@shipit-ai/cli 1.165.0 → 1.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (742) hide show
  1. package/LICENSE +2 -1
  2. package/README.md +6 -0
  3. package/apis/json-schema/AgentSession.yaml +1 -1
  4. package/apis/json-schema/AgentType.yaml +2 -0
  5. package/dist/eslint.config.mjs +2 -0
  6. package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts +1 -1
  7. package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.js +1 -1
  8. package/dist/packages/core/src/application/use-cases/agents/delete-agent-run.use-case.js +1 -1
  9. package/dist/packages/core/src/domain/generated/output.d.ts +3 -1
  10. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  11. package/dist/packages/core/src/domain/generated/output.js +2 -0
  12. package/dist/packages/core/src/infrastructure/di/modules/agents.module.d.ts.map +1 -1
  13. package/dist/packages/core/src/infrastructure/di/modules/agents.module.js +6 -0
  14. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-factory.service.js +33 -0
  16. package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.d.ts.map +1 -1
  17. package/dist/packages/core/src/infrastructure/services/agents/common/agent-validator.service.js +2 -0
  18. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.d.ts +1 -1
  19. package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-interactive-executor.service.js +1 -1
  20. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts +34 -0
  21. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.d.ts.map +1 -0
  22. package/dist/packages/core/src/infrastructure/services/agents/common/executors/copilot-cli-executor.service.js +149 -0
  23. package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +2 -2
  24. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/research.fixture.d.ts +1 -1
  25. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/research.fixture.d.ts.map +1 -1
  26. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/research.fixture.js +2 -2
  27. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/tasks.fixture.d.ts +1 -1
  28. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/tasks.fixture.d.ts.map +1 -1
  29. package/dist/packages/core/src/infrastructure/services/agents/common/executors/fixtures/tasks.fixture.js +1 -1
  30. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.d.ts +37 -0
  31. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.d.ts.map +1 -0
  32. package/dist/packages/core/src/infrastructure/services/agents/common/executors/rovo-dev-executor.service.js +150 -0
  33. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +1 -1
  34. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +1 -1
  35. package/dist/packages/core/src/infrastructure/services/git/merge-strategy.service.js +1 -1
  36. package/dist/packages/core/src/infrastructure/services/interactive/feature-context.builder.js +1 -1
  37. package/dist/packages/core/src/infrastructure/services/notifications/notification-bus.js +1 -1
  38. package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts +1 -1
  39. package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.js +3 -3
  40. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/copilot-cli.json +31 -0
  41. package/dist/packages/core/src/infrastructure/services/tool-installer/tools/rovo-dev.json +31 -0
  42. package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -1
  43. package/dist/src/presentation/web/app/actions/check-agent-auth.js +35 -0
  44. package/dist/src/presentation/web/app/actions/check-agent-tool.d.ts.map +1 -1
  45. package/dist/src/presentation/web/app/actions/check-agent-tool.js +4 -0
  46. package/dist/src/presentation/web/app/actions/get-all-agent-models.d.ts.map +1 -1
  47. package/dist/src/presentation/web/app/actions/get-all-agent-models.js +8 -2
  48. package/dist/src/presentation/web/components/assistant-ui/thread.js +2 -2
  49. package/dist/src/presentation/web/components/common/action-button/action-button.js +2 -2
  50. package/dist/src/presentation/web/components/common/action-button/action-button.stories.d.ts +1 -1
  51. package/dist/src/presentation/web/components/common/action-button/action-button.stories.d.ts.map +1 -1
  52. package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.d.ts.map +1 -1
  53. package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.js +3 -2
  54. package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.stories.d.ts +1 -1
  55. package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.stories.d.ts.map +1 -1
  56. package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.stories.js +1 -1
  57. package/dist/src/presentation/web/components/common/attachment-card/attachment-card.d.ts.map +1 -1
  58. package/dist/src/presentation/web/components/common/attachment-card/attachment-card.js +2 -2
  59. package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts +1 -1
  60. package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts.map +1 -1
  61. package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.js +1 -1
  62. package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.js +2 -2
  63. package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts +1 -1
  64. package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts.map +1 -1
  65. package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.js +1 -1
  66. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.stories.d.ts +1 -1
  67. package/dist/src/presentation/web/components/common/base-drawer/base-drawer.stories.d.ts.map +1 -1
  68. package/dist/src/presentation/web/components/common/ci-status-badge/ci-status-badge.js +4 -4
  69. package/dist/src/presentation/web/components/common/ci-status-badge/ci-status-badge.stories.d.ts +1 -1
  70. package/dist/src/presentation/web/components/common/ci-status-badge/ci-status-badge.stories.d.ts.map +1 -1
  71. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +3 -3
  72. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts +1 -1
  73. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.d.ts.map +1 -1
  74. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.stories.js +1 -1
  75. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.stories.d.ts +1 -1
  76. package/dist/src/presentation/web/components/common/control-center-drawer/adopt-drawer-client.stories.d.ts.map +1 -1
  77. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  78. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +3 -3
  79. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.stories.d.ts +1 -1
  80. package/dist/src/presentation/web/components/common/control-center-drawer/global-chat-drawer-client.stories.d.ts.map +1 -1
  81. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +5 -5
  82. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.stories.d.ts +1 -1
  83. package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.stories.d.ts.map +1 -1
  84. package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.js +2 -2
  85. package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.d.ts +1 -1
  86. package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.d.ts.map +1 -1
  87. package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.js +1 -1
  88. package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.js +2 -2
  89. package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.stories.d.ts +1 -1
  90. package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.stories.d.ts.map +1 -1
  91. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +2 -2
  92. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.stories.d.ts +1 -1
  93. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.stories.d.ts.map +1 -1
  94. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.stories.js +1 -1
  95. package/dist/src/presentation/web/components/common/drawer-revision-input/drawer-revision-input.stories.d.ts +1 -1
  96. package/dist/src/presentation/web/components/common/drawer-revision-input/drawer-revision-input.stories.d.ts.map +1 -1
  97. package/dist/src/presentation/web/components/common/drawer-revision-input/drawer-revision-input.stories.js +1 -1
  98. package/dist/src/presentation/web/components/common/editor-type-icons.stories.d.ts +1 -1
  99. package/dist/src/presentation/web/components/common/editor-type-icons.stories.d.ts.map +1 -1
  100. package/dist/src/presentation/web/components/common/elapsed-time/elapsed-time.stories.d.ts +1 -1
  101. package/dist/src/presentation/web/components/common/elapsed-time/elapsed-time.stories.d.ts.map +1 -1
  102. package/dist/src/presentation/web/components/common/empty-state/empty-state.stories.d.ts +1 -1
  103. package/dist/src/presentation/web/components/common/empty-state/empty-state.stories.d.ts.map +1 -1
  104. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +1 -1
  105. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
  106. package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +1 -1
  107. package/dist/src/presentation/web/components/common/feature-create-drawer/parent-feature-combobox.stories.d.ts +1 -1
  108. package/dist/src/presentation/web/components/common/feature-create-drawer/parent-feature-combobox.stories.d.ts.map +1 -1
  109. package/dist/src/presentation/web/components/common/feature-create-drawer/prompt-section.stories.d.ts +1 -1
  110. package/dist/src/presentation/web/components/common/feature-create-drawer/prompt-section.stories.d.ts.map +1 -1
  111. package/dist/src/presentation/web/components/common/feature-create-drawer/prompt-section.stories.js +1 -1
  112. package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.js +2 -2
  113. package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.stories.d.ts +1 -1
  114. package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.stories.d.ts.map +1 -1
  115. package/dist/src/presentation/web/components/common/feature-create-drawer/workflow-options-section.stories.d.ts +1 -1
  116. package/dist/src/presentation/web/components/common/feature-create-drawer/workflow-options-section.stories.d.ts.map +1 -1
  117. package/dist/src/presentation/web/components/common/feature-create-drawer/workflow-options-section.stories.js +1 -1
  118. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +7 -7
  119. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.stories.d.ts +1 -1
  120. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.stories.d.ts.map +1 -1
  121. package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.js +2 -2
  122. package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.stories.d.ts +1 -1
  123. package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.stories.d.ts.map +1 -1
  124. package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.stories.js +1 -1
  125. package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.js +4 -6
  126. package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.stories.d.ts +1 -1
  127. package/dist/src/presentation/web/components/common/feature-drawer-tabs/event-log-viewer.stories.d.ts.map +1 -1
  128. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +2 -2
  129. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.d.ts +1 -1
  130. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.d.ts.map +1 -1
  131. package/dist/src/presentation/web/components/common/feature-drawer-tabs/log-tab.js +2 -2
  132. package/dist/src/presentation/web/components/common/feature-drawer-tabs/log-tab.stories.d.ts +1 -1
  133. package/dist/src/presentation/web/components/common/feature-drawer-tabs/log-tab.stories.d.ts.map +1 -1
  134. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +4 -4
  135. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +1 -1
  136. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
  137. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +1 -1
  138. package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.js +4 -4
  139. package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.stories.d.ts +1 -1
  140. package/dist/src/presentation/web/components/common/feature-drawer-tabs/plan-tab.stories.d.ts.map +1 -1
  141. package/dist/src/presentation/web/components/common/feature-list-item/feature-list-item.stories.d.ts +1 -1
  142. package/dist/src/presentation/web/components/common/feature-list-item/feature-list-item.stories.d.ts.map +1 -1
  143. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts +1 -1
  144. package/dist/src/presentation/web/components/common/feature-node/agent-type-icons.stories.d.ts.map +1 -1
  145. package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.js +3 -3
  146. package/dist/src/presentation/web/components/common/feature-node/feature-node.js +5 -11
  147. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts +1 -1
  148. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.d.ts.map +1 -1
  149. package/dist/src/presentation/web/components/common/feature-node/feature-node.stories.js +1 -1
  150. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts +1 -1
  151. package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.stories.d.ts.map +1 -1
  152. package/dist/src/presentation/web/components/common/feature-status-badges/feature-status-badges.stories.d.ts +1 -1
  153. package/dist/src/presentation/web/components/common/feature-status-badges/feature-status-badges.stories.d.ts.map +1 -1
  154. package/dist/src/presentation/web/components/common/feature-status-config.js +2 -2
  155. package/dist/src/presentation/web/components/common/feature-status-group/feature-status-group.stories.d.ts +1 -1
  156. package/dist/src/presentation/web/components/common/feature-status-group/feature-status-group.stories.d.ts.map +1 -1
  157. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.js +2 -2
  158. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.stories.d.ts +1 -1
  159. package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.stories.d.ts.map +1 -1
  160. package/dist/src/presentation/web/components/common/github-import-dialog/github-import-dialog.stories.d.ts +1 -1
  161. package/dist/src/presentation/web/components/common/github-import-dialog/github-import-dialog.stories.d.ts.map +1 -1
  162. package/dist/src/presentation/web/components/common/github-import-dialog/github-import-dialog.stories.js +1 -1
  163. package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.js +3 -3
  164. package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.d.ts +1 -1
  165. package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.d.ts.map +1 -1
  166. package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.stories.js +1 -1
  167. package/dist/src/presentation/web/components/common/github-import-dialog/github-url-input.js +2 -2
  168. package/dist/src/presentation/web/components/common/github-import-dialog/github-url-input.stories.d.ts +1 -1
  169. package/dist/src/presentation/web/components/common/github-import-dialog/github-url-input.stories.d.ts.map +1 -1
  170. package/dist/src/presentation/web/components/common/github-import-dialog/github-url-input.stories.js +1 -1
  171. package/dist/src/presentation/web/components/common/inline-attachments/inline-attachments.stories.d.ts +1 -1
  172. package/dist/src/presentation/web/components/common/inline-attachments/inline-attachments.stories.d.ts.map +1 -1
  173. package/dist/src/presentation/web/components/common/loading-skeleton/loading-skeleton.stories.d.ts +1 -1
  174. package/dist/src/presentation/web/components/common/loading-skeleton/loading-skeleton.stories.d.ts.map +1 -1
  175. package/dist/src/presentation/web/components/common/merge-review/diff-view.stories.d.ts +1 -1
  176. package/dist/src/presentation/web/components/common/merge-review/diff-view.stories.d.ts.map +1 -1
  177. package/dist/src/presentation/web/components/common/merge-review/merge-review.js +3 -5
  178. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.d.ts +1 -1
  179. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.d.ts.map +1 -1
  180. package/dist/src/presentation/web/components/common/merge-review/merge-review.stories.js +1 -1
  181. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.js +2 -2
  182. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts +1 -1
  183. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts.map +1 -1
  184. package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.js +1 -1
  185. package/dist/src/presentation/web/components/common/page-header/page-header.stories.d.ts +1 -1
  186. package/dist/src/presentation/web/components/common/page-header/page-header.stories.d.ts.map +1 -1
  187. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.d.ts +1 -1
  188. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.d.ts.map +1 -1
  189. package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.stories.js +1 -1
  190. package/dist/src/presentation/web/components/common/product-decisions-summary/product-decisions-summary.stories.d.ts +1 -1
  191. package/dist/src/presentation/web/components/common/product-decisions-summary/product-decisions-summary.stories.d.ts.map +1 -1
  192. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.js +2 -2
  193. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.stories.d.ts +1 -1
  194. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.stories.d.ts.map +1 -1
  195. package/dist/src/presentation/web/components/common/react-file-manager-dialog/react-file-manager-dialog.stories.js +1 -1
  196. package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.js +2 -2
  197. package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.stories.d.ts +1 -1
  198. package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.stories.d.ts.map +1 -1
  199. package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.stories.js +1 -1
  200. package/dist/src/presentation/web/components/common/repo-group/repo-group.stories.d.ts +1 -1
  201. package/dist/src/presentation/web/components/common/repo-group/repo-group.stories.d.ts.map +1 -1
  202. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts +1 -1
  203. package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts.map +1 -1
  204. package/dist/src/presentation/web/components/common/repository-node/repository-node.js +4 -7
  205. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts +1 -1
  206. package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts.map +1 -1
  207. package/dist/src/presentation/web/components/common/server-log-viewer/server-log-viewer.stories.d.ts +1 -1
  208. package/dist/src/presentation/web/components/common/server-log-viewer/server-log-viewer.stories.d.ts.map +1 -1
  209. package/dist/src/presentation/web/components/common/shipit-ai-logo/shipit-ai-logo.stories.d.ts +1 -1
  210. package/dist/src/presentation/web/components/common/shipit-ai-logo/shipit-ai-logo.stories.d.ts.map +1 -1
  211. package/dist/src/presentation/web/components/common/sidebar-collapse-toggle/sidebar-collapse-toggle.stories.d.ts +1 -1
  212. package/dist/src/presentation/web/components/common/sidebar-collapse-toggle/sidebar-collapse-toggle.stories.d.ts.map +1 -1
  213. package/dist/src/presentation/web/components/common/sidebar-nav-item/sidebar-nav-item.stories.d.ts +1 -1
  214. package/dist/src/presentation/web/components/common/sidebar-nav-item/sidebar-nav-item.stories.d.ts.map +1 -1
  215. package/dist/src/presentation/web/components/common/sidebar-section-header/sidebar-section-header.stories.d.ts +1 -1
  216. package/dist/src/presentation/web/components/common/sidebar-section-header/sidebar-section-header.stories.d.ts.map +1 -1
  217. package/dist/src/presentation/web/components/common/sound-toggle/sound-toggle.stories.d.ts +1 -1
  218. package/dist/src/presentation/web/components/common/sound-toggle/sound-toggle.stories.d.ts.map +1 -1
  219. package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.js +4 -4
  220. package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.stories.d.ts +1 -1
  221. package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.stories.d.ts.map +1 -1
  222. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.d.ts +1 -1
  223. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.d.ts.map +1 -1
  224. package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.stories.js +1 -1
  225. package/dist/src/presentation/web/components/common/theme-toggle/theme-toggle.stories.d.ts +1 -1
  226. package/dist/src/presentation/web/components/common/theme-toggle/theme-toggle.stories.d.ts.map +1 -1
  227. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.d.ts +1 -1
  228. package/dist/src/presentation/web/components/common/version-badge/version-badge.stories.d.ts.map +1 -1
  229. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.js +7 -7
  230. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.stories.d.ts +1 -1
  231. package/dist/src/presentation/web/components/features/chat/AgentStatusBadge.stories.d.ts.map +1 -1
  232. package/dist/src/presentation/web/components/features/chat/ChatComposer.stories.d.ts +1 -1
  233. package/dist/src/presentation/web/components/features/chat/ChatComposer.stories.d.ts.map +1 -1
  234. package/dist/src/presentation/web/components/features/chat/ChatComposer.stories.js +1 -1
  235. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts +1 -1
  236. package/dist/src/presentation/web/components/features/chat/ChatDotIndicator.stories.d.ts.map +1 -1
  237. package/dist/src/presentation/web/components/features/chat/ChatInput.stories.d.ts +1 -1
  238. package/dist/src/presentation/web/components/features/chat/ChatInput.stories.d.ts.map +1 -1
  239. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.stories.d.ts +1 -1
  240. package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.stories.d.ts.map +1 -1
  241. package/dist/src/presentation/web/components/features/chat/ChatMessageList.stories.d.ts +2 -2
  242. package/dist/src/presentation/web/components/features/chat/ChatMessageList.stories.d.ts.map +1 -1
  243. package/dist/src/presentation/web/components/features/chat/ChatSheet.stories.d.ts +2 -2
  244. package/dist/src/presentation/web/components/features/chat/ChatSheet.stories.d.ts.map +1 -1
  245. package/dist/src/presentation/web/components/features/chat/ChatTab.stories.d.ts +1 -1
  246. package/dist/src/presentation/web/components/features/chat/ChatTab.stories.d.ts.map +1 -1
  247. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +9 -13
  248. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.stories.d.ts +1 -1
  249. package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.stories.d.ts.map +1 -1
  250. package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
  251. package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +3 -2
  252. package/dist/src/presentation/web/components/features/control-center/control-center-inner.stories.d.ts +2 -2
  253. package/dist/src/presentation/web/components/features/control-center/control-center-inner.stories.d.ts.map +1 -1
  254. package/dist/src/presentation/web/components/features/control-center/control-center.stories.d.ts +1 -1
  255. package/dist/src/presentation/web/components/features/control-center/control-center.stories.d.ts.map +1 -1
  256. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +3 -3
  257. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.stories.d.ts +1 -1
  258. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.stories.d.ts.map +1 -1
  259. package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.stories.js +1 -1
  260. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.stories.d.ts +2 -2
  261. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.stories.d.ts.map +1 -1
  262. package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.stories.js +1 -1
  263. package/dist/src/presentation/web/components/features/features-canvas/dependency-edge.stories.d.ts +1 -1
  264. package/dist/src/presentation/web/components/features/features-canvas/dependency-edge.stories.d.ts.map +1 -1
  265. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.d.ts +1 -1
  266. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.d.ts.map +1 -1
  267. package/dist/src/presentation/web/components/features/features-canvas/features-canvas.stories.js +1 -4
  268. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts +1 -1
  269. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.d.ts.map +1 -1
  270. package/dist/src/presentation/web/components/features/settings/AgentModelPicker/AgentModelPicker.stories.js +1 -1
  271. package/dist/src/presentation/web/components/features/settings/ModelPicker/ModelPicker.stories.d.ts +1 -1
  272. package/dist/src/presentation/web/components/features/settings/ModelPicker/ModelPicker.stories.d.ts.map +1 -1
  273. package/dist/src/presentation/web/components/features/settings/ModelPicker/ModelPicker.stories.js +1 -1
  274. package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts +1 -1
  275. package/dist/src/presentation/web/components/features/settings/agent-settings-section.stories.d.ts.map +1 -1
  276. package/dist/src/presentation/web/components/features/settings/ci-settings-section.stories.d.ts +1 -1
  277. package/dist/src/presentation/web/components/features/settings/ci-settings-section.stories.d.ts.map +1 -1
  278. package/dist/src/presentation/web/components/features/settings/database-settings-section.stories.d.ts +1 -1
  279. package/dist/src/presentation/web/components/features/settings/database-settings-section.stories.d.ts.map +1 -1
  280. package/dist/src/presentation/web/components/features/settings/environment-settings-section.stories.d.ts +1 -1
  281. package/dist/src/presentation/web/components/features/settings/environment-settings-section.stories.d.ts.map +1 -1
  282. package/dist/src/presentation/web/components/features/settings/fab-layout-settings-section.stories.d.ts +1 -1
  283. package/dist/src/presentation/web/components/features/settings/fab-layout-settings-section.stories.d.ts.map +1 -1
  284. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts +1 -1
  285. package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts.map +1 -1
  286. package/dist/src/presentation/web/components/features/settings/interactive-agent-settings-section.stories.d.ts +1 -1
  287. package/dist/src/presentation/web/components/features/settings/interactive-agent-settings-section.stories.d.ts.map +1 -1
  288. package/dist/src/presentation/web/components/features/settings/language-settings-section.stories.d.ts +1 -1
  289. package/dist/src/presentation/web/components/features/settings/language-settings-section.stories.d.ts.map +1 -1
  290. package/dist/src/presentation/web/components/features/settings/notification-settings-section.stories.d.ts +1 -1
  291. package/dist/src/presentation/web/components/features/settings/notification-settings-section.stories.d.ts.map +1 -1
  292. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts +1 -1
  293. package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
  294. package/dist/src/presentation/web/components/features/settings/settings-section-utils.stories.d.ts +1 -1
  295. package/dist/src/presentation/web/components/features/settings/settings-section-utils.stories.d.ts.map +1 -1
  296. package/dist/src/presentation/web/components/features/settings/settings-section-utils.stories.js +1 -1
  297. package/dist/src/presentation/web/components/features/settings/stage-timeouts-settings-section.stories.d.ts +1 -1
  298. package/dist/src/presentation/web/components/features/settings/stage-timeouts-settings-section.stories.d.ts.map +1 -1
  299. package/dist/src/presentation/web/components/features/settings/timeout-slider.stories.d.ts +1 -1
  300. package/dist/src/presentation/web/components/features/settings/timeout-slider.stories.d.ts.map +1 -1
  301. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.d.ts +1 -1
  302. package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.d.ts.map +1 -1
  303. package/dist/src/presentation/web/components/features/skills/category-filter.stories.d.ts +1 -1
  304. package/dist/src/presentation/web/components/features/skills/category-filter.stories.d.ts.map +1 -1
  305. package/dist/src/presentation/web/components/features/skills/skill-card.stories.d.ts +1 -1
  306. package/dist/src/presentation/web/components/features/skills/skill-card.stories.d.ts.map +1 -1
  307. package/dist/src/presentation/web/components/features/skills/skill-card.stories.js +3 -3
  308. package/dist/src/presentation/web/components/features/skills/skill-detail-drawer.stories.d.ts +1 -1
  309. package/dist/src/presentation/web/components/features/skills/skill-detail-drawer.stories.d.ts.map +1 -1
  310. package/dist/src/presentation/web/components/features/skills/skill-detail-drawer.stories.js +3 -3
  311. package/dist/src/presentation/web/components/features/skills/skill-list.stories.d.ts +1 -1
  312. package/dist/src/presentation/web/components/features/skills/skill-list.stories.d.ts.map +1 -1
  313. package/dist/src/presentation/web/components/features/skills/skill-list.stories.js +4 -4
  314. package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts +1 -1
  315. package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts.map +1 -1
  316. package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.js +8 -8
  317. package/dist/src/presentation/web/components/features/tools/tool-card.js +3 -5
  318. package/dist/src/presentation/web/components/features/tools/tool-card.stories.d.ts +1 -1
  319. package/dist/src/presentation/web/components/features/tools/tool-card.stories.d.ts.map +1 -1
  320. package/dist/src/presentation/web/components/features/tools/tool-detail-drawer.js +3 -7
  321. package/dist/src/presentation/web/components/features/tools/tool-detail-drawer.stories.d.ts +1 -1
  322. package/dist/src/presentation/web/components/features/tools/tool-detail-drawer.stories.d.ts.map +1 -1
  323. package/dist/src/presentation/web/components/features/tools/tools-page-client.stories.d.ts +1 -1
  324. package/dist/src/presentation/web/components/features/tools/tools-page-client.stories.d.ts.map +1 -1
  325. package/dist/src/presentation/web/components/features/version/version-page-client.stories.d.ts +1 -1
  326. package/dist/src/presentation/web/components/features/version/version-page-client.stories.d.ts.map +1 -1
  327. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.stories.d.ts +1 -1
  328. package/dist/src/presentation/web/components/layouts/app-shell/app-shell.stories.d.ts.map +1 -1
  329. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts +1 -1
  330. package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
  331. package/dist/src/presentation/web/components/layouts/dashboard-layout/dashboard-layout.stories.d.ts +1 -1
  332. package/dist/src/presentation/web/components/layouts/dashboard-layout/dashboard-layout.stories.d.ts.map +1 -1
  333. package/dist/src/presentation/web/components/layouts/header/header.stories.d.ts +1 -1
  334. package/dist/src/presentation/web/components/layouts/header/header.stories.d.ts.map +1 -1
  335. package/dist/src/presentation/web/components/layouts/sidebar/sidebar.stories.d.ts +1 -1
  336. package/dist/src/presentation/web/components/layouts/sidebar/sidebar.stories.d.ts.map +1 -1
  337. package/dist/src/presentation/web/components/ui/accordion.stories.d.ts +1 -1
  338. package/dist/src/presentation/web/components/ui/accordion.stories.d.ts.map +1 -1
  339. package/dist/src/presentation/web/components/ui/alert-dialog.stories.d.ts +1 -1
  340. package/dist/src/presentation/web/components/ui/alert-dialog.stories.d.ts.map +1 -1
  341. package/dist/src/presentation/web/components/ui/alert.stories.d.ts +1 -1
  342. package/dist/src/presentation/web/components/ui/alert.stories.d.ts.map +1 -1
  343. package/dist/src/presentation/web/components/ui/alert.stories.js +2 -2
  344. package/dist/src/presentation/web/components/ui/badge.stories.d.ts +1 -1
  345. package/dist/src/presentation/web/components/ui/badge.stories.d.ts.map +1 -1
  346. package/dist/src/presentation/web/components/ui/button.stories.d.ts +1 -1
  347. package/dist/src/presentation/web/components/ui/button.stories.d.ts.map +1 -1
  348. package/dist/src/presentation/web/components/ui/card.stories.d.ts +1 -1
  349. package/dist/src/presentation/web/components/ui/card.stories.d.ts.map +1 -1
  350. package/dist/src/presentation/web/components/ui/checkbox-group-item.stories.d.ts +1 -1
  351. package/dist/src/presentation/web/components/ui/checkbox-group-item.stories.d.ts.map +1 -1
  352. package/dist/src/presentation/web/components/ui/checkbox-group.stories.d.ts +1 -1
  353. package/dist/src/presentation/web/components/ui/checkbox-group.stories.d.ts.map +1 -1
  354. package/dist/src/presentation/web/components/ui/checkbox.stories.d.ts +1 -1
  355. package/dist/src/presentation/web/components/ui/checkbox.stories.d.ts.map +1 -1
  356. package/dist/src/presentation/web/components/ui/comet-spinner.stories.d.ts +1 -1
  357. package/dist/src/presentation/web/components/ui/comet-spinner.stories.d.ts.map +1 -1
  358. package/dist/src/presentation/web/components/ui/command.stories.d.ts +2 -2
  359. package/dist/src/presentation/web/components/ui/command.stories.d.ts.map +1 -1
  360. package/dist/src/presentation/web/components/ui/dialog.stories.d.ts +1 -1
  361. package/dist/src/presentation/web/components/ui/dialog.stories.d.ts.map +1 -1
  362. package/dist/src/presentation/web/components/ui/drawer.stories.d.ts +1 -1
  363. package/dist/src/presentation/web/components/ui/drawer.stories.d.ts.map +1 -1
  364. package/dist/src/presentation/web/components/ui/dropdown-menu.stories.d.ts +1 -1
  365. package/dist/src/presentation/web/components/ui/dropdown-menu.stories.d.ts.map +1 -1
  366. package/dist/src/presentation/web/components/ui/github-icon.d.ts +13 -0
  367. package/dist/src/presentation/web/components/ui/github-icon.d.ts.map +1 -0
  368. package/dist/src/presentation/web/components/ui/github-icon.js +15 -0
  369. package/dist/src/presentation/web/components/ui/github-icon.stories.d.ts +10 -0
  370. package/dist/src/presentation/web/components/ui/github-icon.stories.d.ts.map +1 -0
  371. package/dist/src/presentation/web/components/ui/github-icon.stories.js +22 -0
  372. package/dist/src/presentation/web/components/ui/input.stories.d.ts +1 -1
  373. package/dist/src/presentation/web/components/ui/input.stories.d.ts.map +1 -1
  374. package/dist/src/presentation/web/components/ui/label.stories.d.ts +1 -1
  375. package/dist/src/presentation/web/components/ui/label.stories.d.ts.map +1 -1
  376. package/dist/src/presentation/web/components/ui/popover.stories.d.ts +1 -1
  377. package/dist/src/presentation/web/components/ui/popover.stories.d.ts.map +1 -1
  378. package/dist/src/presentation/web/components/ui/scroll-area.stories.d.ts +1 -1
  379. package/dist/src/presentation/web/components/ui/scroll-area.stories.d.ts.map +1 -1
  380. package/dist/src/presentation/web/components/ui/select.stories.d.ts +1 -1
  381. package/dist/src/presentation/web/components/ui/select.stories.d.ts.map +1 -1
  382. package/dist/src/presentation/web/components/ui/separator.stories.d.ts +1 -1
  383. package/dist/src/presentation/web/components/ui/separator.stories.d.ts.map +1 -1
  384. package/dist/src/presentation/web/components/ui/sheet.stories.d.ts +1 -1
  385. package/dist/src/presentation/web/components/ui/sheet.stories.d.ts.map +1 -1
  386. package/dist/src/presentation/web/components/ui/sidebar.stories.d.ts +1 -1
  387. package/dist/src/presentation/web/components/ui/sidebar.stories.d.ts.map +1 -1
  388. package/dist/src/presentation/web/components/ui/skeleton.stories.d.ts +1 -1
  389. package/dist/src/presentation/web/components/ui/skeleton.stories.d.ts.map +1 -1
  390. package/dist/src/presentation/web/components/ui/slider.stories.d.ts +1 -1
  391. package/dist/src/presentation/web/components/ui/slider.stories.d.ts.map +1 -1
  392. package/dist/src/presentation/web/components/ui/sonner.stories.d.ts +1 -1
  393. package/dist/src/presentation/web/components/ui/sonner.stories.d.ts.map +1 -1
  394. package/dist/src/presentation/web/components/ui/spinner.stories.d.ts +1 -1
  395. package/dist/src/presentation/web/components/ui/spinner.stories.d.ts.map +1 -1
  396. package/dist/src/presentation/web/components/ui/switch.stories.d.ts +1 -1
  397. package/dist/src/presentation/web/components/ui/switch.stories.d.ts.map +1 -1
  398. package/dist/src/presentation/web/components/ui/tabs.stories.d.ts +1 -1
  399. package/dist/src/presentation/web/components/ui/tabs.stories.d.ts.map +1 -1
  400. package/dist/src/presentation/web/components/ui/textarea.stories.d.ts +1 -1
  401. package/dist/src/presentation/web/components/ui/textarea.stories.d.ts.map +1 -1
  402. package/dist/src/presentation/web/components/ui/tooltip.stories.d.ts +2 -2
  403. package/dist/src/presentation/web/components/ui/tooltip.stories.d.ts.map +1 -1
  404. package/dist/src/presentation/web/hooks/use-notifications.stories.d.ts +1 -1
  405. package/dist/src/presentation/web/hooks/use-notifications.stories.d.ts.map +1 -1
  406. package/dist/src/presentation/web/hooks/use-sound-action.stories.d.ts +1 -1
  407. package/dist/src/presentation/web/hooks/use-sound-action.stories.d.ts.map +1 -1
  408. package/dist/src/presentation/web/hooks/use-sound.stories.d.ts +1 -1
  409. package/dist/src/presentation/web/hooks/use-sound.stories.d.ts.map +1 -1
  410. package/dist/src/presentation/web/lib/session-scanner.js +2 -2
  411. package/dist/src/presentation/web/lib/skills.js +2 -2
  412. package/dist/tsconfig.build.tsbuildinfo +1 -1
  413. package/package.json +21 -24
  414. package/web/.next/BUILD_ID +1 -1
  415. package/web/.next/build-manifest.json +5 -5
  416. package/web/.next/fallback-build-manifest.json +3 -3
  417. package/web/.next/prerender-manifest.json +3 -3
  418. package/web/.next/required-server-files.js +2 -2
  419. package/web/.next/required-server-files.json +2 -2
  420. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +2 -2
  421. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/react-loadable-manifest.json +3 -3
  422. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
  423. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  424. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  425. package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +2 -2
  426. package/web/.next/server/app/(dashboard)/@drawer/chat/page/react-loadable-manifest.json +3 -3
  427. package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
  428. package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
  429. package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
  430. package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +2 -2
  431. package/web/.next/server/app/(dashboard)/@drawer/create/page/react-loadable-manifest.json +3 -3
  432. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
  433. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  434. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  435. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
  436. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/react-loadable-manifest.json +3 -3
  437. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  438. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
  439. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  440. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  441. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +2 -2
  442. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/react-loadable-manifest.json +3 -3
  443. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +37 -37
  444. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  445. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  446. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  447. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +2 -2
  448. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +3 -3
  449. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  450. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  451. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  452. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +2 -2
  453. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/react-loadable-manifest.json +3 -3
  454. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  455. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  456. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  457. package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +2 -2
  458. package/web/.next/server/app/(dashboard)/chat/page/react-loadable-manifest.json +3 -3
  459. package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
  460. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  461. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  462. package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +2 -2
  463. package/web/.next/server/app/(dashboard)/create/page/react-loadable-manifest.json +3 -3
  464. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
  465. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  466. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  467. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +2 -2
  468. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/react-loadable-manifest.json +3 -3
  469. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +37 -37
  470. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
  471. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  472. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  473. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +2 -2
  474. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/react-loadable-manifest.json +3 -3
  475. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +37 -37
  476. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  477. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  478. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  479. package/web/.next/server/app/(dashboard)/page/build-manifest.json +2 -2
  480. package/web/.next/server/app/(dashboard)/page/react-loadable-manifest.json +3 -3
  481. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
  482. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  483. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  484. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +2 -2
  485. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/react-loadable-manifest.json +3 -3
  486. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
  487. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
  488. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
  489. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +2 -2
  490. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/react-loadable-manifest.json +3 -3
  491. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
  492. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  493. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  494. package/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
  495. package/web/.next/server/app/_global-error.html +1 -1
  496. package/web/.next/server/app/_global-error.rsc +1 -1
  497. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  498. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  499. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  500. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  501. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  502. package/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
  503. package/web/.next/server/app/_not-found/page/react-loadable-manifest.json +3 -3
  504. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
  505. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  506. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  507. package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
  508. package/web/.next/server/app/api/dialog/pick-files/route.js.nft.json +1 -1
  509. package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
  510. package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
  511. package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
  512. package/web/.next/server/app/api/sessions/route.js +2 -2
  513. package/web/.next/server/app/settings/page/build-manifest.json +2 -2
  514. package/web/.next/server/app/settings/page/react-loadable-manifest.json +3 -3
  515. package/web/.next/server/app/settings/page/server-reference-manifest.json +11 -11
  516. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  517. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  518. package/web/.next/server/app/skills/page/build-manifest.json +2 -2
  519. package/web/.next/server/app/skills/page/react-loadable-manifest.json +3 -3
  520. package/web/.next/server/app/skills/page/server-reference-manifest.json +11 -11
  521. package/web/.next/server/app/skills/page.js.nft.json +1 -1
  522. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  523. package/web/.next/server/app/tools/page/build-manifest.json +2 -2
  524. package/web/.next/server/app/tools/page/react-loadable-manifest.json +3 -3
  525. package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
  526. package/web/.next/server/app/tools/page.js.nft.json +1 -1
  527. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  528. package/web/.next/server/app/version/page/build-manifest.json +2 -2
  529. package/web/.next/server/app/version/page/react-loadable-manifest.json +3 -3
  530. package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
  531. package/web/.next/server/app/version/page.js.nft.json +1 -1
  532. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  533. package/web/.next/server/chunks/0n.o_server_app_api_interactive_chat_[featureId]_stop_route_actions_09da~zt.js +1 -1
  534. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js +1 -1
  535. package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js.map +1 -1
  536. package/web/.next/server/chunks/[root-of-the-server]__07suer1._.js.map +1 -1
  537. package/web/.next/server/chunks/[root-of-the-server]__0_.w-eb._.js +1 -1
  538. package/web/.next/server/chunks/[root-of-the-server]__0_.w-eb._.js.map +1 -1
  539. package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
  540. package/web/.next/server/chunks/[root-of-the-server]__13ni_ow._.js +1 -1
  541. package/web/.next/server/chunks/ssr/{0lyk_lucide-react_dist_esm_icons_0shxsmr._.js → 08qz_lucide-react_dist_esm_icons_0_gqlce._.js} +2 -2
  542. package/web/.next/server/chunks/ssr/08qz_lucide-react_dist_esm_icons_0_gqlce._.js.map +1 -0
  543. package/web/.next/server/chunks/ssr/08qz_lucide-react_dist_esm_icons_0zwb4s4._.js +3 -0
  544. package/web/.next/server/chunks/ssr/08qz_lucide-react_dist_esm_icons_0zwb4s4._.js.map +1 -0
  545. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js +1 -1
  546. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_00~eq5i.js.map +1 -1
  547. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js +1 -1
  548. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_0979_c..js.map +1 -1
  549. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js +1 -1
  550. package/web/.next/server/chunks/ssr/0j.8_web__next-internal_server_app_(dashboard)_chat_page_actions_0dqll_1.js.map +1 -1
  551. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
  552. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
  553. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +3 -3
  554. package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
  555. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
  556. package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
  557. package/web/.next/server/chunks/ssr/11es_next_dist_0e36~wi._.js +2 -2
  558. package/web/.next/server/chunks/ssr/11es_next_dist_client_components_058~c_t._.js +1 -1
  559. package/web/.next/server/chunks/ssr/11es_next_dist_esm_build_templates_app-page_0l-25e2.js +1 -1
  560. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_global-chat-drawer-client_tsx_03s32.q._.js +1 -1
  561. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
  562. package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
  563. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0uxn6-j._.js → [root-of-the-server]__045sv4b._.js} +2 -2
  564. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0uxn6-j._.js.map → [root-of-the-server]__045sv4b._.js.map} +1 -1
  565. package/web/.next/server/chunks/ssr/[root-of-the-server]__0brje6_._.js +1 -1
  566. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0np51e2._.js → [root-of-the-server]__0d_0_fp._.js} +2 -2
  567. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0np51e2._.js.map → [root-of-the-server]__0d_0_fp._.js.map} +1 -1
  568. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0~h382a._.js → [root-of-the-server]__0l4d7e.._.js} +2 -2
  569. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0~h382a._.js.map → [root-of-the-server]__0l4d7e.._.js.map} +1 -1
  570. package/web/.next/server/chunks/ssr/{[root-of-the-server]__0_ag.8y._.js → [root-of-the-server]__0lslgap._.js} +3 -3
  571. package/web/.next/server/chunks/ssr/[root-of-the-server]__0lslgap._.js.map +1 -0
  572. package/web/.next/server/chunks/ssr/[root-of-the-server]__0o3qggc._.js +3 -0
  573. package/web/.next/server/chunks/ssr/[root-of-the-server]__0o3qggc._.js.map +1 -0
  574. package/web/.next/server/chunks/ssr/{[root-of-the-server]__01~y8wi._.js → [root-of-the-server]__0r32z03._.js} +2 -2
  575. package/web/.next/server/chunks/ssr/{[root-of-the-server]__01~y8wi._.js.map → [root-of-the-server]__0r32z03._.js.map} +1 -1
  576. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
  577. package/web/.next/server/chunks/ssr/[root-of-the-server]__122xqm6._.js +1 -1
  578. package/web/.next/server/chunks/ssr/[root-of-the-server]__12g8h3_._.js +1 -1
  579. package/web/.next/server/chunks/ssr/[root-of-the-server]__12g8h3_._.js.map +1 -1
  580. package/web/.next/server/chunks/ssr/{_0d-pkk0._.js → _0-09vq7._.js} +2 -2
  581. package/web/.next/server/chunks/ssr/_0-09vq7._.js.map +1 -0
  582. package/web/.next/server/chunks/ssr/_0.rsra~._.js.map +1 -1
  583. package/web/.next/server/chunks/ssr/_00k65h-._.js +3 -0
  584. package/web/.next/server/chunks/ssr/_00k65h-._.js.map +1 -0
  585. package/web/.next/server/chunks/ssr/_01mq~sm._.js +2 -2
  586. package/web/.next/server/chunks/ssr/_01mq~sm._.js.map +1 -1
  587. package/web/.next/server/chunks/ssr/_01sesw0._.js +3 -0
  588. package/web/.next/server/chunks/ssr/_01sesw0._.js.map +1 -0
  589. package/web/.next/server/chunks/ssr/_04s_q5r._.js +1 -1
  590. package/web/.next/server/chunks/ssr/_04s_q5r._.js.map +1 -1
  591. package/web/.next/server/chunks/ssr/{_0xtds88._.js → _08i-c2n._.js} +2 -2
  592. package/web/.next/server/chunks/ssr/_08i-c2n._.js.map +1 -0
  593. package/web/.next/server/chunks/ssr/{_0jk5q_z._.js → _09di2m~._.js} +2 -2
  594. package/web/.next/server/chunks/ssr/_09di2m~._.js.map +1 -0
  595. package/web/.next/server/chunks/ssr/_0gdghcr._.js +3 -0
  596. package/web/.next/server/chunks/ssr/_0gdghcr._.js.map +1 -0
  597. package/web/.next/server/chunks/ssr/_0hwjfpu._.js +3 -0
  598. package/web/.next/server/chunks/ssr/_0hwjfpu._.js.map +1 -0
  599. package/web/.next/server/chunks/ssr/_0hw~zvl._.js +3 -0
  600. package/web/.next/server/chunks/ssr/_0hw~zvl._.js.map +1 -0
  601. package/web/.next/server/chunks/ssr/_0jpbsh_._.js +1 -1
  602. package/web/.next/server/chunks/ssr/_0jpbsh_._.js.map +1 -1
  603. package/web/.next/server/chunks/ssr/_0phryzt._.js +3 -0
  604. package/web/.next/server/chunks/ssr/_0phryzt._.js.map +1 -0
  605. package/web/.next/server/chunks/ssr/_0r~xv6k._.js +3 -0
  606. package/web/.next/server/chunks/ssr/_0r~xv6k._.js.map +1 -0
  607. package/web/.next/server/chunks/ssr/_0vyfc4b._.js +3 -0
  608. package/web/.next/server/chunks/ssr/_0vyfc4b._.js.map +1 -0
  609. package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
  610. package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
  611. package/web/.next/server/chunks/ssr/{_0j9vx-1._.js → _0y8u4.e._.js} +3 -3
  612. package/web/.next/server/chunks/ssr/_0y8u4.e._.js.map +1 -0
  613. package/web/.next/server/chunks/ssr/_0~7lwu_._.js +3 -0
  614. package/web/.next/server/chunks/ssr/_0~7lwu_._.js.map +1 -0
  615. package/web/.next/server/chunks/ssr/{_0rvaoj4._.js → _109n-y4._.js} +2 -2
  616. package/web/.next/server/chunks/ssr/_109n-y4._.js.map +1 -0
  617. package/web/.next/server/chunks/ssr/{_13bl-l1._.js → _12104w0._.js} +2 -2
  618. package/web/.next/server/chunks/ssr/_12104w0._.js.map +1 -0
  619. package/web/.next/server/chunks/ssr/{_09g41d0._.js → _12un22l._.js} +3 -3
  620. package/web/.next/server/chunks/ssr/_12un22l._.js.map +1 -0
  621. package/web/.next/server/chunks/ssr/node_modules__pnpm_0l8_ov3._.js +3 -0
  622. package/web/.next/server/chunks/ssr/node_modules__pnpm_0l8_ov3._.js.map +1 -0
  623. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js +1 -1
  624. package/web/.next/server/chunks/ssr/src_presentation_web_0.e4~xc._.js.map +1 -1
  625. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js +1 -1
  626. package/web/.next/server/chunks/ssr/src_presentation_web_00dvh.m._.js.map +1 -1
  627. package/web/.next/server/chunks/ssr/src_presentation_web_05-w-~v._.js +1 -1
  628. package/web/.next/server/chunks/ssr/src_presentation_web_05-w-~v._.js.map +1 -1
  629. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js +2 -2
  630. package/web/.next/server/chunks/ssr/src_presentation_web_06b6~lt._.js.map +1 -1
  631. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js +1 -1
  632. package/web/.next/server/chunks/ssr/src_presentation_web_08fy2mf._.js.map +1 -1
  633. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js +1 -1
  634. package/web/.next/server/chunks/ssr/src_presentation_web_0f~udu1._.js.map +1 -1
  635. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js +2 -2
  636. package/web/.next/server/chunks/ssr/src_presentation_web_0qys821._.js.map +1 -1
  637. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js +1 -1
  638. package/web/.next/server/chunks/ssr/src_presentation_web_0q~dt0o._.js.map +1 -1
  639. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js +1 -1
  640. package/web/.next/server/chunks/ssr/src_presentation_web_0y11iiz._.js.map +1 -1
  641. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js +1 -1
  642. package/web/.next/server/chunks/ssr/src_presentation_web_11jrkxt._.js.map +1 -1
  643. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js +1 -1
  644. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_1199d3x.js.map +1 -1
  645. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js +1 -1
  646. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app__not-found_page_actions_0m2jqxx.js.map +1 -1
  647. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js +1 -1
  648. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_version_page_actions_0krkh_0.js.map +1 -1
  649. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_load-settings_ts_0b8f3pf._.js +1 -1
  650. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
  651. package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js.map +1 -1
  652. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
  653. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
  654. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js +1 -1
  655. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js.map +1 -1
  656. package/web/.next/server/chunks/ssr/src_presentation_web_components_ui_select_tsx_0b.-59k._.js +1 -1
  657. package/web/.next/server/middleware-build-manifest.js +5 -5
  658. package/web/.next/server/pages/500.html +1 -1
  659. package/web/.next/server/server-reference-manifest.js +1 -1
  660. package/web/.next/server/server-reference-manifest.json +49 -49
  661. package/web/.next/static/chunks/0-lu0b1ewsb0_.js +1 -0
  662. package/web/.next/static/chunks/00uywouqbytc0.js +5 -0
  663. package/web/.next/static/chunks/{0t_48qc0x7bhs.js → 01hf_nf2ge.tn.js} +3 -3
  664. package/web/.next/static/chunks/01~dudieyb7wl.js +5 -0
  665. package/web/.next/static/chunks/{0riti1bs-erm~.js → 02kpdawdtqcxm.js} +1 -1
  666. package/web/.next/static/chunks/{0~er~22zwvx0i.js → 09_oo_kc.j.df.js} +1 -1
  667. package/web/.next/static/chunks/0b01fd0lkhnzf.js +1 -0
  668. package/web/.next/static/chunks/0b_anwzlzr9p7.js +1 -0
  669. package/web/.next/static/chunks/0fg~vc93spa9c.js +1 -0
  670. package/web/.next/static/chunks/0fmbl3o08a~-h.js +1 -0
  671. package/web/.next/static/chunks/0j_0i2qsrwh-c.js +1 -0
  672. package/web/.next/static/chunks/{07yqyvabetyrh.js → 0l.kymg3jmf7n.js} +2 -2
  673. package/web/.next/static/chunks/0m5~9kij3s~81.js +1 -0
  674. package/web/.next/static/chunks/0ntps8p7wo1re.js +1 -0
  675. package/web/.next/static/chunks/{0wmckrtphfa12.js → 0odlgm-ixqorl.js} +1 -1
  676. package/web/.next/static/chunks/0q~uf2s33.48w.js +1 -0
  677. package/web/.next/static/chunks/0rfap2l5xz_-p.js +1 -0
  678. package/web/.next/static/chunks/0rhoh5o1y7grf.js +7 -0
  679. package/web/.next/static/chunks/0sywjtf8m0_fb.js +1 -0
  680. package/web/.next/static/chunks/{071_2_.sfp-im.js → 0tutcr7trd_7d.js} +1 -1
  681. package/web/.next/static/chunks/11bi612fz8agh.js +1 -0
  682. package/web/.next/static/chunks/121l3o3vd~hvn.js +1 -0
  683. package/web/.next/static/chunks/13ryk8qc9y3qu.js +1 -0
  684. package/web/.next/static/chunks/164dnpi666fv_.js +5 -0
  685. package/web/.next/static/chunks/16jcg65-2mxc..js +1 -0
  686. package/web/.next/static/chunks/{turbopack-0ve8f54_veg.u.js → turbopack-0wsav6to5abtk.js} +1 -1
  687. package/web/package.json +5 -5
  688. package/web/.next/server/chunks/ssr/0lyk_lucide-react_dist_esm_icons_06zrfq4._.js +0 -3
  689. package/web/.next/server/chunks/ssr/0lyk_lucide-react_dist_esm_icons_06zrfq4._.js.map +0 -1
  690. package/web/.next/server/chunks/ssr/0lyk_lucide-react_dist_esm_icons_0shxsmr._.js.map +0 -1
  691. package/web/.next/server/chunks/ssr/[root-of-the-server]__0_ag.8y._.js.map +0 -1
  692. package/web/.next/server/chunks/ssr/[root-of-the-server]__12qqi.~._.js +0 -3
  693. package/web/.next/server/chunks/ssr/[root-of-the-server]__12qqi.~._.js.map +0 -1
  694. package/web/.next/server/chunks/ssr/_0.gy.n8._.js +0 -3
  695. package/web/.next/server/chunks/ssr/_0.gy.n8._.js.map +0 -1
  696. package/web/.next/server/chunks/ssr/_0.k7wl.._.js +0 -3
  697. package/web/.next/server/chunks/ssr/_0.k7wl.._.js.map +0 -1
  698. package/web/.next/server/chunks/ssr/_09g41d0._.js.map +0 -1
  699. package/web/.next/server/chunks/ssr/_0aa~oer._.js +0 -3
  700. package/web/.next/server/chunks/ssr/_0aa~oer._.js.map +0 -1
  701. package/web/.next/server/chunks/ssr/_0d-pkk0._.js.map +0 -1
  702. package/web/.next/server/chunks/ssr/_0ez.1o4._.js +0 -3
  703. package/web/.next/server/chunks/ssr/_0ez.1o4._.js.map +0 -1
  704. package/web/.next/server/chunks/ssr/_0j9vx-1._.js.map +0 -1
  705. package/web/.next/server/chunks/ssr/_0jk5q_z._.js.map +0 -1
  706. package/web/.next/server/chunks/ssr/_0n.xy38._.js +0 -3
  707. package/web/.next/server/chunks/ssr/_0n.xy38._.js.map +0 -1
  708. package/web/.next/server/chunks/ssr/_0rvaoj4._.js.map +0 -1
  709. package/web/.next/server/chunks/ssr/_0v.yfmg._.js +0 -3
  710. package/web/.next/server/chunks/ssr/_0v.yfmg._.js.map +0 -1
  711. package/web/.next/server/chunks/ssr/_0vl.03w._.js +0 -3
  712. package/web/.next/server/chunks/ssr/_0vl.03w._.js.map +0 -1
  713. package/web/.next/server/chunks/ssr/_0xtds88._.js.map +0 -1
  714. package/web/.next/server/chunks/ssr/_11kuznh._.js +0 -3
  715. package/web/.next/server/chunks/ssr/_11kuznh._.js.map +0 -1
  716. package/web/.next/server/chunks/ssr/_13bl-l1._.js.map +0 -1
  717. package/web/.next/server/chunks/ssr/_13euo-f._.js +0 -3
  718. package/web/.next/server/chunks/ssr/_13euo-f._.js.map +0 -1
  719. package/web/.next/server/chunks/ssr/node_modules__pnpm_0xyo1be._.js +0 -3
  720. package/web/.next/server/chunks/ssr/node_modules__pnpm_0xyo1be._.js.map +0 -1
  721. package/web/.next/static/chunks/00racug7sobut.js +0 -1
  722. package/web/.next/static/chunks/06sdx5zm71_u5.js +0 -1
  723. package/web/.next/static/chunks/08iq.j3rbmhbm.js +0 -1
  724. package/web/.next/static/chunks/08iuksm8rvb09.js +0 -1
  725. package/web/.next/static/chunks/08se-_opmk~.7.js +0 -1
  726. package/web/.next/static/chunks/09b2usag59_bi.js +0 -5
  727. package/web/.next/static/chunks/0icjwdqytqa_8.js +0 -5
  728. package/web/.next/static/chunks/0qjoc4x5q-aeg.js +0 -1
  729. package/web/.next/static/chunks/0rhzqh.-6e6k7.js +0 -1
  730. package/web/.next/static/chunks/0s-e-ekdbgoqa.js +0 -1
  731. package/web/.next/static/chunks/0u5.s.lv2bae5.js +0 -1
  732. package/web/.next/static/chunks/0vgbvqu82ac1x.js +0 -1
  733. package/web/.next/static/chunks/0w~84g7r9307~.js +0 -1
  734. package/web/.next/static/chunks/0y1nwnouroh6k.js +0 -1
  735. package/web/.next/static/chunks/0zz.xgsd83.3n.js +0 -1
  736. package/web/.next/static/chunks/0~wymq55b2bn3.js +0 -1
  737. package/web/.next/static/chunks/10wo3waalauct.js +0 -5
  738. package/web/.next/static/chunks/15lcx-697j_3z.js +0 -7
  739. package/web/.next/static/chunks/176x256xw_viv.js +0 -1
  740. /package/web/.next/static/{xP_-L4TLYvd3i_sEmljLs → 21GZVGanhwKlq9p5dtTCB}/_buildManifest.js +0 -0
  741. /package/web/.next/static/{xP_-L4TLYvd3i_sEmljLs → 21GZVGanhwKlq9p5dtTCB}/_clientMiddlewareManifest.js +0 -0
  742. /package/web/.next/static/{xP_-L4TLYvd3i_sEmljLs → 21GZVGanhwKlq9p5dtTCB}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../node_modules/.pnpm/lucide-react%401.7.0_react%4019.2.4/node_modules/lucide-react/src/icons/maximize-2.ts","../../../../../../../node_modules/.pnpm/zustand%405.0.12_%40types%2Breact%4019.2.14_react%4019.2.4_use-sync-external-store%401.6.0_react%4019.2.4_/node_modules/zustand/esm/vanilla.mjs","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/context.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-reducer.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/helpers/execution-context.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/attachTransformScopes.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-memo.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/withKey.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/ReadonlyStore.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/tapClientLookup.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/helpers/env.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/types/events.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/clients/model-context-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/composer-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-resources.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/message-part-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-effect-event.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/react-assistant-context.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/message-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/useAui.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/splitClients.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-resource.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/tapClientResource.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/thread-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/thread-list-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/clients/suggestions.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/NotificationManager.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/react/use-resource.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/clients/runtime-adapter.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/tapResourceRoot.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/thread-list-item-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/client/Tools.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-effect.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/ResourceFiber.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/proxied-assistant-state.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/RuntimeAdapter.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/AssistantProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/stores/ThreadViewport.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/utils/createContextHook.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/attachment-runtime-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/ThreadViewportContext.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/tap-assistant-context.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/utils/depsShallowEqual.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-state.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/utils/composite-context-provider.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/runtime-clients/tap-subscribable.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/helpers/commit.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/client/DataRenderers.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-callback.ts","../../../../../../../node_modules/.pnpm/zustand%405.0.12_%40types%2Breact%4019.2.14_react%4019.2.4_use-sync-external-store%401.6.0_react%4019.2.4_/node_modules/zustand/esm/react.mjs","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/tap-const.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/scheduler.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/tap-client-stack-context.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/hooks/utils/tapHook.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/legacy-runtime/AssistantRuntimeProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/providers/ThreadViewportProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/model-context/types.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/utils/createContextStoreHook.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/utils/BaseProxyHandler.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/wrapperResource.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/tap/src/core/helpers/root.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/Derived.ts","../../../../../../../node_modules/.pnpm/lucide-react%401.7.0_react%4019.2.4/node_modules/lucide-react/src/icons/cpu.ts","../../../../../../../node_modules/.pnpm/%40babel%2Bruntime%407.29.2/node_modules/%40babel/runtime/helpers/esm/extends.js","../../../../../../../node_modules/.pnpm/%40babel%2Bruntime%407.29.2/node_modules/%40babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../../../../node_modules/.pnpm/zustand%405.0.12_%40types%2Breact%4019.2.14_react%4019.2.4_use-sync-external-store%401.6.0_react%4019.2.4_/node_modules/zustand/esm/vanilla/shallow.mjs","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/utils/ensureBinding.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/utils/createStateHookForRuntime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/composer/ComposerIf.tsx","../../../../../../../node_modules/.pnpm/use-effect-event%402.0.3_react%4019.2.4/node_modules/use-effect-event/src/useEffectEvent.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/utils/getMessageQuote.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/PartByIndexProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/smooth/useSmooth.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/AttachmentByIndexProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/QueueItemByIndexProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/MessageByIndexProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/SuggestionByIndexProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useComposerSend.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useComposerCancel.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarStopSpeaking.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarFeedback.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useComposerDictate.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarEdit.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useComposerAddAttachment.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarCopy.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/TextMessagePartProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarReload.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useSuggestionTrigger.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useActionBarSpeak.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/legacy-runtime/hooks/MessageContext.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/Primitive.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message/MessageError.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer.ts","../../../../../../../node_modules/.pnpm/use-isomorphic-layout-effect%401.2.1_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-primitive%402.1.4_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Bre_0243fb2db8a1fb85ca77b8d9e5c2d650/node_modules/%40radix-ui/react-primitive/dist/index.mjs","../../../../../../../node_modules/.pnpm/use-composed-ref%401.4.0_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/use-composed-ref/dist/use-composed-ref.esm.js","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slot%401.2.4_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40radix-ui/react-slot/dist/index.mjs","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitive-hooks/useMessageError.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-primitive%402.1.4_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Bre_0243fb2db8a1fb85ca77b8d9e5c2d650/node_modules/%40radix-ui/react-primitive/src/primitive.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/context/react/utils/useRuntimeState.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadIf.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerStopDictation.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/useAuiEvent.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/ComposerMentionCategories.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarRoot.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerQuote.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/ComposerMentionBack.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message/MessageIf.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerDictationTranscript.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/messagePart/MessagePartImage.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/ComposerMentionItems.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/hooks/useOnScrollToBottom.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/ComposerMentionPopover.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message/MessageRoot.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadRoot.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/createActionButton.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarStopSpeaking.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerAttachmentDropzone.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/messagePart/MessagePartText.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarCopy.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarFeedbackNegative.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarExportMarkdown.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarFeedbackPositive.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/smooth/SmoothContext.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerSend.ts","../../../../../../../node_modules/.pnpm/zustand%405.0.12_%40types%2Breact%4019.2.14_react%4019.2.4_use-sync-external-store%401.6.0_react%4019.2.4_/node_modules/zustand/esm/react/shallow.mjs","../../../../../../../node_modules/.pnpm/use-latest%401.3.0_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/use-latest/dist/use-latest.esm.js","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/useActionBarFloatStatus.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/messagePart/useMessagePartText.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarInteractionContext.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/messagePart/MessagePartInProgress.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadSuggestion.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/providers/ChainOfThoughtByIndicesProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/message/MessageParts.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message/MessageParts.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/thread/ThreadMessages.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/composer/ComposerQueue.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/thread/ThreadSuggestions.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/message/MessageAttachments.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/composer/ComposerAttachments.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadScrollToBottom.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerDictate.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/store/clients/chain-of-thought-client.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/useThreadViewportAutoScroll.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerAddAttachment.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/MentionResource.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/ComposerMentionContext.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadViewport.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerInput.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/messagePart/useMessagePartImage.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/message/MessagePartsGrouped.tsx","../../../../../../../node_modules/.pnpm/react-textarea-autosize%408.5.9_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/react-textarea-autosize/dist/react-textarea-autosize.esm.js","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/mention/detectMentionTrigger.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/hooks/useOnResizeContent.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadViewportSlack.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarSpeak.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/utils/hooks/useSizeHandle.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/adapters/mention.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-slot%401.2.4_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40radix-ui/react-slot/src/slot.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/RenderChildrenWithAccessor.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breact%4019.2.14_react%4019.2.4__%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/%40assistant-ui/store/src/useAuiState.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/primitives/message/MessageQuote.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerRoot.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/composer/ComposerCancel.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarEdit.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/actionBar/ActionBarReload.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Breact%400.12.22_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.14__%40types%2Breact%40_fe5ee3893a3d3914cc14c9fc16f48ee8/node_modules/%40assistant-ui/react/src/primitives/thread/ThreadViewportFooter.tsx","../../../../../../../node_modules/.pnpm/inline-style-parser%400.2.7/node_modules/inline-style-parser/index.js","../../../../../../../node_modules/.pnpm/style-to-object%401.0.14/node_modules/style-to-object/src/index.ts","../../../../../../../node_modules/.pnpm/style-to-js%401.1.21/node_modules/style-to-js/src/utilities.ts","../../../../../../../node_modules/.pnpm/style-to-js%401.1.21/node_modules/style-to-js/src/index.ts","../../../../../../../node_modules/.pnpm/extend%403.0.2/node_modules/extend/index.js","../../../../../../../node_modules/.pnpm/devlop%401.1.0/node_modules/devlop/lib/default.js","../../../../../../../node_modules/.pnpm/comma-separated-tokens%402.0.3/node_modules/comma-separated-tokens/index.js","../../../../../../../node_modules/.pnpm/estree-util-is-identifier-name%403.0.0/node_modules/estree-util-is-identifier-name/lib/index.js","../../../../../../../node_modules/.pnpm/hast-util-whitespace%403.0.0/node_modules/hast-util-whitespace/lib/index.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/info.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/types.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/defined-info.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/normalize.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/find.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/hast-to-react.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/schema.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/merge.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/create.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/aria.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/case-sensitive-transform.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/util/case-insensitive-transform.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/html.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/svg.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/xlink.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/xmlns.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/lib/xml.js","../../../../../../../node_modules/.pnpm/property-information%407.1.0/node_modules/property-information/index.js","../../../../../../../node_modules/.pnpm/space-separated-tokens%402.0.2/node_modules/space-separated-tokens/index.js","../../../../../../../node_modules/.pnpm/hast-util-to-jsx-runtime%402.3.6/node_modules/hast-util-to-jsx-runtime/lib/index.js","../../../../../../../node_modules/.pnpm/unist-util-position%405.0.0/node_modules/unist-util-position/lib/index.js","../../../../../../../node_modules/.pnpm/unist-util-stringify-position%404.0.0/node_modules/unist-util-stringify-position/lib/index.js","../../../../../../../node_modules/.pnpm/vfile-message%404.0.3/node_modules/vfile-message/lib/index.js","../../../../../../../node_modules/.pnpm/html-url-attributes%403.0.1/node_modules/html-url-attributes/lib/index.js","../../../../../../../node_modules/.pnpm/react-markdown%4010.1.0_%40types%2Breact%4019.2.14_react%4019.2.4/node_modules/react-markdown/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-string%404.0.0/node_modules/mdast-util-to-string/lib/index.js","../../../../../../../node_modules/.pnpm/micromark-util-chunked%402.0.1/node_modules/micromark-util-chunked/index.js","../../../../../../../node_modules/.pnpm/micromark-util-combine-extensions%402.0.1/node_modules/micromark-util-combine-extensions/index.js","../../../../../../../node_modules/.pnpm/micromark-util-character%402.1.1/node_modules/micromark-util-character/index.js","../../../../../../../node_modules/.pnpm/micromark-factory-space%402.0.1/node_modules/micromark-factory-space/index.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/initialize/content.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/initialize/document.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/blank-line.js","../../../../../../../node_modules/.pnpm/micromark-util-subtokenize%402.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../../../../../../../node_modules/.pnpm/micromark-util-subtokenize%402.1.0/node_modules/micromark-util-subtokenize/index.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/content.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/initialize/flow.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/initialize/text.js","../../../../../../../node_modules/.pnpm/micromark-util-classify-character%402.0.1/node_modules/micromark-util-classify-character/index.js","../../../../../../../node_modules/.pnpm/micromark-util-resolve-all%402.0.1/node_modules/micromark-util-resolve-all/index.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/attention.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/autolink.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/block-quote.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/character-escape.js","../../../../../../../node_modules/.pnpm/character-entities%402.0.2/node_modules/character-entities/index.js","../../../../../../../node_modules/.pnpm/decode-named-character-reference%401.3.0/node_modules/decode-named-character-reference/index.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/character-reference.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/code-fenced.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/code-indented.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/code-text.js","../../../../../../../node_modules/.pnpm/micromark-factory-destination%402.0.1/node_modules/micromark-factory-destination/index.js","../../../../../../../node_modules/.pnpm/micromark-factory-label%402.0.1/node_modules/micromark-factory-label/index.js","../../../../../../../node_modules/.pnpm/micromark-factory-title%402.0.1/node_modules/micromark-factory-title/index.js","../../../../../../../node_modules/.pnpm/micromark-factory-whitespace%402.0.1/node_modules/micromark-factory-whitespace/index.js","../../../../../../../node_modules/.pnpm/micromark-util-normalize-identifier%402.0.1/node_modules/micromark-util-normalize-identifier/index.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/definition.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/heading-atx.js","../../../../../../../node_modules/.pnpm/micromark-util-html-tag-name%402.0.1/node_modules/micromark-util-html-tag-name/index.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/html-flow.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/html-text.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/label-end.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/label-start-image.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/label-start-link.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/line-ending.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/thematic-break.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/list.js","../../../../../../../node_modules/.pnpm/micromark-core-commonmark%402.0.3/node_modules/micromark-core-commonmark/lib/setext-underline.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/constructs.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/parse.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/create-tokenizer.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/postprocess.js","../../../../../../../node_modules/.pnpm/micromark%404.0.2/node_modules/micromark/lib/preprocess.js","../../../../../../../node_modules/.pnpm/micromark-util-decode-numeric-character-reference%402.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.js","../../../../../../../node_modules/.pnpm/micromark-util-decode-string%402.0.1/node_modules/micromark-util-decode-string/index.js","../../../../../../../node_modules/.pnpm/mdast-util-from-markdown%402.0.3/node_modules/mdast-util-from-markdown/lib/index.js","../../../../../../../node_modules/.pnpm/remark-parse%4011.0.0/node_modules/remark-parse/lib/index.js","../../../../../../../node_modules/.pnpm/%40ungap%2Bstructured-clone%401.3.0/node_modules/%40ungap/structured-clone/esm/types.js","../../../../../../../node_modules/.pnpm/%40ungap%2Bstructured-clone%401.3.0/node_modules/%40ungap/structured-clone/esm/deserialize.js","../../../../../../../node_modules/.pnpm/%40ungap%2Bstructured-clone%401.3.0/node_modules/%40ungap/structured-clone/esm/serialize.js","../../../../../../../node_modules/.pnpm/%40ungap%2Bstructured-clone%401.3.0/node_modules/%40ungap/structured-clone/esm/index.js","../../../../../../../node_modules/.pnpm/micromark-util-sanitize-uri%402.0.1/node_modules/micromark-util-sanitize-uri/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/footer.js","../../../../../../../node_modules/.pnpm/unist-util-is%406.0.1/node_modules/unist-util-is/lib/index.js","../../../../../../../node_modules/.pnpm/unist-util-visit-parents%406.0.2/node_modules/unist-util-visit-parents/lib/color.node.js","../../../../../../../node_modules/.pnpm/unist-util-visit-parents%406.0.2/node_modules/unist-util-visit-parents/lib/index.js","../../../../../../../node_modules/.pnpm/unist-util-visit%405.1.0/node_modules/unist-util-visit/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/break.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/code.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/delete.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/heading.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/html.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/revert.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/image.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/link.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/list-item.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/list.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/root.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/strong.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/table.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-row.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js","../../../../../../../node_modules/.pnpm/trim-lines%403.0.1/node_modules/trim-lines/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/text.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/handlers/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/state.js","../../../../../../../node_modules/.pnpm/mdast-util-to-hast%4013.2.1/node_modules/mdast-util-to-hast/lib/index.js","../../../../../../../node_modules/.pnpm/remark-rehype%4011.1.2/node_modules/remark-rehype/lib/index.js","../../../../../../../node_modules/.pnpm/bail%402.0.2/node_modules/bail/index.js","../../../../../../../node_modules/.pnpm/unified%4011.0.5/node_modules/unified/lib/index.js","../../../../../../../node_modules/.pnpm/is-plain-obj%404.1.0/node_modules/is-plain-obj/index.js","../../../../../../../node_modules/.pnpm/trough%402.2.0/node_modules/trough/lib/index.js","../../../../../../../node_modules/.pnpm/vfile%406.0.3/node_modules/vfile/lib/minurl.shared.js","../../../../../../../node_modules/.pnpm/vfile%406.0.3/node_modules/vfile/lib/index.js","../../../../../../../node_modules/.pnpm/unified%4011.0.5/node_modules/unified/lib/callable-instance.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm-strikethrough%402.0.0/node_modules/mdast-util-gfm-strikethrough/lib/index.js","../../../../../../../node_modules/.pnpm/markdown-table%403.0.4/node_modules/markdown-table/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm%403.0.0/node_modules/micromark-extension-gfm/index.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-footnote%402.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-strikethrough%402.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../../../../../../../node_modules/.pnpm/escape-string-regexp%405.0.0/node_modules/escape-string-regexp/index.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-autolink-literal%402.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-task-list-item%402.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm-autolink-literal%402.0.1/node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../../../../../../../node_modules/.pnpm/lucide-react%401.7.0_react%4019.2.4/node_modules/lucide-react/src/icons/circle-stop.ts","../../../../../../../node_modules/.pnpm/lucide-react%401.7.0_react%4019.2.4/node_modules/lucide-react/src/icons/send-horizontal.ts","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js","../../../../../../../node_modules/.pnpm/ccount%402.0.1/node_modules/ccount/index.js","../../../../../../../node_modules/.pnpm/longest-streak%403.1.0/node_modules/longest-streak/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js","../../../../../../../node_modules/.pnpm/remark-gfm%404.0.1/node_modules/remark-gfm/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm-footnote%402.1.0/node_modules/mdast-util-gfm-footnote/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.js","../../../../../../../node_modules/.pnpm/mdast-util-phrasing%404.1.0/node_modules/mdast-util-phrasing/lib/index.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-table%402.1.1/node_modules/micromark-extension-gfm-table/lib/infer.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm-task-list-item%402.0.0/node_modules/mdast-util-gfm-task-list-item/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-to-markdown%402.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-table%402.1.1/node_modules/micromark-extension-gfm-table/lib/syntax.js","../../../../../../../node_modules/.pnpm/micromark-extension-gfm-table%402.1.1/node_modules/micromark-extension-gfm-table/lib/edit-map.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm%403.1.0/node_modules/mdast-util-gfm/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-gfm-table%402.0.0/node_modules/mdast-util-gfm-table/lib/index.js","../../../../../../../node_modules/.pnpm/mdast-util-find-and-replace%403.0.2/node_modules/mdast-util-find-and-replace/lib/index.js","../../../../../../../node_modules/.pnpm/secure-json-parse%404.1.0/node_modules/secure-json-parse/index.js","../../../../../../../node_modules/.pnpm/%40tanstack%2Bquery-core%405.96.2/node_modules/%40tanstack/query-core/src/mutation.ts","../../../../../../../node_modules/.pnpm/nanoid%405.1.7/node_modules/nanoid/non-secure/index.js","../../../../../../../src/presentation/web/components/assistant-ui/thread.tsx","../../../../../../../src/presentation/web/components/features/chat/ChatTab.tsx","../../../../../../../node_modules/.pnpm/%40tanstack%2Bquery-core%405.96.2/node_modules/%40tanstack/query-core/build/modern/mutationObserver.js","../../../../../../../node_modules/.pnpm/%40tanstack%2Breact-query%405.96.2_react%4019.2.4/node_modules/%40tanstack/react-query/build/modern/useMutation.js","../../../../../../../src/presentation/web/components/features/chat/useChatRuntime.ts","../../../../../../../src/presentation/web/components/features/chat/ChatComposer.tsx","../../../../../../../src/presentation/web/hooks/use-attachments.ts","../../../../../../../node_modules/.pnpm/assistant-stream%400.3.9/node_modules/assistant-stream/src/core/tool/ToolResponse.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtimes/external-store/external-store-thread-list-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/message-part-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/utils/message-repository.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/utils/auto-status.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/utils/id.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtimes/external-store/external-store-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtimes/external-store/external-store-thread-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/base/base-assistant-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtimes/external-store/thread-message-converter.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/utils/text.ts","../../../../../../../node_modules/.pnpm/assistant-stream%400.3.9/node_modules/assistant-stream/src/utils/json/parse-partial-json-object.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/thread-list-item-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/runtimes/useExternalStoreRuntime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/base/base-thread-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/utils/thread-message-like.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/thread-list-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/message-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/composer-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/base/default-edit-composer-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40tanstack%2Bquery-core%405.96.2/node_modules/%40tanstack/query-core/src/mutationObserver.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/react/runtimes/RuntimeAdapterProvider.tsx","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/thread-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/utils/external-store-message.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/assistant-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/adapters/attachment.ts","../../../../../../../node_modules/.pnpm/assistant-stream%400.3.9/node_modules/assistant-stream/src/utils/json/fix-json.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/base/default-thread-composer-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/api/attachment-runtime.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/runtime/base/base-composer-runtime-core.ts","../../../../../../../node_modules/.pnpm/%40assistant-ui%2Bcore%400.1.10_%40assistant-ui%2Bstore%400.2.6_%40assistant-ui%2Btap%400.5.6_%40types%2Breac_842ab41b926a8de7cb0f7d26686614dd/node_modules/%40assistant-ui/core/src/subscribable/subscribable.ts","../../../../../../../src/presentation/web/app/actions/compose-user-input.ts","../../../../../../../node_modules/.pnpm/%40tanstack%2Breact-query%405.96.2_react%4019.2.4/node_modules/%40tanstack/react-query/src/useMutation.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M15 3h6v6', key: '1q9fwt' }],\n ['path', { d: 'm21 3-7 7', key: '1l2asr' }],\n ['path', { d: 'm3 21 7-7', key: 'tjx5ai' }],\n ['path', { d: 'M9 21H3v-6', key: 'wtvkvv' }],\n];\n\n/**\n * @component @name Maximize2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgM2g2djYiIC8+CiAgPHBhdGggZD0ibTIxIDMtNyA3IiAvPgogIDxwYXRoIGQ9Im0zIDIxIDctNyIgLz4KICA8cGF0aCBkPSJNOSAyMUgzdi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/maximize-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Maximize2 = createLucideIcon('maximize-2', __iconNode);\n\nexport default Maximize2;\n","const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n","const contextValue: unique symbol = Symbol(\"tap.Context\");\ntype Context<T> = {\n [contextValue]: T;\n};\n\nexport const createResourceContext = <T>(defaultValue: T): Context<T> => {\n return {\n [contextValue]: defaultValue,\n };\n};\n\nexport const withContextProvider = <T, TResult>(\n context: Context<T>,\n value: T,\n fn: () => TResult,\n) => {\n const previousValue = context[contextValue];\n context[contextValue] = value;\n try {\n return fn();\n } finally {\n context[contextValue] = previousValue;\n }\n};\n\nexport const tap = <T>(context: Context<T>) => {\n return context[contextValue];\n};\n","import { isDevelopment } from \"../core/helpers/env\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\nimport { ReducerQueueEntry, ResourceFiber } from \"../core/types\";\nimport { markCellDirty } from \"../core/helpers/root\";\nimport { tapHook } from \"./utils/tapHook\";\n\ntype Dispatch<A> = (action: A) => void;\n\nconst dispatchOnFiber = (\n fiber: ResourceFiber<any, any>,\n callback: () => (() => void) | null,\n): void => {\n if (fiber.renderContext) {\n throw new Error(\"Resource updated during render\");\n }\n if (fiber.isNeverMounted) {\n throw new Error(\"Resource updated before mount\");\n }\n\n fiber.root.dispatchUpdate(() => {\n const result = callback();\n if (result) {\n result();\n fiber.root.changelog.push(result);\n return true;\n }\n return false;\n });\n};\n\nfunction tapReducerImpl<S, A, I, R extends S>(\n reducer: (state: S, action: A) => S,\n getDerivedState: ((state: S) => R) | undefined,\n initialArg: S | I,\n initFn: ((arg: I) => S) | undefined,\n): [R, Dispatch<A>] {\n const cell = tapHook(\"reducer\", () => {\n const fiber = getCurrentResourceFiber();\n\n // First render: compute initial state\n const initialState = initFn ? initFn(initialArg as I) : initialArg;\n\n if (isDevelopment && fiber.devStrictMode && initFn) {\n void initFn(initialArg as I);\n }\n\n return {\n type: \"reducer\",\n queue: new Set(),\n dirty: false,\n workInProgress: initialState,\n current: initialState,\n reducer,\n dispatch: (action: A) => {\n const entry: ReducerQueueEntry = {\n action,\n hasEagerState: false,\n eagerState: undefined,\n };\n\n dispatchOnFiber(fiber, () => {\n if (fiber.root.dirtyCells.length === 0 && !entry.hasEagerState) {\n entry.eagerState = reducer(cell.workInProgress, action);\n entry.hasEagerState = true;\n\n if (Object.is(cell.current, entry.eagerState)) return null;\n }\n\n return () => {\n markCellDirty(fiber, cell);\n cell.queue.add(entry);\n };\n });\n },\n };\n });\n\n const fiber = getCurrentResourceFiber();\n const sameReducer = reducer === cell.reducer;\n cell.reducer = reducer;\n\n for (const item of cell.queue) {\n if (!item.hasEagerState || !sameReducer) {\n item.eagerState = reducer(cell.workInProgress, item.action);\n item.hasEagerState = true;\n }\n\n if (isDevelopment && fiber.devStrictMode) {\n void reducer(cell.workInProgress, item.action);\n }\n\n cell.workInProgress = item.eagerState;\n }\n cell.queue.clear();\n\n if (getDerivedState) {\n const derived = getDerivedState(cell.workInProgress);\n\n if (!Object.is(derived, cell.workInProgress)) {\n markCellDirty(fiber, cell);\n cell.workInProgress = derived;\n }\n }\n\n return [cell.workInProgress, cell.dispatch];\n}\n\nexport function tapReducer<S, A>(\n reducer: (state: S, action: A) => S,\n initialState: S,\n): [S, Dispatch<A>];\nexport function tapReducer<S, A, I>(\n reducer: (state: S, action: A) => S,\n initialArg: I,\n init: (arg: I) => S,\n): [S, Dispatch<A>];\nexport function tapReducer<S, A, I>(\n reducer: (state: S, action: A) => S,\n initialArg: S | I,\n init?: (arg: I) => S,\n): [S, Dispatch<A>] {\n return tapReducerImpl(\n reducer,\n undefined,\n initialArg as S,\n init as ((arg: S) => S) | undefined,\n );\n}\n\nexport function tapReducerWithDerivedState<S, A, R extends S>(\n reducer: (state: S, action: A) => S,\n getDerivedState: (state: S) => R,\n initialState: S,\n): [R, Dispatch<A>];\nexport function tapReducerWithDerivedState<S, A, I, R extends S>(\n reducer: (state: S, action: A) => S,\n getDerivedState: (state: S) => R,\n initialArg: I,\n init: (arg: I) => S,\n): [R, Dispatch<A>];\nexport function tapReducerWithDerivedState<S, A, I, R extends S>(\n reducer: (state: S, action: A) => S,\n getDerivedState: (state: S) => R,\n initialArg: I,\n init?: (arg: I) => S,\n): [R, Dispatch<A>] {\n return tapReducerImpl(reducer, getDerivedState, initialArg, init);\n}\n","import { isDevelopment } from \"./env\";\nimport { ResourceFiber } from \"../types\";\n\nlet currentResourceFiber: ResourceFiber<any, any> | null = null;\n\nexport function withResourceFiber<R, P>(\n fiber: ResourceFiber<R, P>,\n fn: () => void,\n): void {\n fiber.currentIndex = 0;\n\n const previousContext = currentResourceFiber;\n currentResourceFiber = fiber;\n try {\n fn();\n\n fiber.isFirstRender = false;\n\n // ensure hook count matches\n if (fiber.cells.length !== fiber.currentIndex) {\n throw new Error(\n `Rendered ${fiber.currentIndex} hooks but expected ${fiber.cells.length}. ` +\n \"Hooks must be called in the exact same order in every render.\",\n );\n }\n } finally {\n currentResourceFiber = previousContext;\n }\n}\nexport function getCurrentResourceFiber(): ResourceFiber<unknown, unknown> {\n if (!currentResourceFiber) {\n throw new Error(\"No resource fiber available\");\n }\n return currentResourceFiber;\n}\n\nexport function getDevStrictMode(enable: boolean) {\n if (!isDevelopment) return null;\n if (currentResourceFiber?.devStrictMode)\n return currentResourceFiber.isFirstRender ? \"child\" : \"root\";\n\n return enable ? \"root\" : null;\n}\n","import type { ResourceElement } from \"@assistant-ui/tap\";\nimport type {\n AssistantClient,\n ClientElement,\n ClientNames,\n} from \"./types/client\";\nimport type { DerivedElement } from \"./Derived\";\n\nconst TRANSFORM_SCOPES = Symbol(\"assistant-ui.transform-scopes\");\n\nexport type ScopesConfig = {\n [K in ClientNames]?: ClientElement<K> | DerivedElement<K>;\n};\n\ntype TransformScopesFn = (\n scopes: ScopesConfig,\n parent: AssistantClient,\n) => void;\n\ntype ResourceWithTransformScopes = {\n [TRANSFORM_SCOPES]?: TransformScopesFn;\n};\n\nexport function attachTransformScopes<\n T extends (...args: any[]) => ResourceElement<any>,\n>(resource: T, transform: TransformScopesFn): void {\n const r = resource as T & ResourceWithTransformScopes;\n if (r[TRANSFORM_SCOPES]) {\n throw new Error(\"transformScopes is already attached to this resource\");\n }\n r[TRANSFORM_SCOPES] = transform;\n}\n\nexport function forwardTransformScopes<\n T extends (...args: any[]) => ResourceElement<any>,\n S extends (...args: any[]) => ResourceElement<any>,\n>(target: T, source: S): void {\n const sourceTransform = getTransformScopes(source);\n if (!sourceTransform) return;\n\n const r = target as T & ResourceWithTransformScopes;\n const existingTransform = r[TRANSFORM_SCOPES];\n if (existingTransform) {\n r[TRANSFORM_SCOPES] = (scopes, parent) => {\n sourceTransform(scopes, parent);\n existingTransform(scopes, parent);\n };\n } else {\n r[TRANSFORM_SCOPES] = sourceTransform;\n }\n}\n\nexport function getTransformScopes<\n T extends (...args: any[]) => ResourceElement<any>,\n>(resource: T): TransformScopesFn | undefined {\n return (resource as T & ResourceWithTransformScopes)[TRANSFORM_SCOPES];\n}\n","import { isDevelopment } from \"../core/helpers/env\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\nimport { tapReducerWithDerivedState } from \"./tap-reducer\";\nimport { depsShallowEqual } from \"./utils/depsShallowEqual\";\n\nconst memoReducer = () => {\n throw new Error(\"Memo reducer should not be called\");\n};\n\ntype MemoState<T> = { value: T; deps: readonly unknown[] };\n\nexport const tapMemo = <T>(fn: () => T, deps: readonly unknown[]): T => {\n const fiber = getCurrentResourceFiber();\n const [state] = tapReducerWithDerivedState(\n memoReducer,\n (state: MemoState<T> | null): MemoState<T> => {\n if (state && depsShallowEqual(state.deps, deps)) return state;\n\n const value = fn();\n\n if (isDevelopment && fiber.devStrictMode) {\n void fn();\n }\n\n return { value, deps };\n },\n null,\n );\n return state.value;\n};\n","import { ResourceElement } from \"./types\";\n\nexport function withKey<E extends ResourceElement<any, any>>(\n key: string | number,\n element: E,\n): E {\n return { ...element, key };\n}\n","import type { StoreApi } from \"zustand\";\n\nexport type ReadonlyStore<T> = Omit<StoreApi<T>, \"setState\" | \"destroy\">;\n\nexport const writableStore = <T>(store: ReadonlyStore<T> | undefined) => {\n return store as unknown as StoreApi<T>;\n};\n","import {\n tapMemo,\n tapResource,\n tapResources,\n type ResourceElement,\n} from \"@assistant-ui/tap\";\nimport type { ClientMethods } from \"./types/client\";\nimport { ClientResource } from \"./tapClientResource\";\nimport { wrapperResource } from \"./wrapperResource\";\n\ntype InferClientState<TMethods> = TMethods extends {\n getState: () => infer S;\n}\n ? S\n : unknown;\n\nconst ClientResourceWithKey = wrapperResource(\n <TMethods extends ClientMethods>(el: ResourceElement<TMethods>) => {\n if (el.key === undefined) {\n throw new Error(\"tapClientResource: Element has no key\");\n }\n return tapResource(ClientResource(el)) as {\n methods: TMethods;\n state: InferClientState<TMethods>;\n key: string | number;\n };\n },\n);\n\nexport function tapClientLookup<TMethods extends ClientMethods>(\n getElements: () => readonly ResourceElement<TMethods>[],\n getElementsDeps: readonly unknown[],\n): {\n state: InferClientState<TMethods>[];\n get: (lookup: { index: number } | { key: string }) => TMethods;\n} {\n const resources = tapResources(\n () => getElements().map((el) => ClientResourceWithKey(el)),\n // biome-ignore lint/correctness/useExhaustiveDependencies: getElementsDeps is passed through from caller\n getElementsDeps,\n );\n\n const keys = tapMemo(() => Object.keys(resources), [resources]);\n\n // For arrays, track element key -> index mapping\n const keyToIndex = tapMemo(() => {\n return resources.reduce(\n (acc, resource, index) => {\n acc[resource.key] = index;\n return acc;\n },\n {} as Record<string, number>,\n );\n }, [resources]);\n\n const state = tapMemo(() => {\n return resources.map((r) => r.state);\n }, [resources]);\n\n return {\n state,\n get: (lookup: { index: number } | { key: string }) => {\n if (\"index\" in lookup) {\n if (lookup.index < 0 || lookup.index >= keys.length) {\n throw new Error(\n `tapClientLookup: Index ${lookup.index} out of bounds (length: ${keys.length})`,\n );\n }\n return resources[lookup.index]!.methods;\n }\n\n const index = keyToIndex[lookup.key];\n if (index === undefined) {\n throw new Error(`tapClientLookup: Key \"${lookup.key}\" not found`);\n }\n return resources[index]!.methods;\n },\n };\n}\n","export const isDevelopment =\n typeof process !== \"undefined\" &&\n (process.env.NODE_ENV === \"development\" || process.env.NODE_ENV === \"test\");\n","import type {\n AssistantClientAccessor,\n ClientEvents,\n ClientNames,\n} from \"./client\";\n\n// --- Event Map Construction ---\ntype UnionToIntersection<U> = (\n U extends unknown\n ? (x: U) => void\n : never\n) extends (x: infer I) => void\n ? I\n : never;\n\ntype ClientEventMap = UnionToIntersection<\n { [K in ClientNames]: ClientEvents<K> }[ClientNames]\n>;\n\n// --- Core Types ---\n\ntype WildcardPayload = {\n [K in keyof ClientEventMap]: { event: K; payload: ClientEventMap[K] };\n}[keyof ClientEventMap];\n\nexport type AssistantEventPayload = ClientEventMap & { \"*\": WildcardPayload };\n\nexport type AssistantEventName = keyof AssistantEventPayload;\n\ntype EventSource<T extends AssistantEventName> =\n T extends `${infer Source}.${string}` ? Source : never;\n\n// --- Scoping ---\n\ntype ParentOf<K extends ClientNames> =\n AssistantClientAccessor<K> extends { source: infer S }\n ? S extends ClientNames\n ? S\n : never\n : never;\n\ntype AncestorsOf<\n K extends ClientNames,\n Seen extends ClientNames = never,\n> = K extends Seen\n ? never\n : ParentOf<K> extends never\n ? never\n : ParentOf<K> | AncestorsOf<ParentOf<K>, Seen | K>;\n\n/** Valid scopes: `\"*\"` | event source | ancestors of event source */\nexport type AssistantEventScope<TEvent extends AssistantEventName> =\n | \"*\"\n | EventSource<TEvent>\n | (EventSource<TEvent> extends ClientNames\n ? AncestorsOf<EventSource<TEvent>>\n : never);\n\n// --- Selection & Callbacks ---\n\nexport type AssistantEventSelector<TEvent extends AssistantEventName> =\n | TEvent\n | { scope: AssistantEventScope<TEvent>; event: TEvent };\n\nexport const normalizeEventSelector = <TEvent extends AssistantEventName>(\n selector: AssistantEventSelector<TEvent>,\n) => {\n if (typeof selector === \"string\") {\n const source = selector.split(\".\")[0] as AssistantEventScope<TEvent>;\n return { scope: source, event: selector };\n }\n return { scope: selector.scope, event: selector.event };\n};\n\nexport type AssistantEventCallback<TEvent extends AssistantEventName> = (\n payload: AssistantEventPayload[TEvent],\n) => void;\n","import { resource, tapMemo, tapState } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport { CompositeContextProvider } from \"../../utils/composite-context-provider\";\nimport type { ModelContextState } from \"../scopes/model-context\";\n\nconst version = 1;\n\nexport const ModelContext = resource((): ClientOutput<\"modelContext\"> => {\n const [state] = tapState<ModelContextState>(\n () => ({ version: version + 1 }) as unknown as ModelContextState,\n );\n const composite = tapMemo(() => new CompositeContextProvider(), []);\n\n return {\n getState: () => state,\n getModelContext: () => composite.getModelContext(),\n subscribe: (callback) => composite.subscribe(callback),\n register: (provider) => composite.registerModelContextProvider(provider),\n };\n});\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport {\n resource,\n tapMemo,\n tapEffect,\n tapResource,\n type tapRef,\n withKey,\n} from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n tapAssistantEmit,\n tapClientLookup,\n} from \"@assistant-ui/store\";\nimport {\n ComposerRuntime,\n EditComposerRuntime,\n} from \"../../runtime/api/composer-runtime\";\nimport { ComposerState } from \"../scopes/composer\";\nimport { AttachmentRuntimeClient } from \"./attachment-runtime-client\";\nimport { tapSubscribable } from \"./tap-subscribable\";\n\nconst ComposerAttachmentClientByIndex = resource(\n ({ runtime, index }: { runtime: ComposerRuntime; index: number }) => {\n const attachmentRuntime = tapMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n\n return tapResource(\n AttachmentRuntimeClient({\n runtime: attachmentRuntime,\n }),\n );\n },\n);\n\nexport const ComposerClient = resource(\n ({\n threadIdRef,\n messageIdRef,\n runtime,\n }: {\n threadIdRef: tapRef.RefObject<string>;\n messageIdRef?: tapRef.RefObject<string>;\n runtime: ComposerRuntime;\n }): ClientOutput<\"composer\"> => {\n const runtimeState = tapSubscribable(runtime);\n const emit = tapAssistantEmit();\n\n // Bind composer events to event manager\n tapEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to composer events\n for (const event of [\"send\", \"attachmentAdd\"] as const) {\n const unsubscribe = runtime.unstable_on(event, () => {\n emit(`composer.${event}`, {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n // attachmentAddError carries the failed attachment ID\n unsubscribers.push(\n runtime.unstable_on(\"attachmentAddError\", () => {\n const errorAttachment = runtime\n .getState()\n .attachments.findLast(\n (a) =>\n a.status.type === \"incomplete\" && a.status.reason === \"error\",\n );\n emit(\"composer.attachmentAddError\", {\n threadId: threadIdRef.current,\n ...(messageIdRef && { messageId: messageIdRef.current }),\n ...(errorAttachment && { attachmentId: errorAttachment.id }),\n });\n }),\n );\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, emit, threadIdRef, messageIdRef]);\n\n const attachments = tapClientLookup(\n () =>\n runtimeState.attachments.map((attachment, idx) =>\n withKey(\n attachment.id,\n ComposerAttachmentClientByIndex({\n runtime,\n index: idx,\n }),\n ),\n ),\n [runtimeState.attachments, runtime],\n );\n\n const state = tapMemo<ComposerState>(() => {\n return {\n text: runtimeState.text,\n role: runtimeState.role,\n attachments: attachments.state,\n runConfig: runtimeState.runConfig,\n isEditing: runtimeState.isEditing,\n canCancel: runtimeState.canCancel,\n attachmentAccept: runtimeState.attachmentAccept,\n isEmpty: runtimeState.isEmpty,\n type: runtimeState.type ?? \"thread\",\n dictation: runtimeState.dictation,\n quote: runtimeState.quote,\n queue: [],\n };\n }, [runtimeState, attachments.state]);\n\n return {\n getState: () => state,\n setText: runtime.setText,\n setRole: runtime.setRole,\n setRunConfig: runtime.setRunConfig,\n addAttachment: runtime.addAttachment,\n reset: runtime.reset,\n clearAttachments: runtime.clearAttachments,\n send: runtime.send,\n cancel: runtime.cancel,\n beginEdit:\n (runtime as EditComposerRuntime).beginEdit ??\n (() => {\n throw new Error(\"beginEdit is not supported in this runtime\");\n }),\n startDictation: runtime.startDictation,\n stopDictation: runtime.stopDictation,\n setQuote: runtime.setQuote,\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.get({ key: selector.id });\n } else {\n return attachments.get(selector);\n }\n },\n queueItem: () => {\n throw new Error(\"Queue is not supported in this runtime\");\n },\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","import {\n ExtractResourceReturnType,\n RenderResult,\n ResourceElement,\n ResourceFiber,\n} from \"../core/types\";\nimport { tapEffect } from \"./tap-effect\";\nimport { tapMemo } from \"./tap-memo\";\nimport { tapCallback } from \"./tap-callback\";\nimport {\n createResourceFiber,\n unmountResourceFiber,\n renderResourceFiber,\n commitResourceFiber,\n} from \"../core/ResourceFiber\";\nimport { tapConst } from \"./tap-const\";\nimport { tapRef } from \"./tap-ref\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\n\ntype FiberState = {\n fiber: ResourceFiber<unknown, unknown>;\n next:\n | RenderResult\n | [ResourceFiber<unknown, unknown>, RenderResult]\n | \"delete\";\n};\n\nexport function tapResources<E extends ResourceElement<any, any>>(\n getElements: () => readonly E[],\n getElementsDeps?: readonly unknown[],\n): ExtractResourceReturnType<E>[] {\n const versionRef = tapRef(0);\n const version = versionRef.current;\n\n const parentFiber = tapConst(getCurrentResourceFiber, []);\n const markDirty = tapConst(\n () => () => {\n versionRef.current++;\n parentFiber.markDirty?.();\n },\n [],\n );\n const fibers = tapConst(() => new Map<string | number, FiberState>(), []);\n\n const getElementsMemo = getElementsDeps\n ? // biome-ignore lint/correctness/useExhaustiveDependencies: library code\n tapCallback(getElements, getElementsDeps)\n : getElements;\n\n // Process each element\n\n const res = tapMemo(() => {\n void version;\n\n const elementsArray = getElementsMemo();\n const seenKeys = new Set<string | number>();\n const results: any[] = [];\n let newCount = 0;\n\n // Create/update fibers and render\n for (let i = 0; i < elementsArray.length; i++) {\n const element = elementsArray[i]!;\n\n const elementKey = element.key;\n if (elementKey === undefined) {\n throw new Error(\n `tapResources did not provide a key for array at index ${i}`,\n );\n }\n\n if (seenKeys.has(elementKey))\n throw new Error(`Duplicate key ${elementKey} in tapResources`);\n seenKeys.add(elementKey);\n\n let state = fibers.get(elementKey);\n if (!state) {\n const fiber = createResourceFiber(\n element.type,\n parentFiber.root,\n markDirty,\n );\n const result = renderResourceFiber(fiber, element.props);\n state = {\n fiber,\n next: result,\n };\n newCount++;\n fibers.set(elementKey, state);\n results.push(result.output);\n } else if (state.fiber.type !== element.type) {\n const fiber = createResourceFiber(\n element.type,\n parentFiber.root,\n markDirty,\n );\n const result = renderResourceFiber(fiber, element.props);\n state.next = [fiber, result];\n results.push(result.output);\n } else {\n state.next = renderResourceFiber(state.fiber, element.props);\n results.push(state.next.output);\n }\n }\n\n // Clean up removed fibers (only if there might be stale ones)\n if (fibers.size > results.length - newCount) {\n for (const key of fibers.keys()) {\n if (!seenKeys.has(key)) {\n fibers.get(key)!.next = \"delete\";\n }\n }\n }\n\n return results;\n }, [getElementsMemo, version]);\n\n // Cleanup on unmount\n tapEffect(() => {\n return () => {\n for (const key of fibers.keys()) {\n const fiber = fibers.get(key)!.fiber;\n unmountResourceFiber(fiber);\n }\n };\n }, []);\n\n tapEffect(() => {\n res; // as a performance optimization, we only run if the results have changed\n\n for (const [key, state] of fibers.entries()) {\n if (state.next === \"delete\") {\n if (state.fiber.isMounted) {\n unmountResourceFiber(state.fiber);\n }\n\n fibers.delete(key);\n } else if (Array.isArray(state.next)) {\n unmountResourceFiber(state.fiber);\n state.fiber = state.next[0];\n commitResourceFiber(state.fiber, state.next[1]);\n } else {\n commitResourceFiber(state.fiber, state.next);\n }\n }\n }, [res]);\n\n return res;\n}\n","import { resource } from \"@assistant-ui/tap\";\nimport { type ClientOutput } from \"@assistant-ui/store\";\nimport { MessagePartRuntime } from \"../../runtime/api/message-part-runtime\";\nimport { tapSubscribable } from \"./tap-subscribable\";\n\nexport const MessagePartClient = resource(\n ({ runtime }: { runtime: MessagePartRuntime }): ClientOutput<\"part\"> => {\n const state = tapSubscribable(runtime);\n\n return {\n getState: () => state,\n addToolResult: (result) => runtime.addToolResult(result),\n resumeToolCall: (payload) => runtime.resumeToolCall(payload),\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","import { tapRef } from \"./tap-ref\";\nimport { tapEffect } from \"./tap-effect\";\nimport { isDevelopment } from \"../core/helpers/env\";\nimport { tapCallback } from \"./tap-callback\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\n\n/**\n * Creates a stable function reference that always calls the most recent version of the callback.\n * Similar to React's useEffectEvent hook.\n *\n * @param callback - The callback function to wrap\n * @returns A stable function reference that always calls the latest callback\n *\n * @example\n * ```typescript\n * const handleClick = tapEffectEvent((value: string) => {\n * console.log(value);\n * });\n * // handleClick reference is stable, but always calls the latest version\n * ```\n */\nexport function tapEffectEvent<T extends (...args: any[]) => any>(\n callback: T,\n): T {\n const callbackRef = tapRef(callback);\n\n // TODO this effect needs to run before all userland effects\n tapEffect(() => {\n callbackRef.current = callback;\n });\n\n if (isDevelopment) {\n const fiber = getCurrentResourceFiber();\n return tapCallback(\n ((...args: Parameters<T>) => {\n if (fiber.renderContext)\n throw new Error(\"tapEffectEvent cannot be called during render\");\n return callbackRef.current(...args);\n }) as T,\n [fiber],\n );\n }\n\n return callbackRef.current;\n}\n","import React, { createContext, useContext } from \"react\";\nimport type { AssistantClient, AssistantClientAccessor } from \"../types/client\";\nimport {\n createProxiedAssistantState,\n PROXIED_ASSISTANT_STATE_SYMBOL,\n} from \"./proxied-assistant-state\";\nimport { BaseProxyHandler, handleIntrospectionProp } from \"./BaseProxyHandler\";\n\nconst NO_OP_SUBSCRIBE = () => () => {};\n\nconst createErrorClientField = (\n message: string,\n): AssistantClientAccessor<never> => {\n const fn = (() => {\n throw new Error(message);\n }) as AssistantClientAccessor<never>;\n fn.source = null;\n fn.query = null;\n return fn;\n};\n\nclass DefaultAssistantClientProxyHandler\n extends BaseProxyHandler\n implements ProxyHandler<AssistantClient>\n{\n get(_: unknown, prop: string | symbol) {\n if (prop === \"subscribe\") return NO_OP_SUBSCRIBE;\n if (prop === \"on\") return NO_OP_SUBSCRIBE;\n if (prop === PROXIED_ASSISTANT_STATE_SYMBOL)\n return DefaultAssistantClientProxiedAssistantState;\n const introspection = handleIntrospectionProp(\n prop,\n \"DefaultAssistantClient\",\n );\n if (introspection !== false) return introspection;\n return createErrorClientField(\n \"You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.\",\n );\n }\n\n ownKeys(): ArrayLike<string | symbol> {\n return [\"subscribe\", \"on\", PROXIED_ASSISTANT_STATE_SYMBOL];\n }\n\n has(_: unknown, prop: string | symbol): boolean {\n return (\n prop === \"subscribe\" ||\n prop === \"on\" ||\n prop === PROXIED_ASSISTANT_STATE_SYMBOL\n );\n }\n}\n/** Default context value - throws \"wrap in AuiProvider\" error */\nexport const DefaultAssistantClient: AssistantClient =\n new Proxy<AssistantClient>(\n {} as AssistantClient,\n new DefaultAssistantClientProxyHandler(),\n );\n\nconst DefaultAssistantClientProxiedAssistantState = createProxiedAssistantState(\n DefaultAssistantClient,\n);\n\n/** Root prototype for created clients - throws \"scope not defined\" error */\nexport const createRootAssistantClient = (): AssistantClient =>\n new Proxy<AssistantClient>({} as AssistantClient, {\n get(_: AssistantClient, prop: string | symbol) {\n const introspection = handleIntrospectionProp(prop, \"AssistantClient\");\n if (introspection !== false) return introspection;\n\n return createErrorClientField(\n `The current scope does not have a \"${String(prop)}\" property.`,\n );\n },\n });\n\n/**\n * React Context for the AssistantClient\n */\nconst AssistantContext = createContext<AssistantClient>(DefaultAssistantClient);\n\nexport const useAssistantContextValue = (): AssistantClient => {\n return useContext(AssistantContext);\n};\n\n/**\n * Provider component for AssistantClient\n *\n * @example\n * ```typescript\n * <AuiProvider value={aui}>\n * <YourApp />\n * </AuiProvider>\n * ```\n */\nexport const AuiProvider = ({\n value,\n children,\n}: {\n value: AssistantClient;\n children: React.ReactNode;\n}): React.ReactElement => {\n return (\n <AssistantContext.Provider value={value}>\n {children}\n </AssistantContext.Provider>\n );\n};\n","import {\n withKey,\n resource,\n tapResource,\n tapMemo,\n tapState,\n type tapRef,\n} from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n tapClientLookup,\n tapClientResource,\n} from \"@assistant-ui/store\";\nimport { MessageRuntime } from \"../../runtime/api/message-runtime\";\nimport { tapSubscribable } from \"./tap-subscribable\";\nimport { ComposerClient } from \"./composer-runtime-client\";\nimport { MessagePartClient } from \"./message-part-runtime-client\";\nimport { MessageState } from \"../scopes/message\";\nimport { AttachmentRuntimeClient } from \"./attachment-runtime-client\";\n\nconst MessageAttachmentClientByIndex = resource(\n ({ runtime, index }: { runtime: MessageRuntime; index: number }) => {\n const attachmentRuntime = tapMemo(\n () => runtime.getAttachmentByIndex(index),\n [runtime, index],\n );\n return tapResource(AttachmentRuntimeClient({ runtime: attachmentRuntime }));\n },\n);\n\nconst MessagePartByIndex = resource(\n ({ runtime, index }: { runtime: MessageRuntime; index: number }) => {\n const partRuntime = tapMemo(\n () => runtime.getMessagePartByIndex(index),\n [runtime, index],\n );\n return tapResource(MessagePartClient({ runtime: partRuntime }));\n },\n);\n\nexport const MessageClient = resource(\n ({\n runtime,\n threadIdRef,\n }: {\n runtime: MessageRuntime;\n threadIdRef: tapRef.RefObject<string>;\n }): ClientOutput<\"message\"> => {\n const runtimeState = tapSubscribable(runtime);\n\n const [isCopiedState, setIsCopied] = tapState(false);\n const [isHoveringState, setIsHovering] = tapState(false);\n\n const messageIdRef = tapMemo(\n () => ({\n get current() {\n return runtime.getState().id;\n },\n }),\n [runtime],\n );\n\n const composer = tapClientResource(\n ComposerClient({\n runtime: runtime.composer,\n threadIdRef,\n messageIdRef,\n }),\n );\n const parts = tapClientLookup(\n () =>\n runtimeState.content.map((part, idx) =>\n withKey(\n \"toolCallId\" in part && part.toolCallId != null\n ? `toolCallId-${part.toolCallId}`\n : `index-${idx}`,\n MessagePartByIndex({ runtime, index: idx }),\n ),\n ),\n [runtimeState.content, runtime],\n );\n\n const attachments = tapClientLookup(\n () =>\n (runtimeState.attachments ?? []).map((attachment, idx) =>\n withKey(\n attachment.id,\n MessageAttachmentClientByIndex({ runtime, index: idx }),\n ),\n ),\n [runtimeState.attachments, runtime],\n );\n\n const state = tapMemo<MessageState>(() => {\n return {\n ...(runtimeState as MessageState),\n\n parts: parts.state,\n composer: composer.state,\n\n isCopied: isCopiedState,\n isHovering: isHoveringState,\n };\n }, [\n runtimeState,\n parts.state,\n composer.state,\n isCopiedState,\n isHoveringState,\n ]);\n\n return {\n getState: () => state,\n\n composer: () => composer.methods,\n\n reload: (config) => runtime.reload(config),\n speak: () => runtime.speak(),\n stopSpeaking: () => runtime.stopSpeaking(),\n submitFeedback: (feedback) => runtime.submitFeedback(feedback),\n switchToBranch: (options) => runtime.switchToBranch(options),\n getCopyText: () => runtime.unstable_getCopyText(),\n part: (selector) => {\n if (\"index\" in selector) {\n return parts.get({ index: selector.index });\n } else {\n return parts.get({ key: `toolCallId-${selector.toolCallId}` });\n }\n },\n\n attachment: (selector) => {\n if (\"id\" in selector) {\n return attachments.get({ key: selector.id });\n } else {\n return attachments.get(selector);\n }\n },\n\n setIsCopied,\n setIsHovering,\n\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","\"use client\";\n\nimport { useResource } from \"@assistant-ui/tap/react\";\nimport {\n resource,\n tapMemo,\n tapResources,\n tapEffectEvent,\n tapEffect,\n tapRef,\n tapResource,\n withKey,\n tapResourceRoot,\n} from \"@assistant-ui/tap\";\nimport type {\n AssistantClient,\n AssistantClientAccessor,\n ClientNames,\n ClientElement,\n ClientMeta,\n} from \"./types/client\";\nimport { Derived, DerivedElement } from \"./Derived\";\nimport {\n useAssistantContextValue,\n DefaultAssistantClient,\n createRootAssistantClient,\n} from \"./utils/react-assistant-context\";\nimport {\n DerivedClients,\n RootClients,\n tapSplitClients,\n} from \"./utils/splitClients\";\nimport {\n normalizeEventSelector,\n type AssistantEventName,\n type AssistantEventCallback,\n type AssistantEventSelector,\n} from \"./types/events\";\nimport { NotificationManager } from \"./utils/NotificationManager\";\nimport { withAssistantTapContextProvider } from \"./utils/tap-assistant-context\";\nimport { tapClientResource } from \"./tapClientResource\";\nimport { getClientIndex } from \"./utils/tap-client-stack-context\";\nimport {\n PROXIED_ASSISTANT_STATE_SYMBOL,\n createProxiedAssistantState,\n} from \"./utils/proxied-assistant-state\";\n\nconst tapShallowMemoArray = <T>(array: readonly T[]) => {\n // biome-ignore lint/correctness/useExhaustiveDependencies: shallow memo\n return tapMemo(() => array, array);\n};\n\nconst RootClientResource = resource(\n <K extends ClientNames>({\n element,\n emit,\n clientRef,\n }: {\n element: ClientElement<K>;\n emit: NotificationManager[\"emit\"];\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n }) => {\n const { methods, state } = withAssistantTapContextProvider(\n { clientRef, emit },\n () => tapClientResource(element),\n );\n return tapMemo(() => ({ state, methods }), [methods, state]);\n },\n);\n\nconst RootClientAccessorResource = resource(\n <K extends ClientNames>({\n element,\n notifications,\n clientRef,\n name,\n }: {\n element: ClientElement<K>;\n notifications: NotificationManager;\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n name: K;\n }): AssistantClientAccessor<K> => {\n const store = tapResourceRoot(\n RootClientResource({ element, emit: notifications.emit, clientRef }),\n );\n\n tapEffect(() => {\n return store.subscribe(notifications.notifySubscribers);\n }, [store, notifications]);\n\n return tapMemo(() => {\n const clientFunction = () => store.getValue().methods;\n Object.defineProperties(clientFunction, {\n source: {\n value: \"root\" as const,\n writable: false,\n },\n query: {\n value: {} as Record<string, never>,\n writable: false,\n },\n name: {\n value: name,\n configurable: true,\n },\n });\n return clientFunction as AssistantClientAccessor<K>;\n }, [store, name]);\n },\n);\n\nconst NoOpRootClientsAccessorsResource = resource(() => {\n return tapMemo(\n () => ({\n clients: [] as AssistantClientAccessor<ClientNames>[],\n subscribe: undefined,\n on: undefined,\n }),\n [],\n );\n});\n\nconst RootClientsAccessorsResource = resource(\n ({\n clients: inputClients,\n clientRef,\n }: {\n clients: RootClients;\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n }) => {\n const notifications = tapResource(NotificationManager());\n\n tapEffect(\n () => clientRef.parent.subscribe(notifications.notifySubscribers),\n [clientRef, notifications],\n );\n\n const results = tapShallowMemoArray(\n tapResources(\n () =>\n Object.keys(inputClients).map((key) =>\n withKey(\n key,\n RootClientAccessorResource({\n element: inputClients[key as keyof typeof inputClients]!,\n notifications,\n clientRef,\n name: key as keyof typeof inputClients,\n }),\n ),\n ),\n [inputClients, notifications, clientRef],\n ),\n );\n\n return tapMemo(() => {\n return {\n clients: results,\n subscribe: notifications.subscribe,\n on: function <TEvent extends AssistantEventName>(\n this: AssistantClient,\n selector: AssistantEventSelector<TEvent>,\n callback: AssistantEventCallback<TEvent>,\n ) {\n if (!this) {\n throw new Error(\n \"const { on } = useAui() is not supported. Use aui.on() instead.\",\n );\n }\n\n const { scope, event } = normalizeEventSelector(selector);\n\n if (scope !== \"*\") {\n const source = this[scope as ClientNames].source;\n if (source === null) {\n throw new Error(\n `Scope \"${scope}\" is not available. Use { scope: \"*\", event: \"${event}\" } to listen globally.`,\n );\n }\n }\n\n const localUnsub = notifications.on(event, (payload, clientStack) => {\n if (scope === \"*\") {\n callback(payload);\n return;\n }\n\n const scopeClient = this[scope as ClientNames]();\n const index = getClientIndex(scopeClient);\n if (scopeClient === clientStack[index]) {\n callback(payload);\n }\n });\n if (\n scope !== \"*\" &&\n clientRef.parent[scope as ClientNames].source === null\n )\n return localUnsub;\n\n const parentUnsub = clientRef.parent.on(selector, callback);\n\n return () => {\n localUnsub();\n parentUnsub();\n };\n },\n };\n }, [results, notifications, clientRef]);\n },\n);\n\ntype MetaMemo<K extends ClientNames> = {\n meta?: ClientMeta<K>;\n dep?: unknown;\n};\n\nconst getMeta = <K extends ClientNames>(\n props: Derived.Props<K>,\n clientRef: { parent: AssistantClient; current: AssistantClient | null },\n memo: MetaMemo<K>,\n): ClientMeta<K> => {\n if (\"source\" in props && \"query\" in props) return props;\n if (memo.dep === props) return memo.meta!;\n const meta = props.getMeta(clientRef.current!);\n memo.meta = meta;\n memo.dep = props;\n return meta;\n};\n\nconst DerivedClientAccessorResource = resource(\n <K extends ClientNames>({\n element,\n clientRef,\n name,\n }: {\n element: DerivedElement<K>;\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n name: K;\n }) => {\n const get = tapEffectEvent(() => element.props);\n\n return tapMemo(() => {\n const clientFunction = () => get().get(clientRef.current!);\n const metaMemo = {};\n Object.defineProperties(clientFunction, {\n source: {\n get: () => getMeta(get(), clientRef, metaMemo).source,\n },\n query: {\n get: () => getMeta(get(), clientRef, metaMemo).query,\n },\n name: {\n value: name,\n configurable: true,\n },\n });\n return clientFunction as AssistantClientAccessor<K>;\n }, [clientRef, name]);\n },\n);\n\nconst DerivedClientsAccessorsResource = resource(\n ({\n clients,\n clientRef,\n }: {\n clients: DerivedClients;\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n }) => {\n return tapShallowMemoArray(\n tapResources(\n () =>\n Object.keys(clients).map((key) =>\n withKey(\n key,\n DerivedClientAccessorResource({\n element: clients[key as keyof typeof clients]!,\n clientRef,\n name: key as keyof typeof clients,\n }),\n ),\n ),\n [clients, clientRef],\n ),\n );\n },\n);\n\n/**\n * Resource that creates an extended AssistantClient.\n */\nexport const AssistantClientResource = resource(\n ({\n parent,\n clients,\n }: {\n parent: AssistantClient;\n clients: useAui.Props;\n }): AssistantClient => {\n const { rootClients, derivedClients } = tapSplitClients(clients, parent);\n\n const clientRef = tapRef({\n parent: parent,\n current: null as AssistantClient | null,\n }).current;\n\n tapEffect(() => {\n // if (clientRef.current && clientRef.current !== client)\n // throw new Error(\"clientRef.current !== client\");\n\n clientRef.current = client;\n });\n\n const rootFields = tapResource(\n Object.keys(rootClients).length > 0\n ? RootClientsAccessorsResource({ clients: rootClients, clientRef })\n : NoOpRootClientsAccessorsResource(),\n );\n\n const derivedFields = tapResource(\n DerivedClientsAccessorsResource({ clients: derivedClients, clientRef }),\n );\n\n const client = tapMemo(() => {\n // Swap DefaultAssistantClient -> createRootAssistantClient at root to change error message\n const proto =\n parent === DefaultAssistantClient\n ? createRootAssistantClient()\n : parent;\n\n const client = Object.create(proto) as AssistantClient;\n Object.assign(client, {\n subscribe: rootFields.subscribe ?? parent.subscribe,\n on: rootFields.on ?? parent.on,\n [PROXIED_ASSISTANT_STATE_SYMBOL]: createProxiedAssistantState(client),\n });\n\n for (const field of rootFields.clients) {\n (client as any)[field.name] = field;\n }\n for (const field of derivedFields) {\n (client as any)[field.name] = field;\n }\n\n return client;\n }, [parent, rootFields, derivedFields]);\n\n if (clientRef.current === null) {\n clientRef.current = client;\n }\n\n return client;\n },\n);\n\nexport namespace useAui {\n export type Props = {\n [K in ClientNames]?: ClientElement<K> | DerivedElement<K>;\n };\n}\n\nexport function useAui(): AssistantClient;\nexport function useAui(clients: useAui.Props): AssistantClient;\nexport function useAui(\n clients: useAui.Props,\n config: { parent: null | AssistantClient },\n): AssistantClient;\n/** @deprecated This API is highly experimental and may be changed in a minor release */\nexport function useAui(\n clients?: useAui.Props,\n { parent }: { parent: null | AssistantClient } = {\n parent: useAssistantContextValue(),\n },\n): AssistantClient {\n if (clients) {\n return useResource(\n AssistantClientResource({\n parent: parent ?? DefaultAssistantClient,\n clients,\n }),\n );\n }\n if (parent === null)\n throw new Error(\"received null parent, this usage is not allowed\");\n return parent;\n}\n","import { Derived, DerivedElement } from \"../Derived\";\nimport type {\n AssistantClient,\n ClientElement,\n ClientNames,\n} from \"../types/client\";\nimport { getTransformScopes } from \"../attachTransformScopes\";\nimport type { useAui } from \"../useAui\";\nimport { tapMemo } from \"@assistant-ui/tap\";\n\nexport type RootClients = Partial<\n Record<ClientNames, ClientElement<ClientNames>>\n>;\nexport type DerivedClients = Partial<\n Record<ClientNames, DerivedElement<ClientNames>>\n>;\n\n/**\n * Splits a clients object into root clients and derived clients,\n * applying transformScopes from root client elements.\n */\nfunction splitClients(clients: useAui.Props, baseClient: AssistantClient) {\n // 1. Collect transforms from root elements and run them iteratively\n const scopes = { ...clients } as Record<\n string,\n ClientElement<ClientNames> | DerivedElement<ClientNames>\n >;\n const visited = new Set<(...args: any[]) => any>();\n\n let changed = true;\n while (changed) {\n changed = false;\n for (const clientElement of Object.values(scopes)) {\n if (clientElement.type === (Derived as unknown)) continue;\n if (visited.has(clientElement.type)) continue;\n visited.add(clientElement.type);\n\n const transform = getTransformScopes(clientElement.type);\n if (transform) {\n transform(scopes, baseClient);\n changed = true;\n break; // restart iteration since scopes may have new root elements\n }\n }\n }\n\n // 2. Split result into root/derived\n const rootClients: RootClients = {};\n const derivedClients: DerivedClients = {};\n\n for (const [key, clientElement] of Object.entries(scopes) as [\n ClientNames,\n ClientElement<ClientNames> | DerivedElement<ClientNames>,\n ][]) {\n if (clientElement.type === (Derived as unknown)) {\n derivedClients[key] = clientElement as DerivedElement<ClientNames>;\n } else {\n rootClients[key] = clientElement as ClientElement<ClientNames>;\n }\n }\n\n return { rootClients, derivedClients };\n}\n\nconst tapShallowMemoObject = <T extends object>(object: T) => {\n // biome-ignore lint/correctness/useExhaustiveDependencies: shallow memo\n return tapMemo(() => object, [...Object.entries(object).flat()]);\n};\n\nexport const tapSplitClients = (\n clients: useAui.Props,\n baseClient: AssistantClient,\n) => {\n const { rootClients, derivedClients } = splitClients(clients, baseClient);\n\n return {\n rootClients: tapShallowMemoObject(rootClients),\n derivedClients: tapShallowMemoObject(derivedClients),\n };\n};\n","import { ExtractResourceReturnType, ResourceElement } from \"../core/types\";\nimport { tapEffect } from \"./tap-effect\";\nimport {\n createResourceFiber,\n unmountResourceFiber,\n renderResourceFiber,\n commitResourceFiber,\n} from \"../core/ResourceFiber\";\nimport { tapMemo } from \"./tap-memo\";\nimport { tapRef } from \"./tap-ref\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\n\nexport function tapResource<E extends ResourceElement<any, any>>(\n element: E,\n): ExtractResourceReturnType<E>;\nexport function tapResource<E extends ResourceElement<any, any>>(\n element: E,\n propsDeps: readonly unknown[],\n): ExtractResourceReturnType<E>;\nexport function tapResource<E extends ResourceElement<any, any>>(\n element: E,\n propsDeps?: readonly unknown[],\n): ExtractResourceReturnType<E> {\n const parentFiber = getCurrentResourceFiber();\n const versionRef = tapRef(0);\n const fiber = tapMemo(() => {\n void element.key;\n return createResourceFiber(element.type, parentFiber.root, () => {\n versionRef.current++;\n parentFiber.markDirty?.();\n });\n }, [element.type, element.key, parentFiber]);\n\n const result = propsDeps\n ? // biome-ignore lint/correctness/useExhaustiveDependencies: user provided deps instead of prop identity\n tapMemo(\n () => renderResourceFiber(fiber, element.props),\n [fiber, ...propsDeps, versionRef.current],\n )\n : renderResourceFiber(fiber, element.props);\n\n tapEffect(() => () => unmountResourceFiber(fiber), [fiber]);\n tapEffect(() => {\n commitResourceFiber(fiber, result);\n }, [fiber, result]);\n\n return result.output;\n}\n","import {\n tapEffect,\n tapMemo,\n tapRef,\n type ResourceElement,\n tapResource,\n} from \"@assistant-ui/tap\";\nimport type { ClientMethods } from \"./types/client\";\nimport {\n tapClientStack,\n tapWithClientStack,\n SYMBOL_CLIENT_INDEX,\n} from \"./utils/tap-client-stack-context\";\nimport {\n BaseProxyHandler,\n handleIntrospectionProp,\n} from \"./utils/BaseProxyHandler\";\nimport { wrapperResource } from \"./wrapperResource\";\n\n/**\n * Symbol used internally to get state from ClientProxy.\n * This allows getState() to be optional in the user-facing client.\n */\nconst SYMBOL_GET_OUTPUT = Symbol(\"assistant-ui.store.getValue\");\n\ntype ClientInternal = {\n [SYMBOL_GET_OUTPUT]: ClientMethods;\n};\n\nexport const getClientState = (client: ClientMethods) => {\n const output = (client as unknown as ClientInternal)[SYMBOL_GET_OUTPUT];\n if (!output) {\n throw new Error(\n \"Client scope contains a non-client resource. \" +\n \"Ensure your Derived get() returns a client created with tapClientResource(), not a plain resource.\",\n );\n }\n return (output as any).getState?.();\n};\n\n// Global cache for function templates by field name\nconst fieldAccessFns = new Map<\n string | symbol,\n (this: unknown, ...args: unknown[]) => unknown\n>();\n\nfunction getOrCreateProxyFn(prop: string | symbol) {\n let template = fieldAccessFns.get(prop);\n if (!template) {\n template = function (this: unknown, ...args: unknown[]) {\n if (!this || typeof this !== \"object\") {\n throw new Error(\n `Method \"${String(prop)}\" called without proper context. ` +\n `This may indicate the function was called incorrectly.`,\n );\n }\n\n const output = (this as ClientInternal)[SYMBOL_GET_OUTPUT];\n if (!output) {\n throw new Error(\n `Method \"${String(prop)}\" called on invalid client proxy. ` +\n `Ensure you are calling this method on a valid client instance.`,\n );\n }\n\n const method = output[prop];\n if (!method)\n throw new Error(`Method \"${String(prop)}\" is not implemented.`);\n if (typeof method !== \"function\")\n throw new Error(`\"${String(prop)}\" is not a function.`);\n return method(...args);\n };\n fieldAccessFns.set(prop, template);\n }\n return template;\n}\n\nclass ClientProxyHandler\n extends BaseProxyHandler\n implements ProxyHandler<object>\n{\n private boundFns: Map<string | symbol, Function> | undefined;\n private cachedReceiver: unknown;\n\n constructor(\n private readonly outputRef: {\n current: ClientMethods;\n },\n private readonly index: number,\n ) {\n super();\n }\n\n get(_: unknown, prop: string | symbol, receiver: unknown) {\n if (prop === SYMBOL_GET_OUTPUT) return this.outputRef.current;\n if (prop === SYMBOL_CLIENT_INDEX) return this.index;\n const introspection = handleIntrospectionProp(prop, \"ClientProxy\");\n if (introspection !== false) return introspection;\n const value = this.outputRef.current[prop];\n if (typeof value === \"function\") {\n if (this.cachedReceiver !== receiver) {\n this.boundFns = new Map();\n this.cachedReceiver = receiver;\n }\n let bound = this.boundFns!.get(prop);\n if (!bound) {\n bound = getOrCreateProxyFn(prop).bind(receiver);\n this.boundFns!.set(prop, bound);\n }\n return bound;\n }\n return value;\n }\n\n ownKeys(): ArrayLike<string | symbol> {\n return Object.keys(this.outputRef.current);\n }\n\n has(_: unknown, prop: string | symbol) {\n if (prop === SYMBOL_GET_OUTPUT) return true;\n if (prop === SYMBOL_CLIENT_INDEX) return true;\n return prop in this.outputRef.current;\n }\n}\n\n/**\n * Resource that wraps a plain resource element to create a stable client proxy.\n *\n * Takes a ResourceElement that returns methods (with optional getState()) and\n * wraps it to produce a stable client proxy. This adds the client to the\n * client stack, enabling event scoping.\n *\n * @internal\n */\nexport const ClientResource = wrapperResource(\n <TMethods extends ClientMethods>(\n element: ResourceElement<TMethods>,\n ): {\n methods: TMethods;\n state: unknown;\n key: string | number | undefined;\n } => {\n const valueRef = tapRef(null as unknown as TMethods);\n\n const index = tapClientStack().length;\n const methods = tapMemo(\n () =>\n new Proxy<TMethods>(\n {} as TMethods,\n new ClientProxyHandler(valueRef, index),\n ),\n [index],\n );\n\n const value = tapWithClientStack(methods, () => tapResource(element));\n if (!valueRef.current) {\n valueRef.current = value;\n }\n\n tapEffect(() => {\n valueRef.current = value;\n });\n\n const state = (value as any).getState?.();\n return { methods, state, key: element.key };\n },\n);\n\ntype InferClientState<TMethods> = TMethods extends {\n getState: () => infer S;\n}\n ? S\n : undefined;\n\nexport const tapClientResource = <TMethods extends ClientMethods>(\n element: ResourceElement<TMethods>,\n): {\n state: InferClientState<TMethods>;\n methods: TMethods;\n key: string | number | undefined;\n} => {\n return tapResource(ClientResource(element)) as {\n state: InferClientState<TMethods>;\n methods: TMethods;\n key: string | number | undefined;\n };\n};\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport { ThreadRuntimeEventType } from \"../../runtime/interfaces/thread-runtime-core\";\nimport { ThreadRuntime } from \"../../runtime/api/thread-runtime\";\nimport {\n resource,\n tapResource,\n tapMemo,\n tapEffect,\n type tapRef,\n withKey,\n} from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n tapAssistantEmit,\n tapClientLookup,\n tapClientResource,\n} from \"@assistant-ui/store\";\nimport { ComposerClient } from \"./composer-runtime-client\";\nimport { MessageClient } from \"./message-runtime-client\";\nimport { tapSubscribable } from \"./tap-subscribable\";\nimport { ThreadState } from \"../scopes/thread\";\n\nconst MessageClientById = resource(\n ({\n runtime,\n id,\n threadIdRef,\n }: {\n runtime: ThreadRuntime;\n id: string;\n threadIdRef: tapRef.RefObject<string>;\n }) => {\n const messageRuntime = tapMemo(\n () => runtime.getMessageById(id),\n [runtime, id],\n );\n\n return tapResource(MessageClient({ runtime: messageRuntime, threadIdRef }));\n },\n);\n\nexport const ThreadClient = resource(\n ({ runtime }: { runtime: ThreadRuntime }): ClientOutput<\"thread\"> => {\n const runtimeState = tapSubscribable(runtime);\n const emit = tapAssistantEmit();\n\n tapEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n const threadEvents: ThreadRuntimeEventType[] = [\n \"runStart\",\n \"runEnd\",\n \"initialize\",\n \"modelContextUpdate\",\n ];\n\n for (const event of threadEvents) {\n const unsubscribe = runtime.unstable_on(event, () => {\n const threadId = runtime.getState()?.threadId || \"unknown\";\n emit(`thread.${event}`, {\n threadId,\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, emit]);\n\n const threadIdRef = tapMemo(\n () => ({\n get current() {\n return runtime.getState()!.threadId;\n },\n }),\n [runtime],\n );\n\n const composer = tapClientResource(\n ComposerClient({\n runtime: runtime.composer,\n threadIdRef,\n }),\n );\n const messages = tapClientLookup(\n () =>\n runtimeState.messages.map((m) =>\n withKey(m.id, MessageClientById({ runtime, id: m.id, threadIdRef })),\n ),\n [runtimeState.messages, runtime, threadIdRef],\n );\n\n const state = tapMemo<ThreadState>(() => {\n return {\n isEmpty: messages.state.length === 0 && !runtimeState.isLoading,\n isDisabled: runtimeState.isDisabled,\n isLoading: runtimeState.isLoading,\n isRunning: runtimeState.isRunning,\n capabilities: runtimeState.capabilities,\n state: runtimeState.state,\n suggestions: runtimeState.suggestions,\n extras: runtimeState.extras,\n speech: runtimeState.speech,\n voice: runtimeState.voice,\n\n composer: composer.state,\n messages: messages.state,\n };\n }, [runtimeState, messages, composer.state]);\n\n return {\n getState: () => state,\n composer: () => composer.methods,\n append: runtime.append,\n startRun: runtime.startRun,\n resumeRun: runtime.resumeRun,\n unstable_resumeRun: runtime.resumeRun,\n cancelRun: runtime.cancelRun,\n getModelContext: runtime.getModelContext,\n export: runtime.export,\n import: runtime.import,\n reset: runtime.reset,\n stopSpeaking: runtime.stopSpeaking,\n connectVoice: runtime.connectVoice,\n disconnectVoice: runtime.disconnectVoice,\n getVoiceVolume: runtime.getVoiceVolume,\n subscribeVoiceVolume: runtime.subscribeVoiceVolume,\n muteVoice: runtime.muteVoice,\n unmuteVoice: runtime.unmuteVoice,\n message: (selector) => {\n if (\"id\" in selector) {\n return messages.get({ key: selector.id });\n } else {\n return messages.get(selector);\n }\n },\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","import { withKey, resource, tapResource, tapMemo } from \"@assistant-ui/tap\";\nimport {\n type ClientOutput,\n tapClientLookup,\n tapClientResource,\n} from \"@assistant-ui/store\";\nimport { ThreadListRuntime } from \"../../runtime/api/thread-list-runtime\";\nimport { AssistantRuntime } from \"../../runtime/api/assistant-runtime\";\nimport { tapSubscribable } from \"./tap-subscribable\";\nimport { ThreadListItemClient } from \"./thread-list-item-runtime-client\";\nimport { ThreadClient } from \"./thread-runtime-client\";\nimport { ThreadsState } from \"../scopes/threads\";\n\nconst ThreadListItemClientById = resource(\n ({ runtime, id }: { runtime: ThreadListRuntime; id: string }) => {\n const threadListItemRuntime = tapMemo(\n () => runtime.getItemById(id),\n [runtime, id],\n );\n return tapResource(\n ThreadListItemClient({\n runtime: threadListItemRuntime,\n }),\n );\n },\n);\n\nexport const ThreadListClient = resource(\n ({\n runtime,\n __internal_assistantRuntime,\n }: {\n runtime: ThreadListRuntime;\n __internal_assistantRuntime: AssistantRuntime;\n }): ClientOutput<\"threads\"> => {\n const runtimeState = tapSubscribable(runtime);\n\n const main = tapClientResource(\n ThreadClient({\n runtime: runtime.main,\n }),\n );\n const threadItems = tapClientLookup(\n () =>\n Object.keys(runtimeState.threadItems).map((id) =>\n withKey(id, ThreadListItemClientById({ runtime, id })),\n ),\n [runtimeState.threadItems, runtime],\n );\n\n const state = tapMemo<ThreadsState>(() => {\n return {\n mainThreadId: runtimeState.mainThreadId,\n newThreadId: runtimeState.newThreadId ?? null,\n isLoading: runtimeState.isLoading,\n threadIds: runtimeState.threadIds,\n archivedThreadIds: runtimeState.archivedThreadIds,\n threadItems: threadItems.state,\n\n main: main.state,\n };\n }, [runtimeState, threadItems.state, main.state]);\n\n return {\n getState: () => state,\n thread: () => main.methods,\n item: (threadIdOrOptions) => {\n if (threadIdOrOptions === \"main\") {\n return threadItems.get({ key: state.mainThreadId });\n }\n\n if (\"id\" in threadIdOrOptions) {\n return threadItems.get({ key: threadIdOrOptions.id });\n }\n\n const { index, archived = false } = threadIdOrOptions;\n const id = archived\n ? state.archivedThreadIds[index]!\n : state.threadIds[index]!;\n return threadItems.get({ key: id });\n },\n switchToThread: async (threadId) => {\n await runtime.switchToThread(threadId);\n },\n switchToNewThread: async () => {\n await runtime.switchToNewThread();\n },\n __internal_getAssistantRuntime: () => __internal_assistantRuntime,\n };\n },\n);\n","import { resource, tapState, withKey } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport { tapClientLookup } from \"@assistant-ui/store\";\nimport type { SuggestionsState } from \"../scopes/suggestions\";\nimport type { SuggestionState } from \"../scopes/suggestion\";\n\nexport type SuggestionConfig =\n | string\n | { title: string; label: string; prompt: string };\n\nconst SuggestionClient = resource(\n (state: SuggestionState): ClientOutput<\"suggestion\"> => {\n return {\n getState: () => state,\n };\n },\n);\n\nconst SuggestionsResource = resource(\n (suggestions?: SuggestionConfig[]): ClientOutput<\"suggestions\"> => {\n const [state] = tapState<SuggestionsState>(() => {\n const normalizedSuggestions = (suggestions ?? []).map((s) => {\n if (typeof s === \"string\") {\n return {\n title: s,\n label: \"\",\n prompt: s,\n };\n }\n return {\n title: s.title,\n label: s.label,\n prompt: s.prompt,\n };\n });\n\n return {\n suggestions: normalizedSuggestions,\n };\n });\n\n const suggestionClients = tapClientLookup(\n () =>\n state.suggestions.map((suggestion, index) =>\n withKey(index, SuggestionClient(suggestion)),\n ),\n [state.suggestions],\n );\n\n return {\n getState: () => state,\n suggestion: ({ index }: { index: number }) => {\n return suggestionClients.get({ index });\n },\n };\n },\n);\n\nexport const Suggestions: {\n (): import(\"@assistant-ui/tap\").ResourceElement<\n ClientOutput<\"suggestions\">,\n undefined\n >;\n (\n suggestions: SuggestionConfig[],\n ): import(\"@assistant-ui/tap\").ResourceElement<\n ClientOutput<\"suggestions\">,\n SuggestionConfig[]\n >;\n} = SuggestionsResource as any;\n","import { resource } from \"@assistant-ui/tap\";\nimport type { ClientStack } from \"./tap-client-stack-context\";\nimport type {\n AssistantEventName,\n AssistantEventPayload,\n} from \"../types/events\";\nimport { Unsubscribe } from \"../types/client\";\nimport { tapConst } from \"@assistant-ui/tap\";\n\ntype InternalCallback = (payload: unknown, clientStack: ClientStack) => void;\n\nexport type NotificationManager = {\n on<TEvent extends AssistantEventName>(\n event: TEvent,\n callback: (\n payload: AssistantEventPayload[TEvent],\n clientStack: ClientStack,\n ) => void,\n ): Unsubscribe;\n emit<TEvent extends Exclude<AssistantEventName, \"*\">>(\n event: TEvent,\n payload: AssistantEventPayload[TEvent],\n clientStack: ClientStack,\n ): void;\n subscribe(callback: () => void): Unsubscribe;\n notifySubscribers(): void;\n};\n\nexport const NotificationManager = resource((): NotificationManager => {\n return tapConst(() => {\n const listeners = new Map<string, Set<InternalCallback>>();\n const wildcardListeners = new Set<InternalCallback>();\n const subscribers = new Set<() => void>();\n\n return {\n on(event, callback) {\n const cb = callback as InternalCallback;\n if (event === \"*\") {\n wildcardListeners.add(cb);\n return () => wildcardListeners.delete(cb);\n }\n\n let set = listeners.get(event);\n if (!set) {\n set = new Set();\n listeners.set(event, set);\n }\n set.add(cb);\n\n return () => {\n set!.delete(cb);\n if (set!.size === 0) listeners.delete(event);\n };\n },\n\n emit(event, payload, clientStack) {\n const eventListeners = listeners.get(event);\n if (!eventListeners && wildcardListeners.size === 0) return;\n\n queueMicrotask(() => {\n const errors = [];\n if (eventListeners) {\n for (const cb of eventListeners) {\n try {\n cb(payload, clientStack);\n } catch (e) {\n errors.push(e);\n }\n }\n }\n if (wildcardListeners.size > 0) {\n const wrapped = { event, payload };\n for (const cb of wildcardListeners) {\n try {\n cb(wrapped, clientStack);\n } catch (e) {\n errors.push(e);\n }\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(\n errors,\n \"Errors occurred during event emission\",\n );\n }\n }\n });\n },\n\n subscribe(callback) {\n subscribers.add(callback);\n return () => subscribers.delete(callback);\n },\n\n notifySubscribers() {\n for (const cb of subscribers) {\n try {\n cb();\n } catch (e) {\n console.error(\"NotificationManager: subscriber callback error\", e);\n }\n }\n },\n };\n }, []);\n});\n","import { useLayoutEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport {\n ResourceFiberRoot,\n type ExtractResourceReturnType,\n type ResourceElement,\n} from \"../core/types\";\nimport {\n createResourceFiber,\n unmountResourceFiber,\n renderResourceFiber,\n commitResourceFiber,\n} from \"../core/ResourceFiber\";\nimport { isDevelopment } from \"../core/helpers/env\";\nimport {\n commitRoot,\n createResourceFiberRoot,\n setRootVersion,\n} from \"../core/helpers/root\";\n\nconst useDevStrictMode = () => {\n if (!isDevelopment) return null;\n\n const count = useRef(0);\n const isFirstRender = count.current === 0;\n useState(() => count.current++);\n if (count.current !== 2) return null;\n return isFirstRender ? (\"child\" as const) : (\"root\" as const);\n};\n\nexport function useResource<E extends ResourceElement<any, any>>(\n element: E,\n): ExtractResourceReturnType<E> {\n const root = useMemo<ResourceFiberRoot>(() => {\n return createResourceFiberRoot((cb) => dispatch(cb));\n }, []);\n\n const [version, dispatch] = useReducer((v: number, cb: () => boolean) => {\n setRootVersion(root, v);\n return v + (cb() ? 1 : 0);\n }, 0);\n setRootVersion(root, version);\n\n const devStrictMode = useDevStrictMode();\n const fiber = useMemo(() => {\n void element.key;\n return createResourceFiber(element.type, root, undefined, devStrictMode);\n }, [element.type, element.key, root, devStrictMode]);\n\n const result = renderResourceFiber(fiber, element.props);\n useLayoutEffect(() => {\n return () => unmountResourceFiber(fiber);\n }, [fiber]);\n useLayoutEffect(() => {\n commitRoot(root);\n commitResourceFiber(fiber, result);\n });\n\n return result.output;\n}\n","import { resource, tapEffect, tapResource } from \"@assistant-ui/tap\";\nimport type { AssistantRuntime } from \"../../runtime/api/assistant-runtime\";\nimport { ThreadListClient } from \"../runtime-clients/thread-list-runtime-client\";\nimport {\n tapAssistantClientRef,\n Derived,\n type ScopesConfig,\n type AssistantClient,\n} from \"@assistant-ui/store\";\nimport { ModelContext } from \"./model-context-client\";\nimport { Suggestions } from \"./suggestions\";\n\nexport const RuntimeAdapterResource = resource((runtime: AssistantRuntime) => {\n const clientRef = tapAssistantClientRef();\n\n tapEffect(() => {\n return runtime.registerModelContextProvider(\n clientRef.current!.modelContext(),\n );\n }, [runtime, clientRef]);\n\n return tapResource(\n ThreadListClient({\n runtime: runtime.threads,\n __internal_assistantRuntime: runtime,\n }),\n );\n});\n\nexport const baseRuntimeAdapterTransformScopes = (\n scopes: ScopesConfig,\n parent: AssistantClient,\n): void => {\n scopes.thread ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads().thread(\"main\"),\n });\n scopes.threadListItem ??= Derived({\n source: \"threads\",\n query: { type: \"main\" },\n get: (aui) => aui.threads().item(\"main\"),\n });\n scopes.composer ??= Derived({\n source: \"thread\",\n query: {},\n get: (aui) => aui.threads().thread(\"main\").composer(),\n });\n\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n if (!scopes.suggestions && parent.suggestions.source === null) {\n scopes.suggestions = Suggestions();\n }\n};\n","import {\n commitResourceFiber,\n createResourceFiber,\n renderResourceFiber,\n unmountResourceFiber,\n} from \"./core/ResourceFiber\";\nimport { UpdateScheduler } from \"./core/scheduler\";\nimport { tapConst } from \"./hooks/tap-const\";\nimport { tapMemo } from \"./hooks/tap-memo\";\nimport { tapEffect } from \"./hooks/tap-effect\";\nimport { tapEffectEvent } from \"./hooks/tap-effect-event\";\nimport { tapRef } from \"./hooks/tap-ref\";\nimport { RenderResult, ResourceElement } from \"./core/types\";\nimport { isDevelopment } from \"./core/helpers/env\";\nimport {\n commitRoot,\n createResourceFiberRoot,\n setRootVersion,\n} from \"./core/helpers/root\";\n\nexport namespace tapResourceRoot {\n export type Unsubscribe = () => void;\n\n export interface SubscribableResource<TState> {\n /**\n * Get the current state of the store.\n */\n getValue(): TState;\n\n /**\n * Subscribe to the store.\n */\n subscribe(listener: () => void): Unsubscribe;\n }\n}\n\n// currently we never reset the root, because rollbakcs are not supported in tapResourceRoot\n\nexport const tapResourceRoot = <TState>(\n element: ResourceElement<TState>,\n): tapResourceRoot.SubscribableResource<TState> => {\n const scheduler = tapConst(\n () => new UpdateScheduler(() => handleUpdate(null)),\n [],\n );\n const queue = tapConst(() => [] as (() => void)[], []);\n\n const fiber = tapMemo(() => {\n void element.key;\n\n return createResourceFiber(\n element.type,\n createResourceFiberRoot((callback) => {\n if (!scheduler.isDirty && !callback()) return;\n queue.push(callback);\n scheduler.markDirty();\n }),\n );\n }, [element.type, element.key]);\n\n setRootVersion(fiber.root, fiber.root.committedVersion);\n const render = renderResourceFiber(fiber, element.props);\n\n const isMountedRef = tapRef(false);\n const committedPropsRef = tapRef(element.props);\n const valueRef = tapRef<TState>(render.output);\n const subscribers = tapConst(() => new Set<() => void>(), []);\n const handleUpdate = tapEffectEvent((render: RenderResult | null) => {\n if (render === null) {\n setRootVersion(fiber.root, 2);\n setRootVersion(fiber.root, 1);\n\n queue.forEach((callback) => {\n if (isDevelopment && fiber.devStrictMode) {\n callback();\n }\n\n callback();\n });\n\n if (isDevelopment && fiber.devStrictMode) {\n void renderResourceFiber(fiber, committedPropsRef.current);\n }\n\n render = renderResourceFiber(fiber, committedPropsRef.current);\n }\n\n if (scheduler.isDirty)\n throw new Error(\"Scheduler is dirty, this should never happen\");\n\n commitRoot(fiber.root);\n queue.length = 0;\n\n if (isMountedRef.current) {\n commitResourceFiber(fiber, render);\n }\n\n if (scheduler.isDirty || valueRef.current === render.output) return;\n valueRef.current = render.output;\n subscribers.forEach((callback) => callback());\n });\n\n tapEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n unmountResourceFiber(fiber);\n };\n }, [fiber]);\n\n tapEffect(() => {\n committedPropsRef.current = render.props;\n commitRoot(fiber.root);\n commitResourceFiber(fiber, render);\n\n if (scheduler.isDirty || valueRef.current === render.output) return;\n valueRef.current = render.output;\n subscribers.forEach((callback) => callback());\n });\n\n return tapMemo(\n () => ({\n getValue: () => valueRef.current,\n subscribe: (listener: () => void) => {\n subscribers.add(listener);\n return () => subscribers.delete(listener);\n },\n }),\n [],\n );\n};\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport { resource, tapEffect } from \"@assistant-ui/tap\";\nimport { type ClientOutput, tapAssistantEmit } from \"@assistant-ui/store\";\nimport {\n ThreadListItemEventType,\n ThreadListItemRuntime,\n} from \"../../runtime/api/thread-list-item-runtime\";\nimport { tapSubscribable } from \"./tap-subscribable\";\n\nexport const ThreadListItemClient = resource(\n ({\n runtime,\n }: {\n runtime: ThreadListItemRuntime;\n }): ClientOutput<\"threadListItem\"> => {\n const state = tapSubscribable(runtime);\n const emit = tapAssistantEmit();\n\n // Bind thread list item events to event manager\n tapEffect(() => {\n const unsubscribers: Unsubscribe[] = [];\n\n // Subscribe to thread list item events\n const threadListItemEvents: ThreadListItemEventType[] = [\n \"switchedTo\",\n \"switchedAway\",\n ];\n\n for (const event of threadListItemEvents) {\n const unsubscribe = runtime.unstable_on(event, () => {\n emit(`threadListItem.${event}`, {\n threadId: runtime.getState()!.id,\n });\n });\n unsubscribers.push(unsubscribe);\n }\n\n return () => {\n for (const unsub of unsubscribers) unsub();\n };\n }, [runtime, emit]);\n\n return {\n getState: () => state,\n switchTo: runtime.switchTo,\n rename: runtime.rename,\n archive: runtime.archive,\n unarchive: runtime.unarchive,\n delete: runtime.delete,\n generateTitle: runtime.generateTitle,\n initialize: runtime.initialize,\n detach: runtime.detach,\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","import { resource, tapState, tapEffect, tapCallback } from \"@assistant-ui/tap\";\nimport {\n tapAssistantClientRef,\n type ClientOutput,\n attachTransformScopes,\n} from \"@assistant-ui/store\";\nimport { ToolsState } from \"../types/scopes/tools\";\nimport type { Tool } from \"assistant-stream\";\nimport { type Toolkit } from \"../model-context/toolbox\";\nimport { ToolCallMessagePartComponent } from \"../types/MessagePartComponentTypes\";\nimport { ModelContext } from \"../../store\";\n\nexport const Tools = resource(\n ({ toolkit }: { toolkit?: Toolkit }): ClientOutput<\"tools\"> => {\n const [state, setState] = tapState<ToolsState>(() => ({\n tools: {},\n }));\n\n const clientRef = tapAssistantClientRef();\n\n const setToolUI = tapCallback(\n (toolName: string, render: ToolCallMessagePartComponent) => {\n setState((prev) => {\n return {\n ...prev,\n tools: {\n ...prev.tools,\n [toolName]: [...(prev.tools[toolName] ?? []), render],\n },\n };\n });\n\n return () => {\n setState((prev) => {\n return {\n ...prev,\n tools: {\n ...prev.tools,\n [toolName]:\n prev.tools[toolName]?.filter((r) => r !== render) ?? [],\n },\n };\n });\n };\n },\n [],\n );\n\n tapEffect(() => {\n if (!toolkit) return;\n const unsubscribes: (() => void)[] = [];\n\n // Register tool UIs (exclude symbols)\n for (const [toolName, tool] of Object.entries(toolkit)) {\n if (tool.render) {\n unsubscribes.push(setToolUI(toolName, tool.render));\n }\n }\n\n // Register tools with model context (exclude symbols)\n const toolsWithoutRender = Object.entries(toolkit).reduce(\n (acc, [name, tool]) => {\n const { render, ...rest } = tool;\n acc[name] = rest;\n return acc;\n },\n {} as Record<string, Tool<any, any>>,\n );\n\n const modelContextProvider = {\n getModelContext: () => ({\n tools: toolsWithoutRender,\n }),\n };\n\n unsubscribes.push(\n clientRef.current!.modelContext().register(modelContextProvider),\n );\n\n return () => {\n unsubscribes.forEach((fn) => fn());\n };\n }, [toolkit, setToolUI, clientRef]);\n\n return {\n getState: () => state,\n setToolUI,\n };\n },\n);\n\nattachTransformScopes(Tools, (scopes, parent) => {\n if (!scopes.modelContext && parent.modelContext.source === null) {\n scopes.modelContext = ModelContext();\n }\n});\n","import { Cell } from \"../core/types\";\nimport { depsShallowEqual } from \"./utils/depsShallowEqual\";\nimport { tapHook, registerRenderMountTask } from \"./utils/tapHook\";\n\nconst newEffect = (): Cell & { type: \"effect\" } => ({\n type: \"effect\",\n cleanup: undefined,\n deps: null, // null means the effect has never been run\n});\n\nexport namespace tapEffect {\n export type Destructor = () => void;\n export type EffectCallback = () => void | Destructor;\n}\n\nexport function tapEffect(effect: tapEffect.EffectCallback): void;\nexport function tapEffect(\n effect: tapEffect.EffectCallback,\n deps: readonly unknown[],\n): void;\nexport function tapEffect(\n effect: tapEffect.EffectCallback,\n deps?: readonly unknown[],\n): void {\n const cell = tapHook(\"effect\", newEffect);\n\n if (deps && cell.deps && depsShallowEqual(cell.deps, deps)) return;\n if (cell.deps !== null && !!deps !== !!cell.deps)\n throw new Error(\n \"tapEffect called with and without dependencies across re-renders\",\n );\n\n registerRenderMountTask(() => {\n const errors: unknown[] = [];\n\n try {\n cell.cleanup?.();\n } catch (error) {\n errors.push(error);\n } finally {\n cell.cleanup = undefined;\n }\n\n try {\n const cleanup = effect();\n\n if (cleanup !== undefined && typeof cleanup !== \"function\") {\n throw new Error(\n \"An effect function must either return a cleanup function or nothing. \" +\n `Received: ${typeof cleanup}`,\n );\n }\n\n cell.cleanup = cleanup;\n } catch (error) {\n errors.push(error);\n }\n\n cell.deps = deps;\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(errors, \"Errors during commit\");\n }\n }\n });\n}\n","import {\n ResourceFiber,\n RenderResult,\n Resource,\n ResourceFiberRoot,\n} from \"./types\";\nimport { commitAllEffects, cleanupAllEffects } from \"./helpers/commit\";\nimport {\n getDevStrictMode,\n withResourceFiber,\n} from \"./helpers/execution-context\";\nimport { callResourceFn } from \"./helpers/callResourceFn\";\nimport { isDevelopment } from \"./helpers/env\";\n\nexport function createResourceFiber<R, P>(\n type: Resource<R, P>,\n root: ResourceFiberRoot,\n markDirty: (() => void) | undefined = undefined,\n strictMode: \"root\" | \"child\" | null = getDevStrictMode(false),\n): ResourceFiber<R, P> {\n return {\n type,\n root,\n markDirty,\n devStrictMode: strictMode,\n cells: [],\n currentIndex: 0,\n renderContext: undefined,\n isFirstRender: true,\n isMounted: false,\n isNeverMounted: true,\n };\n}\n\nexport function unmountResourceFiber<R, P>(fiber: ResourceFiber<R, P>): void {\n if (!fiber.isMounted)\n throw new Error(\"Tried to unmount a fiber that is already unmounted\");\n\n fiber.isMounted = false;\n cleanupAllEffects(fiber);\n}\n\nexport function renderResourceFiber<R, P>(\n fiber: ResourceFiber<R, P>,\n props: P,\n): RenderResult {\n const result = {\n effectTasks: [],\n props,\n output: undefined as R | undefined,\n };\n\n withResourceFiber(fiber, () => {\n fiber.renderContext = result;\n try {\n result.output = callResourceFn(fiber.type, props);\n } finally {\n fiber.renderContext = undefined;\n }\n });\n\n return result;\n}\n\nexport function commitResourceFiber<R, P>(\n fiber: ResourceFiber<R, P>,\n result: RenderResult,\n): void {\n fiber.isMounted = true;\n\n if (isDevelopment && fiber.isNeverMounted && fiber.devStrictMode === \"root\") {\n fiber.isNeverMounted = false;\n\n commitAllEffects(result);\n cleanupAllEffects(fiber);\n }\n\n fiber.isNeverMounted = false;\n commitAllEffects(result);\n}\n","\"use client\";\nimport { getClientState } from \"../tapClientResource\";\nimport type { AssistantClient, AssistantState } from \"../types/client\";\nimport { BaseProxyHandler, handleIntrospectionProp } from \"./BaseProxyHandler\";\n\nexport const PROXIED_ASSISTANT_STATE_SYMBOL = Symbol(\n \"assistant-ui.store.proxiedAssistantState\",\n);\n\nconst isIgnoredKey = (key: string | symbol): key is \"on\" | \"subscribe\" => {\n return key === \"on\" || key === \"subscribe\" || typeof key === \"symbol\";\n};\n\n/**\n * Proxied state that lazily accesses scope states\n */\nexport const createProxiedAssistantState = (\n client: AssistantClient,\n): AssistantState => {\n class ProxiedAssistantStateProxyHandler\n extends BaseProxyHandler\n implements ProxyHandler<AssistantState>\n {\n get(_: unknown, prop: string | symbol) {\n const introspection = handleIntrospectionProp(prop, \"AssistantState\");\n if (introspection !== false) return introspection;\n const scope = prop as keyof AssistantClient;\n if (isIgnoredKey(scope)) return undefined;\n return getClientState(client[scope]());\n }\n\n ownKeys(): ArrayLike<string | symbol> {\n return Object.keys(client).filter((key) => !isIgnoredKey(key));\n }\n\n has(_: unknown, prop: string | symbol): boolean {\n return !isIgnoredKey(prop) && prop in client;\n }\n }\n\n return new Proxy<AssistantState>(\n {} as AssistantState,\n new ProxiedAssistantStateProxyHandler(),\n );\n};\n\nexport const getProxiedAssistantState = (\n client: AssistantClient,\n): AssistantState => {\n return (\n client as unknown as { [PROXIED_ASSISTANT_STATE_SYMBOL]: AssistantState }\n )[PROXIED_ASSISTANT_STATE_SYMBOL];\n};\n","import { resource, tapResource } from \"@assistant-ui/tap\";\nimport type { AssistantRuntime } from \"..\";\nimport {\n RuntimeAdapterResource,\n baseRuntimeAdapterTransformScopes,\n} from \"../store/internal\";\nimport { attachTransformScopes } from \"@assistant-ui/store\";\nimport { DataRenderers } from \"./client/DataRenderers\";\nimport { Tools } from \"./client/Tools\";\n\nexport const RuntimeAdapter = resource((runtime: AssistantRuntime) =>\n tapResource(RuntimeAdapterResource(runtime)),\n);\n\nattachTransformScopes(RuntimeAdapter, (scopes, parent) => {\n baseRuntimeAdapterTransformScopes(scopes, parent);\n\n if (!scopes.tools && parent.tools.source === null) {\n scopes.tools = Tools({});\n }\n\n if (!scopes.dataRenderers && parent.dataRenderers.source === null) {\n scopes.dataRenderers = DataRenderers();\n }\n});\n","import {\n memo,\n type ComponentType,\n type FC,\n type PropsWithChildren,\n} from \"react\";\nimport { useAui, AuiProvider, type AssistantClient } from \"@assistant-ui/store\";\nimport type { AssistantRuntime } from \"../runtime/api/assistant-runtime\";\nimport type { AssistantRuntimeCore } from \"../runtime/interfaces/assistant-runtime-core\";\nimport { RuntimeAdapter } from \"./RuntimeAdapter\";\n\nexport const getRenderComponent = (runtime: AssistantRuntime) => {\n return (runtime as { _core?: AssistantRuntimeCore })._core?.RenderComponent as\n | ComponentType\n | undefined;\n};\n\nexport type AssistantProviderBaseProps = PropsWithChildren<{\n runtime: AssistantRuntime;\n aui?: AssistantClient | null;\n}>;\n\nexport const AssistantProviderBase: FC<AssistantProviderBaseProps> = memo(\n ({ runtime, aui: parent = null, children }) => {\n const aui = useAui({ threads: RuntimeAdapter(runtime) }, { parent });\n const RenderComponent = getRenderComponent(runtime);\n return (\n <AuiProvider value={aui}>\n {RenderComponent && <RenderComponent />}\n {children}\n </AuiProvider>\n );\n },\n);\n","\"use client\";\n\nimport { create } from \"zustand\";\nimport type { Unsubscribe } from \"@assistant-ui/core\";\n\nexport type SizeHandle = {\n /** Update the height */\n setHeight: (height: number) => void;\n /** Unregister this handle */\n unregister: Unsubscribe;\n};\n\ntype SizeRegistry = {\n register: () => SizeHandle;\n};\n\nconst createSizeRegistry = (\n onChange: (total: number) => void,\n): SizeRegistry => {\n const entries = new Map<symbol, number>();\n\n const recalculate = () => {\n let total = 0;\n for (const height of entries.values()) {\n total += height;\n }\n onChange(total);\n };\n\n return {\n register: () => {\n const id = Symbol();\n entries.set(id, 0);\n\n return {\n setHeight: (height: number) => {\n if (entries.get(id) !== height) {\n entries.set(id, height);\n recalculate();\n }\n },\n unregister: () => {\n entries.delete(id);\n recalculate();\n },\n };\n },\n };\n};\n\nexport type ThreadViewportState = {\n readonly isAtBottom: boolean;\n readonly scrollToBottom: (config?: {\n behavior?: ScrollBehavior | undefined;\n }) => void;\n readonly onScrollToBottom: (\n callback: ({ behavior }: { behavior: ScrollBehavior }) => void,\n ) => Unsubscribe;\n\n /** Controls scroll anchoring: \"top\" anchors user messages at top, \"bottom\" is classic behavior */\n readonly turnAnchor: \"top\" | \"bottom\";\n\n /** Raw height values from registered elements */\n readonly height: {\n /** Total viewport height */\n readonly viewport: number;\n /** Total content inset height (footer, anchor message, etc.) */\n readonly inset: number;\n /** Height of the anchor user message (full height) */\n readonly userMessage: number;\n };\n\n /** Register a viewport and get a handle to update its height */\n readonly registerViewport: () => SizeHandle;\n\n /** Register a content inset (footer, anchor message, etc.) and get a handle to update its height */\n readonly registerContentInset: () => SizeHandle;\n\n /** Register the anchor user message height */\n readonly registerUserMessageHeight: () => SizeHandle;\n};\n\nexport type ThreadViewportStoreOptions = {\n turnAnchor?: \"top\" | \"bottom\" | undefined;\n};\n\nexport const makeThreadViewportStore = (\n options: ThreadViewportStoreOptions = {},\n) => {\n const scrollToBottomListeners = new Set<\n (config: { behavior: ScrollBehavior }) => void\n >();\n\n const viewportRegistry = createSizeRegistry((total) => {\n store.setState({\n height: {\n ...store.getState().height,\n viewport: total,\n },\n });\n });\n const insetRegistry = createSizeRegistry((total) => {\n store.setState({\n height: {\n ...store.getState().height,\n inset: total,\n },\n });\n });\n const userMessageRegistry = createSizeRegistry((total) => {\n store.setState({\n height: {\n ...store.getState().height,\n userMessage: total,\n },\n });\n });\n\n const store = create<ThreadViewportState>(() => ({\n isAtBottom: true,\n scrollToBottom: ({ behavior = \"auto\" } = {}) => {\n for (const listener of scrollToBottomListeners) {\n listener({ behavior });\n }\n },\n onScrollToBottom: (callback) => {\n scrollToBottomListeners.add(callback);\n return () => {\n scrollToBottomListeners.delete(callback);\n };\n },\n\n turnAnchor: options.turnAnchor ?? \"bottom\",\n\n height: {\n viewport: 0,\n inset: 0,\n userMessage: 0,\n },\n\n registerViewport: viewportRegistry.register,\n registerContentInset: insetRegistry.register,\n registerUserMessageHeight: userMessageRegistry.register,\n }));\n\n return store;\n};\n","\"use client\";\n\nimport { useContext, Context } from \"react\";\n\n/**\n * Creates a context hook with optional support.\n * @param context - The React context to consume.\n * @param providerName - The name of the provider for error messages.\n * @returns A hook function that provides the context value.\n */\nexport function createContextHook<T>(\n context: Context<T | null>,\n providerName: string,\n) {\n function useContextHook(options?: {\n optional?: boolean | undefined;\n }): T | null {\n const contextValue = useContext(context);\n if (!options?.optional && !contextValue) {\n throw new Error(`This component must be used within ${providerName}.`);\n }\n return contextValue;\n }\n\n return useContextHook;\n}\n","import { resource } from \"@assistant-ui/tap\";\nimport { type ClientOutput } from \"@assistant-ui/store\";\nimport { AttachmentRuntime } from \"../../runtime/api/attachment-runtime\";\nimport { tapSubscribable } from \"./tap-subscribable\";\n\nexport const AttachmentRuntimeClient = resource(\n ({ runtime }: { runtime: AttachmentRuntime }): ClientOutput<\"attachment\"> => {\n const state = tapSubscribable(runtime);\n\n return {\n getState: () => state,\n remove: runtime.remove,\n __internal_getRuntime: () => runtime,\n };\n },\n);\n","\"use client\";\n\nimport { createContext } from \"react\";\nimport { ReadonlyStore } from \"../ReadonlyStore\";\nimport { UseBoundStore } from \"zustand\";\nimport { createContextHook } from \"./utils/createContextHook\";\nimport { createContextStoreHook } from \"./utils/createContextStoreHook\";\nimport { ThreadViewportState } from \"../stores/ThreadViewport\";\n\nexport type ThreadViewportContextValue = {\n useThreadViewport: UseBoundStore<ReadonlyStore<ThreadViewportState>>;\n};\n\nexport const ThreadViewportContext =\n createContext<ThreadViewportContextValue | null>(null);\n\nconst useThreadViewportContext = createContextHook(\n ThreadViewportContext,\n \"ThreadPrimitive.Viewport\",\n);\n\nexport const { useThreadViewport, useThreadViewportStore } =\n createContextStoreHook(useThreadViewportContext, \"useThreadViewport\");\n","import {\n createResourceContext,\n tap,\n withContextProvider,\n tapEffectEvent,\n} from \"@assistant-ui/tap\";\nimport type {\n AssistantEventName,\n AssistantEventPayload,\n} from \"../types/events\";\nimport type { AssistantClient } from \"../types/client\";\nimport { tapClientStack, type ClientStack } from \"./tap-client-stack-context\";\n\ntype EmitFn = <TEvent extends Exclude<AssistantEventName, \"*\">>(\n event: TEvent,\n payload: AssistantEventPayload[TEvent],\n clientStack: ClientStack,\n) => void;\n\nexport type AssistantTapContextValue = {\n clientRef: { parent: AssistantClient; current: AssistantClient | null };\n emit: EmitFn;\n};\n\nconst AssistantTapContext =\n createResourceContext<AssistantTapContextValue | null>(null);\n\nexport const withAssistantTapContextProvider = <TResult>(\n value: AssistantTapContextValue,\n fn: () => TResult,\n) => {\n return withContextProvider(AssistantTapContext, value, fn);\n};\n\nconst tapAssistantTapContext = () => {\n const ctx = tap(AssistantTapContext);\n if (!ctx) throw new Error(\"AssistantTapContext is not available\");\n\n return ctx;\n};\n\nexport const tapAssistantClientRef = () => {\n return tapAssistantTapContext().clientRef;\n};\n\nexport const tapAssistantEmit = () => {\n const { emit } = tapAssistantTapContext();\n const clientStack = tapClientStack();\n\n return tapEffectEvent(\n <TEvent extends Exclude<AssistantEventName, \"*\">>(\n event: TEvent,\n payload: AssistantEventPayload[TEvent],\n ) => {\n emit(event, payload, clientStack);\n },\n );\n};\n","export const depsShallowEqual = (\n a: readonly unknown[],\n b: readonly unknown[],\n) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n return true;\n};\n","import { tapReducer } from \"./tap-reducer\";\n\nexport namespace tapState {\n export type StateUpdater<S> = S | ((prev: S) => S);\n}\n\nconst stateReducer = <S>(\n state: S | undefined,\n action: tapState.StateUpdater<S>,\n): S =>\n typeof action === \"function\"\n ? (action as (prev: S | undefined) => S)(state)\n : action;\n\nconst stateInit = <S>(initial: S | (() => S)): S =>\n typeof initial === \"function\" ? (initial as () => S)() : initial;\n\nexport function tapState<S = undefined>(): [\n S | undefined,\n (updater: tapState.StateUpdater<S>) => void,\n];\nexport function tapState<S>(\n initial: S | (() => S),\n): [S, (updater: tapState.StateUpdater<S>) => void];\nexport function tapState<S>(\n initial?: S | (() => S),\n): [S | undefined, (updater: tapState.StateUpdater<S>) => void] {\n return tapReducer(stateReducer, initial, stateInit);\n}\n","import {\n type ModelContextProvider,\n mergeModelContexts,\n} from \"../model-context/types\";\n\nexport class CompositeContextProvider implements ModelContextProvider {\n private _providers = new Set<ModelContextProvider>();\n\n getModelContext() {\n return mergeModelContexts(this._providers);\n }\n\n registerModelContextProvider(provider: ModelContextProvider) {\n this._providers.add(provider);\n const unsubscribe = provider.subscribe?.(() => {\n this.notifySubscribers();\n });\n this.notifySubscribers();\n return () => {\n this._providers.delete(provider);\n unsubscribe?.();\n this.notifySubscribers();\n };\n }\n\n private _subscribers = new Set<() => void>();\n\n notifySubscribers() {\n for (const callback of this._subscribers) callback();\n }\n\n subscribe(callback: () => void) {\n this._subscribers.add(callback);\n return () => this._subscribers.delete(callback);\n }\n}\n","import { tapState, tapEffect } from \"@assistant-ui/tap\";\nimport type { SubscribableWithState } from \"../../subscribable/subscribable\";\n\nexport const tapSubscribable = <T>(\n subscribable: Omit<SubscribableWithState<T, any>, \"path\">,\n) => {\n const [, setState] = tapState(subscribable.getState);\n tapEffect(() => {\n setState(subscribable.getState());\n return subscribable.subscribe(() => {\n setState(subscribable.getState());\n });\n }, [subscribable]);\n\n return subscribable.getState();\n};\n","import { ResourceFiber, RenderResult } from \"../types\";\n\nexport function commitAllEffects(renderResult: RenderResult): void {\n const errors: unknown[] = [];\n\n for (const task of renderResult.effectTasks) {\n try {\n task();\n } catch (error) {\n errors.push(error);\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(errors, \"Errors during commit\");\n }\n }\n}\n\nexport function cleanupAllEffects<R, P>(executionContext: ResourceFiber<R, P>) {\n const errors: unknown[] = [];\n for (const cell of executionContext.cells) {\n if (cell?.type === \"effect\") {\n cell.deps = null; // Reset deps so effect runs again on next mount\n\n if (cell.cleanup) {\n try {\n cell.cleanup?.();\n } catch (e) {\n errors.push(e);\n } finally {\n cell.cleanup = undefined;\n }\n }\n }\n }\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(errors, \"Errors during cleanup\");\n }\n }\n}\n","import { resource, tapState, tapCallback } from \"@assistant-ui/tap\";\nimport { type ClientOutput } from \"@assistant-ui/store\";\nimport { DataRenderersState } from \"../types/scopes/dataRenderers\";\nimport { DataMessagePartComponent } from \"../types/MessagePartComponentTypes\";\n\nexport const DataRenderers = resource((): ClientOutput<\"dataRenderers\"> => {\n const [state, setState] = tapState<DataRenderersState>(() => ({\n renderers: {},\n }));\n\n const setDataUI = tapCallback(\n (name: string, render: DataMessagePartComponent) => {\n setState((prev) => {\n return {\n ...prev,\n renderers: {\n ...prev.renderers,\n [name]: [...(prev.renderers[name] ?? []), render],\n },\n };\n });\n\n return () => {\n setState((prev) => {\n return {\n ...prev,\n renderers: {\n ...prev.renderers,\n [name]: prev.renderers[name]?.filter((r) => r !== render) ?? [],\n },\n };\n });\n };\n },\n [],\n );\n\n return {\n getState: () => state,\n setDataUI,\n };\n});\n","import { tapMemo } from \"./tap-memo\";\n\nexport const tapCallback = <T extends (...args: any[]) => any>(\n fn: T,\n deps: readonly unknown[],\n): T => {\n // biome-ignore lint/correctness/useExhaustiveDependencies: user provided deps instead of callback identity\n return tapMemo(() => fn, deps);\n};\n","import React from 'react';\nimport { createStore } from 'zustand/vanilla';\n\nconst identity = (arg) => arg;\nfunction useStore(api, selector = identity) {\n const slice = React.useSyncExternalStore(\n api.subscribe,\n React.useCallback(() => selector(api.getState()), [api, selector]),\n React.useCallback(() => selector(api.getInitialState()), [api, selector])\n );\n React.useDebugValue(slice);\n return slice;\n}\nconst createImpl = (createState) => {\n const api = createStore(createState);\n const useBoundStore = (selector) => useStore(api, selector);\n Object.assign(useBoundStore, api);\n return useBoundStore;\n};\nconst create = ((createState) => createState ? createImpl(createState) : createImpl);\n\nexport { create, useStore };\n","import { tapState } from \"./tap-state\";\n\nexport function tapConst<T>(getValue: () => T, _deps: readonly never[]): T {\n const [state] = tapState(getValue);\n return state;\n}\n","type Task = () => void;\n\ntype GlobalFlushState = {\n schedulers: Set<UpdateScheduler>;\n isScheduled: boolean;\n};\n\nconst MAX_FLUSH_LIMIT = 50;\nlet flushState: GlobalFlushState = {\n schedulers: new Set([]),\n isScheduled: false,\n};\n\nexport class UpdateScheduler {\n private _isDirty = false;\n\n constructor(private readonly _task: Task) {}\n\n get isDirty() {\n return this._isDirty;\n }\n\n markDirty() {\n this._isDirty = true;\n\n flushState.schedulers.add(this);\n scheduleFlush();\n }\n\n runTask() {\n this._isDirty = false;\n this._task();\n }\n}\n\nconst scheduleFlush = () => {\n if (flushState.isScheduled) return;\n flushState.isScheduled = true;\n scheduleMacrotask();\n};\n\nconst flushScheduled = () => {\n try {\n const errors = [];\n let flushDepth = 0;\n\n for (const scheduler of flushState.schedulers) {\n flushState.schedulers.delete(scheduler);\n if (!scheduler.isDirty) continue;\n\n flushDepth++;\n\n if (flushDepth > MAX_FLUSH_LIMIT) {\n throw new Error(\n `Maximum update depth exceeded. This can happen when a resource ` +\n `repeatedly calls setState inside tapEffect.`,\n );\n }\n\n try {\n scheduler.runTask();\n } catch (error) {\n errors.push(error);\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(errors, \"Errors occurred during flushSync\");\n }\n }\n } finally {\n flushState.schedulers.clear();\n flushState.isScheduled = false;\n }\n};\n\n// Use MessageChannel to schedule flushes as macrotasks (like React's scheduler).\n// This allows more state updates to batch into a single re-render.\nconst scheduleMacrotask = (() => {\n if (typeof MessageChannel !== \"undefined\") {\n const channel = new MessageChannel();\n channel.port1.onmessage = flushScheduled;\n return () => channel.port2.postMessage(null);\n }\n // Fallback for environments without MessageChannel\n return () => setTimeout(flushScheduled, 0);\n})();\n\nexport const flushResourcesSync = <T>(callback: () => T): T => {\n const prev = flushState;\n flushState = {\n schedulers: new Set([]),\n isScheduled: true,\n };\n\n try {\n const result = callback();\n flushScheduled();\n\n return result;\n } finally {\n flushState = prev;\n }\n};\n","import {\n createResourceContext,\n tap,\n withContextProvider,\n tapMemo,\n} from \"@assistant-ui/tap\";\nimport type { ClientMethods } from \"../types/client\";\n\n/**\n * Symbol used to get the client index from a ClientProxy.\n */\nexport const SYMBOL_CLIENT_INDEX = Symbol(\"assistant-ui.store.clientIndex\");\n\n/**\n * Get the index of a client (its position in the client stack when created).\n */\nexport const getClientIndex = (client: ClientMethods): number => {\n return (client as unknown as { [SYMBOL_CLIENT_INDEX]: number })[\n SYMBOL_CLIENT_INDEX\n ];\n};\n\n/**\n * The client stack - an array of clients representing the current hierarchy.\n */\nexport type ClientStack = readonly ClientMethods[];\n\nconst ClientStackContext = createResourceContext<ClientStack>([]);\n\n/**\n * Get the current client stack inside a tap resource.\n */\nexport const tapClientStack = (): ClientStack => {\n return tap(ClientStackContext);\n};\n\n/**\n * Execute a callback with a client pushed onto the stack.\n * The stack is duplicated, not mutated.\n */\nexport const tapWithClientStack = <T>(\n client: ClientMethods,\n callback: () => T,\n): T => {\n const currentStack = tapClientStack();\n const newStack = tapMemo(\n () => [...currentStack, client],\n [currentStack, client],\n );\n return withContextProvider(ClientStackContext, newStack, callback);\n};\n","import { getCurrentResourceFiber } from \"../../core/helpers/execution-context\";\nimport { Cell } from \"../../core/types\";\n\nexport const tapHook = <T extends Cell[\"type\"]>(\n type: T,\n init: () => Cell,\n): Cell & { type: T } => {\n const fiber = getCurrentResourceFiber();\n const index = fiber.currentIndex++;\n\n if (!fiber.isFirstRender && index >= fiber.cells.length) {\n // Check if we're trying to use more hooks than in previous renders\n throw new Error(\n \"Rendered more hooks than during the previous render. \" +\n \"Hooks must be called in the exact same order in every render.\",\n );\n }\n\n let cell = fiber.cells[index];\n if (!cell) {\n cell = init();\n fiber.cells[index] = cell;\n }\n\n if (cell.type !== type) {\n throw new Error(\"Hook order changed between renders\");\n }\n\n return cell as Cell & { type: T };\n};\n\nexport const registerRenderMountTask = (task: () => void) => {\n const fiber = getCurrentResourceFiber();\n fiber.renderContext!.effectTasks.push(task);\n};\n","\"use client\";\n\nimport { FC, memo, PropsWithChildren, useEffect } from \"react\";\nimport { AssistantClient, useAui } from \"@assistant-ui/store\";\nimport { AssistantRuntime } from \"./runtime/AssistantRuntime\";\nimport { AssistantProviderBase } from \"@assistant-ui/core/react\";\nimport { ThreadPrimitiveViewportProvider } from \"../context/providers/ThreadViewportProvider\";\nimport { DevToolsProviderApi } from \"../devtools/DevToolsHooks\";\n\nexport namespace AssistantRuntimeProvider {\n export type Props = PropsWithChildren<{\n /**\n * The runtime to provide to the rest of your app.\n */\n runtime: AssistantRuntime;\n\n /**\n * The aui instance to extend. If not provided, a new aui instance will be created.\n */\n aui?: AssistantClient;\n }>;\n}\n\nconst DevToolsRegistration: FC = () => {\n const aui = useAui();\n useEffect(() => {\n if (typeof process === \"undefined\" || process.env.NODE_ENV === \"production\")\n return;\n return DevToolsProviderApi.register(aui);\n }, [aui]);\n return null;\n};\n\nexport const AssistantRuntimeProviderImpl: FC<\n AssistantRuntimeProvider.Props\n> = ({ children, aui, runtime }) => {\n return (\n <AssistantProviderBase runtime={runtime} aui={aui ?? null}>\n <DevToolsRegistration />\n {/* TODO temporarily allow accessing viewport state from outside the viewport */}\n {/* TODO figure out if this behavior should be deprecated, since it is quite hacky */}\n <ThreadPrimitiveViewportProvider>\n {children}\n </ThreadPrimitiveViewportProvider>\n </AssistantProviderBase>\n );\n};\n\nexport const AssistantRuntimeProvider = memo(AssistantRuntimeProviderImpl);\n","\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport {\n makeThreadViewportStore,\n type ThreadViewportStoreOptions,\n} from \"../stores/ThreadViewport\";\nimport {\n ThreadViewportContext,\n ThreadViewportContextValue,\n useThreadViewportStore,\n} from \"../react/ThreadViewportContext\";\nimport { writableStore } from \"../ReadonlyStore\";\n\nexport type ThreadViewportProviderProps = PropsWithChildren<{\n options?: ThreadViewportStoreOptions;\n}>;\n\nconst useThreadViewportStoreValue = (options: ThreadViewportStoreOptions) => {\n const outerViewport = useThreadViewportStore({ optional: true });\n const [store] = useState(() => makeThreadViewportStore(options));\n\n // Forward scrollToBottom from outer viewport to inner viewport\n useEffect(() => {\n return outerViewport?.getState().onScrollToBottom(() => {\n store.getState().scrollToBottom();\n });\n }, [outerViewport, store]);\n\n useEffect(() => {\n if (!outerViewport) return;\n return store.subscribe((state) => {\n if (outerViewport.getState().isAtBottom !== state.isAtBottom) {\n writableStore(outerViewport).setState({ isAtBottom: state.isAtBottom });\n }\n });\n }, [store, outerViewport]);\n\n // Sync options to store when they change\n useEffect(() => {\n const nextState = {\n turnAnchor: options.turnAnchor ?? \"bottom\",\n };\n\n const currentState = store.getState();\n if (currentState.turnAnchor !== nextState.turnAnchor) {\n writableStore(store).setState(nextState);\n }\n }, [store, options.turnAnchor]);\n\n return store;\n};\n\nexport const ThreadPrimitiveViewportProvider: FC<\n ThreadViewportProviderProps\n> = ({ children, options = {} }) => {\n const useThreadViewport = useThreadViewportStoreValue(options);\n\n const [context] = useState<ThreadViewportContextValue>(() => {\n return {\n useThreadViewport,\n };\n });\n\n return (\n <ThreadViewportContext.Provider value={context}>\n {children}\n </ThreadViewportContext.Provider>\n );\n};\n","import type { Unsubscribe } from \"../types/unsubscribe\";\nimport { Tool } from \"assistant-stream\";\n\n// =============================================================================\n// Language Model Settings\n// =============================================================================\n\nexport type LanguageModelV1CallSettings = {\n maxTokens?: number;\n temperature?: number;\n topP?: number;\n presencePenalty?: number;\n frequencyPenalty?: number;\n seed?: number;\n headers?: Record<string, string | undefined>;\n};\n\nexport type LanguageModelConfig = {\n apiKey?: string;\n baseUrl?: string;\n modelName?: string;\n};\n\n// =============================================================================\n// Model Context\n// =============================================================================\n\nexport type ModelContext = {\n priority?: number | undefined;\n system?: string | undefined;\n tools?: Record<string, Tool<any, any>> | undefined;\n callSettings?: LanguageModelV1CallSettings | undefined;\n config?: LanguageModelConfig | undefined;\n};\n\nexport type ModelContextProvider = {\n getModelContext: () => ModelContext;\n subscribe?: (callback: () => void) => Unsubscribe;\n};\n\n// =============================================================================\n// Tool & Instruction Config\n// =============================================================================\n\nexport type AssistantToolProps<\n TArgs extends Record<string, unknown>,\n TResult,\n> = Tool<TArgs, TResult> & {\n toolName: string;\n render?: unknown;\n};\n\nexport type AssistantInstructionsConfig = {\n disabled?: boolean | undefined;\n instruction: string;\n};\n\nexport type AssistantContextConfig = {\n getContext: () => string;\n disabled?: boolean | undefined;\n};\n\n// =============================================================================\n// Merging\n// =============================================================================\n\nexport const mergeModelContexts = (\n configSet: Set<ModelContextProvider>,\n): ModelContext => {\n const configs = Array.from(configSet)\n .map((c) => c.getModelContext())\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n\n return configs.reduce((acc, config) => {\n if (config.system) {\n if (acc.system) {\n acc.system += `\\n\\n${config.system}`;\n } else {\n acc.system = config.system;\n }\n }\n if (config.tools) {\n for (const [name, tool] of Object.entries(config.tools)) {\n const existing = acc.tools?.[name];\n if (existing && existing !== tool) {\n throw new Error(\n `You tried to define a tool with the name ${name}, but it already exists.`,\n );\n }\n\n if (!acc.tools) acc.tools = {};\n acc.tools[name] = tool;\n }\n }\n if (config.config) {\n acc.config = {\n ...acc.config,\n ...config.config,\n };\n }\n if (config.callSettings) {\n acc.callSettings = {\n ...acc.callSettings,\n ...config.callSettings,\n };\n }\n return acc;\n }, {} as ModelContext);\n};\n","import { UseBoundStore } from \"zustand\";\nimport { ReadonlyStore } from \"../../ReadonlyStore\";\n\n/**\n * Creates hooks for accessing a store within a context.\n * @param contextHook - The hook to access the context.\n * @param contextKey - The key of the store in the context.\n * @returns An object containing the hooks: `use...` and `use...Store`.\n */\nexport function createContextStoreHook<T, K extends keyof T & string>(\n contextHook: (options?: { optional?: boolean }) => T | null,\n contextKey: K,\n) {\n type StoreType = T[K];\n type StateType = StoreType extends ReadonlyStore<infer S> ? S : never;\n\n // Define useStoreStoreHook with overloads\n function useStoreStoreHook(): ReadonlyStore<StateType>;\n function useStoreStoreHook(options: {\n optional: true;\n }): ReadonlyStore<StateType> | null;\n function useStoreStoreHook(options?: {\n optional?: boolean;\n }): ReadonlyStore<StateType> | null {\n const context = contextHook(options);\n if (!context) return null;\n return context[contextKey] as ReadonlyStore<StateType>;\n }\n\n // Define useStoreHook with overloads\n function useStoreHook(): StateType;\n function useStoreHook<TSelected>(\n selector: (state: StateType) => TSelected,\n ): TSelected;\n function useStoreHook(options: { optional: true }): StateType | null;\n function useStoreHook<TSelected>(options: {\n optional: true;\n selector?: (state: StateType) => TSelected;\n }): TSelected | null;\n function useStoreHook<TSelected>(\n param?:\n | ((state: StateType) => TSelected)\n | {\n optional?: boolean;\n selector?: (state: StateType) => TSelected;\n },\n ): TSelected | StateType | null {\n let optional = false;\n let selector: ((state: StateType) => TSelected) | undefined;\n\n if (typeof param === \"function\") {\n selector = param;\n } else if (param && typeof param === \"object\") {\n optional = !!param.optional;\n selector = param.selector;\n }\n\n const store = useStoreStoreHook({\n optional,\n } as any) as UseBoundStore<ReadonlyStore<StateType>>;\n if (!store) return null;\n return selector ? store(selector) : store();\n }\n\n // Return an object with keys based on contextKey\n return {\n [contextKey]: useStoreHook,\n [`${contextKey}Store`]: useStoreStoreHook,\n } as {\n [P in K]: typeof useStoreHook;\n } & {\n [P in `${K}Store`]: typeof useStoreStoreHook;\n };\n}\n","const INTROSPECTION_PROPS = new Set([\"$$typeof\", \"nodeType\", \"then\"]);\n\n/**\n * Handles common proxy introspection properties.\n * Returns the appropriate value for toStringTag, toJSON, and props that should return undefined.\n * Returns `false` if the prop should be handled by the subclass.\n */\nexport const handleIntrospectionProp = (\n prop: string | symbol,\n name: string,\n): unknown | false => {\n if (prop === Symbol.toStringTag) return name;\n if (typeof prop === \"symbol\") return undefined;\n if (prop === \"toJSON\") return () => name;\n if (INTROSPECTION_PROPS.has(prop)) return undefined;\n return false;\n};\n\nexport abstract class BaseProxyHandler implements ProxyHandler<object> {\n abstract get(_: unknown, prop: string | symbol, receiver?: unknown): unknown;\n abstract ownKeys(): ArrayLike<string | symbol>;\n abstract has(_: unknown, prop: string | symbol): boolean;\n\n getOwnPropertyDescriptor(_: unknown, prop: string | symbol) {\n const value = this.get(_, prop);\n if (value === undefined) return undefined;\n return {\n value,\n writable: false,\n enumerable: true,\n configurable: false,\n };\n }\n\n set() {\n return false;\n }\n setPrototypeOf() {\n return false;\n }\n defineProperty() {\n return false;\n }\n deleteProperty() {\n return false;\n }\n preventExtensions(): boolean {\n return false;\n }\n}\n","import {\n type ResourceElement,\n Resource,\n resource,\n withKey,\n} from \"@assistant-ui/tap\";\n\nexport const wrapperResource = <R, P>(\n fn: (props: ResourceElement<P>) => R,\n): Resource<R, ResourceElement<P>> => {\n const res = resource(fn);\n return (props: ResourceElement<P>) => {\n const el = res(props);\n if (props.key === undefined) return el;\n return withKey(props.key, el);\n };\n};\n","import { Cell, ResourceFiber, ResourceFiberRoot } from \"../types\";\n\nexport const createResourceFiberRoot = (\n dispatchUpdate: (cb: () => boolean) => void,\n): ResourceFiberRoot => {\n return {\n version: 0,\n committedVersion: 0,\n dispatchUpdate,\n changelog: [],\n dirtyCells: [],\n };\n};\n\nexport const commitRoot = (root: ResourceFiberRoot): void => {\n for (const cell of root.dirtyCells) {\n cell.dirty = false;\n cell.queue.clear();\n cell.current = cell.workInProgress;\n }\n root.committedVersion = root.version;\n root.changelog.length = 0;\n root.dirtyCells.length = 0;\n};\n\nexport const setRootVersion = (\n root: ResourceFiberRoot,\n version: number,\n): void => {\n const rollback = root.version > version;\n root.version = version;\n if (rollback) {\n for (const cell of root.dirtyCells) {\n cell.dirty = false;\n cell.queue.clear();\n cell.workInProgress = cell.current;\n }\n root.dirtyCells.length = 0;\n\n if (version === root.committedVersion) {\n root.changelog.length = 0;\n } else {\n // commit happened without a useEffect update (offscreen API)\n\n if (root.committedVersion > version)\n throw new Error(\"Version is less than committed version\");\n\n while (root.committedVersion + root.changelog.length > version) {\n root.changelog.pop();\n }\n\n root.changelog.forEach((apply) => apply());\n commitRoot(root);\n }\n }\n};\n\nexport const markCellDirty = (\n fiber: ResourceFiber<any, any>,\n cell: Cell & { type: \"reducer\" },\n): void => {\n if (!cell.dirty) {\n cell.dirty = true;\n fiber.markDirty?.();\n fiber.root.dirtyCells.push(cell);\n }\n};\n","import { resource, ResourceElement } from \"@assistant-ui/tap\";\nimport type {\n AssistantClient,\n ClientNames,\n AssistantClientAccessor,\n ClientMeta,\n} from \"./types/client\";\n\n/**\n * Creates a derived client field that references a client from a parent scope.\n * The get callback always calls the most recent version (useEffectEvent pattern).\n *\n * IMPORTANT: The `get` callback must return a client that was created via\n * `tapClientResource` (or `tapClientLookup`/`tapClientList` which use it internally).\n * This is required for event scoping to work correctly.\n *\n * @example\n * ```typescript\n * const aui = useAui({\n * message: Derived({\n * source: \"thread\",\n * query: { index: 0 },\n * get: (aui) => aui.thread().message({ index: 0 }),\n * }),\n * });\n * ```\n */\nexport const Derived = resource(\n <K extends ClientNames>(_config: Derived.Props<K>): null => {\n return null;\n },\n);\n\nexport type DerivedElement<K extends ClientNames> = ResourceElement<\n null,\n Derived.Props<K>\n>;\n\nexport namespace Derived {\n /**\n * Props passed to a derived client resource element.\n */\n export type Props<K extends ClientNames> = {\n get: (client: AssistantClient) => ReturnType<AssistantClientAccessor<K>>;\n } & (ClientMeta<K> | { getMeta: (client: AssistantClient) => ClientMeta<K> });\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 20v2', key: '1lh1kg' }],\n ['path', { d: 'M12 2v2', key: 'tus03m' }],\n ['path', { d: 'M17 20v2', key: '1rnc9c' }],\n ['path', { d: 'M17 2v2', key: '11trls' }],\n ['path', { d: 'M2 12h2', key: '1t8f8n' }],\n ['path', { d: 'M2 17h2', key: '7oei6x' }],\n ['path', { d: 'M2 7h2', key: 'asdhe0' }],\n ['path', { d: 'M20 12h2', key: '1q8mjw' }],\n ['path', { d: 'M20 17h2', key: '1fpfkl' }],\n ['path', { d: 'M20 7h2', key: '1o8tra' }],\n ['path', { d: 'M7 20v2', key: '4gnj0m' }],\n ['path', { d: 'M7 2v2', key: '1i4yhu' }],\n ['rect', { x: '4', y: '4', width: '16', height: '16', rx: '2', key: '1vbyd7' }],\n ['rect', { x: '8', y: '8', width: '8', height: '8', rx: '1', key: 'z9xiuo' }],\n];\n\n/**\n * @component @name Cpu\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjB2MiIgLz4KICA8cGF0aCBkPSJNMTIgMnYyIiAvPgogIDxwYXRoIGQ9Ik0xNyAyMHYyIiAvPgogIDxwYXRoIGQ9Ik0xNyAydjIiIC8+CiAgPHBhdGggZD0iTTIgMTJoMiIgLz4KICA8cGF0aCBkPSJNMiAxN2gyIiAvPgogIDxwYXRoIGQ9Ik0yIDdoMiIgLz4KICA8cGF0aCBkPSJNMjAgMTJoMiIgLz4KICA8cGF0aCBkPSJNMjAgMTdoMiIgLz4KICA8cGF0aCBkPSJNMjAgN2gyIiAvPgogIDxwYXRoIGQ9Ik03IDIwdjIiIC8+CiAgPHBhdGggZD0iTTcgMnYyIiAvPgogIDxyZWN0IHg9IjQiIHk9IjQiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgcng9IjIiIC8+CiAgPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjgiIGhlaWdodD0iOCIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/cpu\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Cpu = createLucideIcon('cpu', __iconNode);\n\nexport default Cpu;\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","const isIterable = (obj) => Symbol.iterator in obj;\nconst hasIterableEntries = (value) => (\n // HACK: avoid checking entries type\n \"entries\" in value\n);\nconst compareEntries = (valueA, valueB) => {\n const mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());\n const mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());\n if (mapA.size !== mapB.size) {\n return false;\n }\n for (const [key, value] of mapA) {\n if (!mapB.has(key) || !Object.is(value, mapB.get(key))) {\n return false;\n }\n }\n return true;\n};\nconst compareIterables = (valueA, valueB) => {\n const iteratorA = valueA[Symbol.iterator]();\n const iteratorB = valueB[Symbol.iterator]();\n let nextA = iteratorA.next();\n let nextB = iteratorB.next();\n while (!nextA.done && !nextB.done) {\n if (!Object.is(nextA.value, nextB.value)) {\n return false;\n }\n nextA = iteratorA.next();\n nextB = iteratorB.next();\n }\n return !!nextA.done && !!nextB.done;\n};\nfunction shallow(valueA, valueB) {\n if (Object.is(valueA, valueB)) {\n return true;\n }\n if (typeof valueA !== \"object\" || valueA === null || typeof valueB !== \"object\" || valueB === null) {\n return false;\n }\n if (Object.getPrototypeOf(valueA) !== Object.getPrototypeOf(valueB)) {\n return false;\n }\n if (isIterable(valueA) && isIterable(valueB)) {\n if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {\n return compareEntries(valueA, valueB);\n }\n return compareIterables(valueA, valueB);\n }\n return compareEntries(\n { entries: () => Object.entries(valueA) },\n { entries: () => Object.entries(valueB) }\n );\n}\n\nexport { shallow };\n","type Bindable = {\n __internal_bindMethods?: () => void;\n __isBound?: boolean;\n};\nconst debugVerifyPrototype = (\n runtime: Record<string, unknown>,\n prototype: any,\n) => {\n const unboundMethods = Object.getOwnPropertyNames(prototype).filter(\n (methodStr) => {\n const descriptor = Object.getOwnPropertyDescriptor(prototype, methodStr);\n const isMethod = descriptor && typeof descriptor.value === \"function\";\n if (!isMethod) return false;\n\n const methodName = methodStr as keyof typeof runtime | \"constructor\";\n return (\n isMethod &&\n !methodName.startsWith(\"_\") &&\n methodName !== \"constructor\" &&\n prototype[methodName] === runtime[methodName]\n );\n },\n );\n\n if (unboundMethods.length > 0) {\n throw new Error(\n `The following methods are not bound: ${JSON.stringify(unboundMethods)}`,\n );\n }\n\n const prototypePrototype = Object.getPrototypeOf(prototype);\n if (prototypePrototype && prototypePrototype !== Object.prototype) {\n debugVerifyPrototype(runtime, prototypePrototype);\n }\n};\nexport const ensureBinding = (r: unknown) => {\n const runtime = r as Bindable;\n if (runtime.__isBound) return;\n\n runtime.__internal_bindMethods?.();\n runtime.__isBound = true;\n\n if (process.env.NODE_ENV !== \"production\") {\n debugVerifyPrototype(runtime, Object.getPrototypeOf(runtime));\n }\n};\n","import {\n SubscribableRuntime,\n useRuntimeStateInternal,\n} from \"./useRuntimeState\";\n\nexport function createStateHookForRuntime<TState>(\n useRuntime: (options: {\n optional: boolean | undefined;\n }) => SubscribableRuntime<TState> | null,\n) {\n // empty\n function useStoreHook(): TState;\n\n // selector\n function useStoreHook<TSelected>(\n selector: (state: TState) => TSelected,\n ): TSelected;\n\n // selector?\n function useStoreHook<TSelected>(\n selector: ((state: TState) => TSelected) | undefined,\n ): TSelected | TState;\n\n // optional=false\n function useStoreHook(options: { optional?: false | undefined }): TState;\n\n // optional?\n function useStoreHook(options: {\n optional?: boolean | undefined;\n }): TState | null;\n\n // optional=false, selector\n function useStoreHook<TSelected>(options: {\n optional?: false | undefined;\n selector: (state: TState) => TSelected;\n }): TSelected;\n\n // optional=false, selector?\n function useStoreHook<TSelected>(options: {\n optional?: false | undefined;\n selector: ((state: TState) => TSelected) | undefined;\n }): TSelected | TState;\n\n // optional?, selector\n function useStoreHook<TSelected>(options: {\n optional?: boolean | undefined;\n selector: (state: TState) => TSelected;\n }): TSelected | null;\n\n // optional?, selector?\n function useStoreHook<TSelected>(options: {\n optional?: boolean | undefined;\n selector: ((state: TState) => TSelected) | undefined;\n }): TSelected | TState | null;\n\n function useStoreHook<TSelected>(\n param?:\n | ((state: TState) => TSelected)\n | {\n optional?: boolean | undefined;\n selector?: ((state: TState) => TSelected) | undefined;\n },\n ): TSelected | TState | null {\n let optional = false;\n let selector: ((state: TState) => TSelected) | undefined;\n\n if (typeof param === \"function\") {\n selector = param;\n } else if (param) {\n optional = !!param.optional;\n selector = param.selector;\n }\n\n const store = useRuntime({ optional });\n if (!store) return null;\n\n // it is ok to call useRuntimeStateInternal conditionally because it will never become null if its available\n return useRuntimeStateInternal(store, selector);\n }\n\n return useStoreHook;\n}\n","import type { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\ntype ComposerIfFilters = {\n /** Whether the composer is in editing mode */\n editing: boolean | undefined;\n /** Whether dictation is currently active */\n dictation: boolean | undefined;\n};\n\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport type UseComposerIfProps = RequireAtLeastOne<ComposerIfFilters>;\n\nconst useComposerIf = (props: UseComposerIfProps) => {\n return useAuiState((s) => {\n if (props.editing === true && !s.composer.isEditing) return false;\n if (props.editing === false && s.composer.isEditing) return false;\n\n const isDictating = s.composer.dictation != null;\n if (props.dictation === true && !isDictating) return false;\n if (props.dictation === false && isDictating) return false;\n\n return true;\n });\n};\n\nexport namespace ComposerPrimitiveIf {\n export type Props = PropsWithChildren<UseComposerIfProps>;\n}\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.composer...} />` instead.\n */\nexport const ComposerPrimitiveIf: FC<ComposerPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useComposerIf(query);\n return result ? children : null;\n};\n\nComposerPrimitiveIf.displayName = \"ComposerPrimitive.If\";\n","import React from 'react'\n\nconst context = React.createContext(true)\n\nfunction forbiddenInRender() {\n throw new Error(\"A function wrapped in useEffectEvent can't be called during rendering.\")\n}\n\n// We can only check if we're in a render phase, beyond initial render, in React 19, with its `React.use` hook.\nconst isInvalidExecutionContextForEventFunction =\n 'use' in React\n ? () => {\n // There's no way to check if we're in a render phase from outside of React, the API used by useEffectEvent is private: https://github.com/facebook/react/blob/a00ca6f6b51e46a0ccec54a2231bfe7a1ed9ae1d/packages/react-reconciler/src/ReactFiberWorkLoop.js#L1785-L1788\n // So to emulate the same behavior, we call the use hook and if it doesn't throw, we're in a render phase.\n try {\n return React.use(context)\n } catch {\n return false\n }\n }\n : () => false\n\n/**\n * This is a ponyfill of the upcoming `useEffectEvent` hook that'll arrive in React 19.\n * https://19.react.dev/learn/separating-events-from-effects#declaring-an-effect-event\n * To learn more about the ponyfill itself, see: https://blog.bitsrc.io/a-look-inside-the-useevent-polyfill-from-the-new-react-docs-d1c4739e8072\n * @public\n */\nexport function useEffectEvent<const T extends (...args: any[]) => void>(fn: T): T {\n /**\n * For both React 18 and 19 we set the ref to the forbiddenInRender function, to catch illegal calls to the function during render.\n * Once the insertion effect runs, we set the ref to the actual function.\n */\n const ref = React.useRef(forbiddenInRender as T)\n\n React.useInsertionEffect(() => {\n ref.current = fn\n }, [fn])\n\n return ((...args: any) => {\n // Performs a similar check to what React does for `useEffectEvent`:\n // 1. https://github.com/facebook/react/blob/b7e2de632b2a160bc09edda1fbb9b8f85a6914e8/packages/react-reconciler/src/ReactFiberHooks.js#L2729-L2733\n // 2. https://github.com/facebook/react/blob/b7e2de632b2a160bc09edda1fbb9b8f85a6914e8/packages/react-reconciler/src/ReactFiberHooks.js#L2746C9-L2750\n if (isInvalidExecutionContextForEventFunction()) {\n forbiddenInRender()\n }\n\n const latestFn = ref.current!\n return latestFn(...args)\n }) as T\n}\n","import type { QuoteInfo } from \"../../types/quote\";\n\ntype MessageQuoteState = {\n message: {\n metadata?: unknown;\n };\n};\n\nexport const getMessageQuote = (\n state: MessageQuoteState,\n): QuoteInfo | undefined => {\n const metadata = state.message.metadata;\n if (!metadata || typeof metadata !== \"object\") return undefined;\n\n return (metadata as { custom?: Record<string, unknown> }).custom?.quote as\n | QuoteInfo\n | undefined;\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { useAui, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const PartByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui({\n part: Derived({\n source: \"message\",\n query: { type: \"index\", index },\n get: (aui) => aui.message().part({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","\"use client\";\n\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type {\n MessagePartStatus,\n ReasoningMessagePart,\n TextMessagePart,\n MessagePartState,\n} from \"@assistant-ui/core\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useSmoothStatusStore } from \"./SmoothContext\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\n\nclass TextStreamAnimator {\n private animationFrameId: number | null = null;\n private lastUpdateTime: number = Date.now();\n\n public targetText: string = \"\";\n\n constructor(\n public currentText: string,\n private setText: (newText: string) => void,\n ) {}\n\n start() {\n if (this.animationFrameId !== null) return;\n this.lastUpdateTime = Date.now();\n this.animate();\n }\n\n stop() {\n if (this.animationFrameId !== null) {\n cancelAnimationFrame(this.animationFrameId);\n this.animationFrameId = null;\n }\n }\n\n private animate = () => {\n const currentTime = Date.now();\n const deltaTime = currentTime - this.lastUpdateTime;\n let timeToConsume = deltaTime;\n\n const remainingChars = this.targetText.length - this.currentText.length;\n const baseTimePerChar = Math.min(5, 250 / remainingChars);\n\n let charsToAdd = 0;\n while (timeToConsume >= baseTimePerChar && charsToAdd < remainingChars) {\n charsToAdd++;\n timeToConsume -= baseTimePerChar;\n }\n\n if (charsToAdd !== remainingChars) {\n this.animationFrameId = requestAnimationFrame(this.animate);\n } else {\n this.animationFrameId = null;\n }\n if (charsToAdd === 0) return;\n\n this.currentText = this.targetText.slice(\n 0,\n this.currentText.length + charsToAdd,\n );\n this.lastUpdateTime = currentTime - timeToConsume;\n this.setText(this.currentText);\n };\n}\n\nconst SMOOTH_STATUS: MessagePartStatus = Object.freeze({\n type: \"running\",\n});\n\nexport const useSmooth = (\n state: MessagePartState & (TextMessagePart | ReasoningMessagePart),\n smooth: boolean = false,\n): MessagePartState & (TextMessagePart | ReasoningMessagePart) => {\n const { text } = state;\n const id = useAuiState((s) => s.message.id);\n\n const idRef = useRef(id);\n const [displayedText, setDisplayedText] = useState(\n state.status.type === \"running\" ? \"\" : text,\n );\n\n const smoothStatusStore = useSmoothStatusStore({ optional: true });\n const setText = useCallbackRef((text: string) => {\n setDisplayedText(text);\n if (smoothStatusStore) {\n const target =\n displayedText !== text || state.status.type === \"running\"\n ? SMOOTH_STATUS\n : state.status;\n writableStore(smoothStatusStore).setState(target, true);\n }\n });\n\n // TODO this is hacky\n useEffect(() => {\n if (smoothStatusStore) {\n const target =\n smooth && (displayedText !== text || state.status.type === \"running\")\n ? SMOOTH_STATUS\n : state.status;\n writableStore(smoothStatusStore).setState(target, true);\n }\n }, [smoothStatusStore, smooth, text, displayedText, state.status]);\n\n const [animatorRef] = useState<TextStreamAnimator>(\n new TextStreamAnimator(displayedText, setText),\n );\n\n useEffect(() => {\n if (!smooth) {\n animatorRef.stop();\n return;\n }\n\n if (idRef.current !== id || !text.startsWith(animatorRef.targetText)) {\n idRef.current = id;\n\n if (state.status.type === \"running\") {\n // New streaming message → animate from empty string\n setText(\"\");\n animatorRef.currentText = \"\";\n animatorRef.targetText = text;\n animatorRef.start();\n } else {\n // Completed message → display immediately\n setText(text);\n animatorRef.currentText = text;\n animatorRef.targetText = text;\n animatorRef.stop();\n }\n\n return;\n }\n\n animatorRef.targetText = text;\n animatorRef.start();\n }, [setText, animatorRef, id, smooth, text, state.status.type]);\n\n useEffect(() => {\n return () => {\n animatorRef.stop();\n };\n }, [animatorRef]);\n\n return useMemo(\n () =>\n smooth\n ? {\n type: \"text\",\n text: displayedText,\n status: text === displayedText ? state.status : SMOOTH_STATUS,\n }\n : state,\n [smooth, displayedText, state, text],\n );\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { useAui, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const MessageAttachmentByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui({\n attachment: Derived({\n source: \"message\",\n query: { type: \"index\", index },\n get: (aui) => aui.message().attachment({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n\nexport const ComposerAttachmentByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui({\n attachment: Derived({\n source: \"composer\",\n query: { type: \"index\", index },\n get: (aui) => aui.composer().attachment({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { AuiProvider, Derived, useAui } from \"@assistant-ui/store\";\n\nexport type QueueItemByIndexProviderProps = PropsWithChildren<{\n index: number;\n}>;\n\nexport const QueueItemByIndexProvider: FC<QueueItemByIndexProviderProps> = ({\n index,\n children,\n}) => {\n const aui = useAui({\n queueItem: Derived({\n source: \"composer\",\n query: { index },\n get: (aui) => aui.composer().queueItem({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { useAui, AuiProvider, Derived } from \"@assistant-ui/store\";\n\nexport const MessageByIndexProvider: FC<\n PropsWithChildren<{\n index: number;\n }>\n> = ({ index, children }) => {\n const aui = useAui({\n message: Derived({\n source: \"thread\",\n query: { type: \"index\", index },\n get: (aui) => aui.thread().message({ index }),\n }),\n composer: Derived({\n source: \"message\",\n query: {},\n get: (aui) => aui.thread().message({ index }).composer(),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { AuiProvider, Derived, useAui } from \"@assistant-ui/store\";\n\nexport type SuggestionByIndexProviderProps = PropsWithChildren<{\n index: number;\n}>;\n\nexport const SuggestionByIndexProvider: FC<SuggestionByIndexProviderProps> = ({\n index,\n children,\n}) => {\n const aui = useAui({\n suggestion: Derived({\n source: \"suggestions\",\n query: { index },\n get: (aui) => aui.suggestions().suggestion({ index }),\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type { ComposerSendOptions } from \"../../store/scopes/composer\";\n\nexport const useComposerSend = () => {\n const aui = useAui();\n const disabled = useAuiState(\n (s) =>\n (s.thread.isRunning && !s.thread.capabilities.queue) ||\n !s.composer.isEditing ||\n s.composer.isEmpty,\n );\n\n const send = useCallback(\n (opts?: ComposerSendOptions) => {\n aui.composer().send(opts);\n },\n [aui],\n );\n\n return { send, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useComposerCancel = () => {\n const aui = useAui();\n const disabled = useAuiState((s) => !s.composer.canCancel);\n\n const cancel = useCallback(() => {\n aui.composer().cancel();\n }, [aui]);\n\n return { cancel, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useActionBarStopSpeaking = () => {\n const aui = useAui();\n const disabled = useAuiState((s) => s.message.speech == null);\n\n const stopSpeaking = useCallback(() => {\n aui.message().stopSpeaking();\n }, [aui]);\n\n return { stopSpeaking, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useActionBarFeedbackPositive = () => {\n const aui = useAui();\n const isSubmitted = useAuiState(\n (s) => s.message.metadata.submittedFeedback?.type === \"positive\",\n );\n\n const submit = useCallback(() => {\n aui.message().submitFeedback({ type: \"positive\" });\n }, [aui]);\n\n return { submit, isSubmitted };\n};\n\nexport const useActionBarFeedbackNegative = () => {\n const aui = useAui();\n const isSubmitted = useAuiState(\n (s) => s.message.metadata.submittedFeedback?.type === \"negative\",\n );\n\n const submit = useCallback(() => {\n aui.message().submitFeedback({ type: \"negative\" });\n }, [aui]);\n\n return { submit, isSubmitted };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useComposerDictate = () => {\n const aui = useAui();\n const disabled = useAuiState(\n (s) =>\n s.composer.dictation != null ||\n !s.thread.capabilities.dictation ||\n !s.composer.isEditing,\n );\n\n const startDictation = useCallback(() => {\n aui.composer().startDictation();\n }, [aui]);\n\n return { startDictation, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useActionBarEdit = () => {\n const aui = useAui();\n const disabled = useAuiState((s) => s.composer.isEditing);\n\n const edit = useCallback(() => {\n aui.composer().beginEdit();\n }, [aui]);\n\n return { edit, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type { CreateAttachment } from \"../../types/attachment\";\n\nexport const useComposerAddAttachment = () => {\n const aui = useAui();\n const disabled = useAuiState((s) => !s.composer.isEditing);\n\n const addAttachment = useCallback(\n (file: File | CreateAttachment) => {\n return aui.composer().addAttachment(file);\n },\n [aui],\n );\n\n return { addAttachment, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport type UseActionBarCopyOptions = {\n copiedDuration?: number | undefined;\n copyToClipboard?: ((text: string) => void | Promise<void>) | undefined;\n};\n\nexport const useActionBarCopy = ({\n copiedDuration = 3000,\n copyToClipboard,\n}: UseActionBarCopyOptions = {}) => {\n const aui = useAui();\n const disabled = useAuiState((s) => {\n return !(\n (s.message.role !== \"assistant\" ||\n s.message.status?.type !== \"running\") &&\n s.message.parts.some((c) => c.type === \"text\" && c.text.length > 0)\n );\n });\n const isCopied = useAuiState((s) => s.message.isCopied);\n const isEditing = useAuiState((s) => s.composer.isEditing);\n const composerValue = useAuiState((s) => s.composer.text);\n\n const copy = useCallback(() => {\n const valueToCopy = isEditing ? composerValue : aui.message().getCopyText();\n if (!valueToCopy) return;\n\n const write = copyToClipboard ?? (() => {});\n const result = write(valueToCopy);\n Promise.resolve(result).then(() => {\n aui.message().setIsCopied(true);\n setTimeout(() => aui.message().setIsCopied(false), copiedDuration);\n });\n }, [aui, isEditing, composerValue, copiedDuration, copyToClipboard]);\n\n return { copy, disabled, isCopied };\n};\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { useAui, AuiProvider, type ClientOutput } from \"@assistant-ui/store\";\nimport type { PartState } from \"../../store/scopes/part\";\nimport { resource, tapMemo } from \"@assistant-ui/tap\";\n\nconst TextMessagePartClient = resource(\n ({\n text,\n isRunning,\n }: {\n text: string;\n isRunning: boolean;\n }): ClientOutput<\"part\"> => {\n const state = tapMemo<PartState>(\n () => ({\n type: \"text\",\n text,\n status: isRunning ? { type: \"running\" } : { type: \"complete\" },\n }),\n [text, isRunning],\n );\n\n return {\n getState: () => state,\n addToolResult: () => {\n throw new Error(\"Not supported\");\n },\n resumeToolCall: () => {\n throw new Error(\"Not supported\");\n },\n };\n },\n);\n\nexport const TextMessagePartProvider: FC<\n PropsWithChildren<{\n text: string;\n isRunning?: boolean;\n }>\n> = ({ text, isRunning = false, children }) => {\n const aui = useAui({\n part: TextMessagePartClient({ text, isRunning }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useActionBarReload = () => {\n const aui = useAui();\n const disabled = useAuiState(\n (s) =>\n s.thread.isRunning ||\n s.thread.isDisabled ||\n s.message.role !== \"assistant\",\n );\n\n const reload = useCallback(() => {\n aui.message().reload();\n }, [aui]);\n\n return { reload, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport type UseSuggestionTriggerOptions = {\n prompt: string;\n send?: boolean | undefined;\n clearComposer?: boolean | undefined;\n};\n\nexport const useSuggestionTrigger = ({\n prompt,\n send,\n clearComposer = true,\n}: UseSuggestionTriggerOptions) => {\n const aui = useAui();\n const disabled = useAuiState((s) => s.thread.isDisabled);\n const resolvedSend = send ?? false;\n\n const trigger = useCallback(() => {\n const isRunning = aui.thread().getState().isRunning;\n\n if (resolvedSend && !isRunning) {\n aui.thread().append({\n content: [{ type: \"text\", text: prompt }],\n runConfig: aui.composer().getState().runConfig,\n });\n if (clearComposer) {\n aui.composer().setText(\"\");\n }\n } else {\n if (clearComposer) {\n aui.composer().setText(prompt);\n } else {\n const currentText = aui.composer().getState().text;\n aui\n .composer()\n .setText(currentText.trim() ? `${currentText} ${prompt}` : prompt);\n }\n }\n }, [aui, resolvedSend, clearComposer, prompt]);\n\n return { trigger, disabled };\n};\n","import { useCallback } from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\n\nexport const useActionBarSpeak = () => {\n const aui = useAui();\n\n const disabled = useAuiState((s) => {\n return !(\n (s.message.role !== \"assistant\" ||\n s.message.status?.type !== \"running\") &&\n s.message.parts.some((c) => c.type === \"text\" && c.text.length > 0)\n );\n });\n\n const speak = useCallback(async () => {\n aui.message().speak();\n }, [aui]);\n\n return { speak, disabled };\n};\n","\"use client\";\n\nimport { MessageRuntime } from \"../runtime/MessageRuntime\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { createStateHookForRuntime } from \"../../context/react/utils/createStateHookForRuntime\";\nimport type { EditComposerRuntime } from \"@assistant-ui/core\";\n\n/**\n * @deprecated Use `useAui()` with `aui.message()` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12\n *\n * Hook to access the MessageRuntime from the current context.\n *\n * The MessageRuntime provides access to message-level state and actions,\n * including message content, status, editing capabilities, and branching.\n *\n * @param options Configuration options\n * @param options.optional Whether the hook should return null if no context is found\n * @returns The MessageRuntime instance, or null if optional is true and no context exists\n *\n * @example\n * ```tsx\n * // Before:\n * function MessageActions() {\n * const runtime = useMessageRuntime();\n * const handleReload = () => {\n * runtime.reload();\n * };\n * const handleEdit = () => {\n * runtime.startEdit();\n * };\n * return (\n * <div>\n * <button onClick={handleReload}>Reload</button>\n * <button onClick={handleEdit}>Edit</button>\n * </div>\n * );\n * }\n *\n * // After:\n * function MessageActions() {\n * const aui = useAui();\n * const handleReload = () => {\n * aui.message().reload();\n * };\n * const handleEdit = () => {\n * aui.message().startEdit();\n * };\n * return (\n * <div>\n * <button onClick={handleReload}>Reload</button>\n * <button onClick={handleEdit}>Edit</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useMessageRuntime(options?: {\n optional?: false | undefined;\n}): MessageRuntime;\nexport function useMessageRuntime(options?: {\n optional?: boolean | undefined;\n}): MessageRuntime | null;\nexport function useMessageRuntime(options?: {\n optional?: boolean | undefined;\n}) {\n const aui = useAui();\n const runtime = useAuiState(() =>\n aui.message.source\n ? (aui.message().__internal_getRuntime?.() ?? null)\n : null,\n );\n if (!runtime && !options?.optional) {\n throw new Error(\"MessageRuntime is not available\");\n }\n return runtime;\n}\n\n/**\n * @deprecated Use `useAuiState((s) => s.message)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12\n *\n * Hook to access the current message state.\n *\n * This hook provides reactive access to the message's state, including content,\n * role, status, and other message-level properties.\n *\n * @param selector Optional selector function to pick specific state properties\n * @returns The selected message state or the entire message state if no selector provided\n *\n * @example\n * ```tsx\n * // Before:\n * function MessageContent() {\n * const role = useMessage((state) => state.role);\n * const content = useMessage((state) => state.content);\n * const isLoading = useMessage((state) => state.status.type === \"running\");\n * return (\n * <div className={`message-${role}`}>\n * {isLoading ? \"Loading...\" : content.map(part => part.text).join(\"\")}\n * </div>\n * );\n * }\n *\n * // After:\n * function MessageContent() {\n * const role = useAuiState((s) => s.message.role);\n * const content = useAuiState((s) => s.message.content);\n * const isLoading = useAuiState((s) => s.message.status.type === \"running\");\n * return (\n * <div className={`message-${role}`}>\n * {isLoading ? \"Loading...\" : content.map(part => part.text).join(\"\")}\n * </div>\n * );\n * }\n * ```\n */\nexport const useMessage = createStateHookForRuntime(useMessageRuntime);\n\nconst useEditComposerRuntime = (opt: {\n optional: boolean | undefined;\n}): EditComposerRuntime | null => useMessageRuntime(opt)?.composer ?? null;\n\n/**\n * @deprecated Use `useAuiState((s) => s.message.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12\n */\nexport const useEditComposer = createStateHookForRuntime(\n useEditComposerRuntime,\n);\n","import {\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ForwardRefExoticComponent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n cloneElement,\n forwardRef,\n isValidElement,\n} from \"react\";\nimport { Primitive as RadixPrimitive } from \"@radix-ui/react-primitive\";\n\n/**\n * Thin wrapper around `@radix-ui/react-primitive` that adds `render` prop support.\n *\n * When `render` is provided, it is converted to the equivalent `asChild` pattern:\n * render={<Comp props />} + children → asChild + <Comp props>{children}</Comp>\n *\n * All prop merging, ref composition, and event handler chaining remain handled\n * by Radix's battle-tested Slot implementation — we add zero custom logic for that.\n */\n\n// Match @radix-ui/react-primitive's full element set\nconst NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\",\n] as const;\ntype PrimitiveNode = (typeof NODES)[number];\n\ntype PrimitiveProps<E extends PrimitiveNode> = ComponentPropsWithoutRef<\n (typeof RadixPrimitive)[E]\n> & {\n render?: ReactElement | undefined;\n};\n\ntype PrimitiveRef<E extends PrimitiveNode> = ComponentRef<\n (typeof RadixPrimitive)[E]\n>;\n\nfunction createPrimitive<E extends PrimitiveNode>(node: E) {\n const RadixComp = RadixPrimitive[node];\n\n const Component = forwardRef<PrimitiveRef<E>, PrimitiveProps<E>>(\n ({ render, asChild, children, ...props }, ref) => {\n if (render && isValidElement(render)) {\n // render={<Comp p />} + children\n // → asChild + <Comp p>{children}</Comp>\n const renderChildren =\n children !== undefined\n ? children\n : ((render.props as Record<string, unknown>).children as ReactNode);\n return (\n <RadixComp asChild {...(props as any)} ref={ref}>\n {cloneElement(render, undefined, renderChildren)}\n </RadixComp>\n );\n }\n\n return (\n <RadixComp asChild={asChild} {...(props as any)} ref={ref}>\n {children}\n </RadixComp>\n );\n },\n );\n\n Component.displayName = `Primitive.${node}`;\n return Component as ForwardRefExoticComponent<\n PrimitiveProps<E> & RefAttributes<PrimitiveRef<E>>\n >;\n}\n\nconst Primitive = NODES.reduce(\n (acc, node) => {\n acc[node] = createPrimitive(node);\n return acc;\n },\n {} as {\n [K in PrimitiveNode]: ReturnType<typeof createPrimitive<K>>;\n },\n);\n\nexport { Primitive };\nexport type { PrimitiveProps };\n","\"use client\";\n\nimport { FC, PropsWithChildren } from \"react\";\nimport { useMessageError } from \"@assistant-ui/core/react\";\n\nexport const MessagePrimitiveError: FC<PropsWithChildren> = ({ children }) => {\n const error = useMessageError();\n return error !== undefined ? children : null;\n};\n\nMessagePrimitiveError.displayName = \"MessagePrimitive.Error\";\n","export { MessagePrimitiveRoot as Root } from \"./message/MessageRoot\";\nexport { MessagePrimitiveParts as Parts } from \"./message/MessageParts\";\nexport { MessagePrimitivePartByIndex as PartByIndex } from \"./message/MessageParts\";\nexport { MessagePrimitiveParts as Content } from \"./message/MessageParts\";\nexport { MessagePrimitiveIf as If } from \"./message/MessageIf\";\nexport { MessagePrimitiveAttachments as Attachments } from \"./message/MessageAttachments\";\nexport { MessagePrimitiveAttachmentByIndex as AttachmentByIndex } from \"./message/MessageAttachments\";\nexport { MessagePrimitiveQuote as Quote } from \"@assistant-ui/core/react\";\nexport { MessagePrimitiveError as Error } from \"./message/MessageError\";\nexport {\n MessagePrimitiveUnstable_PartsGrouped as Unstable_PartsGrouped,\n MessagePrimitiveUnstable_PartsGroupedByParentId as Unstable_PartsGroupedByParentId,\n} from \"./message/MessagePartsGrouped\";\n","export { ActionBarPrimitiveRoot as Root } from \"./actionBar/ActionBarRoot\";\nexport { ActionBarPrimitiveCopy as Copy } from \"./actionBar/ActionBarCopy\";\nexport { ActionBarPrimitiveReload as Reload } from \"./actionBar/ActionBarReload\";\nexport { ActionBarPrimitiveEdit as Edit } from \"./actionBar/ActionBarEdit\";\nexport { ActionBarPrimitiveSpeak as Speak } from \"./actionBar/ActionBarSpeak\";\nexport { ActionBarPrimitiveStopSpeaking as StopSpeaking } from \"./actionBar/ActionBarStopSpeaking\";\nexport { ActionBarPrimitiveFeedbackPositive as FeedbackPositive } from \"./actionBar/ActionBarFeedbackPositive\";\nexport { ActionBarPrimitiveFeedbackNegative as FeedbackNegative } from \"./actionBar/ActionBarFeedbackNegative\";\nexport { ActionBarPrimitiveExportMarkdown as ExportMarkdown } from \"./actionBar/ActionBarExportMarkdown\";\n","export { ComposerPrimitiveRoot as Root } from \"./composer/ComposerRoot\";\nexport { ComposerPrimitiveInput as Input } from \"./composer/ComposerInput\";\nexport { ComposerPrimitiveSend as Send } from \"./composer/ComposerSend\";\nexport { ComposerPrimitiveCancel as Cancel } from \"./composer/ComposerCancel\";\nexport { ComposerPrimitiveAddAttachment as AddAttachment } from \"./composer/ComposerAddAttachment\";\nexport { ComposerPrimitiveAttachments as Attachments } from \"./composer/ComposerAttachments\";\nexport { ComposerPrimitiveAttachmentByIndex as AttachmentByIndex } from \"./composer/ComposerAttachments\";\nexport { ComposerPrimitiveAttachmentDropzone as AttachmentDropzone } from \"./composer/ComposerAttachmentDropzone\";\nexport { ComposerPrimitiveDictate as Dictate } from \"./composer/ComposerDictate\";\nexport { ComposerPrimitiveStopDictation as StopDictation } from \"./composer/ComposerStopDictation\";\nexport { ComposerPrimitiveDictationTranscript as DictationTranscript } from \"./composer/ComposerDictationTranscript\";\nexport { ComposerPrimitiveIf as If } from \"./composer/ComposerIf\";\nexport { ComposerPrimitiveQuote as Quote } from \"./composer/ComposerQuote\";\nexport { ComposerPrimitiveQuoteText as QuoteText } from \"./composer/ComposerQuote\";\nexport { ComposerPrimitiveQuoteDismiss as QuoteDismiss } from \"./composer/ComposerQuote\";\nexport { ComposerPrimitiveQueue as Queue } from \"./composer/ComposerQueue\";\nexport { ComposerPrimitiveMentionRoot as Unstable_MentionRoot } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionPopover as Unstable_MentionPopover } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionCategories as Unstable_MentionCategories } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionCategoryItem as Unstable_MentionCategoryItem } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionItems as Unstable_MentionItems } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionItem as Unstable_MentionItem } from \"./composer/mention\";\nexport { ComposerPrimitiveMentionBack as Unstable_MentionBack } from \"./composer/mention\";\nexport { useMentionContext as unstable_useMentionContext } from \"./composer/mention\";\nexport { useMentionContextOptional as unstable_useMentionContextOptional } from \"./composer/mention\";\n","import { useLayoutEffect } from 'react';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\nexport { index as default };\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","import React from 'react';\n\n// basically Exclude<React.ClassAttributes<T>[\"ref\"], string>\n\nvar updateRef = function updateRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n return;\n }\n ref.current = value;\n};\nvar useComposedRef = function useComposedRef(libRef, userRef) {\n var prevUserRef = React.useRef();\n return React.useCallback(function (instance) {\n libRef.current = instance;\n if (prevUserRef.current) {\n updateRef(prevUserRef.current, null);\n }\n prevUserRef.current = userRef;\n if (!userRef) {\n return;\n }\n updateRef(userRef, instance);\n }, [userRef]);\n};\n\nexport { useComposedRef as default };\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","import { useAuiState } from \"@assistant-ui/store\";\n\nexport const useMessageError = () => {\n return useAuiState((s) =>\n s.message.status?.type === \"incomplete\" &&\n s.message.status.reason === \"error\"\n ? (s.message.status.error ?? \"An error occurred\")\n : undefined,\n );\n};\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst NODES = [\n 'a',\n 'button',\n 'div',\n 'form',\n 'h2',\n 'h3',\n 'img',\n 'input',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'select',\n 'span',\n 'svg',\n 'ul',\n] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n","import type { Unsubscribe } from \"@assistant-ui/core\";\nimport { useDebugValue, useSyncExternalStore } from \"react\";\nimport { ensureBinding } from \"./ensureBinding\";\n\nexport type SubscribableRuntime<TState> = {\n getState: () => TState;\n subscribe: (callback: () => void) => Unsubscribe;\n};\n\nexport function useRuntimeStateInternal<TState, TSelected>(\n runtime: SubscribableRuntime<TState>,\n selector: ((state: TState) => TSelected | TState) | undefined = identity,\n): TSelected | TState {\n // TODO move to useRuntimeState\n ensureBinding(runtime);\n\n const slice = useSyncExternalStore(\n runtime.subscribe,\n () => selector(runtime.getState()),\n () => selector(runtime.getState()),\n );\n useDebugValue(slice);\n return slice;\n}\n\nconst identity = <T>(arg: T): T => arg;\nexport function useRuntimeState<TState>(\n runtime: SubscribableRuntime<TState>,\n): TState;\nexport function useRuntimeState<TState, TSelected>(\n runtime: SubscribableRuntime<TState>,\n selector: (state: TState) => TSelected,\n): TSelected;\nexport function useRuntimeState<TState, TSelected>(\n runtime: SubscribableRuntime<TState>,\n selector: ((state: TState) => TSelected) | undefined,\n): TSelected | TState;\nexport function useRuntimeState<TState, TSelected>(\n runtime: SubscribableRuntime<TState>,\n selector?: ((state: TState) => TSelected) | undefined,\n): TSelected | TState {\n // ensure that the runtime is bound\n // ensureBinding(runtime);\n\n return useRuntimeStateInternal(runtime, selector);\n}\n","\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { RequireAtLeastOne } from \"../../utils/RequireAtLeastOne\";\n\ntype ThreadIfFilters = {\n empty: boolean | undefined;\n running: boolean | undefined;\n disabled: boolean | undefined;\n};\n\ntype UseThreadIfProps = RequireAtLeastOne<ThreadIfFilters>;\n\nconst useThreadIf = (props: UseThreadIfProps) => {\n return useAuiState((s) => {\n if (props.empty === true && !s.thread.isEmpty) return false;\n if (props.empty === false && s.thread.isEmpty) return false;\n\n if (props.running === true && !s.thread.isRunning) return false;\n if (props.running === false && s.thread.isRunning) return false;\n if (props.disabled === true && !s.thread.isDisabled) return false;\n if (props.disabled === false && s.thread.isDisabled) return false;\n\n return true;\n });\n};\n\nexport namespace ThreadPrimitiveIf {\n export type Props = PropsWithChildren<UseThreadIfProps>;\n}\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.thread...} />` instead.\n */\nexport const ThreadPrimitiveIf: FC<ThreadPrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useThreadIf(query);\n return result ? children : null;\n};\n\nThreadPrimitiveIf.displayName = \"ThreadPrimitive.If\";\n","\"use client\";\n\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nconst useComposerStopDictation = () => {\n const aui = useAui();\n const isDictating = useAuiState((s) => s.composer.dictation != null);\n\n const callback = useCallback(() => {\n aui.composer().stopDictation();\n }, [aui]);\n\n if (!isDictating) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveStopDictation {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerStopDictation>;\n}\n\n/**\n * A button that stops the current dictation session.\n *\n * Only rendered when dictation is active.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.StopDictation>\n * <StopIcon />\n * </ComposerPrimitive.StopDictation>\n * ```\n */\nexport const ComposerPrimitiveStopDictation = createActionButton(\n \"ComposerPrimitive.StopDictation\",\n useComposerStopDictation,\n);\n","import { useEffect } from \"react\";\nimport { useEffectEvent } from \"use-effect-event\";\nimport { useAui } from \"./useAui\";\nimport type {\n AssistantEventName,\n AssistantEventCallback,\n AssistantEventSelector,\n} from \"./types/events\";\nimport { normalizeEventSelector } from \"./types/events\";\n\nexport const useAuiEvent = <TEvent extends AssistantEventName>(\n selector: AssistantEventSelector<TEvent>,\n callback: AssistantEventCallback<TEvent>,\n) => {\n const aui = useAui();\n const callbackRef = useEffectEvent(callback);\n\n const { scope, event } = normalizeEventSelector(selector);\n useEffect(\n () => aui.on({ scope, event }, callbackRef),\n [aui, scope, event, callbackRef],\n );\n};\n","\"use client\";\n\nimport { Primitive } from \"../../../utils/Primitive\";\nimport {\n type ComponentRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useCallback,\n} from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useMentionContext } from \"./ComposerMentionContext\";\nimport type { Unstable_MentionCategory } from \"@assistant-ui/core\";\n\n// =============================================================================\n// MentionCategories — Renders the list of categories\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionCategories {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.div>,\n \"children\"\n > & {\n /**\n * Render function that receives the filtered categories and returns\n * the UI. A render-function pattern is used here (instead of a\n * `components` prop) to give consumers full control over list layout,\n * ordering, grouping, and empty states.\n */\n children: (categories: readonly Unstable_MentionCategory[]) => ReactNode;\n };\n}\n\nexport const ComposerPrimitiveMentionCategories = forwardRef<\n ComposerPrimitiveMentionCategories.Element,\n ComposerPrimitiveMentionCategories.Props\n>(({ children, ...props }, forwardedRef) => {\n const { categories, activeCategoryId, isSearchMode } = useMentionContext();\n\n if (activeCategoryId || isSearchMode) return null;\n\n return (\n <Primitive.div role=\"group\" {...props} ref={forwardedRef}>\n {children(categories)}\n </Primitive.div>\n );\n});\n\nComposerPrimitiveMentionCategories.displayName =\n \"ComposerPrimitive.MentionCategories\";\n\n// =============================================================================\n// MentionCategoryItem — A single category row (clickable to drill-down)\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionCategoryItem {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button> & {\n categoryId: string;\n };\n}\n\n/**\n * A button that selects a category and triggers drill-down navigation.\n * Automatically receives `data-highlighted` when keyboard-navigated.\n */\nexport const ComposerPrimitiveMentionCategoryItem = forwardRef<\n ComposerPrimitiveMentionCategoryItem.Element,\n ComposerPrimitiveMentionCategoryItem.Props\n>(({ categoryId, onClick, ...props }, forwardedRef) => {\n const {\n selectCategory,\n categories,\n highlightedIndex,\n activeCategoryId,\n isSearchMode,\n } = useMentionContext();\n\n const handleClick = useCallback(() => {\n selectCategory(categoryId);\n }, [selectCategory, categoryId]);\n\n // Derive highlighted state from context — no manual wiring needed\n const isHighlighted =\n !activeCategoryId &&\n !isSearchMode &&\n categories.findIndex((c) => c.id === categoryId) === highlightedIndex;\n\n return (\n <Primitive.button\n type=\"button\"\n role=\"option\"\n aria-selected={isHighlighted}\n data-highlighted={isHighlighted ? \"\" : undefined}\n {...props}\n ref={forwardedRef}\n onClick={composeEventHandlers(onClick, handleClick)}\n />\n );\n});\n\nComposerPrimitiveMentionCategoryItem.displayName =\n \"ComposerPrimitive.MentionCategoryItem\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport {\n useActionBarFloatStatus,\n HideAndFloatStatus,\n} from \"./useActionBarFloatStatus\";\nimport { ActionBarInteractionContext } from \"./ActionBarInteractionContext\";\n\ntype PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;\n\nexport namespace ActionBarPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = PrimitiveDivProps & {\n /**\n * Whether to hide the action bar when the thread is running.\n * @default false\n */\n hideWhenRunning?: boolean | undefined;\n /**\n * Controls when the action bar should automatically hide.\n * - \"always\": Always hide unless hovered\n * - \"not-last\": Hide unless this is the last message\n * - \"never\": Never auto-hide\n * @default \"never\"\n */\n autohide?: \"always\" | \"not-last\" | \"never\" | undefined;\n /**\n * Controls floating behavior when auto-hidden.\n * - \"always\": Always float when hidden\n * - \"single-branch\": Float only for single-branch messages\n * - \"never\": Never float\n * @default \"never\"\n */\n autohideFloat?: \"always\" | \"single-branch\" | \"never\" | undefined;\n };\n}\n\n/**\n * The root container for action bar components.\n *\n * This component provides intelligent visibility and floating behavior for action bars,\n * automatically hiding and showing based on message state, hover status, and configuration.\n * It supports floating mode for better UX when space is limited.\n *\n * @example\n * ```tsx\n * <ActionBarPrimitive.Root\n * hideWhenRunning={true}\n * autohide=\"not-last\"\n * autohideFloat=\"single-branch\"\n * >\n * <ActionBarPrimitive.Copy />\n * <ActionBarPrimitive.Edit />\n * <ActionBarPrimitive.Reload />\n * </ActionBarPrimitive.Root>\n * ```\n */\nexport const ActionBarPrimitiveRoot = forwardRef<\n ActionBarPrimitiveRoot.Element,\n ActionBarPrimitiveRoot.Props\n>(({ hideWhenRunning, autohide, autohideFloat, ...rest }, ref) => {\n const [interactionCount, setInteractionCount] = useState(0);\n\n const acquireInteractionLock = useCallback(() => {\n let released = false;\n\n setInteractionCount((count) => count + 1);\n\n return () => {\n if (released) return;\n released = true;\n setInteractionCount((count) => Math.max(0, count - 1));\n };\n }, []);\n\n const interactionContext = useMemo(\n () => ({ acquireInteractionLock }),\n [acquireInteractionLock],\n );\n\n const hideAndfloatStatus = useActionBarFloatStatus({\n hideWhenRunning,\n autohide,\n autohideFloat,\n forceVisible: interactionCount > 0,\n });\n\n if (hideAndfloatStatus === HideAndFloatStatus.Hidden) return null;\n\n return (\n <ActionBarInteractionContext.Provider value={interactionContext}>\n <Primitive.div\n {...(hideAndfloatStatus === HideAndFloatStatus.Floating\n ? { \"data-floating\": \"true\" }\n : null)}\n {...rest}\n ref={ref}\n />\n </ActionBarInteractionContext.Provider>\n );\n});\n\nActionBarPrimitiveRoot.displayName = \"ActionBarPrimitive.Root\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n type ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n} from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\n\n// ---- Root ----\n\nexport namespace ComposerPrimitiveQuote {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * Renders a container for the quoted text preview in the composer.\n * Only renders when a quote is set.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Quote>\n * <ComposerPrimitive.QuoteText />\n * <ComposerPrimitive.QuoteDismiss>×</ComposerPrimitive.QuoteDismiss>\n * </ComposerPrimitive.Quote>\n * ```\n */\nexport const ComposerPrimitiveQuote = forwardRef<\n ComposerPrimitiveQuote.Element,\n ComposerPrimitiveQuote.Props\n>((props, forwardedRef) => {\n const quote = useAuiState((s) => s.composer.quote);\n if (!quote) return null;\n\n return <Primitive.div {...props} ref={forwardedRef} />;\n});\n\nComposerPrimitiveQuote.displayName = \"ComposerPrimitive.Quote\";\n\n// ---- QuoteText ----\n\nexport namespace ComposerPrimitiveQuoteText {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\n/**\n * Renders the quoted text content.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.QuoteText />\n * ```\n */\nexport const ComposerPrimitiveQuoteText = forwardRef<\n ComposerPrimitiveQuoteText.Element,\n ComposerPrimitiveQuoteText.Props\n>(({ children, ...props }, forwardedRef) => {\n const text = useAuiState((s) => s.composer.quote?.text);\n if (!text) return null;\n\n return (\n <Primitive.span {...props} ref={forwardedRef}>\n {children ?? text}\n </Primitive.span>\n );\n});\n\nComposerPrimitiveQuoteText.displayName = \"ComposerPrimitive.QuoteText\";\n\n// ---- QuoteDismiss ----\n\nexport namespace ComposerPrimitiveQuoteDismiss {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\n/**\n * A button that clears the current quote from the composer.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.QuoteDismiss>×</ComposerPrimitive.QuoteDismiss>\n * ```\n */\nexport const ComposerPrimitiveQuoteDismiss = forwardRef<\n ComposerPrimitiveQuoteDismiss.Element,\n ComposerPrimitiveQuoteDismiss.Props\n>(({ onClick, ...props }, forwardedRef) => {\n const aui = useAui();\n const handleDismiss = useCallback(() => {\n aui.composer().setQuote(undefined);\n }, [aui]);\n\n return (\n <Primitive.button\n type=\"button\"\n {...props}\n ref={forwardedRef}\n onClick={composeEventHandlers(onClick, handleDismiss)}\n />\n );\n});\n\nComposerPrimitiveQuoteDismiss.displayName = \"ComposerPrimitive.QuoteDismiss\";\n","\"use client\";\n\nimport { Primitive } from \"../../../utils/Primitive\";\nimport {\n type ComponentRef,\n type ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n} from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useMentionContext } from \"./ComposerMentionContext\";\n\n// =============================================================================\n// MentionBack — Button to navigate back from items to categories\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionBack {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button>;\n}\n\n/**\n * A button that navigates back from category items to the category list.\n * Only renders when a category is active (drill-down view).\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.MentionBack>\n * &larr; Back\n * </ComposerPrimitive.MentionBack>\n * ```\n */\nexport const ComposerPrimitiveMentionBack = forwardRef<\n ComposerPrimitiveMentionBack.Element,\n ComposerPrimitiveMentionBack.Props\n>(({ onClick, ...props }, forwardedRef) => {\n const { activeCategoryId, isSearchMode, goBack } = useMentionContext();\n\n const handleClick = useCallback(() => {\n goBack();\n }, [goBack]);\n\n if (!activeCategoryId || isSearchMode) return null;\n\n return (\n <Primitive.button\n type=\"button\"\n {...props}\n ref={forwardedRef}\n onClick={composeEventHandlers(onClick, handleClick)}\n />\n );\n});\n\nComposerPrimitiveMentionBack.displayName = \"ComposerPrimitive.MentionBack\";\n","\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport type { RequireAtLeastOne } from \"../../utils/RequireAtLeastOne\";\n\ntype MessageIfFilters = {\n user: boolean | undefined;\n assistant: boolean | undefined;\n system: boolean | undefined;\n hasBranches: boolean | undefined;\n copied: boolean | undefined;\n lastOrHover: boolean | undefined;\n last: boolean | undefined;\n speaking: boolean | undefined;\n hasAttachments: boolean | undefined;\n hasContent: boolean | undefined;\n submittedFeedback: \"positive\" | \"negative\" | null | undefined;\n};\ntype UseMessageIfProps = RequireAtLeastOne<MessageIfFilters>;\n\nconst useMessageIf = (props: UseMessageIfProps) => {\n return useAuiState((s) => {\n const {\n role,\n attachments,\n parts,\n branchCount,\n isLast,\n speech,\n isCopied,\n isHovering,\n } = s.message;\n\n if (props.hasBranches === true && branchCount < 2) return false;\n\n if (props.user && role !== \"user\") return false;\n if (props.assistant && role !== \"assistant\") return false;\n if (props.system && role !== \"system\") return false;\n\n if (props.lastOrHover === true && !isHovering && !isLast) return false;\n if (props.last !== undefined && props.last !== isLast) return false;\n\n if (props.copied === true && !isCopied) return false;\n if (props.copied === false && isCopied) return false;\n\n if (props.speaking === true && speech == null) return false;\n if (props.speaking === false && speech != null) return false;\n\n if (\n props.hasAttachments === true &&\n (role !== \"user\" || !attachments?.length)\n )\n return false;\n if (\n props.hasAttachments === false &&\n role === \"user\" &&\n !!attachments?.length\n )\n return false;\n\n if (props.hasContent === true && parts.length === 0) return false;\n if (props.hasContent === false && parts.length > 0) return false;\n\n if (\n props.submittedFeedback !== undefined &&\n (s.message.metadata.submittedFeedback?.type ?? null) !==\n props.submittedFeedback\n )\n return false;\n\n return true;\n });\n};\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\n/**\n * @deprecated Use `<AuiIf condition={(s) => s.message...} />` instead.\n */\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport { type ComponentRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveDictationTranscript {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.span>;\n}\n\n/**\n * Renders the current interim (partial) transcript while dictation is active.\n *\n * This component displays real-time feedback of what the user is saying before\n * the transcription is finalized and committed to the composer input.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.If dictation>\n * <div className=\"dictation-preview\">\n * <ComposerPrimitive.DictationTranscript />\n * </div>\n * </ComposerPrimitive.If>\n * ```\n */\nexport const ComposerPrimitiveDictationTranscript = forwardRef<\n ComposerPrimitiveDictationTranscript.Element,\n ComposerPrimitiveDictationTranscript.Props\n>(({ children, ...props }, forwardRef) => {\n const transcript = useAuiState((s) => s.composer.dictation?.transcript);\n\n if (!transcript) return null;\n\n return (\n <Primitive.span {...props} ref={forwardRef}>\n {children ?? transcript}\n </Primitive.span>\n );\n});\n\nComposerPrimitiveDictationTranscript.displayName =\n \"ComposerPrimitive.DictationTranscript\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport { type ComponentRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\nimport { useMessagePartImage } from \"./useMessagePartImage\";\n\nexport namespace MessagePartPrimitiveImage {\n export type Element = ComponentRef<typeof Primitive.img>;\n /**\n * Props for the MessagePartPrimitive.Image component.\n * Accepts all standard img element props.\n */\n export type Props = ComponentPropsWithoutRef<typeof Primitive.img>;\n}\n\n/**\n * Renders an image from the current message part context.\n *\n * This component displays image content from the current message part,\n * automatically setting the src attribute from the message part's image data.\n *\n * @example\n * ```tsx\n * <MessagePartPrimitive.Image\n * alt=\"Generated image\"\n * className=\"message-image\"\n * style={{ maxWidth: '100%' }}\n * />\n * ```\n */\nexport const MessagePartPrimitiveImage = forwardRef<\n MessagePartPrimitiveImage.Element,\n MessagePartPrimitiveImage.Props\n>((props, forwardedRef) => {\n const { image } = useMessagePartImage();\n return <Primitive.img src={image} {...props} ref={forwardedRef} />;\n});\n\nMessagePartPrimitiveImage.displayName = \"MessagePartPrimitive.Image\";\n","\"use client\";\n\nimport { Primitive } from \"../../../utils/Primitive\";\nimport {\n type ComponentRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useCallback,\n} from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useMentionContext } from \"./ComposerMentionContext\";\nimport type { Unstable_MentionItem } from \"@assistant-ui/core\";\n\n// =============================================================================\n// MentionItems — Renders the list of items within a category\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionItems {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.div>,\n \"children\"\n > & {\n /**\n * Render function that receives the filtered items and returns\n * the UI. A render-function pattern is used here (instead of a\n * `components` prop) to give consumers full control over list layout,\n * ordering, grouping, and empty states.\n */\n children: (items: readonly Unstable_MentionItem[]) => ReactNode;\n };\n}\n\nexport const ComposerPrimitiveMentionItems = forwardRef<\n ComposerPrimitiveMentionItems.Element,\n ComposerPrimitiveMentionItems.Props\n>(({ children, ...props }, forwardedRef) => {\n const { items, activeCategoryId, isSearchMode } = useMentionContext();\n\n if (!activeCategoryId && !isSearchMode) return null;\n\n return (\n <Primitive.div role=\"group\" {...props} ref={forwardedRef}>\n {children(items)}\n </Primitive.div>\n );\n});\n\nComposerPrimitiveMentionItems.displayName = \"ComposerPrimitive.MentionItems\";\n\n// =============================================================================\n// MentionItem — A single selectable mention item\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionItem {\n export type Element = ComponentRef<typeof Primitive.button>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.button> & {\n item: Unstable_MentionItem;\n /** Position in the items list. Used for keyboard highlight matching. Falls back to findIndex by id. */\n index?: number | undefined;\n };\n}\n\n/**\n * A button that inserts the mention item into the composer.\n * Automatically receives `data-highlighted` when keyboard-navigated.\n */\nexport const ComposerPrimitiveMentionItem = forwardRef<\n ComposerPrimitiveMentionItem.Element,\n ComposerPrimitiveMentionItem.Props\n>(({ item, index: indexProp, onClick, ...props }, forwardedRef) => {\n const {\n selectItem,\n items,\n highlightedIndex,\n activeCategoryId,\n isSearchMode,\n } = useMentionContext();\n\n const handleClick = useCallback(() => {\n selectItem(item);\n }, [selectItem, item]);\n\n // Use explicit index prop if provided, fall back to findIndex\n const itemIndex = indexProp ?? items.findIndex((i) => i.id === item.id);\n const isHighlighted =\n (isSearchMode || activeCategoryId !== null) &&\n itemIndex === highlightedIndex;\n\n return (\n <Primitive.button\n type=\"button\"\n role=\"option\"\n aria-selected={isHighlighted}\n data-highlighted={isHighlighted ? \"\" : undefined}\n {...props}\n ref={forwardedRef}\n onClick={composeEventHandlers(onClick, handleClick)}\n />\n );\n});\n\nComposerPrimitiveMentionItem.displayName = \"ComposerPrimitive.MentionItem\";\n","\"use client\";\n\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEffect } from \"react\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\n\nexport const useOnScrollToBottom = (\n callback: (config: { behavior: ScrollBehavior }) => void,\n) => {\n const callbackRef = useCallbackRef(callback);\n const onScrollToBottom = useThreadViewport((vp) => vp.onScrollToBottom);\n\n useEffect(() => {\n return onScrollToBottom(callbackRef);\n }, [onScrollToBottom, callbackRef]);\n};\n","\"use client\";\n\nimport { Primitive } from \"../../../utils/Primitive\";\nimport {\n type ComponentRef,\n type ComponentPropsWithoutRef,\n forwardRef,\n} from \"react\";\nimport { useMentionContext } from \"./ComposerMentionContext\";\n\n// =============================================================================\n// MentionPopover — Container that only renders when mention is active\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionPopover {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * Renders a container for the mention picker popover.\n * Only renders when a `@` trigger is detected in the composer text.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.MentionRoot adapter={mentionAdapter}>\n * <ComposerPrimitive.Input />\n * <ComposerPrimitive.MentionPopover>\n * <ComposerPrimitive.MentionCategories />\n * </ComposerPrimitive.MentionPopover>\n * </ComposerPrimitive.MentionRoot>\n * ```\n */\nexport const ComposerPrimitiveMentionPopover = forwardRef<\n ComposerPrimitiveMentionPopover.Element,\n ComposerPrimitiveMentionPopover.Props\n>((props, forwardedRef) => {\n const { open } = useMentionContext();\n if (!open) return null;\n\n return (\n <Primitive.div\n role=\"listbox\"\n data-state=\"open\"\n {...props}\n ref={forwardedRef}\n />\n );\n});\n\nComposerPrimitiveMentionPopover.displayName =\n \"ComposerPrimitive.MentionPopover\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\nimport { ThreadPrimitiveViewportSlack } from \"../thread/ThreadViewportSlack\";\n\nconst useIsHoveringRef = () => {\n const aui = useAui();\n const message = useAuiState(() => aui.message());\n\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n const handleMouseEnter = () => {\n message.setIsHovering(true);\n };\n const handleMouseLeave = () => {\n message.setIsHovering(false);\n };\n\n el.addEventListener(\"mouseenter\", handleMouseEnter);\n el.addEventListener(\"mouseleave\", handleMouseLeave);\n\n if (el.matches(\":hover\")) {\n // TODO this is needed for SSR to work, figure out why\n queueMicrotask(() => message.setIsHovering(true));\n }\n\n return () => {\n el.removeEventListener(\"mouseenter\", handleMouseEnter);\n el.removeEventListener(\"mouseleave\", handleMouseLeave);\n message.setIsHovering(false);\n };\n },\n [message],\n );\n\n return useManagedRef(callbackRef);\n};\n\n/**\n * Hook that registers the anchor user message as a content inset.\n * Only registers if: user message, at index messages.length-2, and last message is assistant.\n */\nconst useMessageViewportRef = () => {\n const turnAnchor = useThreadViewport((s) => s.turnAnchor);\n const registerUserHeight = useThreadViewport(\n (s) => s.registerUserMessageHeight,\n );\n\n // inset rules:\n // - the previous user message before the last assistant message registers its full height\n const shouldRegisterAsInset = useAuiState(\n (s) =>\n turnAnchor === \"top\" &&\n s.message.role === \"user\" &&\n s.message.index === s.thread.messages.length - 2 &&\n s.thread.messages.at(-1)?.role === \"assistant\",\n );\n\n const getHeight = useCallback((el: HTMLElement) => el.offsetHeight, []);\n\n return useSizeHandle(\n shouldRegisterAsInset ? registerUserHeight : null,\n getHeight,\n );\n};\n\nexport namespace MessagePrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n /**\n * Props for the MessagePrimitive.Root component.\n * Accepts all standard div element props.\n */\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * The root container component for a message.\n *\n * This component provides the foundational wrapper for message content and handles\n * hover state management for the message. It automatically tracks when the user\n * is hovering over the message, which can be used by child components like action bars.\n *\n * When `turnAnchor=\"top\"` is set on the viewport, this component\n * registers itself as the scroll anchor if it's the last user message.\n *\n * @example\n * ```tsx\n * <MessagePrimitive.Root>\n * <MessagePrimitive.Content />\n * <ActionBarPrimitive.Root>\n * <ActionBarPrimitive.Copy />\n * <ActionBarPrimitive.Edit />\n * </ActionBarPrimitive.Root>\n * </MessagePrimitive.Root>\n * ```\n */\nexport const MessagePrimitiveRoot = forwardRef<\n MessagePrimitiveRoot.Element,\n MessagePrimitiveRoot.Props\n>((props, forwardRef) => {\n const isHoveringRef = useIsHoveringRef();\n const anchorUserMessageRef = useMessageViewportRef();\n const ref = useComposedRefs<HTMLDivElement>(\n forwardRef,\n isHoveringRef,\n anchorUserMessageRef,\n );\n const messageId = useAuiState((s) => s.message.id);\n\n return (\n <ThreadPrimitiveViewportSlack>\n <Primitive.div {...props} ref={ref} data-message-id={messageId} />\n </ThreadPrimitiveViewportSlack>\n );\n});\n\nMessagePrimitiveRoot.displayName = \"MessagePrimitive.Root\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport { type ComponentRef, forwardRef, ComponentPropsWithoutRef } from \"react\";\n\nexport namespace ThreadPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.div>;\n /**\n * Props for the ThreadPrimitive.Root component.\n * Accepts all standard div element props.\n */\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * The root container component for a thread.\n *\n * This component serves as the foundational wrapper for all thread-related components.\n * It provides the basic structure and context needed for thread functionality.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Root>\n * <ThreadPrimitive.Viewport>\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * </ThreadPrimitive.Viewport>\n * </ThreadPrimitive.Root>\n * ```\n */\nexport const ThreadPrimitiveRoot = forwardRef<\n ThreadPrimitiveRoot.Element,\n ThreadPrimitiveRoot.Props\n>((props, ref) => {\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveRoot.displayName = \"ThreadPrimitive.Root\";\n","import {\n ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n MouseEventHandler,\n} from \"react\";\nimport { Primitive } from \"./Primitive\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\n\ntype ActionButtonCallback<TProps> = (\n props: TProps,\n) => MouseEventHandler<HTMLButtonElement> | null;\n\ntype PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;\n\nexport type ActionButtonProps<THook> = PrimitiveButtonProps &\n (THook extends (props: infer TProps) => unknown ? TProps : never);\n\nexport type ActionButtonElement = ComponentRef<typeof Primitive.button>;\n\nexport const createActionButton = <TProps,>(\n displayName: string,\n useActionButton: ActionButtonCallback<TProps>,\n forwardProps: (keyof NonNullable<TProps>)[] = [],\n) => {\n const ActionButton = forwardRef<\n ActionButtonElement,\n PrimitiveButtonProps & TProps\n >((props, forwardedRef) => {\n const forwardedProps = {} as TProps;\n const primitiveProps = {} as PrimitiveButtonProps;\n\n (Object.keys(props) as Array<keyof typeof props>).forEach((key) => {\n if (forwardProps.includes(key as keyof TProps)) {\n (forwardedProps as any)[key] = props[key];\n } else {\n (primitiveProps as any)[key] = props[key];\n }\n });\n\n const callback = useActionButton(forwardedProps as TProps) ?? undefined;\n return (\n <Primitive.button\n {...primitiveProps}\n type=\"button\"\n ref={forwardedRef}\n disabled={primitiveProps.disabled || !callback}\n onClick={composeEventHandlers(primitiveProps.onClick, callback)}\n />\n );\n });\n\n ActionButton.displayName = displayName;\n\n return ActionButton;\n};\n","\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useActionBarStopSpeaking as useActionBarStopSpeakingBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarStopSpeaking = () => {\n const { disabled, stopSpeaking } = useActionBarStopSpeakingBehavior();\n if (disabled) return null;\n return stopSpeaking;\n};\n\nexport namespace ActionBarPrimitiveStopSpeaking {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarStopSpeaking>;\n}\n\nexport const ActionBarPrimitiveStopSpeaking = forwardRef<\n ActionBarPrimitiveStopSpeaking.Element,\n ActionBarPrimitiveStopSpeaking.Props\n>((props, ref) => {\n const callback = useActionBarStopSpeaking();\n\n // TODO this stops working if the user is not hovering over an older message\n useEscapeKeydown((e) => {\n if (callback) {\n e.preventDefault();\n callback();\n }\n });\n\n return (\n <Primitive.button\n type=\"button\"\n disabled={!callback}\n {...props}\n ref={ref}\n onClick={composeEventHandlers(props.onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveStopSpeaking.displayName = \"ActionBarPrimitive.StopSpeaking\";\n","\"use client\";\n\nimport {\n forwardRef,\n useCallback,\n useState,\n type ReactElement,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Slot } from \"radix-ui\";\nimport React from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\n\nexport namespace ComposerPrimitiveAttachmentDropzone {\n export type Element = HTMLDivElement;\n export type Props = React.HTMLAttributes<HTMLDivElement> & {\n asChild?: boolean | undefined;\n render?: ReactElement | undefined;\n disabled?: boolean | undefined;\n };\n}\n\nexport const ComposerPrimitiveAttachmentDropzone = forwardRef<\n HTMLDivElement,\n ComposerPrimitiveAttachmentDropzone.Props\n>(({ disabled, asChild = false, render, children, ...rest }, ref) => {\n const [isDragging, setIsDragging] = useState(false);\n const aui = useAui();\n\n const handleDragEnterCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(true);\n },\n [disabled],\n );\n\n const handleDragOverCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n if (!isDragging) setIsDragging(true);\n },\n [disabled, isDragging],\n );\n\n const handleDragLeaveCapture = useCallback(\n (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n const next = e.relatedTarget as Node | null;\n if (next && e.currentTarget.contains(next)) {\n return;\n }\n setIsDragging(false);\n },\n [disabled],\n );\n\n const handleDrop = useCallback(\n async (e: React.DragEvent) => {\n if (disabled) return;\n e.preventDefault();\n setIsDragging(false);\n for (const file of e.dataTransfer.files) {\n try {\n await aui.composer().addAttachment(file);\n } catch (error) {\n console.error(\"Failed to add attachment:\", error);\n }\n }\n },\n [disabled, aui],\n );\n\n const mergedProps = {\n ...(isDragging ? { \"data-dragging\": \"true\" } : null),\n ...rest,\n onDragEnterCapture: composeEventHandlers(\n rest.onDragEnterCapture,\n handleDragEnterCapture,\n ),\n onDragOverCapture: composeEventHandlers(\n rest.onDragOverCapture,\n handleDragOverCapture,\n ),\n onDragLeaveCapture: composeEventHandlers(\n rest.onDragLeaveCapture,\n handleDragLeaveCapture,\n ),\n onDropCapture: composeEventHandlers(rest.onDropCapture, handleDrop),\n ref,\n };\n\n if (render && isValidElement(render)) {\n const renderChildren =\n children !== undefined\n ? children\n : (render.props as Record<string, unknown>).children;\n return (\n <Slot.Root {...mergedProps}>\n {cloneElement(render, undefined, renderChildren as React.ReactNode)}\n </Slot.Root>\n );\n }\n\n const Comp = asChild ? Slot.Root : \"div\";\n return <Comp {...mergedProps}>{children}</Comp>;\n});\n\nComposerPrimitiveAttachmentDropzone.displayName =\n \"ComposerPrimitive.AttachmentDropzone\";\n","\"use client\";\n\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n ElementType,\n} from \"react\";\nimport { useMessagePartText } from \"./useMessagePartText\";\nimport { useSmooth } from \"../../utils/smooth/useSmooth\";\n\nexport namespace MessagePartPrimitiveText {\n export type Element = ComponentRef<typeof Primitive.span>;\n export type Props = Omit<\n ComponentPropsWithoutRef<typeof Primitive.span>,\n \"children\" | \"asChild\"\n > & {\n /**\n * Whether to enable smooth text streaming animation.\n * When enabled, text appears with a typing effect as it streams in.\n * @default true\n */\n smooth?: boolean;\n /**\n * The HTML element or React component to render as.\n * @default \"span\"\n */\n component?: ElementType;\n };\n}\n\n/**\n * Renders the text content of a message part with optional smooth streaming.\n *\n * This component displays text content from the current message part context,\n * with support for smooth streaming animation that shows text appearing\n * character by character as it's generated.\n *\n * @example\n * ```tsx\n * <MessagePartPrimitive.Text\n * smooth={true}\n * component=\"p\"\n * className=\"message-text\"\n * />\n * ```\n */\nexport const MessagePartPrimitiveText = forwardRef<\n MessagePartPrimitiveText.Element,\n MessagePartPrimitiveText.Props\n>(({ smooth = true, component: Component = \"span\", ...rest }, forwardedRef) => {\n const { text, status } = useSmooth(useMessagePartText(), smooth);\n\n return (\n <Component data-status={status.type} {...rest} ref={forwardedRef}>\n {text}\n </Component>\n );\n});\n\nMessagePartPrimitiveText.displayName = \"MessagePartPrimitive.Text\";\n","\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { useActionBarCopy } from \"@assistant-ui/core/react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\n/**\n * Hook that provides copy functionality for action bar buttons.\n *\n * This hook returns a callback function that copies message content to the clipboard,\n * or null if copying is not available. It handles both regular message content and\n * composer text when in editing mode.\n *\n * @param options Configuration options\n * @param options.copiedDuration Duration in milliseconds to show the copied state\n * @returns A copy callback function, or null if copying is disabled\n *\n * @example\n * ```tsx\n * function CustomCopyButton() {\n * const copy = useActionBarPrimitiveCopy({ copiedDuration: 2000 });\n *\n * return (\n * <button onClick={copy} disabled={!copy}>\n * {copy ? \"Copy\" : \"Cannot Copy\"}\n * </button>\n * );\n * }\n * ```\n */\nconst useActionBarPrimitiveCopy = ({\n copiedDuration = 3000,\n}: {\n copiedDuration?: number | undefined;\n} = {}) => {\n const { copy, disabled } = useActionBarCopy({\n copiedDuration,\n copyToClipboard: (text) => navigator.clipboard.writeText(text),\n });\n if (disabled) return null;\n return copy;\n};\n\nexport namespace ActionBarPrimitiveCopy {\n export type Element = HTMLButtonElement;\n /**\n * Props for the ActionBarPrimitive.Copy component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useActionBarPrimitiveCopy>;\n}\n\n/**\n * A button component that copies message content to the clipboard.\n *\n * This component automatically handles copying message text to the clipboard\n * and provides visual feedback through the data-copied attribute. It's disabled\n * when there's no copyable content available.\n *\n * @example\n * ```tsx\n * <ActionBarPrimitive.Copy copiedDuration={2000}>\n * Copy Message\n * </ActionBarPrimitive.Copy>\n * ```\n */\nexport const ActionBarPrimitiveCopy = forwardRef<\n ActionBarPrimitiveCopy.Element,\n ActionBarPrimitiveCopy.Props\n>(({ copiedDuration, onClick, disabled, ...props }, forwardedRef) => {\n const isCopied = useAuiState((s) => s.message.isCopied);\n const callback = useActionBarPrimitiveCopy({ copiedDuration });\n return (\n <Primitive.button\n type=\"button\"\n {...(isCopied ? { \"data-copied\": \"true\" } : {})}\n {...props}\n ref={forwardedRef}\n disabled={disabled || !callback}\n onClick={composeEventHandlers(onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveCopy.displayName = \"ActionBarPrimitive.Copy\";\n","\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useActionBarFeedbackNegative as useActionBarFeedbackNegativeBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarFeedbackNegative = () => {\n const { submit } = useActionBarFeedbackNegativeBehavior();\n return submit;\n};\n\nexport namespace ActionBarPrimitiveFeedbackNegative {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarFeedbackNegative>;\n}\n\nexport const ActionBarPrimitiveFeedbackNegative = forwardRef<\n ActionBarPrimitiveFeedbackNegative.Element,\n ActionBarPrimitiveFeedbackNegative.Props\n>(({ onClick, disabled, ...props }, forwardedRef) => {\n const isSubmitted = useAuiState(\n (s) => s.message.metadata.submittedFeedback?.type === \"negative\",\n );\n const callback = useActionBarFeedbackNegative();\n return (\n <Primitive.button\n type=\"button\"\n {...(isSubmitted ? { \"data-submitted\": \"true\" } : {})}\n {...props}\n ref={forwardedRef}\n disabled={disabled || !callback}\n onClick={composeEventHandlers(onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveFeedbackNegative.displayName =\n \"ActionBarPrimitive.FeedbackNegative\";\n","\"use client\";\n\nimport { forwardRef, useCallback } from \"react\";\nimport { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\n\nconst useActionBarExportMarkdown = ({\n filename,\n onExport,\n}: {\n filename?: string | undefined;\n onExport?: ((content: string) => void | Promise<void>) | undefined;\n} = {}) => {\n const aui = useAui();\n const hasExportableContent = useAuiState((s) => {\n return (\n (s.message.role !== \"assistant\" ||\n s.message.status?.type !== \"running\") &&\n s.message.parts.some((c) => c.type === \"text\" && c.text.length > 0)\n );\n });\n\n const callback = useCallback(async () => {\n const content = aui.message().getCopyText();\n if (!content) return;\n\n if (onExport) {\n await onExport(content);\n return;\n }\n\n const blob = new Blob([content], { type: \"text/markdown\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = filename ?? `message-${Date.now()}.md`;\n a.click();\n URL.revokeObjectURL(url);\n }, [aui, filename, onExport]);\n\n if (!hasExportableContent) return null;\n return callback;\n};\n\nexport namespace ActionBarPrimitiveExportMarkdown {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarExportMarkdown>;\n}\n\nexport const ActionBarPrimitiveExportMarkdown = forwardRef<\n ActionBarPrimitiveExportMarkdown.Element,\n ActionBarPrimitiveExportMarkdown.Props\n>(({ filename, onExport, onClick, disabled, ...props }, forwardedRef) => {\n const callback = useActionBarExportMarkdown({ filename, onExport });\n return (\n <Primitive.button\n type=\"button\"\n {...props}\n ref={forwardedRef}\n disabled={disabled || !callback}\n onClick={composeEventHandlers(onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveExportMarkdown.displayName =\n \"ActionBarPrimitive.ExportMarkdown\";\n","\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { ActionButtonProps } from \"../../utils/createActionButton\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport { useActionBarFeedbackPositive as useActionBarFeedbackPositiveBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarFeedbackPositive = () => {\n const { submit } = useActionBarFeedbackPositiveBehavior();\n return submit;\n};\n\nexport namespace ActionBarPrimitiveFeedbackPositive {\n export type Element = HTMLButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarFeedbackPositive>;\n}\n\nexport const ActionBarPrimitiveFeedbackPositive = forwardRef<\n ActionBarPrimitiveFeedbackPositive.Element,\n ActionBarPrimitiveFeedbackPositive.Props\n>(({ onClick, disabled, ...props }, forwardedRef) => {\n const isSubmitted = useAuiState(\n (s) => s.message.metadata.submittedFeedback?.type === \"positive\",\n );\n const callback = useActionBarFeedbackPositive();\n return (\n <Primitive.button\n type=\"button\"\n {...(isSubmitted ? { \"data-submitted\": \"true\" } : {})}\n {...props}\n ref={forwardedRef}\n disabled={disabled || !callback}\n onClick={composeEventHandlers(onClick, () => {\n callback?.();\n })}\n />\n );\n});\n\nActionBarPrimitiveFeedbackPositive.displayName =\n \"ActionBarPrimitive.FeedbackPositive\";\n","\"use client\";\n\nimport {\n ComponentType,\n createContext,\n FC,\n forwardRef,\n PropsWithChildren,\n useContext,\n useState,\n} from \"react\";\nimport { ReadonlyStore } from \"../../context/ReadonlyStore\";\nimport { create, UseBoundStore } from \"zustand\";\nimport type {\n MessagePartStatus,\n ToolCallMessagePartStatus,\n} from \"@assistant-ui/core\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { createContextStoreHook } from \"../../context/react/utils/createContextStoreHook\";\n\ntype SmoothContextValue = {\n useSmoothStatus: UseBoundStore<\n ReadonlyStore<MessagePartStatus | ToolCallMessagePartStatus>\n >;\n};\n\nconst SmoothContext = createContext<SmoothContextValue | null>(null);\n\nconst makeSmoothContext = (\n initialState: MessagePartStatus | ToolCallMessagePartStatus,\n) => {\n const useSmoothStatus = create(() => initialState);\n return { useSmoothStatus };\n};\n\nexport const SmoothContextProvider: FC<PropsWithChildren> = ({ children }) => {\n const outer = useSmoothContext({ optional: true });\n const aui = useAui();\n\n const [context] = useState(() =>\n makeSmoothContext(aui.part().getState().status),\n );\n\n // do not wrap if there is an outer SmoothContextProvider\n if (outer) return children;\n\n return (\n <SmoothContext.Provider value={context}>{children}</SmoothContext.Provider>\n );\n};\n\nexport const withSmoothContextProvider = <C extends ComponentType<any>>(\n Component: C,\n): C => {\n const Wrapped = forwardRef((props, ref) => {\n return (\n <SmoothContextProvider>\n <Component {...(props as any)} ref={ref} />\n </SmoothContextProvider>\n );\n });\n Wrapped.displayName = Component.displayName;\n return Wrapped as any;\n};\n\nfunction useSmoothContext(options?: {\n optional?: false | undefined;\n}): SmoothContextValue;\nfunction useSmoothContext(options?: {\n optional?: boolean | undefined;\n}): SmoothContextValue | null;\nfunction useSmoothContext(options?: { optional?: boolean | undefined }) {\n const context = useContext(SmoothContext);\n if (!options?.optional && !context)\n throw new Error(\n \"This component must be used within a SmoothContextProvider.\",\n );\n return context;\n}\n\nexport const { useSmoothStatus, useSmoothStatusStore } = createContextStoreHook(\n useSmoothContext,\n \"useSmoothStatus\",\n);\n","\"use client\";\n\nimport { useCallback } from \"react\";\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerSend as useComposerSendBehavior } from \"@assistant-ui/core/react\";\n\nexport const useComposerSend = () => {\n const { disabled, send } = useComposerSendBehavior();\n const callback = useCallback(() => send(), [send]);\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveSend {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Send component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerSend>;\n}\n\n/**\n * A button component that sends the current message in the composer.\n *\n * This component automatically handles the send functionality and is disabled\n * when sending is not available (e.g., when the thread is running, the composer\n * is empty, or not in editing mode).\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Send>\n * Send Message\n * </ComposerPrimitive.Send>\n * ```\n */\nexport const ComposerPrimitiveSend = createActionButton(\n \"ComposerPrimitive.Send\",\n useComposerSend,\n);\n","import React from 'react';\nimport { shallow } from 'zustand/vanilla/shallow';\n\nfunction useShallow(selector) {\n const prev = React.useRef(void 0);\n return (state) => {\n const next = selector(state);\n return shallow(prev.current, next) ? prev.current : prev.current = next;\n };\n}\n\nexport { useShallow };\n","import React from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\n\nvar useLatest = function useLatest(value) {\n var ref = React.useRef(value);\n useIsomorphicLayoutEffect(function () {\n ref.current = value;\n });\n return ref;\n};\n\nexport { useLatest as default };\n","\"use client\";\n\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport enum HideAndFloatStatus {\n Hidden = \"hidden\",\n Floating = \"floating\",\n Normal = \"normal\",\n}\n\nexport type UseActionBarFloatStatusProps = {\n hideWhenRunning?: boolean | undefined;\n autohide?: \"always\" | \"not-last\" | \"never\" | undefined;\n autohideFloat?: \"always\" | \"single-branch\" | \"never\" | undefined;\n forceVisible?: boolean | undefined;\n};\n\nexport const useActionBarFloatStatus = ({\n hideWhenRunning,\n autohide,\n autohideFloat,\n forceVisible,\n}: UseActionBarFloatStatusProps) => {\n return useAuiState((s) => {\n if (hideWhenRunning && s.thread.isRunning) return HideAndFloatStatus.Hidden;\n\n const autohideEnabled =\n autohide === \"always\" || (autohide === \"not-last\" && !s.message.isLast);\n const isVisibleByInteraction = forceVisible || s.message.isHovering;\n\n // normal status\n if (!autohideEnabled) return HideAndFloatStatus.Normal;\n\n // hidden status\n if (!isVisibleByInteraction) return HideAndFloatStatus.Hidden;\n\n // floating status\n if (\n autohideFloat === \"always\" ||\n (autohideFloat === \"single-branch\" && s.message.branchCount <= 1)\n )\n return HideAndFloatStatus.Floating;\n\n return HideAndFloatStatus.Normal;\n });\n};\n","\"use client\";\n\nimport type {\n TextMessagePart,\n ReasoningMessagePart,\n MessagePartState,\n} from \"@assistant-ui/core\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport const useMessagePartText = () => {\n const text = useAuiState((s) => {\n if (s.part.type !== \"text\" && s.part.type !== \"reasoning\")\n throw new Error(\n \"MessagePartText can only be used inside text or reasoning message parts.\",\n );\n\n return s.part as MessagePartState &\n (TextMessagePart | ReasoningMessagePart);\n });\n\n return text;\n};\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\nexport type ActionBarInteractionContextValue = {\n acquireInteractionLock: () => () => void;\n};\n\nexport const ActionBarInteractionContext =\n createContext<ActionBarInteractionContextValue | null>(null);\n\nexport const useActionBarInteractionContext = () =>\n useContext(ActionBarInteractionContext);\n","\"use client\";\n\nimport { FC, PropsWithChildren } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport namespace MessagePartPrimitiveInProgress {\n export type Props = PropsWithChildren;\n}\n\n// TODO should this be renamed to IsRunning?\nexport const MessagePartPrimitiveInProgress: FC<\n MessagePartPrimitiveInProgress.Props\n> = ({ children }) => {\n const isInProgress = useAuiState((s) => s.part.status.type === \"running\");\n\n return isInProgress ? children : null;\n};\n\nMessagePartPrimitiveInProgress.displayName = \"MessagePartPrimitive.InProgress\";\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useSuggestionTrigger as useSuggestionTriggerBehavior } from \"@assistant-ui/core/react\";\n\nconst useThreadSuggestion = ({\n prompt,\n send,\n clearComposer,\n autoSend,\n method: _method,\n}: {\n /** The suggestion prompt. */\n prompt: string;\n\n /**\n * When true, automatically sends the message.\n * When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`.\n */\n send?: boolean | undefined;\n\n /**\n * Whether to clear the composer after sending.\n * When send is set to false, determines if composer text is replaced with suggestion (true, default),\n * or if it's appended to the composer text (false).\n *\n * @default true\n */\n clearComposer?: boolean | undefined;\n\n /** @deprecated Use `send` instead. */\n autoSend?: boolean | undefined;\n\n /** @deprecated Use `clearComposer` instead. */\n method?: \"replace\";\n}) => {\n // ========== Deprecation Mapping ==========\n const resolvedSend = send ?? autoSend ?? false;\n // ==========================================\n\n const { disabled, trigger } = useSuggestionTriggerBehavior({\n prompt,\n send: resolvedSend,\n clearComposer,\n });\n if (disabled) return null;\n return trigger;\n};\n\nexport namespace ThreadPrimitiveSuggestion {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadSuggestion>;\n}\n\nexport const ThreadPrimitiveSuggestion = createActionButton(\n \"ThreadPrimitive.Suggestion\",\n useThreadSuggestion,\n [\"prompt\", \"send\", \"clearComposer\", \"autoSend\", \"method\"],\n);\n","import { type FC, type PropsWithChildren } from \"react\";\nimport { useAui, useAuiState, AuiProvider } from \"@assistant-ui/store\";\nimport { ChainOfThoughtClient } from \"../../store/clients/chain-of-thought-client\";\nimport type { ChainOfThoughtPart } from \"../../store/scopes/chain-of-thought\";\n\nexport const ChainOfThoughtByIndicesProvider: FC<\n PropsWithChildren<{\n startIndex: number;\n endIndex: number;\n }>\n> = ({ startIndex, endIndex, children }) => {\n const parts = useAuiState((s) => s.message.parts).slice(\n startIndex,\n endIndex + 1,\n ) as ChainOfThoughtPart[];\n\n const parentAui = useAui();\n\n const aui = useAui({\n chainOfThought: ChainOfThoughtClient({\n parts,\n getMessagePart: ({ index }) => {\n if (index < 0 || index >= parts.length) {\n throw new Error(\n `ChainOfThought part index ${index} is out of bounds (0..${parts.length - 1})`,\n );\n }\n return parentAui.message().part({ index: startIndex + index });\n },\n }),\n });\n\n return <AuiProvider value={aui}>{children}</AuiProvider>;\n};\n","import {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n PropsWithChildren,\n useMemo,\n} from \"react\";\nimport {\n RenderChildrenWithAccessor,\n useAuiState,\n useAui,\n} from \"@assistant-ui/store\";\nimport type { PartState } from \"../../../store/scopes/part\";\nimport { PartByIndexProvider } from \"../../providers/PartByIndexProvider\";\nimport { TextMessagePartProvider } from \"../../providers/TextMessagePartProvider\";\nimport { ChainOfThoughtByIndicesProvider } from \"../../providers/ChainOfThoughtByIndicesProvider\";\nimport { getMessageQuote } from \"../../utils/getMessageQuote\";\nimport type {\n Unstable_AudioMessagePartComponent,\n DataMessagePartComponent,\n DataMessagePartProps,\n EmptyMessagePartComponent,\n TextMessagePartComponent,\n ImageMessagePartComponent,\n SourceMessagePartComponent,\n ToolCallMessagePartComponent,\n ToolCallMessagePartProps,\n FileMessagePartComponent,\n ReasoningMessagePartComponent,\n ReasoningGroupComponent,\n QuoteMessagePartComponent,\n} from \"../../types/MessagePartComponentTypes\";\nimport type { MessagePartStatus } from \"../../../types/message\";\nimport { useShallow } from \"zustand/shallow\";\n\ntype MessagePartRange =\n | { type: \"single\"; index: number }\n | { type: \"toolGroup\"; startIndex: number; endIndex: number }\n | { type: \"reasoningGroup\"; startIndex: number; endIndex: number }\n | { type: \"chainOfThoughtGroup\"; startIndex: number; endIndex: number };\n\n/**\n * Creates a group state manager for a specific part type.\n * Returns functions to start, end, and finalize groups.\n */\nconst createGroupState = <\n T extends \"toolGroup\" | \"reasoningGroup\" | \"chainOfThoughtGroup\",\n>(\n groupType: T,\n) => {\n let start = -1;\n\n return {\n startGroup: (index: number) => {\n if (start === -1) {\n start = index;\n }\n },\n endGroup: (endIndex: number, ranges: MessagePartRange[]) => {\n if (start !== -1) {\n ranges.push({\n type: groupType,\n startIndex: start,\n endIndex,\n } as MessagePartRange);\n start = -1;\n }\n },\n finalize: (endIndex: number, ranges: MessagePartRange[]) => {\n if (start !== -1) {\n ranges.push({\n type: groupType,\n startIndex: start,\n endIndex,\n } as MessagePartRange);\n }\n },\n };\n};\n\n/**\n * Groups consecutive tool-call and reasoning message parts into ranges.\n * Always groups tool calls and reasoning parts, even if there's only one.\n * When useChainOfThought is true, groups tool-call and reasoning parts together.\n */\nconst groupMessageParts = (\n messageTypes: readonly string[],\n useChainOfThought: boolean,\n): MessagePartRange[] => {\n const ranges: MessagePartRange[] = [];\n\n if (useChainOfThought) {\n const chainOfThoughtGroup = createGroupState(\"chainOfThoughtGroup\");\n\n for (let i = 0; i < messageTypes.length; i++) {\n const type = messageTypes[i];\n\n if (type === \"tool-call\" || type === \"reasoning\") {\n chainOfThoughtGroup.startGroup(i);\n } else {\n chainOfThoughtGroup.endGroup(i - 1, ranges);\n ranges.push({ type: \"single\", index: i });\n }\n }\n\n chainOfThoughtGroup.finalize(messageTypes.length - 1, ranges);\n } else {\n const toolGroup = createGroupState(\"toolGroup\");\n const reasoningGroup = createGroupState(\"reasoningGroup\");\n\n for (let i = 0; i < messageTypes.length; i++) {\n const type = messageTypes[i];\n\n if (type === \"tool-call\") {\n reasoningGroup.endGroup(i - 1, ranges);\n toolGroup.startGroup(i);\n } else if (type === \"reasoning\") {\n toolGroup.endGroup(i - 1, ranges);\n reasoningGroup.startGroup(i);\n } else {\n toolGroup.endGroup(i - 1, ranges);\n reasoningGroup.endGroup(i - 1, ranges);\n ranges.push({ type: \"single\", index: i });\n }\n }\n\n toolGroup.finalize(messageTypes.length - 1, ranges);\n reasoningGroup.finalize(messageTypes.length - 1, ranges);\n }\n\n return ranges;\n};\n\nconst useMessagePartsGroups = (\n useChainOfThought: boolean,\n): MessagePartRange[] => {\n const messageTypes = useAuiState(\n useShallow((s) => s.message.parts.map((c: any) => c.type)),\n );\n\n return useMemo(() => {\n if (messageTypes.length === 0) {\n return [];\n }\n return groupMessageParts(messageTypes, useChainOfThought);\n }, [messageTypes, useChainOfThought]);\n};\n\nexport namespace MessagePrimitiveParts {\n type DataConfig = {\n /** Map data event names to specific components */\n by_name?: Record<string, DataMessagePartComponent | undefined> | undefined;\n /** Fallback component for unmatched data events */\n Fallback?: DataMessagePartComponent | undefined;\n };\n\n type BaseComponents = {\n /** Component for rendering empty messages */\n Empty?: EmptyMessagePartComponent | undefined;\n /** Component for rendering text content */\n Text?: TextMessagePartComponent | undefined;\n /** Component for rendering source content */\n Source?: SourceMessagePartComponent | undefined;\n /** Component for rendering image content */\n Image?: ImageMessagePartComponent | undefined;\n /** Component for rendering file content */\n File?: FileMessagePartComponent | undefined;\n /** Component for rendering audio content (experimental) */\n Unstable_Audio?: Unstable_AudioMessagePartComponent | undefined;\n /** Configuration for data part rendering */\n data?: DataConfig | undefined;\n /** Component for rendering a quoted message reference (from metadata, not parts) */\n Quote?: QuoteMessagePartComponent | undefined;\n };\n\n type ToolsConfig =\n | {\n /** Map of tool names to their specific components */\n by_name?:\n | Record<string, ToolCallMessagePartComponent | undefined>\n | undefined;\n /** Fallback component for unregistered tools */\n Fallback?: ComponentType<ToolCallMessagePartProps> | undefined;\n }\n | {\n /** Override component that handles all tool calls */\n Override: ComponentType<ToolCallMessagePartProps>;\n };\n\n /**\n * Standard component configuration for rendering reasoning and tool-call parts\n * individually (with optional grouping).\n *\n * Cannot be combined with `ChainOfThought`.\n */\n type StandardComponents = BaseComponents & {\n /** Component for rendering reasoning content (typically hidden) */\n Reasoning?: ReasoningMessagePartComponent | undefined;\n /** Configuration for tool call rendering */\n tools?: ToolsConfig | undefined;\n\n /**\n * Component for rendering grouped consecutive tool calls.\n *\n * @param startIndex - Index of the first tool call in the group\n * @param endIndex - Index of the last tool call in the group\n * @param children - Rendered tool call components to display within the group\n *\n * @deprecated This feature is still experimental and subject to change.\n */\n ToolGroup?: ComponentType<\n PropsWithChildren<{ startIndex: number; endIndex: number }>\n >;\n\n /**\n * Component for rendering grouped reasoning parts.\n *\n * @param startIndex - Index of the first reasoning part in the group\n * @param endIndex - Index of the last reasoning part in the group\n * @param children - Rendered reasoning part components\n */\n ReasoningGroup?: ReasoningGroupComponent;\n\n ChainOfThought?: never;\n };\n\n /**\n * Chain of thought component configuration.\n *\n * When `ChainOfThought` is set, it takes control of rendering ALL reasoning and\n * tool-call parts in the message. The `Reasoning`, `tools`, `ReasoningGroup`, and\n * `ToolGroup` components cannot be used alongside it.\n */\n type ChainOfThoughtComponents = BaseComponents & {\n ChainOfThought: ComponentType;\n\n Reasoning?: never;\n tools?: never;\n ToolGroup?: never;\n ReasoningGroup?: never;\n };\n\n export type Props =\n | {\n /**\n * Component configuration for rendering different types of message content.\n *\n * Use either `Reasoning`/`tools`/`ToolGroup`/`ReasoningGroup` for standard rendering,\n * or `ChainOfThought` to group all reasoning and tool-call parts into a single\n * collapsible component. These two modes are mutually exclusive.\n */\n components?: StandardComponents | ChainOfThoughtComponents | undefined;\n /**\n * When enabled, shows the Empty component if the last part in the message\n * is anything other than Text or Reasoning.\n *\n * @experimental This API is experimental and may change in future versions.\n * @default true\n */\n unstable_showEmptyOnNonTextEnd?: boolean | undefined;\n children?: never;\n }\n | {\n /** Render function called for each part. Receives the enriched part state. */\n children: (value: { part: EnrichedPartState }) => ReactNode;\n components?: never;\n unstable_showEmptyOnNonTextEnd?: never;\n };\n}\n\nconst ToolUIDisplay = ({\n Fallback,\n ...props\n}: {\n Fallback: ToolCallMessagePartComponent | undefined;\n} & ToolCallMessagePartProps) => {\n const Render = useAuiState((s) => {\n const Render = s.tools.tools[props.toolName] ?? Fallback;\n if (Array.isArray(Render)) return Render[0] ?? Fallback;\n return Render;\n });\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst DataUIDisplay = ({\n Fallback,\n ...props\n}: {\n Fallback: DataMessagePartComponent | undefined;\n} & DataMessagePartProps) => {\n const Render = useAuiState((s) => {\n const Render = s.dataRenderers.renderers[props.name] ?? Fallback;\n if (Array.isArray(Render)) return Render[0] ?? Fallback;\n return Render;\n });\n if (!Render) return null;\n return <Render {...props} />;\n};\n\n/**\n * Platform-agnostic no-op default components.\n * Each platform (web, RN) wraps MessagePrimitiveParts with its own defaults.\n */\nexport const defaultComponents = {\n Text: () => null,\n Reasoning: () => null,\n Source: () => null,\n Image: () => null,\n File: () => null,\n Unstable_Audio: () => null,\n ToolGroup: ({ children }: PropsWithChildren) => children,\n ReasoningGroup: ({ children }: PropsWithChildren) => children,\n} satisfies MessagePrimitiveParts.Props[\"components\"];\n\ntype MessagePartComponentProps = {\n components: MessagePrimitiveParts.Props[\"components\"];\n};\n\nexport const MessagePartComponent: FC<MessagePartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Reasoning = defaultComponents.Reasoning,\n Image = defaultComponents.Image,\n Source = defaultComponents.Source,\n File = defaultComponents.File,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools = {},\n data,\n } = {},\n}) => {\n const aui = useAui();\n const part = useAuiState((s) => s.part);\n\n const type = part.type;\n if (type === \"tool-call\") {\n const addResult = aui.part().addToolResult;\n const resume = aui.part().resumeToolCall;\n if (\"Override\" in tools)\n return <tools.Override {...part} addResult={addResult} resume={resume} />;\n const Tool = tools.by_name?.[part.toolName] ?? tools.Fallback;\n return (\n <ToolUIDisplay\n {...part}\n Fallback={Tool}\n addResult={addResult}\n resume={resume}\n />\n );\n }\n\n if (part.status?.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n return <Text {...part} />;\n\n case \"reasoning\":\n return <Reasoning {...part} />;\n\n case \"source\":\n return <Source {...part} />;\n\n case \"image\":\n return <Image {...part} />;\n\n case \"file\":\n return <File {...part} />;\n\n case \"audio\":\n return <Audio {...part} />;\n\n case \"data\": {\n const Data = data?.by_name?.[part.name] ?? data?.Fallback;\n return <DataUIDisplay {...part} Fallback={Data} />;\n }\n\n default:\n console.warn(`Unknown message part type: ${type}`);\n return null;\n }\n};\n\nexport namespace MessagePrimitivePartByIndex {\n export type Props = {\n index: number;\n components: MessagePrimitiveParts.Props[\"components\"];\n };\n}\n\n/**\n * Renders a single message part at the specified index.\n */\nexport const MessagePrimitivePartByIndex: FC<MessagePrimitivePartByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <PartByIndexProvider index={index}>\n <MessagePartComponent components={components} />\n </PartByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Reasoning === next.components?.Reasoning &&\n prev.components?.Source === next.components?.Source &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.File === next.components?.File &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.tools === next.components?.tools &&\n prev.components?.data === next.components?.data &&\n prev.components?.ToolGroup === next.components?.ToolGroup &&\n prev.components?.ReasoningGroup === next.components?.ReasoningGroup,\n );\n\nMessagePrimitivePartByIndex.displayName = \"MessagePrimitive.PartByIndex\";\n\nconst EmptyPartFallback: FC<{\n status: MessagePartStatus;\n component: TextMessagePartComponent;\n}> = ({ status, component: Component }) => {\n return (\n <TextMessagePartProvider text=\"\" isRunning={status.type === \"running\"}>\n <Component type=\"text\" text=\"\" status={status} />\n </TextMessagePartProvider>\n );\n};\n\nconst COMPLETE_STATUS: MessagePartStatus = Object.freeze({\n type: \"complete\",\n});\n\nconst EmptyPartsImpl: FC<MessagePartComponentProps> = ({ components }) => {\n const status = useAuiState(\n (s) => (s.message.status ?? COMPLETE_STATUS) as MessagePartStatus,\n );\n\n if (components?.Empty) return <components.Empty status={status} />;\n\n if (status.type !== \"running\") return null;\n\n return (\n <EmptyPartFallback\n status={status}\n component={components?.Text ?? defaultComponents.Text}\n />\n );\n};\n\nconst EmptyParts = memo(\n EmptyPartsImpl,\n (prev, next) =>\n prev.components?.Empty === next.components?.Empty &&\n prev.components?.Text === next.components?.Text,\n);\n\nconst ConditionalEmptyImpl: FC<{\n components: MessagePrimitiveParts.Props[\"components\"];\n enabled: boolean;\n}> = ({ components, enabled }) => {\n const shouldShowEmpty = useAuiState((s) => {\n if (!enabled) return false;\n if (s.message.parts.length === 0) return false;\n\n const lastPart = s.message.parts[s.message.parts.length - 1];\n return lastPart?.type !== \"text\" && lastPart?.type !== \"reasoning\";\n });\n\n if (!shouldShowEmpty) return null;\n return <EmptyParts components={components} />;\n};\n\nconst ConditionalEmpty = memo(\n ConditionalEmptyImpl,\n (prev, next) =>\n prev.enabled === next.enabled &&\n prev.components?.Empty === next.components?.Empty &&\n prev.components?.Text === next.components?.Text,\n);\n\nconst QuoteRendererImpl: FC<{ Quote: QuoteMessagePartComponent }> = ({\n Quote,\n}) => {\n const quoteInfo = useAuiState(getMessageQuote);\n if (!quoteInfo) return null;\n return <Quote text={quoteInfo.text} messageId={quoteInfo.messageId} />;\n};\n\nconst QuoteRenderer = memo(QuoteRendererImpl);\n\n/**\n * Stable propless component that renders the registered tool UI for the\n * current part context. Reads tool registry and part state from context.\n */\nconst RegisteredToolUI: FC = () => {\n const aui = useAui();\n const part = useAuiState((s) => s.part);\n const Render = useAuiState((s) => {\n if (s.part.type !== \"tool-call\") return null;\n const entry = s.tools.tools[s.part.toolName];\n if (Array.isArray(entry)) return entry[0] ?? null;\n return entry ?? null;\n });\n\n if (!Render || part.type !== \"tool-call\") return null;\n\n return (\n <Render\n {...part}\n addResult={aui.part().addToolResult}\n resume={aui.part().resumeToolCall}\n />\n );\n};\n\n/**\n * Stable propless component that renders the registered data renderer UI\n * for the current part context.\n */\nconst RegisteredDataRendererUI: FC = () => {\n const part = useAuiState((s) => s.part);\n const Render = useAuiState((s) => {\n if (s.part.type !== \"data\") return null;\n const entry = s.dataRenderers.renderers[s.part.name];\n if (Array.isArray(entry)) return entry[0] ?? null;\n return entry ?? null;\n });\n\n if (!Render || part.type !== \"data\") return null;\n\n return <Render {...(part as DataMessagePartProps)} />;\n};\n\n/**\n * Fallback component rendered when the children render function returns null.\n * Renders registered tool/data UIs via context.\n * For all other part types, renders nothing.\n *\n * This allows users to write:\n * {({ part }) => {\n * if (part.type === \"text\") return <MyText />;\n * return null; // tool UIs and data UIs still render via registry\n * }}\n *\n * To explicitly render nothing (suppressing registered UIs), return <></>.\n */\nconst DefaultPartFallback: FC = () => {\n const partType = useAuiState((s) => s.part.type);\n\n if (partType === \"tool-call\") return <RegisteredToolUI />;\n if (partType === \"data\") return <RegisteredDataRendererUI />;\n\n return null;\n};\n\nexport type { PartState };\n\n/**\n * Enriched part state passed to children render functions.\n *\n * For tool-call parts, adds `toolUI`, `addResult`, and `resume`.\n * For data parts, adds `dataRendererUI`.\n */\nexport type EnrichedPartState =\n | (Extract<PartState, { type: \"tool-call\" }> & {\n /** The registered tool UI element, or null if none registered. */\n readonly toolUI: ReactNode;\n /** Add a tool result to this tool call. */\n addResult: ToolCallMessagePartProps[\"addResult\"];\n /** Resume a tool call waiting for human input. */\n resume: ToolCallMessagePartProps[\"resume\"];\n })\n | (Extract<PartState, { type: \"data\" }> & {\n /** The registered data renderer UI element, or null if none registered. */\n readonly dataRendererUI: ReactNode;\n })\n | Exclude<PartState, { type: \"tool-call\" } | { type: \"data\" }>;\n\nconst MessagePrimitivePartsInner: FC<{\n children: (value: { part: EnrichedPartState }) => ReactNode;\n}> = ({ children }) => {\n const aui = useAui();\n const contentLength = useAuiState((s) => s.message.parts.length);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: aui accessors are stable refs\n return useMemo(\n () =>\n Array.from({ length: contentLength }, (_, index) => (\n <PartByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) => aui.message().part({ index }).getState()}\n >\n {(getItem) => {\n const result = children({\n get part() {\n const state = getItem();\n if (state.type === \"tool-call\") {\n const entry = aui.tools().getState().tools[state.toolName];\n const hasUI = Array.isArray(entry) ? !!entry[0] : !!entry;\n const partMethods = aui.message().part({ index });\n return {\n ...state,\n toolUI: hasUI ? <RegisteredToolUI /> : null,\n addResult: partMethods.addToolResult,\n resume: partMethods.resumeToolCall,\n };\n }\n if (state.type === \"data\") {\n const entry = aui.dataRenderers().getState().renderers[\n state.name\n ];\n const hasUI = Array.isArray(entry) ? !!entry[0] : !!entry;\n return {\n ...state,\n dataRendererUI: hasUI ? (\n <RegisteredDataRendererUI />\n ) : null,\n };\n }\n return state;\n },\n });\n if (result !== null) return result;\n return <DefaultPartFallback />;\n }}\n </RenderChildrenWithAccessor>\n </PartByIndexProvider>\n )),\n [contentLength, children],\n );\n};\n\n/**\n * Renders the parts of a message with support for multiple content types.\n *\n * This is the platform-agnostic base. Each platform wraps this with its own\n * default components (web uses `<p>`, `<span>`; RN would use `<Text>`, etc.).\n */\nexport const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = ({\n components,\n unstable_showEmptyOnNonTextEnd = true,\n children,\n}) => {\n if (children) {\n return <MessagePrimitivePartsInner>{children}</MessagePrimitivePartsInner>;\n }\n return (\n <MessagePrimitivePartsCompat\n components={components}\n unstable_showEmptyOnNonTextEnd={unstable_showEmptyOnNonTextEnd}\n />\n );\n};\n\nMessagePrimitiveParts.displayName = \"MessagePrimitive.Parts\";\n\nconst MessagePrimitivePartsCompat: FC<{\n components: MessagePrimitiveParts.Props[\"components\"];\n unstable_showEmptyOnNonTextEnd: boolean;\n}> = ({ components, unstable_showEmptyOnNonTextEnd }) => {\n const contentLength = useAuiState((s) => s.message.parts.length);\n const useChainOfThought = !!components?.ChainOfThought;\n const messageRanges = useMessagePartsGroups(useChainOfThought);\n\n const partsElements = useMemo(() => {\n if (contentLength === 0) {\n return <EmptyParts components={components} />;\n }\n\n return messageRanges.map((range) => {\n if (range.type === \"single\") {\n return (\n <MessagePrimitivePartByIndex\n key={range.index}\n index={range.index}\n components={components}\n />\n );\n } else if (range.type === \"chainOfThoughtGroup\") {\n const ChainOfThoughtComponent = components?.ChainOfThought;\n if (!ChainOfThoughtComponent) return null;\n return (\n <ChainOfThoughtByIndicesProvider\n key={`chainOfThought-${range.startIndex}`}\n startIndex={range.startIndex}\n endIndex={range.endIndex}\n >\n <ChainOfThoughtComponent />\n </ChainOfThoughtByIndicesProvider>\n );\n } else if (range.type === \"toolGroup\") {\n const ToolGroupComponent =\n components?.ToolGroup ?? defaultComponents.ToolGroup;\n return (\n <ToolGroupComponent\n key={`tool-${range.startIndex}`}\n startIndex={range.startIndex}\n endIndex={range.endIndex}\n >\n {Array.from(\n { length: range.endIndex - range.startIndex + 1 },\n (_, i) => (\n <MessagePrimitivePartByIndex\n key={i}\n index={range.startIndex + i}\n components={components}\n />\n ),\n )}\n </ToolGroupComponent>\n );\n } else {\n // reasoningGroup\n const ReasoningGroupComponent =\n components?.ReasoningGroup ?? defaultComponents.ReasoningGroup;\n return (\n <ReasoningGroupComponent\n key={`reasoning-${range.startIndex}`}\n startIndex={range.startIndex}\n endIndex={range.endIndex}\n >\n {Array.from(\n { length: range.endIndex - range.startIndex + 1 },\n (_, i) => (\n <MessagePrimitivePartByIndex\n key={i}\n index={range.startIndex + i}\n components={components}\n />\n ),\n )}\n </ReasoningGroupComponent>\n );\n }\n });\n }, [messageRanges, components, contentLength]);\n\n return (\n <>\n {components?.Quote && <QuoteRenderer Quote={components.Quote} />}\n {partsElements}\n <ConditionalEmpty\n components={components}\n enabled={unstable_showEmptyOnNonTextEnd}\n />\n </>\n );\n};\n","\"use client\";\n\nimport type { FC } from \"react\";\nimport {\n MessagePrimitiveParts as MessagePrimitivePartsBase,\n MessagePartComponent as MessagePartComponentBase,\n MessagePrimitivePartByIndex as MessagePrimitivePartByIndexBase,\n messagePartsDefaultComponents,\n} from \"@assistant-ui/core/react\";\nimport { MessagePartPrimitiveText } from \"../messagePart/MessagePartText\";\nimport { MessagePartPrimitiveImage } from \"../messagePart/MessagePartImage\";\nimport { MessagePartPrimitiveInProgress } from \"../messagePart/MessagePartInProgress\";\n\nconst webDefaultComponents = {\n ...messagePartsDefaultComponents,\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <MessagePartPrimitiveText />\n <MessagePartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </MessagePartPrimitiveInProgress>\n </p>\n ),\n Image: () => <MessagePartPrimitiveImage />,\n} satisfies MessagePrimitiveParts.Props[\"components\"];\n\nexport namespace MessagePrimitiveParts {\n export type Props = MessagePrimitivePartsBase.Props;\n}\n\n/**\n * Renders the parts of a message with web-specific default components.\n */\nexport const MessagePrimitiveParts: FC<MessagePrimitiveParts.Props> = (\n props,\n) => {\n if (\"children\" in props) {\n return (\n <MessagePrimitivePartsBase>{props.children}</MessagePrimitivePartsBase>\n );\n }\n\n const { components, ...rest } = props;\n const merged = components\n ? {\n Text: components.Text ?? webDefaultComponents.Text,\n Image: components.Image ?? webDefaultComponents.Image,\n Reasoning:\n components.Reasoning ?? messagePartsDefaultComponents.Reasoning,\n Source: components.Source ?? messagePartsDefaultComponents.Source,\n File: components.File ?? messagePartsDefaultComponents.File,\n Unstable_Audio:\n components.Unstable_Audio ??\n messagePartsDefaultComponents.Unstable_Audio,\n ...(\"ChainOfThought\" in components\n ? { ChainOfThought: components.ChainOfThought }\n : {\n tools: components.tools,\n data: components.data,\n ToolGroup:\n components.ToolGroup ?? messagePartsDefaultComponents.ToolGroup,\n ReasoningGroup:\n components.ReasoningGroup ??\n messagePartsDefaultComponents.ReasoningGroup,\n }),\n Empty: components.Empty,\n Quote: components.Quote,\n }\n : webDefaultComponents;\n\n return <MessagePrimitivePartsBase components={merged as any} {...rest} />;\n};\n\nMessagePrimitiveParts.displayName = \"MessagePrimitive.Parts\";\n\n// Re-export everything else unchanged\nexport {\n MessagePartComponentBase as MessagePartComponent,\n MessagePrimitivePartByIndexBase as MessagePrimitivePartByIndex,\n};\n","export { ThreadPrimitiveRoot as Root } from \"./thread/ThreadRoot\";\nexport { ThreadPrimitiveEmpty as Empty } from \"./thread/ThreadEmpty\";\nexport { ThreadPrimitiveIf as If } from \"./thread/ThreadIf\";\nexport { ThreadPrimitiveViewport as Viewport } from \"./thread/ThreadViewport\";\nexport { ThreadPrimitiveViewportProvider as ViewportProvider } from \"../context/providers/ThreadViewportProvider\";\nexport { ThreadPrimitiveViewportFooter as ViewportFooter } from \"./thread/ThreadViewportFooter\";\nexport { ThreadPrimitiveViewportSlack as ViewportSlack } from \"./thread/ThreadViewportSlack\";\nexport { ThreadPrimitiveMessages as Messages } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveMessageByIndex as MessageByIndex } from \"./thread/ThreadMessages\";\nexport { ThreadPrimitiveScrollToBottom as ScrollToBottom } from \"./thread/ThreadScrollToBottom\";\nexport { ThreadPrimitiveSuggestion as Suggestion } from \"./thread/ThreadSuggestion\";\nexport {\n ThreadPrimitiveSuggestions as Suggestions,\n ThreadPrimitiveSuggestionByIndex as SuggestionByIndex,\n} from \"./thread/ThreadSuggestions\";\n","import {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport { MessageByIndexProvider } from \"../../providers/MessageByIndexProvider\";\nimport { MessageState } from \"../../../store\";\n\ntype MessagesComponentConfig =\n | {\n /** Component used to render all message types */\n Message: ComponentType;\n /** Component used when editing any message type */\n EditComposer?: ComponentType | undefined;\n /** Component used when editing user messages specifically */\n UserEditComposer?: ComponentType | undefined;\n /** Component used when editing assistant messages specifically */\n AssistantEditComposer?: ComponentType | undefined;\n /** Component used when editing system messages specifically */\n SystemEditComposer?: ComponentType | undefined;\n /** Component used to render user messages specifically */\n UserMessage?: ComponentType | undefined;\n /** Component used to render assistant messages specifically */\n AssistantMessage?: ComponentType | undefined;\n /** Component used to render system messages specifically */\n SystemMessage?: ComponentType | undefined;\n }\n | {\n /** Component used to render all message types (fallback) */\n Message?: ComponentType | undefined;\n /** Component used when editing any message type */\n EditComposer?: ComponentType | undefined;\n /** Component used when editing user messages specifically */\n UserEditComposer?: ComponentType | undefined;\n /** Component used when editing assistant messages specifically */\n AssistantEditComposer?: ComponentType | undefined;\n /** Component used when editing system messages specifically */\n SystemEditComposer?: ComponentType | undefined;\n /** Component used to render user messages */\n UserMessage: ComponentType;\n /** Component used to render assistant messages */\n AssistantMessage: ComponentType;\n /** Component used to render system messages */\n SystemMessage?: ComponentType | undefined;\n };\n\nexport namespace ThreadPrimitiveMessages {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: MessagesComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each message. Receives the message. */\n children: (value: { message: MessageState }) => ReactNode;\n components?: never;\n };\n}\n\nconst isComponentsSame = (\n prev: MessagesComponentConfig,\n next: MessagesComponentConfig,\n) => {\n return (\n prev.Message === next.Message &&\n prev.EditComposer === next.EditComposer &&\n prev.UserEditComposer === next.UserEditComposer &&\n prev.AssistantEditComposer === next.AssistantEditComposer &&\n prev.SystemEditComposer === next.SystemEditComposer &&\n prev.UserMessage === next.UserMessage &&\n prev.AssistantMessage === next.AssistantMessage &&\n prev.SystemMessage === next.SystemMessage\n );\n};\n\nconst DEFAULT_SYSTEM_MESSAGE = () => null;\n\nconst getComponent = (\n components: MessagesComponentConfig,\n role: MessageState[\"role\"],\n isEditing: boolean,\n) => {\n switch (role) {\n case \"user\":\n if (isEditing) {\n return (\n components.UserEditComposer ??\n components.EditComposer ??\n components.UserMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return components.UserMessage ?? (components.Message as ComponentType);\n }\n case \"assistant\":\n if (isEditing) {\n return (\n components.AssistantEditComposer ??\n components.EditComposer ??\n components.AssistantMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.AssistantMessage ?? (components.Message as ComponentType)\n );\n }\n case \"system\":\n if (isEditing) {\n return (\n components.SystemEditComposer ??\n components.EditComposer ??\n components.SystemMessage ??\n (components.Message as ComponentType)\n );\n } else {\n return (\n components.SystemMessage ??\n (components.Message as ComponentType) ??\n DEFAULT_SYSTEM_MESSAGE\n );\n }\n default:\n const _exhaustiveCheck: never = role;\n throw new Error(`Unknown message role: ${_exhaustiveCheck}`);\n }\n};\n\ntype ThreadMessageComponentProps = {\n components: MessagesComponentConfig;\n};\n\nconst ThreadMessageComponent: FC<ThreadMessageComponentProps> = ({\n components,\n}) => {\n const role = useAuiState((s) => s.message.role);\n const isEditing = useAuiState((s) => s.message.composer.isEditing);\n const Component = getComponent(components, role, isEditing);\n\n return <Component />;\n};\nexport namespace ThreadPrimitiveMessageByIndex {\n export type Props = {\n index: number;\n components: MessagesComponentConfig;\n };\n}\n\n/**\n * Renders a single message at the specified index in the current thread.\n */\nexport const ThreadPrimitiveMessageByIndex: FC<ThreadPrimitiveMessageByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <MessageByIndexProvider index={index}>\n <ThreadMessageComponent components={components} />\n </MessageByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n isComponentsSame(prev.components, next.components),\n );\n\nThreadPrimitiveMessageByIndex.displayName = \"ThreadPrimitive.MessageByIndex\";\n\nconst ThreadPrimitiveMessagesInner: FC<{\n children: (value: { message: MessageState }) => ReactNode;\n}> = ({ children }) => {\n const messagesLength = useAuiState((s) => s.thread.messages.length);\n\n return useMemo(() => {\n if (messagesLength === 0) return null;\n return Array.from({ length: messagesLength }, (_, index) => (\n <MessageByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) => aui.thread().message({ index }).getState()}\n >\n {(getItem) =>\n children({\n get message() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </MessageByIndexProvider>\n ));\n }, [messagesLength, children]);\n};\n\n/**\n * Renders all messages in the current thread.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Messages>\n * {({ message }) => {\n * if (message.role === \"user\") return <MyUserMessage />;\n * return <MyAssistantMessage />;\n * }}\n * </ThreadPrimitive.Messages>\n * ```\n */\nexport const ThreadPrimitiveMessagesImpl: FC<ThreadPrimitiveMessages.Props> = ({\n components,\n children,\n}) => {\n if (components) {\n return (\n <ThreadPrimitiveMessagesInner>\n {() => <ThreadMessageComponent components={components} />}\n </ThreadPrimitiveMessagesInner>\n );\n }\n return (\n <ThreadPrimitiveMessagesInner>{children}</ThreadPrimitiveMessagesInner>\n );\n};\n\nThreadPrimitiveMessagesImpl.displayName = \"ThreadPrimitive.Messages\";\n\nexport const ThreadPrimitiveMessages = memo(\n ThreadPrimitiveMessagesImpl,\n (prev, next) => {\n if (prev.children || next.children) {\n return prev.children === next.children;\n }\n return isComponentsSame(prev.components!, next.components!);\n },\n);\n","import { type FC, type ReactNode, memo, useMemo } from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { QueueItemState } from \"../../../store/scopes/queue-item\";\nimport { QueueItemByIndexProvider } from \"../../providers/QueueItemByIndexProvider\";\n\nexport namespace ComposerPrimitiveQueue {\n export type Props = {\n /** Render function called for each queue item. Receives the queue item state. */\n children: (value: { queueItem: QueueItemState }) => ReactNode;\n };\n}\n\nconst ComposerPrimitiveQueueInner: FC<{\n children: (value: { queueItem: QueueItemState }) => ReactNode;\n}> = ({ children }) => {\n const queue = useAuiState((s) => s.composer.queue.length);\n\n return useMemo(\n () =>\n Array.from({ length: queue }, (_, index) => (\n <QueueItemByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.composer().queueItem({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get queueItem() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </QueueItemByIndexProvider>\n )),\n [queue, children],\n );\n};\n\n/**\n * Renders all queue items in the composer.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Queue>\n * {({ queueItem }) => (\n * <div>\n * <QueueItemPrimitive.Text />\n * <QueueItemPrimitive.Steer>Run Now</QueueItemPrimitive.Steer>\n * </div>\n * )}\n * </ComposerPrimitive.Queue>\n * ```\n */\nexport const ComposerPrimitiveQueue = memo(ComposerPrimitiveQueueInner);\n\nComposerPrimitiveQueue.displayName = \"ComposerPrimitive.Queue\";\n","import {\n type ComponentType,\n type FC,\n type ReactNode,\n memo,\n useMemo,\n} from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport type { SuggestionState } from \"../../../store/scopes/suggestion\";\nimport { SuggestionByIndexProvider } from \"../../providers/SuggestionByIndexProvider\";\n\ntype SuggestionsComponentConfig = {\n /** Component used to render each suggestion */\n Suggestion: ComponentType;\n};\n\nexport namespace ThreadPrimitiveSuggestions {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: SuggestionsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each suggestion. Receives the suggestion. */\n children: (value: { suggestion: SuggestionState }) => ReactNode;\n components?: never;\n };\n}\n\ntype SuggestionComponentProps = {\n components: SuggestionsComponentConfig;\n};\n\nconst SuggestionComponent: FC<SuggestionComponentProps> = ({ components }) => {\n const Component = components.Suggestion;\n return <Component />;\n};\n\nexport namespace ThreadPrimitiveSuggestionByIndex {\n export type Props = {\n index: number;\n components: SuggestionsComponentConfig;\n };\n}\n\n/**\n * Renders a single suggestion at the specified index.\n */\nexport const ThreadPrimitiveSuggestionByIndex: FC<ThreadPrimitiveSuggestionByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <SuggestionByIndexProvider index={index}>\n <SuggestionComponent components={components} />\n </SuggestionByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components.Suggestion === next.components.Suggestion,\n );\n\nThreadPrimitiveSuggestionByIndex.displayName =\n \"ThreadPrimitive.SuggestionByIndex\";\n\nconst ThreadPrimitiveSuggestionsInner: FC<{\n children: (value: { suggestion: SuggestionState }) => ReactNode;\n}> = ({ children }) => {\n const suggestionsLength = useAuiState(\n (s) => s.suggestions.suggestions.length,\n );\n\n return useMemo(() => {\n if (suggestionsLength === 0) return null;\n return Array.from({ length: suggestionsLength }, (_, index) => (\n <SuggestionByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.suggestions().suggestion({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get suggestion() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </SuggestionByIndexProvider>\n ));\n }, [suggestionsLength, children]);\n};\n\n/**\n * Renders all suggestions.\n */\nexport const ThreadPrimitiveSuggestionsImpl: FC<\n ThreadPrimitiveSuggestions.Props\n> = ({ components, children }) => {\n if (components) {\n return (\n <ThreadPrimitiveSuggestionsInner>\n {() => <SuggestionComponent components={components} />}\n </ThreadPrimitiveSuggestionsInner>\n );\n }\n return (\n <ThreadPrimitiveSuggestionsInner>\n {children}\n </ThreadPrimitiveSuggestionsInner>\n );\n};\n\nThreadPrimitiveSuggestionsImpl.displayName = \"ThreadPrimitive.Suggestions\";\n\nexport const ThreadPrimitiveSuggestions = memo(\n ThreadPrimitiveSuggestionsImpl,\n (prev, next) => {\n if (prev.children || next.children) {\n return prev.children === next.children;\n }\n return prev.components!.Suggestion === next.components!.Suggestion;\n },\n);\n","import type { CompleteAttachment } from \"../../../types/attachment\";\nimport { ComponentType, type FC, type ReactNode, memo, useMemo } from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport { MessageAttachmentByIndexProvider } from \"../../providers/AttachmentByIndexProvider\";\n\ntype MessageAttachmentsComponentConfig = {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n};\n\nexport namespace MessagePrimitiveAttachments {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: MessageAttachmentsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each attachment. Receives the attachment. */\n children: (value: { attachment: CompleteAttachment }) => ReactNode;\n components?: never;\n };\n}\n\nconst getComponent = (\n components: MessageAttachmentsComponentConfig | undefined,\n attachment: CompleteAttachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n return components?.Attachment;\n }\n};\n\nconst AttachmentComponent: FC<{\n components: MessageAttachmentsComponentConfig | undefined;\n}> = ({ components }) => {\n const attachment = useAuiState((s) => s.attachment);\n if (!attachment) return null;\n\n const Component = getComponent(components, attachment as CompleteAttachment);\n if (!Component) return null;\n return <Component />;\n};\n\nexport namespace MessagePrimitiveAttachmentByIndex {\n export type Props = {\n index: number;\n components?: MessageAttachmentsComponentConfig;\n };\n}\n\n/**\n * Renders a single attachment at the specified index within the current message.\n */\nexport const MessagePrimitiveAttachmentByIndex: FC<MessagePrimitiveAttachmentByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <MessageAttachmentByIndexProvider index={index}>\n <AttachmentComponent components={components} />\n </MessageAttachmentByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n );\n\nMessagePrimitiveAttachmentByIndex.displayName =\n \"MessagePrimitive.AttachmentByIndex\";\n\nconst MessagePrimitiveAttachmentsInner: FC<{\n children: (value: { attachment: CompleteAttachment }) => ReactNode;\n}> = ({ children }) => {\n const attachmentsCount = useAuiState((s) => {\n if (s.message.role !== \"user\") return 0;\n return s.message.attachments.length;\n });\n\n return useMemo(\n () =>\n Array.from({ length: attachmentsCount }, (_, index) => (\n <MessageAttachmentByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.message().attachment({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get attachment() {\n return getItem() as CompleteAttachment;\n },\n })\n }\n </RenderChildrenWithAccessor>\n </MessageAttachmentByIndexProvider>\n )),\n [attachmentsCount, children],\n );\n};\n\nexport const MessagePrimitiveAttachments: FC<\n MessagePrimitiveAttachments.Props\n> = ({ components, children }) => {\n if (components) {\n return (\n <MessagePrimitiveAttachmentsInner>\n {({ attachment }) => {\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n }}\n </MessagePrimitiveAttachmentsInner>\n );\n }\n return (\n <MessagePrimitiveAttachmentsInner>\n {children}\n </MessagePrimitiveAttachmentsInner>\n );\n};\n\nMessagePrimitiveAttachments.displayName = \"MessagePrimitive.Attachments\";\n","import type { Attachment } from \"../../../types/attachment\";\nimport { ComponentType, type FC, type ReactNode, memo, useMemo } from \"react\";\nimport { RenderChildrenWithAccessor, useAuiState } from \"@assistant-ui/store\";\nimport { ComposerAttachmentByIndexProvider } from \"../../providers/AttachmentByIndexProvider\";\n\ntype ComposerAttachmentsComponentConfig = {\n Image?: ComponentType | undefined;\n Document?: ComponentType | undefined;\n File?: ComponentType | undefined;\n Attachment?: ComponentType | undefined;\n};\n\nexport namespace ComposerPrimitiveAttachments {\n export type Props =\n | {\n /** @deprecated Use the children render function instead. */\n components: ComposerAttachmentsComponentConfig;\n children?: never;\n }\n | {\n /** Render function called for each attachment. Receives the attachment. */\n children: (value: { attachment: Attachment }) => ReactNode;\n components?: never;\n };\n}\n\nconst getComponent = (\n components: ComposerAttachmentsComponentConfig | undefined,\n attachment: Attachment,\n) => {\n const type = attachment.type;\n switch (type) {\n case \"image\":\n return components?.Image ?? components?.Attachment;\n case \"document\":\n return components?.Document ?? components?.Attachment;\n case \"file\":\n return components?.File ?? components?.Attachment;\n default:\n return components?.Attachment;\n }\n};\n\nconst AttachmentComponent: FC<{\n components: ComposerAttachmentsComponentConfig | undefined;\n}> = ({ components }) => {\n const attachment = useAuiState((s) => s.attachment);\n if (!attachment) return null;\n\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n};\n\nexport namespace ComposerPrimitiveAttachmentByIndex {\n export type Props = {\n index: number;\n components?: ComposerAttachmentsComponentConfig;\n };\n}\n\n/**\n * Renders a single attachment at the specified index within the composer.\n */\nexport const ComposerPrimitiveAttachmentByIndex: FC<ComposerPrimitiveAttachmentByIndex.Props> =\n memo(\n ({ index, components }) => {\n return (\n <ComposerAttachmentByIndexProvider index={index}>\n <AttachmentComponent components={components} />\n </ComposerAttachmentByIndexProvider>\n );\n },\n (prev, next) =>\n prev.index === next.index &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.Document === next.components?.Document &&\n prev.components?.File === next.components?.File &&\n prev.components?.Attachment === next.components?.Attachment,\n );\n\nComposerPrimitiveAttachmentByIndex.displayName =\n \"ComposerPrimitive.AttachmentByIndex\";\n\nconst ComposerPrimitiveAttachmentsInner: FC<{\n children: (value: { attachment: Attachment }) => ReactNode;\n}> = ({ children }) => {\n const attachmentsCount = useAuiState((s) => s.composer.attachments.length);\n\n return useMemo(\n () =>\n Array.from({ length: attachmentsCount }, (_, index) => (\n <ComposerAttachmentByIndexProvider key={index} index={index}>\n <RenderChildrenWithAccessor\n getItemState={(aui) =>\n aui.composer().attachment({ index }).getState()\n }\n >\n {(getItem) =>\n children({\n get attachment() {\n return getItem();\n },\n })\n }\n </RenderChildrenWithAccessor>\n </ComposerAttachmentByIndexProvider>\n )),\n [attachmentsCount, children],\n );\n};\n\nexport const ComposerPrimitiveAttachments: FC<\n ComposerPrimitiveAttachments.Props\n> = ({ components, children }) => {\n if (components) {\n return (\n <ComposerPrimitiveAttachmentsInner>\n {({ attachment }) => {\n const Component = getComponent(components, attachment);\n if (!Component) return null;\n return <Component />;\n }}\n </ComposerPrimitiveAttachmentsInner>\n );\n }\n return (\n <ComposerPrimitiveAttachmentsInner>\n {children}\n </ComposerPrimitiveAttachmentsInner>\n );\n};\n\nComposerPrimitiveAttachments.displayName = \"ComposerPrimitive.Attachments\";\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport {\n useThreadViewport,\n useThreadViewportStore,\n} from \"../../context/react/ThreadViewportContext\";\n\nexport namespace useThreadScrollToBottom {\n export type Options = {\n behavior?: ScrollBehavior | undefined;\n };\n}\n\nconst useThreadScrollToBottom = ({\n behavior,\n}: useThreadScrollToBottom.Options = {}) => {\n const isAtBottom = useThreadViewport((s) => s.isAtBottom);\n\n const threadViewportStore = useThreadViewportStore();\n\n const handleScrollToBottom = useCallback(() => {\n threadViewportStore.getState().scrollToBottom({ behavior });\n }, [threadViewportStore, behavior]);\n\n if (isAtBottom) return null;\n return handleScrollToBottom;\n};\n\nexport namespace ThreadPrimitiveScrollToBottom {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useThreadScrollToBottom>;\n}\n\nexport const ThreadPrimitiveScrollToBottom = createActionButton(\n \"ThreadPrimitive.ScrollToBottom\",\n useThreadScrollToBottom,\n [\"behavior\"],\n);\n","\"use client\";\n\nimport type {\n ActionButtonElement,\n ActionButtonProps,\n} from \"../../utils/createActionButton\";\nimport { createActionButton } from \"../../utils/createActionButton\";\nimport { useComposerDictate as useComposerDictateBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerDictate = () => {\n const { disabled, startDictation } = useComposerDictateBehavior();\n if (disabled) return null;\n return startDictation;\n};\n\nexport namespace ComposerPrimitiveDictate {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerDictate>;\n}\n\n/**\n * A button that starts dictation to convert voice to text.\n *\n * Requires a DictationAdapter to be configured in the runtime.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Dictate>\n * <MicIcon />\n * </ComposerPrimitive.Dictate>\n * ```\n */\nexport const ComposerPrimitiveDictate = createActionButton(\n \"ComposerPrimitive.Dictate\",\n useComposerDictate,\n);\n","import { resource, tapMemo, tapState } from \"@assistant-ui/tap\";\nimport type { ClientOutput } from \"@assistant-ui/store\";\nimport type {\n ChainOfThoughtState,\n ChainOfThoughtPart,\n} from \"../scopes/chain-of-thought\";\nimport type { MessagePartStatus } from \"../../types/message\";\nimport type { PartMethods } from \"../scopes/part\";\n\nconst COMPLETE_STATUS: MessagePartStatus = Object.freeze({\n type: \"complete\",\n});\n\nexport const ChainOfThoughtClient = resource(\n ({\n parts,\n getMessagePart,\n }: {\n parts: readonly ChainOfThoughtPart[];\n getMessagePart: (selector: { index: number }) => PartMethods;\n }): ClientOutput<\"chainOfThought\"> => {\n const [collapsed, setCollapsed] = tapState(true);\n\n const status = tapMemo(() => {\n const lastPart = parts[parts.length - 1];\n return lastPart?.status ?? COMPLETE_STATUS;\n }, [parts]);\n\n const state = tapMemo<ChainOfThoughtState>(\n () => ({ parts, collapsed, status }),\n [parts, collapsed, status],\n );\n\n return {\n getState: () => state,\n setCollapsed,\n part: getMessagePart,\n };\n },\n);\n","\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallback, useRef, type RefCallback } from \"react\";\nimport { useAuiEvent } from \"@assistant-ui/store\";\nimport { useOnResizeContent } from \"../../utils/hooks/useOnResizeContent\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\nimport { writableStore } from \"../../context/ReadonlyStore\";\nimport { useThreadViewportStore } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace useThreadViewportAutoScroll {\n export type Options = {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when thread history is first loaded.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nexport const useThreadViewportAutoScroll = <TElement extends HTMLElement>({\n autoScroll,\n scrollToBottomOnRunStart = true,\n scrollToBottomOnInitialize = true,\n scrollToBottomOnThreadSwitch = true,\n}: useThreadViewportAutoScroll.Options): RefCallback<TElement> => {\n const divRef = useRef<TElement>(null);\n\n const threadViewportStore = useThreadViewportStore();\n if (autoScroll === undefined) {\n autoScroll = threadViewportStore.getState().turnAnchor !== \"top\";\n }\n\n const lastScrollTop = useRef<number>(0);\n\n // bug: when ScrollToBottom's button changes its disabled state, the scroll stops\n // fix: delay the state change until the scroll is done\n // stores the scroll behavior to reuse during content resize, or null if not scrolling\n const scrollingToBottomBehaviorRef = useRef<ScrollBehavior | null>(null);\n\n const scrollToBottom = useCallback((behavior: ScrollBehavior) => {\n const div = divRef.current;\n if (!div) return;\n\n scrollingToBottomBehaviorRef.current = behavior;\n div.scrollTo({ top: div.scrollHeight, behavior });\n }, []);\n\n const handleScroll = () => {\n const div = divRef.current;\n if (!div) return;\n\n const isAtBottom = threadViewportStore.getState().isAtBottom;\n const newIsAtBottom =\n Math.abs(div.scrollHeight - div.scrollTop - div.clientHeight) < 1 ||\n div.scrollHeight <= div.clientHeight;\n\n if (!newIsAtBottom && lastScrollTop.current < div.scrollTop) {\n // ignore scroll down\n } else {\n if (newIsAtBottom) {\n scrollingToBottomBehaviorRef.current = null;\n }\n\n const shouldUpdate =\n newIsAtBottom || scrollingToBottomBehaviorRef.current === null;\n\n if (shouldUpdate && newIsAtBottom !== isAtBottom) {\n writableStore(threadViewportStore).setState({\n isAtBottom: newIsAtBottom,\n });\n }\n }\n\n lastScrollTop.current = div.scrollTop;\n };\n\n const resizeRef = useOnResizeContent(() => {\n const scrollBehavior = scrollingToBottomBehaviorRef.current;\n if (scrollBehavior) {\n scrollToBottom(scrollBehavior);\n } else if (autoScroll && threadViewportStore.getState().isAtBottom) {\n scrollToBottom(\"instant\");\n }\n\n handleScroll();\n });\n\n const scrollRef = useManagedRef<HTMLElement>((el) => {\n el.addEventListener(\"scroll\", handleScroll);\n return () => {\n el.removeEventListener(\"scroll\", handleScroll);\n };\n });\n\n useOnScrollToBottom(({ behavior }) => {\n scrollToBottom(behavior);\n });\n\n // autoscroll on run start\n useAuiEvent(\"thread.runStart\", () => {\n if (!scrollToBottomOnRunStart) return;\n scrollingToBottomBehaviorRef.current = \"auto\";\n requestAnimationFrame(() => {\n scrollToBottom(\"auto\");\n });\n });\n\n // scroll to bottom instantly when thread history is first loaded\n useAuiEvent(\"thread.initialize\", () => {\n if (!scrollToBottomOnInitialize) return;\n scrollingToBottomBehaviorRef.current = \"instant\";\n requestAnimationFrame(() => {\n scrollToBottom(\"instant\");\n });\n });\n\n // scroll to bottom instantly when switching threads\n useAuiEvent(\"threadListItem.switchedTo\", () => {\n if (!scrollToBottomOnThreadSwitch) return;\n scrollingToBottomBehaviorRef.current = \"instant\";\n requestAnimationFrame(() => {\n scrollToBottom(\"instant\");\n });\n });\n\n const autoScrollRef = useComposedRefs<TElement>(resizeRef, scrollRef, divRef);\n return autoScrollRef as RefCallback<TElement>;\n};\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useAui } from \"@assistant-ui/store\";\nimport { useComposerAddAttachment as useComposerAddAttachmentBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const { disabled, addAttachment } = useComposerAddAttachmentBehavior();\n const aui = useAui();\n\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = aui.composer().getState().attachmentAccept;\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n document.body.appendChild(input);\n\n input.onchange = (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n for (const file of fileList) {\n addAttachment(file);\n }\n\n document.body.removeChild(input);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n };\n\n input.click();\n }, [aui, multiple, addAttachment]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n","import {\n resource,\n tapState,\n tapMemo,\n tapEffectEvent,\n tapEffect,\n tapRef,\n} from \"@assistant-ui/tap\";\nimport type {\n Unstable_MentionAdapter,\n Unstable_MentionCategory,\n Unstable_MentionItem,\n Unstable_DirectiveFormatter,\n} from \"@assistant-ui/core\";\nimport type { AssistantClient } from \"@assistant-ui/store\";\nimport { detectMentionTrigger } from \"./detectMentionTrigger\";\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type MentionKeyEvent = {\n readonly key: string;\n readonly shiftKey: boolean;\n preventDefault(): void;\n};\n\nexport type SelectItemOverride = (item: Unstable_MentionItem) => boolean;\n\nexport type MentionResourceOutput = {\n // State\n readonly open: boolean;\n readonly query: string;\n readonly activeCategoryId: string | null;\n readonly categories: readonly Unstable_MentionCategory[];\n readonly items: readonly Unstable_MentionItem[];\n readonly highlightedIndex: number;\n readonly isSearchMode: boolean;\n readonly formatter: Unstable_DirectiveFormatter;\n\n // Actions\n selectCategory(categoryId: string): void;\n goBack(): void;\n selectItem(item: Unstable_MentionItem): void;\n close(): void;\n handleKeyDown(e: MentionKeyEvent): boolean;\n\n // Internal (for ComposerInput integration)\n setCursorPosition(pos: number): void;\n registerSelectItemOverride(fn: SelectItemOverride): () => void;\n};\n\n// =============================================================================\n// Resource\n// =============================================================================\n\nexport const MentionResource = resource(\n ({\n adapter,\n text,\n triggerChar,\n formatter,\n aui,\n }: {\n adapter: Unstable_MentionAdapter | undefined;\n text: string;\n triggerChar: string;\n formatter: Unstable_DirectiveFormatter;\n aui: AssistantClient;\n }): MentionResourceOutput => {\n // -------------------------------------------------------------------------\n // Cursor tracking + trigger detection\n // -------------------------------------------------------------------------\n\n const [cursorPosition, setCursorPosition] = tapState(text.length);\n\n const trigger = tapMemo(() => {\n const pos = Math.min(cursorPosition, text.length);\n return detectMentionTrigger(text, triggerChar, pos);\n }, [cursorPosition, text, triggerChar]);\n\n const open = trigger !== null && adapter !== undefined;\n const query = trigger?.query ?? \"\";\n\n // -------------------------------------------------------------------------\n // Category navigation\n // -------------------------------------------------------------------------\n\n const [activeCategoryId, setActiveCategoryId] = tapState<string | null>(\n null,\n );\n\n // Reset when popover closes\n tapEffect(() => {\n if (!open) setActiveCategoryId(null);\n }, [open]);\n\n const categories = tapMemo<readonly Unstable_MentionCategory[]>(() => {\n if (!open || !adapter) return [];\n return adapter.categories();\n }, [open, adapter]);\n\n const effectiveActiveCategoryId = open ? activeCategoryId : null;\n\n // -------------------------------------------------------------------------\n // Items + search\n // -------------------------------------------------------------------------\n\n const allItems = tapMemo<readonly Unstable_MentionItem[]>(() => {\n if (!effectiveActiveCategoryId || !adapter) return [];\n return adapter.categoryItems(effectiveActiveCategoryId);\n }, [effectiveActiveCategoryId, adapter]);\n\n const searchResults = tapMemo<\n readonly Unstable_MentionItem[] | null\n >(() => {\n if (!open || !adapter || !query || effectiveActiveCategoryId) return null;\n if (adapter.search) return adapter.search(query);\n\n const cats = adapter.categories();\n const all: Unstable_MentionItem[] = [];\n const lower = query.toLowerCase();\n for (const cat of cats) {\n for (const item of adapter.categoryItems(cat.id)) {\n if (\n item.id.toLowerCase().includes(lower) ||\n item.label.toLowerCase().includes(lower) ||\n item.description?.toLowerCase().includes(lower)\n ) {\n all.push(item);\n }\n }\n }\n return all;\n }, [open, adapter, query, effectiveActiveCategoryId]);\n\n const isSearchMode = searchResults !== null;\n\n // -------------------------------------------------------------------------\n // Filtering\n // -------------------------------------------------------------------------\n\n const filteredCategories = tapMemo(() => {\n if (isSearchMode) return [];\n if (!query) return categories;\n const lower = query.toLowerCase();\n return categories.filter((cat) =>\n cat.label.toLowerCase().includes(lower),\n );\n }, [categories, query, isSearchMode]);\n\n const filteredItems = tapMemo(() => {\n if (isSearchMode) return searchResults ?? [];\n if (!query) return allItems;\n const lower = query.toLowerCase();\n return allItems.filter(\n (item) =>\n item.id.toLowerCase().includes(lower) ||\n item.label.toLowerCase().includes(lower) ||\n item.description?.toLowerCase().includes(lower),\n );\n }, [allItems, query, isSearchMode, searchResults]);\n\n // -------------------------------------------------------------------------\n // Keyboard navigation\n // -------------------------------------------------------------------------\n\n const [highlightedIndex, setHighlightedIndex] = tapState(0);\n\n const navigableList = tapMemo(() => {\n if (isSearchMode) return searchResults ?? [];\n if (effectiveActiveCategoryId) return filteredItems;\n return filteredCategories;\n }, [\n isSearchMode,\n searchResults,\n effectiveActiveCategoryId,\n filteredItems,\n filteredCategories,\n ]);\n\n // Reset highlight when list changes\n // biome-ignore lint/correctness/useExhaustiveDependencies: intentional reset on list change\n tapEffect(() => {\n setHighlightedIndex(0);\n }, [navigableList]);\n\n // -------------------------------------------------------------------------\n // Lexical select-item override\n // -------------------------------------------------------------------------\n\n const selectItemOverrideRef = tapRef<SelectItemOverride | null>(null);\n\n const registerSelectItemOverride = tapEffectEvent(\n (fn: SelectItemOverride) => {\n selectItemOverrideRef.current = fn;\n return () => {\n if (selectItemOverrideRef.current === fn) {\n selectItemOverrideRef.current = null;\n }\n };\n },\n );\n\n // -------------------------------------------------------------------------\n // Actions (stable via tapEffectEvent)\n // -------------------------------------------------------------------------\n\n const selectCategory = tapEffectEvent((categoryId: string) => {\n setActiveCategoryId(categoryId);\n setHighlightedIndex(0);\n });\n\n const goBack = tapEffectEvent(() => {\n setActiveCategoryId(null);\n setHighlightedIndex(0);\n });\n\n const selectItem = tapEffectEvent((item: Unstable_MentionItem) => {\n if (!trigger) return;\n\n // Try the Lexical override first\n if (selectItemOverrideRef.current?.(item)) {\n setActiveCategoryId(null);\n setHighlightedIndex(0);\n return;\n }\n\n // Default: text-based replacement (textarea path)\n const currentText = aui.composer().getState().text;\n const before = currentText.slice(0, trigger.offset);\n const after = currentText.slice(\n trigger.offset + triggerChar.length + trigger.query.length,\n );\n const directive = formatter.serialize(item);\n const newText =\n before + directive + (after.startsWith(\" \") ? after : ` ${after}`);\n\n aui.composer().setText(newText);\n setActiveCategoryId(null);\n setHighlightedIndex(0);\n });\n\n const close = tapEffectEvent(() => {\n setActiveCategoryId(null);\n setHighlightedIndex(0);\n // Move cursor before the trigger so trigger detection deactivates\n if (trigger) {\n setCursorPosition(trigger.offset);\n }\n });\n\n const handleKeyDown = tapEffectEvent((e: MentionKeyEvent): boolean => {\n if (!open) return false;\n\n switch (e.key) {\n case \"ArrowDown\": {\n e.preventDefault();\n setHighlightedIndex((prev) => {\n const len = navigableList.length;\n if (len === 0) return 0;\n return prev < len - 1 ? prev + 1 : 0;\n });\n return true;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n setHighlightedIndex((prev) => {\n const len = navigableList.length;\n if (len === 0) return 0;\n return prev > 0 ? prev - 1 : len - 1;\n });\n return true;\n }\n case \"Enter\": {\n if (e.shiftKey) return false;\n e.preventDefault();\n const item = navigableList[highlightedIndex];\n if (!item) return true;\n\n if (isSearchMode || effectiveActiveCategoryId) {\n selectItem(item as Unstable_MentionItem);\n } else {\n selectCategory((item as Unstable_MentionCategory).id);\n }\n return true;\n }\n case \"Escape\": {\n e.preventDefault();\n close();\n return true;\n }\n case \"Backspace\": {\n if (effectiveActiveCategoryId && query === \"\") {\n e.preventDefault();\n goBack();\n return true;\n }\n return false;\n }\n default:\n return false;\n }\n });\n\n // -------------------------------------------------------------------------\n // Output\n // -------------------------------------------------------------------------\n\n return {\n open,\n query,\n activeCategoryId: effectiveActiveCategoryId,\n categories: filteredCategories,\n items: filteredItems,\n highlightedIndex,\n isSearchMode,\n formatter,\n selectCategory,\n goBack,\n selectItem,\n close,\n handleKeyDown,\n setCursorPosition,\n registerSelectItemOverride,\n };\n },\n);\n","\"use client\";\n\nimport {\n createContext,\n useContext,\n useState,\n useCallback,\n useMemo,\n useEffect,\n type ReactNode,\n type FC,\n} from \"react\";\nimport { useResource } from \"@assistant-ui/tap/react\";\nimport { useAui, useAuiState } from \"@assistant-ui/store\";\nimport type {\n Unstable_MentionAdapter,\n Unstable_DirectiveFormatter,\n} from \"@assistant-ui/core\";\nimport { unstable_defaultDirectiveFormatter } from \"@assistant-ui/core\";\nimport {\n MentionResource,\n type MentionResourceOutput,\n type SelectItemOverride,\n} from \"./MentionResource\";\n\n// =============================================================================\n// Context — public (popover components read state + actions from here)\n// =============================================================================\n\nconst MentionContext = createContext<MentionResourceOutput | null>(null);\n\nexport const useMentionContext = () => {\n const ctx = useContext(MentionContext);\n if (!ctx)\n throw new Error(\n \"useMentionContext must be used within ComposerPrimitive.MentionRoot\",\n );\n return ctx;\n};\n\nexport const useMentionContextOptional = () => {\n return useContext(MentionContext);\n};\n\n// =============================================================================\n// Internal context — ComposerInput → MentionRoot communication\n// =============================================================================\n\ntype MentionInternalContextValue = {\n setCursorPosition(pos: number): void;\n registerSelectItemOverride(fn: SelectItemOverride): () => void;\n};\n\nconst MentionInternalContext =\n createContext<MentionInternalContextValue | null>(null);\n\nexport const useMentionInternalContext = () => {\n return useContext(MentionInternalContext);\n};\n\n// =============================================================================\n// Provider Component\n// =============================================================================\n\nexport namespace ComposerPrimitiveMentionRoot {\n export type Props = {\n children: ReactNode;\n adapter?: Unstable_MentionAdapter | undefined;\n /** Character(s) that trigger the mention popover. @default \"@\" */\n trigger?: string | undefined;\n /** Custom formatter for serializing/parsing mention directives. */\n formatter?: Unstable_DirectiveFormatter | undefined;\n };\n}\n\nexport const ComposerPrimitiveMentionRoot: FC<\n ComposerPrimitiveMentionRoot.Props\n> = ({\n children,\n adapter: adapterProp,\n trigger: triggerChar = \"@\",\n formatter: formatterProp,\n}) => {\n const aui = useAui();\n const text = useAuiState((s) => s.composer.text);\n const formatter = formatterProp ?? unstable_defaultDirectiveFormatter;\n\n // ---------------------------------------------------------------------------\n // Runtime adapter (subscribe to state changes instead of useAuiState to avoid\n // infinite loop — getModelContext() returns a new object on every call)\n // ---------------------------------------------------------------------------\n\n const getRuntimeAdapter = useCallback(() => {\n try {\n const runtime = aui.composer().__internal_getRuntime?.();\n return (runtime as any)?._core?.getState()?.getMentionAdapter?.();\n } catch {\n return undefined;\n }\n }, [aui]);\n const [runtimeAdapter, setRuntimeAdapter] = useState(getRuntimeAdapter);\n useEffect(() => {\n return aui.subscribe(() => {\n setRuntimeAdapter((prev: unknown) => {\n const next = getRuntimeAdapter();\n return prev === next ? prev : next;\n });\n });\n }, [aui, getRuntimeAdapter]);\n const adapter = adapterProp ?? runtimeAdapter;\n\n // ---------------------------------------------------------------------------\n // Mention resource (all state + logic managed via tap primitives)\n // ---------------------------------------------------------------------------\n\n const mention = useResource(\n MentionResource({ adapter, text, triggerChar, formatter, aui }),\n );\n\n // ---------------------------------------------------------------------------\n // Internal context (stable — methods come from tapEffectEvent)\n // ---------------------------------------------------------------------------\n\n const internalContextValue = useMemo<MentionInternalContextValue>(\n () => ({\n setCursorPosition: mention.setCursorPosition,\n registerSelectItemOverride: mention.registerSelectItemOverride,\n }),\n [mention.setCursorPosition, mention.registerSelectItemOverride],\n );\n\n return (\n <MentionContext.Provider value={mention}>\n <MentionInternalContext.Provider value={internalContextValue}>\n {children}\n </MentionInternalContext.Provider>\n </MentionContext.Provider>\n );\n};\n\nComposerPrimitiveMentionRoot.displayName = \"ComposerPrimitive.MentionRoot\";\n","\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useThreadViewportAutoScroll } from \"./useThreadViewportAutoScroll\";\nimport { ThreadPrimitiveViewportProvider } from \"../../context/providers/ThreadViewportProvider\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace ThreadPrimitiveViewport {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div> & {\n /**\n * Whether to automatically scroll to the bottom when new messages are added.\n * When enabled, the viewport will automatically scroll to show the latest content.\n *\n * Default false if `turnAnchor` is \"top\", otherwise defaults to true.\n */\n autoScroll?: boolean | undefined;\n\n /**\n * Controls scroll anchoring behavior for new messages.\n * - \"bottom\" (default): Messages anchor at the bottom, classic chat behavior.\n * - \"top\": New user messages anchor at the top of the viewport for a focused reading experience.\n */\n turnAnchor?: \"top\" | \"bottom\" | undefined;\n\n /**\n * Whether to scroll to bottom when a new run starts.\n *\n * Defaults to true.\n */\n scrollToBottomOnRunStart?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when thread history is first loaded.\n *\n * Defaults to true.\n */\n scrollToBottomOnInitialize?: boolean | undefined;\n\n /**\n * Whether to scroll to bottom when switching to a different thread.\n *\n * Defaults to true.\n */\n scrollToBottomOnThreadSwitch?: boolean | undefined;\n };\n}\n\nconst useViewportSizeRef = () => {\n const register = useThreadViewport((s) => s.registerViewport);\n const getHeight = useCallback((el: HTMLElement) => el.clientHeight, []);\n return useSizeHandle(register, getHeight);\n};\n\nconst ThreadPrimitiveViewportScrollable = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(\n (\n {\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n children,\n ...rest\n },\n forwardedRef,\n ) => {\n const autoScrollRef = useThreadViewportAutoScroll<HTMLDivElement>({\n autoScroll,\n scrollToBottomOnRunStart,\n scrollToBottomOnInitialize,\n scrollToBottomOnThreadSwitch,\n });\n const viewportSizeRef = useViewportSizeRef();\n const ref = useComposedRefs(forwardedRef, autoScrollRef, viewportSizeRef);\n\n return (\n <Primitive.div {...rest} ref={ref}>\n {children}\n </Primitive.div>\n );\n },\n);\n\nThreadPrimitiveViewportScrollable.displayName =\n \"ThreadPrimitive.ViewportScrollable\";\n\n/**\n * A scrollable viewport container for thread messages.\n *\n * This component provides a scrollable area for displaying thread messages with\n * automatic scrolling capabilities. It manages the viewport state and provides\n * context for child components to access viewport-related functionality.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport turnAnchor=\"top\">\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewport = forwardRef<\n ThreadPrimitiveViewport.Element,\n ThreadPrimitiveViewport.Props\n>(({ turnAnchor, ...props }, ref) => {\n return (\n <ThreadPrimitiveViewportProvider options={{ turnAnchor }}>\n <ThreadPrimitiveViewportScrollable {...props} ref={ref} />\n </ThreadPrimitiveViewportProvider>\n );\n});\n\nThreadPrimitiveViewport.displayName = \"ThreadPrimitive.Viewport\";\n","\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Slot } from \"radix-ui\";\nimport {\n ClipboardEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n cloneElement,\n isValidElement,\n} from \"react\";\nimport TextareaAutosize, {\n type TextareaAutosizeProps,\n} from \"react-textarea-autosize\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { useOnScrollToBottom } from \"../../utils/hooks/useOnScrollToBottom\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\nimport { flushResourcesSync } from \"@assistant-ui/tap\";\nimport {\n useMentionContextOptional,\n useMentionInternalContext,\n} from \"./mention/ComposerMentionContext\";\n\nexport namespace ComposerPrimitiveInput {\n export type Element = HTMLTextAreaElement;\n\n type BaseProps = {\n /**\n * Whether to render as a child component using Slot.\n * When true, the component will merge its props with its child.\n */\n asChild?: boolean | undefined;\n /**\n * A React element to use as the input container, with props merged in.\n */\n render?: ReactElement | undefined;\n /**\n * Whether to cancel message composition when Escape is pressed.\n * @default true\n */\n cancelOnEscape?: boolean | undefined;\n /**\n * Whether to automatically focus the input when a new run starts.\n * @default true\n */\n unstable_focusOnRunStart?: boolean | undefined;\n /**\n * Whether to automatically focus the input when scrolling to bottom.\n * @default true\n */\n unstable_focusOnScrollToBottom?: boolean | undefined;\n /**\n * Whether to automatically focus the input when switching threads.\n * @default true\n */\n unstable_focusOnThreadSwitched?: boolean | undefined;\n /**\n * Whether to automatically add pasted files as attachments.\n * @default true\n */\n addAttachmentOnPaste?: boolean | undefined;\n };\n\n type SubmitModeProps =\n | {\n /**\n * Controls how the Enter key submits messages.\n * - \"enter\": Plain Enter submits (Shift+Enter for newline)\n * - \"ctrlEnter\": Ctrl/Cmd+Enter submits (plain Enter for newline)\n * - \"none\": Keyboard submission disabled\n * @default \"enter\"\n */\n submitMode?: \"enter\" | \"ctrlEnter\" | \"none\" | undefined;\n /**\n * @deprecated Use `submitMode` instead\n * @ignore\n */\n submitOnEnter?: never;\n }\n | {\n submitMode?: never;\n /**\n * Whether to submit the message when Enter is pressed (without Shift).\n * @default true\n * @deprecated Use `submitMode` instead. Will be removed in a future version.\n */\n submitOnEnter?: boolean | undefined;\n };\n\n export type Props = TextareaAutosizeProps & BaseProps & SubmitModeProps;\n}\n\n/**\n * A text input component for composing messages.\n *\n * This component provides a rich text input experience with automatic resizing,\n * keyboard shortcuts, file paste support, and intelligent focus management.\n * It integrates with the composer context to manage message state and submission.\n *\n * @example\n * ```tsx\n * // Ctrl/Cmd+Enter to submit (plain Enter inserts newline)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitMode=\"ctrlEnter\"\n * />\n *\n * // Old API (deprecated, still supported)\n * <ComposerPrimitive.Input\n * placeholder=\"Type your message...\"\n * submitOnEnter={true}\n * />\n * ```\n */\nexport const ComposerPrimitiveInput = forwardRef<\n ComposerPrimitiveInput.Element,\n ComposerPrimitiveInput.Props\n>(\n (\n {\n autoFocus = false,\n asChild,\n render,\n disabled: disabledProp,\n onChange,\n onKeyDown,\n onPaste,\n onSelect,\n submitOnEnter,\n submitMode,\n cancelOnEscape = true,\n unstable_focusOnRunStart = true,\n unstable_focusOnScrollToBottom = true,\n unstable_focusOnThreadSwitched = true,\n addAttachmentOnPaste = true,\n ...rest\n },\n forwardedRef,\n ) => {\n const aui = useAui();\n const mentionContext = useMentionContextOptional();\n const mentionInternalContext = useMentionInternalContext();\n\n const effectiveSubmitMode =\n submitMode ?? (submitOnEnter === false ? \"none\" : \"enter\");\n\n const value = useAuiState((s) => {\n if (!s.composer.isEditing) return \"\";\n return s.composer.text;\n });\n\n const isDisabled =\n useAuiState(\n (s) => s.thread.isDisabled || s.composer.dictation?.inputDisabled,\n ) || disabledProp;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const ref = useComposedRefs(forwardedRef, textareaRef);\n\n useEscapeKeydown((e) => {\n // Only handle ESC if it originated from within this input\n if (!textareaRef.current?.contains(e.target as Node)) return;\n\n // Let mention popover handle Escape first\n if (mentionContext?.open) {\n mentionContext.handleKeyDown(e);\n return;\n }\n\n if (!cancelOnEscape) return;\n\n const composer = aui.composer();\n if (composer.getState().canCancel) {\n composer.cancel();\n e.preventDefault();\n }\n });\n\n const handleKeyPress = (e: KeyboardEvent) => {\n if (isDisabled) return;\n\n // ignore IME composition events\n if (e.nativeEvent.isComposing) return;\n\n // Let the mention popover handle keyboard events first\n if (mentionContext?.handleKeyDown(e)) return;\n\n if (e.key === \"Enter\") {\n const threadState = aui.thread().getState();\n const hasQueue = threadState.capabilities.queue;\n\n // Steer hotkey: Cmd/Ctrl+Shift+Enter (respects submitMode=\"none\" and isEmpty)\n if (\n e.shiftKey &&\n (e.ctrlKey || e.metaKey) &&\n hasQueue &&\n effectiveSubmitMode !== \"none\" &&\n !aui.composer().getState().isEmpty\n ) {\n e.preventDefault();\n aui.composer().send({ steer: true });\n return;\n }\n\n // Regular newline: Shift+Enter\n if (e.shiftKey) return;\n\n // Block submission when running unless queue is supported\n if (threadState.isRunning && !hasQueue) return;\n\n let shouldSubmit = false;\n if (effectiveSubmitMode === \"ctrlEnter\") {\n shouldSubmit = e.ctrlKey || e.metaKey;\n } else if (effectiveSubmitMode === \"enter\") {\n shouldSubmit = true;\n }\n\n if (shouldSubmit) {\n e.preventDefault();\n textareaRef.current?.closest(\"form\")?.requestSubmit();\n }\n }\n };\n\n const handlePaste = async (e: ClipboardEvent<HTMLTextAreaElement>) => {\n if (!addAttachmentOnPaste) return;\n const threadCapabilities = aui.thread().getState().capabilities;\n const files = Array.from(e.clipboardData?.files || []);\n\n if (threadCapabilities.attachments && files.length > 0) {\n try {\n e.preventDefault();\n await Promise.all(\n files.map((file) => aui.composer().addAttachment(file)),\n );\n } catch (error) {\n console.error(\"Error adding attachment:\", error);\n }\n }\n };\n\n const autoFocusEnabled = autoFocus && !isDisabled;\n const focus = useCallback(() => {\n const textarea = textareaRef.current;\n if (!textarea || !autoFocusEnabled) return;\n\n textarea.focus({ preventScroll: true });\n textarea.setSelectionRange(textarea.value.length, textarea.value.length);\n }, [autoFocusEnabled]);\n\n useEffect(() => focus(), [focus]);\n\n useOnScrollToBottom(() => {\n if (\n aui.composer().getState().type === \"thread\" &&\n unstable_focusOnScrollToBottom\n ) {\n focus();\n }\n });\n\n useEffect(() => {\n if (\n aui.composer().getState().type !== \"thread\" ||\n !unstable_focusOnRunStart\n )\n return undefined;\n\n return aui.on(\"thread.runStart\", focus);\n }, [unstable_focusOnRunStart, focus, aui]);\n\n useEffect(() => {\n if (\n aui.composer().getState().type !== \"thread\" ||\n !unstable_focusOnThreadSwitched\n )\n return undefined;\n\n return aui.on(\"threadListItem.switchedTo\", focus);\n }, [unstable_focusOnThreadSwitched, focus, aui]);\n\n const inputProps = {\n name: \"input\" as const,\n value,\n ...rest,\n ref: ref as React.ForwardedRef<HTMLTextAreaElement>,\n disabled: isDisabled,\n onChange: composeEventHandlers(\n onChange,\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (!aui.composer().getState().isEditing) return;\n flushResourcesSync(() => {\n aui.composer().setText(e.target.value);\n });\n mentionInternalContext?.setCursorPosition(\n e.target.selectionStart ?? e.target.value.length,\n );\n },\n ),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyPress),\n onSelect: composeEventHandlers(\n onSelect,\n (e: React.SyntheticEvent<HTMLTextAreaElement>) => {\n const target = e.target as HTMLTextAreaElement;\n mentionInternalContext?.setCursorPosition(\n target.selectionStart ?? target.value.length,\n );\n },\n ),\n onPaste: composeEventHandlers(onPaste, handlePaste),\n };\n\n if (render && isValidElement(render)) {\n const renderChildren =\n (rest as any).children !== undefined\n ? ((rest as any).children as ReactNode)\n : ((render.props as Record<string, unknown>).children as ReactNode);\n return (\n <Slot.Root {...inputProps}>\n {cloneElement(render, undefined, renderChildren)}\n </Slot.Root>\n );\n }\n\n const Component = asChild ? Slot.Root : TextareaAutosize;\n return <Component {...inputProps} />;\n },\n);\n\nComposerPrimitiveInput.displayName = \"ComposerPrimitive.Input\";\n","\"use client\";\n\nimport type { ImageMessagePart, MessagePartState } from \"@assistant-ui/core\";\nimport { useAuiState } from \"@assistant-ui/store\";\n\nexport const useMessagePartImage = () => {\n const image = useAuiState((s) => {\n if (s.part.type !== \"image\")\n throw new Error(\n \"MessagePartImage can only be used inside image message parts.\",\n );\n\n return s.part as MessagePartState & ImageMessagePart;\n });\n\n return image;\n};\n","\"use client\";\n\nimport {\n type ComponentType,\n type FC,\n memo,\n PropsWithChildren,\n useMemo,\n} from \"react\";\nimport { useAuiState, useAui } from \"@assistant-ui/store\";\nimport { PartByIndexProvider } from \"../../context/providers/PartByIndexProvider\";\nimport { TextMessagePartProvider } from \"../../context/providers/TextMessagePartProvider\";\nimport { MessagePartPrimitiveText } from \"../messagePart/MessagePartText\";\nimport { MessagePartPrimitiveImage } from \"../messagePart/MessagePartImage\";\nimport type {\n Unstable_AudioMessagePartComponent,\n DataMessagePartComponent,\n DataMessagePartProps,\n EmptyMessagePartComponent,\n TextMessagePartComponent,\n ImageMessagePartComponent,\n SourceMessagePartComponent,\n ToolCallMessagePartComponent,\n ToolCallMessagePartProps,\n FileMessagePartComponent,\n ReasoningMessagePartComponent,\n} from \"@assistant-ui/core/react\";\nimport { MessagePartPrimitiveInProgress } from \"../messagePart/MessagePartInProgress\";\nimport type { MessagePartStatus } from \"@assistant-ui/core\";\n\ntype MessagePartGroup = {\n groupKey: string | undefined;\n indices: number[];\n};\n\nexport type GroupingFunction = (parts: readonly any[]) => MessagePartGroup[];\n\n/**\n * Groups message parts by their parent ID.\n * Parts without a parent ID appear in their chronological position as individual groups.\n * Parts with the same parent ID are grouped together at the position of their first occurrence.\n */\nconst groupMessagePartsByParentId: GroupingFunction = (\n parts: readonly any[],\n): MessagePartGroup[] => {\n // Map maintains insertion order, so groups appear in order of first occurrence\n const groupMap = new Map<string, number[]>();\n\n // Process each part in order\n for (let i = 0; i < parts.length; i++) {\n const part = parts[i];\n const parentId = part?.parentId as string | undefined;\n\n // For parts without parentId, assign a unique group ID to maintain their position\n const groupId = parentId ?? `__ungrouped_${i}`;\n\n // Get or create the indices array for this group\n const indices = groupMap.get(groupId) ?? [];\n indices.push(i);\n groupMap.set(groupId, indices);\n }\n\n // Convert map to array of groups\n const groups: MessagePartGroup[] = [];\n for (const [groupId, indices] of groupMap) {\n // Extract parentId (undefined for ungrouped parts)\n const groupKey = groupId.startsWith(\"__ungrouped_\") ? undefined : groupId;\n groups.push({ groupKey, indices });\n }\n\n return groups;\n};\n\nconst useMessagePartsGrouped = (\n groupingFunction: GroupingFunction,\n): MessagePartGroup[] => {\n const parts = useAuiState((s) => s.message.parts);\n\n return useMemo(() => {\n if (parts.length === 0) {\n return [];\n }\n return groupingFunction(parts);\n }, [parts, groupingFunction]);\n};\n\nexport namespace MessagePrimitiveUnstable_PartsGrouped {\n export type Props = {\n /**\n * Function that takes an array of message parts and returns an array of groups.\n * Each group contains a key (for identification) and an array of indices.\n *\n * @example\n * ```tsx\n * // Group by parent ID (default behavior)\n * groupingFunction={(parts) => {\n * const groups = new Map<string, number[]>();\n * parts.forEach((part, i) => {\n * const key = part.parentId ?? `__ungrouped_${i}`;\n * const indices = groups.get(key) ?? [];\n * indices.push(i);\n * groups.set(key, indices);\n * });\n * return Array.from(groups.entries()).map(([key, indices]) => ({\n * key: key.startsWith(\"__ungrouped_\") ? undefined : key,\n * indices\n * }));\n * }}\n * ```\n *\n * @example\n * ```tsx\n * // Group by tool name\n * import { groupMessagePartsByToolName } from \"@assistant-ui/react\";\n *\n * <MessagePrimitive.Unstable_PartsGrouped\n * groupingFunction={groupMessagePartsByToolName}\n * components={{\n * Group: ({ key, indices, children }) => {\n * if (!key) return <>{children}</>;\n * return (\n * <div className=\"tool-group\">\n * <h4>Tool: {key}</h4>\n * {children}\n * </div>\n * );\n * }\n * }}\n * />\n * ```\n */\n groupingFunction: GroupingFunction;\n\n /**\n * Component configuration for rendering different types of message content.\n *\n * You can provide custom components for each content type (text, image, file, etc.)\n * and configure tool rendering behavior. If not provided, default components will be used.\n */\n components:\n | {\n /** Component for rendering empty messages */\n Empty?: EmptyMessagePartComponent | undefined;\n /** Component for rendering text content */\n Text?: TextMessagePartComponent | undefined;\n /** Component for rendering reasoning content (typically hidden) */\n Reasoning?: ReasoningMessagePartComponent | undefined;\n /** Component for rendering source content */\n Source?: SourceMessagePartComponent | undefined;\n /** Component for rendering image content */\n Image?: ImageMessagePartComponent | undefined;\n /** Component for rendering file content */\n File?: FileMessagePartComponent | undefined;\n /** Component for rendering audio content (experimental) */\n Unstable_Audio?: Unstable_AudioMessagePartComponent | undefined;\n /** Configuration for data part rendering */\n data?:\n | {\n /** Map data event names to specific components */\n by_name?:\n | Record<string, DataMessagePartComponent | undefined>\n | undefined;\n /** Fallback component for unmatched data events */\n Fallback?: DataMessagePartComponent | undefined;\n }\n | undefined;\n /** Configuration for tool call rendering */\n tools?:\n | {\n /** Map of tool names to their specific components */\n by_name?:\n | Record<string, ToolCallMessagePartComponent | undefined>\n | undefined;\n /** Fallback component for unregistered tools */\n Fallback?: ComponentType<ToolCallMessagePartProps> | undefined;\n }\n | {\n /** Override component that handles all tool calls */\n Override: ComponentType<ToolCallMessagePartProps>;\n }\n | undefined;\n\n /**\n * Component for rendering grouped message parts.\n *\n * When provided, this component will automatically wrap message parts that share\n * the same group key as determined by the groupingFunction.\n *\n * The component receives:\n * - `groupKey`: The group key (or undefined for ungrouped parts)\n * - `indices`: Array of indices for the parts in this group\n * - `children`: The rendered message part components\n *\n * @example\n * ```tsx\n * // Collapsible group\n * Group: ({ groupKey, indices, children }) => {\n * if (!groupKey) return <>{children}</>;\n * return (\n * <details className=\"message-group\">\n * <summary>\n * Group {groupKey} ({indices.length} parts)\n * </summary>\n * <div className=\"group-content\">\n * {children}\n * </div>\n * </details>\n * );\n * }\n * ```\n *\n * @param groupKey - The group key (undefined for ungrouped parts)\n * @param indices - Array of indices for the parts in this group\n * @param children - Rendered message part components to display within the group\n */\n Group?: ComponentType<\n PropsWithChildren<{\n groupKey: string | undefined;\n indices: number[];\n }>\n >;\n }\n | undefined;\n };\n}\n\nconst ToolUIDisplay = ({\n Fallback,\n ...props\n}: {\n Fallback: ToolCallMessagePartComponent | undefined;\n} & ToolCallMessagePartProps) => {\n const Render = useAuiState((s) => {\n const Render = s.tools.tools[props.toolName] ?? Fallback;\n if (Array.isArray(Render)) return Render[0] ?? Fallback;\n return Render;\n });\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst DataUIDisplay = ({\n Fallback,\n ...props\n}: {\n Fallback: DataMessagePartComponent | undefined;\n} & DataMessagePartProps) => {\n const Render = useAuiState((s) => {\n const Render = s.dataRenderers.renderers[props.name] ?? Fallback;\n if (Array.isArray(Render)) return Render[0] ?? Fallback;\n return Render;\n });\n if (!Render) return null;\n return <Render {...props} />;\n};\n\nconst defaultComponents = {\n Text: () => (\n <p style={{ whiteSpace: \"pre-line\" }}>\n <MessagePartPrimitiveText />\n <MessagePartPrimitiveInProgress>\n <span style={{ fontFamily: \"revert\" }}>{\" \\u25CF\"}</span>\n </MessagePartPrimitiveInProgress>\n </p>\n ),\n Reasoning: () => null,\n Source: () => null,\n Image: () => <MessagePartPrimitiveImage />,\n File: () => null,\n Unstable_Audio: () => null,\n Group: ({ children }) => children,\n} satisfies MessagePrimitiveUnstable_PartsGrouped.Props[\"components\"];\n\ntype MessagePartComponentProps = {\n components: MessagePrimitiveUnstable_PartsGrouped.Props[\"components\"];\n};\n\nconst MessagePartComponent: FC<MessagePartComponentProps> = ({\n components: {\n Text = defaultComponents.Text,\n Reasoning = defaultComponents.Reasoning,\n Image = defaultComponents.Image,\n Source = defaultComponents.Source,\n File = defaultComponents.File,\n Unstable_Audio: Audio = defaultComponents.Unstable_Audio,\n tools = {},\n data,\n } = {},\n}) => {\n const aui = useAui();\n const part = useAuiState((s) => s.part);\n\n const type = part.type;\n if (type === \"tool-call\") {\n const addResult = aui.part().addToolResult;\n const resume = aui.part().resumeToolCall;\n if (\"Override\" in tools)\n return <tools.Override {...part} addResult={addResult} resume={resume} />;\n const Tool = tools.by_name?.[part.toolName] ?? tools.Fallback;\n return (\n <ToolUIDisplay\n {...part}\n Fallback={Tool}\n addResult={addResult}\n resume={resume}\n />\n );\n }\n\n if (part.status?.type === \"requires-action\")\n throw new Error(\"Encountered unexpected requires-action status\");\n\n switch (type) {\n case \"text\":\n return <Text {...part} />;\n\n case \"reasoning\":\n return <Reasoning {...part} />;\n\n case \"source\":\n return <Source {...part} />;\n\n case \"image\":\n return <Image {...part} />;\n\n case \"file\":\n return <File {...part} />;\n\n case \"audio\":\n return <Audio {...part} />;\n\n case \"data\": {\n const Data = data?.by_name?.[part.name] ?? data?.Fallback;\n return <DataUIDisplay {...part} Fallback={Data} />;\n }\n\n default:\n console.warn(`Unknown message part type: ${type}`);\n return null;\n }\n};\n\ntype MessagePartProps = {\n partIndex: number;\n components: MessagePrimitiveUnstable_PartsGrouped.Props[\"components\"];\n};\n\nconst MessagePartImpl: FC<MessagePartProps> = ({ partIndex, components }) => {\n return (\n <PartByIndexProvider index={partIndex}>\n <MessagePartComponent components={components} />\n </PartByIndexProvider>\n );\n};\n\nconst MessagePart = memo(\n MessagePartImpl,\n (prev, next) =>\n prev.partIndex === next.partIndex &&\n prev.components?.Text === next.components?.Text &&\n prev.components?.Reasoning === next.components?.Reasoning &&\n prev.components?.Source === next.components?.Source &&\n prev.components?.Image === next.components?.Image &&\n prev.components?.File === next.components?.File &&\n prev.components?.Unstable_Audio === next.components?.Unstable_Audio &&\n prev.components?.tools === next.components?.tools &&\n prev.components?.data === next.components?.data &&\n prev.components?.Group === next.components?.Group,\n);\n\nconst EmptyPartFallback: FC<{\n status: MessagePartStatus;\n component: TextMessagePartComponent;\n}> = ({ status, component: Component }) => {\n return (\n <TextMessagePartProvider text=\"\" isRunning={status.type === \"running\"}>\n <Component type=\"text\" text=\"\" status={status} />\n </TextMessagePartProvider>\n );\n};\n\nconst COMPLETE_STATUS: MessagePartStatus = Object.freeze({\n type: \"complete\",\n});\n\nconst EmptyPartsImpl: FC<MessagePartComponentProps> = ({ components }) => {\n const status = useAuiState(\n (s) => (s.message.status ?? COMPLETE_STATUS) as MessagePartStatus,\n );\n\n if (components?.Empty) return <components.Empty status={status} />;\n\n return (\n <EmptyPartFallback\n status={status}\n component={components?.Text ?? defaultComponents.Text}\n />\n );\n};\n\nconst EmptyParts = memo(\n EmptyPartsImpl,\n (prev, next) =>\n prev.components?.Empty === next.components?.Empty &&\n prev.components?.Text === next.components?.Text,\n);\n\n/**\n * Renders the parts of a message grouped by a custom grouping function.\n *\n * This component allows you to group message parts based on any criteria you define.\n * The grouping function receives all message parts and returns an array of groups,\n * where each group has a key and an array of part indices.\n *\n * @example\n * ```tsx\n * // Group by parent ID (default behavior)\n * <MessagePrimitive.Unstable_PartsGrouped\n * components={{\n * Text: ({ text }) => <p className=\"message-text\">{text}</p>,\n * Image: ({ image }) => <img src={image} alt=\"Message image\" />,\n * Group: ({ groupKey, indices, children }) => {\n * if (!groupKey) return <>{children}</>;\n * return (\n * <div className=\"parent-group border rounded p-4\">\n * <h4>Parent ID: {groupKey}</h4>\n * {children}\n * </div>\n * );\n * }\n * }}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Group by tool name\n * import { groupMessagePartsByToolName } from \"@assistant-ui/react\";\n *\n * <MessagePrimitive.Unstable_PartsGrouped\n * groupingFunction={groupMessagePartsByToolName}\n * components={{\n * Group: ({ groupKey, indices, children }) => {\n * if (!groupKey) return <>{children}</>;\n * return (\n * <div className=\"tool-group\">\n * <h4>Tool: {groupKey}</h4>\n * {children}\n * </div>\n * );\n * }\n * }}\n * />\n * ```\n */\nexport const MessagePrimitiveUnstable_PartsGrouped: FC<\n MessagePrimitiveUnstable_PartsGrouped.Props\n> = ({ groupingFunction, components }) => {\n const contentLength = useAuiState((s) => s.message.parts.length);\n const messageGroups = useMessagePartsGrouped(groupingFunction);\n\n const partsElements = useMemo(() => {\n if (contentLength === 0) {\n return <EmptyParts components={components} />;\n }\n\n return messageGroups.map((group, groupIndex) => {\n const GroupComponent = components?.Group ?? defaultComponents.Group;\n\n return (\n <GroupComponent\n key={`group-${groupIndex}-${group.groupKey ?? \"ungrouped\"}`}\n groupKey={group.groupKey}\n indices={group.indices}\n >\n {group.indices.map((partIndex) => (\n <MessagePart\n key={partIndex}\n partIndex={partIndex}\n components={components}\n />\n ))}\n </GroupComponent>\n );\n });\n }, [messageGroups, components, contentLength]);\n\n return <>{partsElements}</>;\n};\n\nMessagePrimitiveUnstable_PartsGrouped.displayName =\n \"MessagePrimitive.Unstable_PartsGrouped\";\n\n/**\n * Renders the parts of a message grouped by their parent ID.\n * This is a convenience wrapper around Unstable_PartsGrouped with parent ID grouping.\n *\n * @deprecated Use MessagePrimitive.Unstable_PartsGrouped instead for more flexibility\n */\nexport const MessagePrimitiveUnstable_PartsGroupedByParentId: FC<\n Omit<MessagePrimitiveUnstable_PartsGrouped.Props, \"groupingFunction\">\n> = ({ components, ...props }) => {\n return (\n <MessagePrimitiveUnstable_PartsGrouped\n {...props}\n components={components}\n groupingFunction={groupMessagePartsByParentId}\n />\n );\n};\n\nMessagePrimitiveUnstable_PartsGroupedByParentId.displayName =\n \"MessagePrimitive.Unstable_PartsGroupedByParentId\";\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport * as React from 'react';\nimport useLatest from 'use-latest';\nimport useComposedRef from 'use-composed-ref';\n\nvar isBrowser = typeof document !== 'undefined';\n\nvar HIDDEN_TEXTAREA_STYLE = {\n 'min-height': '0',\n 'max-height': 'none',\n height: '0',\n visibility: 'hidden',\n overflow: 'hidden',\n position: 'absolute',\n 'z-index': '-1000',\n top: '0',\n right: '0',\n display: 'block'\n};\nvar forceHiddenStyles = function forceHiddenStyles(node) {\n Object.keys(HIDDEN_TEXTAREA_STYLE).forEach(function (key) {\n node.style.setProperty(key, HIDDEN_TEXTAREA_STYLE[key], 'important');\n });\n};\nvar forceHiddenStyles$1 = forceHiddenStyles;\n\nvar hiddenTextarea = null;\nvar getHeight = function getHeight(node, sizingData) {\n var height = node.scrollHeight;\n if (sizingData.sizingStyle.boxSizing === 'border-box') {\n // border-box: add border, since height = content + padding + border\n return height + sizingData.borderSize;\n }\n\n // remove padding, since height = content\n return height - sizingData.paddingSize;\n};\nfunction calculateNodeHeight(sizingData, value, minRows, maxRows) {\n if (minRows === void 0) {\n minRows = 1;\n }\n if (maxRows === void 0) {\n maxRows = Infinity;\n }\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement('textarea');\n hiddenTextarea.setAttribute('tabindex', '-1');\n hiddenTextarea.setAttribute('aria-hidden', 'true');\n forceHiddenStyles$1(hiddenTextarea);\n }\n if (hiddenTextarea.parentNode === null) {\n document.body.appendChild(hiddenTextarea);\n }\n var paddingSize = sizingData.paddingSize,\n borderSize = sizingData.borderSize,\n sizingStyle = sizingData.sizingStyle;\n var boxSizing = sizingStyle.boxSizing;\n Object.keys(sizingStyle).forEach(function (_key) {\n var key = _key;\n hiddenTextarea.style[key] = sizingStyle[key];\n });\n forceHiddenStyles$1(hiddenTextarea);\n hiddenTextarea.value = value;\n var height = getHeight(hiddenTextarea, sizingData);\n // Double set and calc due to Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1795904\n hiddenTextarea.value = value;\n height = getHeight(hiddenTextarea, sizingData);\n\n // measure height of a textarea with a single row\n hiddenTextarea.value = 'x';\n var rowHeight = hiddenTextarea.scrollHeight - paddingSize;\n var minHeight = rowHeight * minRows;\n if (boxSizing === 'border-box') {\n minHeight = minHeight + paddingSize + borderSize;\n }\n height = Math.max(minHeight, height);\n var maxHeight = rowHeight * maxRows;\n if (boxSizing === 'border-box') {\n maxHeight = maxHeight + paddingSize + borderSize;\n }\n height = Math.min(maxHeight, height);\n return [height, rowHeight];\n}\n\nvar noop = function noop() {};\nvar pick = function pick(props, obj) {\n return props.reduce(function (acc, prop) {\n acc[prop] = obj[prop];\n return acc;\n }, {});\n};\n\nvar SIZING_STYLE = ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'boxSizing', 'fontFamily', 'fontSize', 'fontStyle', 'fontWeight', 'letterSpacing', 'lineHeight', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop',\n// non-standard\n'tabSize', 'textIndent',\n// non-standard\n'textRendering', 'textTransform', 'width', 'wordBreak', 'wordSpacing', 'scrollbarGutter'];\nvar isIE = isBrowser ? !!document.documentElement.currentStyle : false;\nvar getSizingData = function getSizingData(node) {\n var style = window.getComputedStyle(node);\n if (style === null) {\n return null;\n }\n var sizingStyle = pick(SIZING_STYLE, style);\n var boxSizing = sizingStyle.boxSizing;\n\n // probably node is detached from DOM, can't read computed dimensions\n if (boxSizing === '') {\n return null;\n }\n\n // IE (Edge has already correct behaviour) returns content width as computed width\n // so we need to add manually padding and border widths\n if (isIE && boxSizing === 'border-box') {\n sizingStyle.width = parseFloat(sizingStyle.width) + parseFloat(sizingStyle.borderRightWidth) + parseFloat(sizingStyle.borderLeftWidth) + parseFloat(sizingStyle.paddingRight) + parseFloat(sizingStyle.paddingLeft) + 'px';\n }\n var paddingSize = parseFloat(sizingStyle.paddingBottom) + parseFloat(sizingStyle.paddingTop);\n var borderSize = parseFloat(sizingStyle.borderBottomWidth) + parseFloat(sizingStyle.borderTopWidth);\n return {\n sizingStyle: sizingStyle,\n paddingSize: paddingSize,\n borderSize: borderSize\n };\n};\nvar getSizingData$1 = getSizingData;\n\nfunction useListener(target, type, listener) {\n var latestListener = useLatest(listener);\n React.useLayoutEffect(function () {\n var handler = function handler(ev) {\n return latestListener.current(ev);\n };\n // might happen if document.fonts is not defined, for instance\n if (!target) {\n return;\n }\n target.addEventListener(type, handler);\n return function () {\n return target.removeEventListener(type, handler);\n };\n }, []);\n}\nvar useFormResetListener = function useFormResetListener(libRef, listener) {\n useListener(document.body, 'reset', function (ev) {\n if (libRef.current.form === ev.target) {\n listener(ev);\n }\n });\n};\nvar useWindowResizeListener = function useWindowResizeListener(listener) {\n useListener(window, 'resize', listener);\n};\nvar useFontsLoadedListener = function useFontsLoadedListener(listener) {\n useListener(document.fonts, 'loadingdone', listener);\n};\n\nvar _excluded = [\"cacheMeasurements\", \"maxRows\", \"minRows\", \"onChange\", \"onHeightChange\"];\nvar TextareaAutosize = function TextareaAutosize(_ref, userRef) {\n var cacheMeasurements = _ref.cacheMeasurements,\n maxRows = _ref.maxRows,\n minRows = _ref.minRows,\n _ref$onChange = _ref.onChange,\n onChange = _ref$onChange === void 0 ? noop : _ref$onChange,\n _ref$onHeightChange = _ref.onHeightChange,\n onHeightChange = _ref$onHeightChange === void 0 ? noop : _ref$onHeightChange,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n var isControlled = props.value !== undefined;\n var libRef = React.useRef(null);\n var ref = useComposedRef(libRef, userRef);\n var heightRef = React.useRef(0);\n var measurementsCacheRef = React.useRef();\n var resizeTextarea = function resizeTextarea() {\n var node = libRef.current;\n var nodeSizingData = cacheMeasurements && measurementsCacheRef.current ? measurementsCacheRef.current : getSizingData$1(node);\n if (!nodeSizingData) {\n return;\n }\n measurementsCacheRef.current = nodeSizingData;\n var _calculateNodeHeight = calculateNodeHeight(nodeSizingData, node.value || node.placeholder || 'x', minRows, maxRows),\n height = _calculateNodeHeight[0],\n rowHeight = _calculateNodeHeight[1];\n if (heightRef.current !== height) {\n heightRef.current = height;\n node.style.setProperty('height', height + \"px\", 'important');\n onHeightChange(height, {\n rowHeight: rowHeight\n });\n }\n };\n var handleChange = function handleChange(event) {\n if (!isControlled) {\n resizeTextarea();\n }\n onChange(event);\n };\n if (isBrowser) {\n React.useLayoutEffect(resizeTextarea);\n useFormResetListener(libRef, function () {\n if (!isControlled) {\n var currentValue = libRef.current.value;\n requestAnimationFrame(function () {\n var node = libRef.current;\n if (node && currentValue !== node.value) {\n resizeTextarea();\n }\n });\n }\n });\n useWindowResizeListener(resizeTextarea);\n useFontsLoadedListener(resizeTextarea);\n return /*#__PURE__*/React.createElement(\"textarea\", _extends({}, props, {\n onChange: handleChange,\n ref: ref\n }));\n }\n return /*#__PURE__*/React.createElement(\"textarea\", _extends({}, props, {\n onChange: onChange,\n ref: ref\n }));\n};\nvar index = /* #__PURE__ */React.forwardRef(TextareaAutosize);\n\nexport { index as default };\n","const WHITESPACE_RE = /\\s/;\n\n/**\n * Detect a mention trigger in text relative to the cursor position.\n *\n * @internal Exported for testing and for the MentionResource.\n */\nexport function detectMentionTrigger(\n text: string,\n triggerChar: string,\n cursorPosition: number,\n): {\n query: string;\n offset: number;\n} | null {\n // Only consider text up to the cursor\n const textUpToCursor = text.slice(0, cursorPosition);\n\n // Search backwards from cursor for the trigger character.\n // Stop at any whitespace during scan — trigger must be contiguous with cursor.\n for (let i = textUpToCursor.length - 1; i >= 0; i--) {\n const char = textUpToCursor[i]!;\n\n if (WHITESPACE_RE.test(char)) return null;\n\n if (textUpToCursor.startsWith(triggerChar, i)) {\n // Trigger must be preceded by whitespace or be at start of text\n if (i > 0 && !WHITESPACE_RE.test(textUpToCursor[i - 1]!)) continue;\n\n const query = textUpToCursor.slice(i + triggerChar.length);\n\n return { query, offset: i };\n }\n }\n\n return null;\n}\n","import { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useCallback } from \"react\";\nimport { useManagedRef } from \"./useManagedRef\";\n\nexport const useOnResizeContent = (callback: () => void) => {\n const callbackRef = useCallbackRef(callback);\n\n const refCallback = useCallback(\n (el: HTMLElement) => {\n const resizeObserver = new ResizeObserver(() => {\n callbackRef();\n });\n\n const mutationObserver = new MutationObserver((mutations) => {\n // Filter out style-only attribute mutations to prevent feedback loops\n // with components like ThreadViewportSlack that write styles in response\n // to viewport changes\n const hasRelevantMutation = mutations.some(\n (m) => m.type !== \"attributes\" || m.attributeName !== \"style\",\n );\n if (hasRelevantMutation) {\n callbackRef();\n }\n });\n\n resizeObserver.observe(el);\n mutationObserver.observe(el, {\n childList: true,\n subtree: true,\n attributes: true,\n characterData: true,\n });\n\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n };\n },\n [callbackRef],\n );\n\n return useManagedRef(refCallback);\n};\n","\"use client\";\n\nimport { Slot } from \"radix-ui\";\nimport {\n createContext,\n type FC,\n type ReactNode,\n useCallback,\n useContext,\n} from \"react\";\nimport { useThreadViewportStore } from \"../../context/react/ThreadViewportContext\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { useManagedRef } from \"../../utils/hooks/useManagedRef\";\n\nconst SlackNestingContext = createContext(false);\n\nconst parseCssLength = (value: string, element: HTMLElement): number => {\n const match = value.match(/^([\\d.]+)(em|px|rem)$/);\n if (!match) return 0;\n\n const num = parseFloat(match[1]!);\n const unit = match[2];\n\n if (unit === \"px\") return num;\n if (unit === \"em\") {\n const fontSize = parseFloat(getComputedStyle(element).fontSize) || 16;\n return num * fontSize;\n }\n if (unit === \"rem\") {\n const rootFontSize =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n return num * rootFontSize;\n }\n return 0;\n};\n\nexport type ThreadViewportSlackProps = {\n /** Threshold at which the user message height clamps to the offset */\n fillClampThreshold?: string;\n /** Offset used when clamping large user messages */\n fillClampOffset?: string;\n children: ReactNode;\n};\n\n/**\n * A slot component that provides minimum height to enable scroll anchoring.\n *\n * When using `turnAnchor=\"top\"`, this component ensures there is\n * enough scroll room below the anchor point (last user message) for it to scroll\n * to the top of the viewport. The min-height is applied only to the last\n * assistant message.\n *\n * This component is used internally by MessagePrimitive.Root.\n */\nexport const ThreadPrimitiveViewportSlack: FC<ThreadViewportSlackProps> = ({\n children,\n fillClampThreshold = \"10em\",\n fillClampOffset = \"6em\",\n}) => {\n const shouldApplySlack = useAuiState(\n // only add slack to the last assistant message following a user message (valid turn)\n (s) =>\n s.message.isLast &&\n s.message.role === \"assistant\" &&\n s.message.index >= 1 &&\n s.thread.messages.at(s.message.index - 1)?.role === \"user\",\n );\n const threadViewportStore = useThreadViewportStore({ optional: true });\n const isNested = useContext(SlackNestingContext);\n\n const callback = useCallback(\n (el: HTMLElement) => {\n if (!threadViewportStore || isNested) return;\n\n const updateMinHeight = () => {\n const state = threadViewportStore.getState();\n if (state.turnAnchor === \"top\" && shouldApplySlack) {\n const { viewport, inset, userMessage } = state.height;\n const threshold = parseCssLength(fillClampThreshold, el);\n const offset = parseCssLength(fillClampOffset, el);\n const clampAdjustment =\n userMessage <= threshold ? userMessage : offset;\n\n const minHeight = Math.max(0, viewport - inset - clampAdjustment);\n el.style.minHeight = `${minHeight}px`;\n el.style.flexShrink = \"0\";\n el.style.transition = \"min-height 0s\";\n } else {\n el.style.minHeight = \"\";\n el.style.flexShrink = \"\";\n el.style.transition = \"\";\n }\n };\n\n updateMinHeight();\n return threadViewportStore.subscribe(updateMinHeight);\n },\n [\n threadViewportStore,\n shouldApplySlack,\n isNested,\n fillClampThreshold,\n fillClampOffset,\n ],\n );\n\n const ref = useManagedRef<HTMLElement>(callback);\n\n return (\n <SlackNestingContext.Provider value={true}>\n <Slot.Root ref={ref}>{children}</Slot.Root>\n </SlackNestingContext.Provider>\n );\n};\n\nThreadPrimitiveViewportSlack.displayName = \"ThreadPrimitive.ViewportSlack\";\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useActionBarSpeak as useActionBarSpeakBehavior } from \"@assistant-ui/core/react\";\n\nconst useActionBarSpeak = () => {\n const { disabled, speak } = useActionBarSpeakBehavior();\n if (disabled) return null;\n return speak;\n};\n\nexport namespace ActionBarPrimitiveSpeak {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useActionBarSpeak>;\n}\n\nexport const ActionBarPrimitiveSpeak = createActionButton(\n \"ActionBarPrimitive.Speak\",\n useActionBarSpeak,\n);\n","\"use client\";\n\nimport { useCallback } from \"react\";\nimport { useManagedRef } from \"./useManagedRef\";\nimport type { SizeHandle } from \"../../context/stores/ThreadViewport\";\n\n/**\n * Hook that creates a ref for tracking element size via a SizeHandle.\n * Automatically sets up ResizeObserver and reports height changes.\n *\n * @param register - Function that returns a SizeHandle (e.g., registerContentInset)\n * @param getHeight - Optional function to compute height (defaults to el.offsetHeight)\n * @returns A ref callback to attach to the element\n */\nexport const useSizeHandle = (\n register: (() => SizeHandle) | null | undefined,\n getHeight?: (el: HTMLElement) => number,\n) => {\n const callbackRef = useCallback(\n (el: HTMLElement) => {\n if (!register) return;\n\n const sizeHandle = register();\n\n const updateHeight = () => {\n const height = getHeight ? getHeight(el) : el.offsetHeight;\n sizeHandle.setHeight(height);\n };\n\n const ro = new ResizeObserver(updateHeight);\n ro.observe(el);\n updateHeight();\n\n return () => {\n ro.disconnect();\n sizeHandle.unregister();\n };\n },\n [register, getHeight],\n );\n\n return useManagedRef(callbackRef);\n};\n","import type {\n Unstable_MentionCategory,\n Unstable_MentionItem,\n Unstable_DirectiveSegment,\n Unstable_DirectiveFormatter,\n} from \"../types/mention\";\n\n// =============================================================================\n// Mention Adapter\n// =============================================================================\n\n/**\n * Adapter for providing mention categories and items to the mention picker.\n *\n * All methods are synchronous by design — the adapter drives UI display and\n * must return data immediately. Use external state management (e.g. React\n * Query, SWR, or local state) to handle async data fetching, then expose\n * the loaded results synchronously through this adapter.\n */\nexport type Unstable_MentionAdapter = {\n /** Return the top-level categories for the mention picker. */\n categories(): readonly Unstable_MentionCategory[];\n\n /** Return items within a category. */\n categoryItems(categoryId: string): readonly Unstable_MentionItem[];\n\n /** Global search across all categories (optional). */\n search?(query: string): readonly Unstable_MentionItem[];\n};\n\n// =============================================================================\n// Default Directive Formatter\n// =============================================================================\n\nconst DIRECTIVE_RE = /:([\\w-]+)\\[([^\\]]+)\\](?:\\{name=([^}]+)\\})?/g;\n\n/**\n * Default directive formatter using the `:type[label]{name=id}` syntax.\n *\n * When `id` equals `label`, the `{name=…}` attribute is omitted for brevity.\n */\nexport const unstable_defaultDirectiveFormatter: Unstable_DirectiveFormatter = {\n serialize(item: Unstable_MentionItem): string {\n const attrs = item.id !== item.label ? `{name=${item.id}}` : \"\";\n return `:${item.type}[${item.label}]${attrs}`;\n },\n\n parse(text: string): Unstable_DirectiveSegment[] {\n const segments: Unstable_DirectiveSegment[] = [];\n let lastIndex = 0;\n\n DIRECTIVE_RE.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = DIRECTIVE_RE.exec(text)) !== null) {\n if (match.index > lastIndex) {\n segments.push({\n kind: \"text\",\n text: text.slice(lastIndex, match.index),\n });\n }\n const label = match[2]!;\n segments.push({\n kind: \"mention\",\n type: match[1]!,\n label,\n id: match[3] ?? label,\n });\n lastIndex = DIRECTIVE_RE.lastIndex;\n }\n\n if (lastIndex < text.length) {\n segments.push({ kind: \"text\", text: text.slice(lastIndex) });\n }\n\n return segments;\n },\n};\n","import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\ndeclare module 'react' {\n interface ReactElement {\n $$typeof?: symbol | string;\n }\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<any>>>;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\nconst use: typeof React.use | undefined = (React as any)[' use '.trim().toString()];\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === 'object' && value !== null && 'then' in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === 'object' &&\n '$$typeof' in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n '_payload' in element &&\n isPromiseLike(element._payload)\n );\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode,\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n","\"use client\";\n\nimport { type ReactNode, useMemo, useRef } from \"react\";\nimport type { AssistantClient } from \"./types/client\";\nimport { useAuiState } from \"./useAuiState\";\nimport { useAui } from \"./useAui\";\n\nexport const useGetItemAccessor = <T,>(\n getItemState: (aui: AssistantClient) => T,\n) => {\n const aui = useAui();\n\n // if the consumer never accesses the item, do not trigger rerenders\n const cacheRef = useRef<T | undefined>(undefined);\n useAuiState(() => {\n if (cacheRef.current === undefined) {\n cacheRef.current = getItemState(aui);\n }\n return cacheRef.current;\n });\n\n return () => {\n cacheRef.current = undefined; // clear the cache (rerender on next state change)\n\n return getItemState(aui);\n };\n};\n\nconst EMPTY_OBJECT = Object.freeze({});\n\n/**\n * Component that sets up a lazy item accessor and memoizes propless children.\n *\n * For the common pattern where children returns a component without props\n * (e.g. `<Foo />`), the output is memoized and not re-created on parent re-renders.\n *\n * @example\n * ```tsx\n * <RenderChildrenWithAccessor\n * getItemState={(aui) => aui.fooList().foo({ index }).getState()}\n * >\n * {() => <Foo />}\n * </RenderChildrenWithAccessor>\n * ```\n */\nexport function RenderChildrenWithAccessor<T>({\n getItemState,\n children,\n}: {\n getItemState: (aui: AssistantClient) => T;\n children: (getItem: () => T) => ReactNode;\n}): ReactNode {\n const getItem = useGetItemAccessor(getItemState);\n return useMemoizedProplessComponent(children(getItem));\n}\n\nconst useMemoizedProplessComponent = (node: ReactNode) => {\n const el =\n typeof node === \"object\" && node != null && \"type\" in node ? node : null;\n const resultType = el?.type;\n const resultKey = el?.key;\n const resultProps =\n typeof el?.props === \"object\" &&\n el.props != null &&\n Object.entries(el.props).length === 0\n ? EMPTY_OBJECT\n : el?.props;\n\n return (\n // biome-ignore lint/correctness/useExhaustiveDependencies: optimization\n useMemo(() => el, [resultType, resultKey, resultProps]) ?? node\n );\n};\n","import { useSyncExternalStore, useDebugValue } from \"react\";\nimport type { AssistantState } from \"./types/client\";\nimport { useAui } from \"./useAui\";\nimport { getProxiedAssistantState } from \"./utils/proxied-assistant-state\";\n\n/**\n * Hook to access a slice of the assistant state with automatic subscription\n *\n * @param selector - Function to select a slice of the state\n * @returns The selected state slice\n *\n * @example\n * ```typescript\n * const aui = useAui({\n * foo: RootScope({ ... }),\n * });\n *\n * const bar = useAuiState((s) => s.foo.bar);\n * ```\n */\nexport const useAuiState = <T>(selector: (state: AssistantState) => T): T => {\n const aui = useAui();\n const proxiedState = getProxiedAssistantState(aui);\n\n const slice = useSyncExternalStore(\n aui.subscribe,\n () => selector(proxiedState),\n () => selector(proxiedState),\n );\n\n if (slice === proxiedState) {\n throw new Error(\n \"You tried to return the entire AssistantState. This is not supported due to technical limitations.\",\n );\n }\n\n useDebugValue(slice);\n\n return slice;\n};\n","import { type FC, type ReactNode, memo } from \"react\";\nimport { useAuiState } from \"@assistant-ui/store\";\nimport { getMessageQuote } from \"../../utils/getMessageQuote\";\nimport type { QuoteInfo } from \"../../../types/quote\";\n\nexport namespace MessagePrimitiveQuote {\n export type Props = {\n /** Render function called when a quote is present. Receives quote info. */\n children: (value: QuoteInfo) => ReactNode;\n };\n}\n\n/**\n * Renders a quote block if the message has quote metadata.\n * Place this above `MessagePrimitive.Parts` in your message layout.\n *\n * @example\n * ```tsx\n * <MessagePrimitive.Quote>\n * {({ text, messageId }) => <QuoteBlock text={text} messageId={messageId} />}\n * </MessagePrimitive.Quote>\n * <MessagePrimitive.Parts>\n * {({ part }) => { ... }}\n * </MessagePrimitive.Parts>\n * ```\n */\nconst MessagePrimitiveQuoteImpl: FC<MessagePrimitiveQuote.Props> = ({\n children,\n}) => {\n const quoteInfo = useAuiState(getMessageQuote);\n if (!quoteInfo) return null;\n return <>{children(quoteInfo)}</>;\n};\n\nexport const MessagePrimitiveQuote = memo(MessagePrimitiveQuoteImpl);\n\nMessagePrimitiveQuote.displayName = \"MessagePrimitive.Quote\";\n","\"use client\";\n\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n type FormEvent,\n forwardRef,\n ComponentPropsWithoutRef,\n} from \"react\";\nimport { useComposerSend } from \"./ComposerSend\";\n\nexport namespace ComposerPrimitiveRoot {\n export type Element = ComponentRef<typeof Primitive.form>;\n /**\n * Props for the ComposerPrimitive.Root component.\n * Accepts all standard form element props.\n */\n export type Props = ComponentPropsWithoutRef<typeof Primitive.form>;\n}\n\n/**\n * The root form container for message composition.\n *\n * This component provides a form wrapper that handles message submission when the form\n * is submitted (e.g., via Enter key or submit button). It automatically prevents the\n * default form submission and triggers the composer's send functionality.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Root>\n * <ComposerPrimitive.Input placeholder=\"Type your message...\" />\n * <ComposerPrimitive.Send>Send</ComposerPrimitive.Send>\n * </ComposerPrimitive.Root>\n * ```\n */\nexport const ComposerPrimitiveRoot = forwardRef<\n ComposerPrimitiveRoot.Element,\n ComposerPrimitiveRoot.Props\n>(({ onSubmit, ...rest }, forwardedRef) => {\n const send = useComposerSend();\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n\n if (!send) return;\n send();\n };\n\n return (\n <Primitive.form\n {...rest}\n ref={forwardedRef}\n onSubmit={composeEventHandlers(onSubmit, handleSubmit)}\n />\n );\n});\n\nComposerPrimitiveRoot.displayName = \"ComposerPrimitive.Root\";\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useComposerCancel as useComposerCancelBehavior } from \"@assistant-ui/core/react\";\n\nconst useComposerCancel = () => {\n const { disabled, cancel } = useComposerCancelBehavior();\n if (disabled) return null;\n return cancel;\n};\n\nexport namespace ComposerPrimitiveCancel {\n export type Element = ActionButtonElement;\n /**\n * Props for the ComposerPrimitive.Cancel component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useComposerCancel>;\n}\n\n/**\n * A button component that cancels the current message composition.\n *\n * This component automatically handles the cancel functionality and is disabled\n * when canceling is not available.\n *\n * @example\n * ```tsx\n * <ComposerPrimitive.Cancel>\n * Cancel\n * </ComposerPrimitive.Cancel>\n * ```\n */\nexport const ComposerPrimitiveCancel = createActionButton(\n \"ComposerPrimitive.Cancel\",\n useComposerCancel,\n);\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useActionBarEdit as useActionBarEditBehavior } from \"@assistant-ui/core/react\";\n\n/**\n * Hook that provides edit functionality for action bar buttons.\n *\n * This hook returns a callback function that starts editing the current message,\n * or null if editing is not available (e.g., already in editing mode).\n *\n * @returns An edit callback function, or null if editing is disabled\n *\n * @example\n * ```tsx\n * function CustomEditButton() {\n * const edit = useActionBarEdit();\n *\n * return (\n * <button onClick={edit} disabled={!edit}>\n * {edit ? \"Edit Message\" : \"Cannot Edit\"}\n * </button>\n * );\n * }\n * ```\n */\nconst useActionBarEdit = () => {\n const { disabled, edit } = useActionBarEditBehavior();\n if (disabled) return null;\n return edit;\n};\n\nexport namespace ActionBarPrimitiveEdit {\n export type Element = ActionButtonElement;\n /**\n * Props for the ActionBarPrimitive.Edit component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useActionBarEdit>;\n}\n\n/**\n * A button component that starts editing the current message.\n *\n * This component automatically handles starting the edit mode for the current message\n * and is disabled when editing is not available (e.g., already in editing mode).\n *\n * @example\n * ```tsx\n * <ActionBarPrimitive.Edit>\n * Edit Message\n * </ActionBarPrimitive.Edit>\n * ```\n */\nexport const ActionBarPrimitiveEdit = createActionButton(\n \"ActionBarPrimitive.Edit\",\n useActionBarEdit,\n);\n","\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useActionBarReload as useActionBarReloadBehavior } from \"@assistant-ui/core/react\";\n\n/**\n * Hook that provides reload functionality for action bar buttons.\n *\n * This hook returns a callback function that reloads/regenerates the current assistant message,\n * or null if reloading is not available (e.g., thread is running, disabled, or message is not from assistant).\n *\n * @returns A reload callback function, or null if reloading is disabled\n *\n * @example\n * ```tsx\n * function CustomReloadButton() {\n * const reload = useActionBarReload();\n *\n * return (\n * <button onClick={reload} disabled={!reload}>\n * {reload ? \"Reload Message\" : \"Cannot Reload\"}\n * </button>\n * );\n * }\n * ```\n */\nconst useActionBarReload = () => {\n const { disabled, reload } = useActionBarReloadBehavior();\n if (disabled) return null;\n return reload;\n};\n\nexport namespace ActionBarPrimitiveReload {\n export type Element = ActionButtonElement;\n /**\n * Props for the ActionBarPrimitive.Reload component.\n * Inherits all button element props and action button functionality.\n */\n export type Props = ActionButtonProps<typeof useActionBarReload>;\n}\n\n/**\n * A button component that reloads/regenerates the current assistant message.\n *\n * This component automatically handles reloading the current assistant message\n * and is disabled when reloading is not available (e.g., thread is running,\n * disabled, or message is not from assistant).\n *\n * @example\n * ```tsx\n * <ActionBarPrimitive.Reload>\n * Reload Message\n * </ActionBarPrimitive.Reload>\n * ```\n */\nexport const ActionBarPrimitiveReload = createActionButton(\n \"ActionBarPrimitive.Reload\",\n useActionBarReload,\n);\n","\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"../../utils/Primitive\";\nimport {\n type ComponentRef,\n forwardRef,\n ComponentPropsWithoutRef,\n useCallback,\n} from \"react\";\nimport { useSizeHandle } from \"../../utils/hooks/useSizeHandle\";\nimport { useThreadViewport } from \"../../context/react/ThreadViewportContext\";\n\nexport namespace ThreadPrimitiveViewportFooter {\n export type Element = ComponentRef<typeof Primitive.div>;\n export type Props = ComponentPropsWithoutRef<typeof Primitive.div>;\n}\n\n/**\n * A footer container that measures its height for scroll calculations.\n *\n * This component measures its height and provides it to the viewport context\n * for use in scroll calculations (e.g., ViewportSlack min-height).\n *\n * Multiple ViewportFooter components can be used - their heights are summed.\n *\n * Typically used with `className=\"sticky bottom-0\"` to keep the footer\n * visible at the bottom of the viewport while scrolling.\n *\n * @example\n * ```tsx\n * <ThreadPrimitive.Viewport>\n * <ThreadPrimitive.Messages>\n * {() => <MyMessage />}\n * </ThreadPrimitive.Messages>\n * <ThreadPrimitive.ViewportFooter className=\"sticky bottom-0\">\n * <Composer />\n * </ThreadPrimitive.ViewportFooter>\n * </ThreadPrimitive.Viewport>\n * ```\n */\nexport const ThreadPrimitiveViewportFooter = forwardRef<\n ThreadPrimitiveViewportFooter.Element,\n ThreadPrimitiveViewportFooter.Props\n>((props, forwardedRef) => {\n const register = useThreadViewport((s) => s.registerContentInset);\n const getHeight = useCallback((el: HTMLElement) => {\n const marginTop = parseFloat(getComputedStyle(el).marginTop) || 0;\n return el.offsetHeight + marginTop;\n }, []);\n\n const resizeRef = useSizeHandle(register, getHeight);\n\n const ref = useComposedRefs(forwardedRef, resizeRef);\n\n return <Primitive.div {...props} ref={ref} />;\n});\n\nThreadPrimitiveViewportFooter.displayName = \"ThreadPrimitive.ViewportFooter\";\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nexport default function (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n","import type { Declaration } from 'inline-style-parser';\nimport parse from 'inline-style-parser';\n\nexport { Declaration };\n\nexport interface StyleObject {\n [name: string]: string;\n}\n\ntype Iterator = (\n property: string,\n value: string,\n declaration: Declaration,\n) => void;\n\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nexport default function StyleToObject(\n style: string,\n iterator?: Iterator,\n): StyleObject | null {\n let styleObject: StyleObject | null = null;\n\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n\n const declarations = parse(style);\n const hasIterator = typeof iterator === 'function';\n\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n\n const { property, value } = declaration;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n\n return styleObject;\n}\n","const CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/;\nconst HYPHEN_REGEX = /-([a-z])/g;\nconst NO_HYPHEN_REGEX = /^[^-]+$/;\nconst VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/;\nconst MS_VENDOR_PREFIX_REGEX = /^-(ms)-/;\n\n/**\n * Checks whether to skip camelCase.\n */\nconst skipCamelCase = (property: string) =>\n !property ||\n NO_HYPHEN_REGEX.test(property) ||\n CUSTOM_PROPERTY_REGEX.test(property);\n\n/**\n * Replacer that capitalizes first character.\n */\nconst capitalize = (match: string, character: string) =>\n character.toUpperCase();\n\n/**\n * Replacer that removes beginning hyphen of vendor prefix property.\n */\nconst trimHyphen = (match: string, prefix: string) => `${prefix}-`;\n\n/**\n * CamelCase options.\n */\nexport interface CamelCaseOptions {\n reactCompat?: boolean;\n}\n\n/**\n * CamelCases a CSS property.\n */\nexport const camelCase = (property: string, options: CamelCaseOptions = {}) => {\n if (skipCamelCase(property)) {\n return property;\n }\n\n property = property.toLowerCase();\n\n if (options.reactCompat) {\n // `-ms` vendor prefix should not be capitalized\n property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen);\n } else {\n // for non-React, remove first hyphen so vendor prefix is not capitalized\n property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen);\n }\n\n return property.replace(HYPHEN_REGEX, capitalize);\n};\n","import StyleToObject from 'style-to-object';\n\nimport { camelCase, CamelCaseOptions } from './utilities';\n\ntype StyleObject = Record<string, string>;\n\ninterface StyleToJSOptions extends CamelCaseOptions {}\n\n/**\n * Parses CSS inline style to JavaScript object (camelCased).\n */\nfunction StyleToJS(style: string, options?: StyleToJSOptions): StyleObject {\n const output: StyleObject = {};\n\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n StyleToObject(style, (property, value) => {\n // skip CSS comment\n if (property && value) {\n output[camelCase(property, options)] = value;\n }\n });\n\n return output;\n}\n\nStyleToJS.default = StyleToJS;\n\nexport = StyleToJS;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","export function deprecate(fn) {\n return fn\n}\n\nexport function equal() {}\n\nexport function ok() {}\n\nexport function unreachable() {}\n","/**\n * @typedef Options\n * Configuration for `stringify`.\n * @property {boolean} [padLeft=true]\n * Whether to pad a space before a token.\n * @property {boolean} [padRight=false]\n * Whether to pad a space after a token.\n */\n\n/**\n * @typedef {Options} StringifyOptions\n * Please use `StringifyOptions` instead.\n */\n\n/**\n * Parse comma-separated tokens to an array.\n *\n * @param {string} value\n * Comma-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n /** @type {Array<string>} */\n const tokens = []\n const input = String(value || '')\n let index = input.indexOf(',')\n let start = 0\n /** @type {boolean} */\n let end = false\n\n while (!end) {\n if (index === -1) {\n index = input.length\n end = true\n }\n\n const token = input.slice(start, index).trim()\n\n if (token || !end) {\n tokens.push(token)\n }\n\n start = index + 1\n index = input.indexOf(',', start)\n }\n\n return tokens\n}\n\n/**\n * Serialize an array of strings or numbers to comma-separated tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @param {Options} [options]\n * Configuration for `stringify` (optional).\n * @returns {string}\n * Comma-separated tokens.\n */\nexport function stringify(values, options) {\n const settings = options || {}\n\n // Ensure the last empty entry is seen.\n const input = values[values.length - 1] === '' ? [...values, ''] : values\n\n return input\n .join(\n (settings.padRight ? ' ' : '') +\n ',' +\n (settings.padLeft === false ? '' : ' ')\n )\n .trim()\n}\n","/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [jsx=false]\n * Support JSX identifiers (default: `false`).\n */\n\nconst startRe = /[$_\\p{ID_Start}]/u\nconst contRe = /[$_\\u{200C}\\u{200D}\\p{ID_Continue}]/u\nconst contReJsx = /[-$_\\u{200C}\\u{200D}\\p{ID_Continue}]/u\nconst nameRe = /^[$_\\p{ID_Start}][$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$/u\nconst nameReJsx = /^[$_\\p{ID_Start}][-$_\\u{200C}\\u{200D}\\p{ID_Continue}]*$/u\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Checks if the given code point can start an identifier.\n *\n * @param {number | undefined} code\n * Code point to check.\n * @returns {boolean}\n * Whether `code` can start an identifier.\n */\n// Note: `undefined` is supported so you can pass the result from `''.codePointAt`.\nexport function start(code) {\n return code ? startRe.test(String.fromCodePoint(code)) : false\n}\n\n/**\n * Checks if the given code point can continue an identifier.\n *\n * @param {number | undefined} code\n * Code point to check.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {boolean}\n * Whether `code` can continue an identifier.\n */\n// Note: `undefined` is supported so you can pass the result from `''.codePointAt`.\nexport function cont(code, options) {\n const settings = options || emptyOptions\n const re = settings.jsx ? contReJsx : contRe\n return code ? re.test(String.fromCodePoint(code)) : false\n}\n\n/**\n * Checks if the given value is a valid identifier name.\n *\n * @param {string} name\n * Identifier to check.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {boolean}\n * Whether `name` can be an identifier.\n */\nexport function name(name, options) {\n const settings = options || emptyOptions\n const re = settings.jsx ? nameReJsx : nameRe\n return re.test(name)\n}\n","/**\n * @typedef {import('hast').Nodes} Nodes\n */\n\n// HTML whitespace expression.\n// See <https://infra.spec.whatwg.org/#ascii-whitespace>.\nconst re = /[ \\t\\n\\f\\r]/g\n\n/**\n * Check if the given value is *inter-element whitespace*.\n *\n * @param {Nodes | string} thing\n * Thing to check (`Node` or `string`).\n * @returns {boolean}\n * Whether the `value` is inter-element whitespace (`boolean`): consisting of\n * zero or more of space, tab (`\\t`), line feed (`\\n`), carriage return\n * (`\\r`), or form feed (`\\f`); if a node is passed it must be a `Text` node,\n * whose `value` field is checked.\n */\nexport function whitespace(thing) {\n return typeof thing === 'object'\n ? thing.type === 'text'\n ? empty(thing.value)\n : false\n : empty(thing)\n}\n\n/**\n * @param {string} value\n * @returns {boolean}\n */\nfunction empty(value) {\n return value.replace(re, '') === ''\n}\n","/**\n * @import {Info as InfoType} from 'property-information'\n */\n\n/** @type {InfoType} */\nexport class Info {\n /**\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @returns\n * Info.\n */\n constructor(property, attribute) {\n this.attribute = attribute\n this.property = property\n }\n}\n\nInfo.prototype.attribute = ''\nInfo.prototype.booleanish = false\nInfo.prototype.boolean = false\nInfo.prototype.commaOrSpaceSeparated = false\nInfo.prototype.commaSeparated = false\nInfo.prototype.defined = false\nInfo.prototype.mustUseProperty = false\nInfo.prototype.number = false\nInfo.prototype.overloadedBoolean = false\nInfo.prototype.property = ''\nInfo.prototype.spaceSeparated = false\nInfo.prototype.space = undefined\n","let powers = 0\n\nexport const boolean = increment()\nexport const booleanish = increment()\nexport const overloadedBoolean = increment()\nexport const number = increment()\nexport const spaceSeparated = increment()\nexport const commaSeparated = increment()\nexport const commaOrSpaceSeparated = increment()\n\nfunction increment() {\n return 2 ** ++powers\n}\n","/**\n * @import {Space} from 'property-information'\n */\n\nimport {Info} from './info.js'\nimport * as types from './types.js'\n\nconst checks = /** @type {ReadonlyArray<keyof typeof types>} */ (\n Object.keys(types)\n)\n\nexport class DefinedInfo extends Info {\n /**\n * @constructor\n * @param {string} property\n * Property.\n * @param {string} attribute\n * Attribute.\n * @param {number | null | undefined} [mask]\n * Mask.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Info.\n */\n constructor(property, attribute, mask, space) {\n let index = -1\n\n super(property, attribute)\n\n mark(this, 'space', space)\n\n if (typeof mask === 'number') {\n while (++index < checks.length) {\n const check = checks[index]\n mark(this, checks[index], (mask & types[check]) === types[check])\n }\n }\n }\n}\n\nDefinedInfo.prototype.defined = true\n\n/**\n * @template {keyof DefinedInfo} Key\n * Key type.\n * @param {DefinedInfo} values\n * Info.\n * @param {Key} key\n * Key.\n * @param {DefinedInfo[Key]} value\n * Value.\n * @returns {undefined}\n * Nothing.\n */\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","/**\n * Get the cleaned case insensitive form of an attribute or property.\n *\n * @param {string} value\n * An attribute-like or property-like name.\n * @returns {string}\n * Value that can be used to look up the properly cased property on a\n * `Schema`.\n */\nexport function normalize(value) {\n return value.toLowerCase()\n}\n","/**\n * @import {Schema} from 'property-information'\n */\n\nimport {DefinedInfo} from './util/defined-info.js'\nimport {Info} from './util/info.js'\nimport {normalize} from './normalize.js'\n\nconst cap = /[A-Z]/g\nconst dash = /-[a-z]/g\nconst valid = /^data[-\\w.:]+$/i\n\n/**\n * Look up info on a property.\n *\n * In most cases the given `schema` contains info on the property.\n * All standard,\n * most legacy,\n * and some non-standard properties are supported.\n * For these cases,\n * the returned `Info` has hints about the value of the property.\n *\n * `name` can also be a valid data attribute or property,\n * in which case an `Info` object with the correctly cased `attribute` and\n * `property` is returned.\n *\n * `name` can be an unknown attribute,\n * in which case an `Info` object with `attribute` and `property` set to the\n * given name is returned.\n * It is not recommended to provide unsupported legacy or recently specced\n * properties.\n *\n *\n * @param {Schema} schema\n * Schema;\n * either the `html` or `svg` export.\n * @param {string} value\n * An attribute-like or property-like name;\n * it will be passed through `normalize` to hopefully find the correct info.\n * @returns {Info}\n * Info.\n */\nexport function find(schema, value) {\n const normal = normalize(value)\n let property = value\n let Type = Info\n\n if (normal in schema.normal) {\n return schema.property[schema.normal[normal]]\n }\n\n if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) {\n // Attribute or property.\n if (value.charAt(4) === '-') {\n // Turn it into a property.\n const rest = value.slice(5).replace(dash, camelcase)\n property = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1)\n } else {\n // Turn it into an attribute.\n const rest = value.slice(4)\n\n if (!dash.test(rest)) {\n let dashes = rest.replace(cap, kebab)\n\n if (dashes.charAt(0) !== '-') {\n dashes = '-' + dashes\n }\n\n value = 'data' + dashes\n }\n }\n\n Type = DefinedInfo\n }\n\n return new Type(property, value)\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Kebab.\n */\nfunction kebab($0) {\n return '-' + $0.toLowerCase()\n}\n\n/**\n * @param {string} $0\n * Value.\n * @returns {string}\n * Camel.\n */\nfunction camelcase($0) {\n return $0.charAt(1).toUpperCase()\n}\n","/**\n * Special cases for React (`Record<string, string>`).\n *\n * `hast` is close to `React` but differs in a couple of cases.\n * To get a React property from a hast property,\n * check if it is in `hastToReact`.\n * If it is, use the corresponding value;\n * otherwise, use the hast property.\n *\n * @type {Record<string, string>}\n */\nexport const hastToReact = {\n classId: 'classID',\n dataType: 'datatype',\n itemId: 'itemID',\n strokeDashArray: 'strokeDasharray',\n strokeDashOffset: 'strokeDashoffset',\n strokeLineCap: 'strokeLinecap',\n strokeLineJoin: 'strokeLinejoin',\n strokeMiterLimit: 'strokeMiterlimit',\n typeOf: 'typeof',\n xLinkActuate: 'xlinkActuate',\n xLinkArcRole: 'xlinkArcrole',\n xLinkHref: 'xlinkHref',\n xLinkRole: 'xlinkRole',\n xLinkShow: 'xlinkShow',\n xLinkTitle: 'xlinkTitle',\n xLinkType: 'xlinkType',\n xmlnsXLink: 'xmlnsXlink'\n}\n","/**\n * @import {Schema as SchemaType, Space} from 'property-information'\n */\n\n/** @type {SchemaType} */\nexport class Schema {\n /**\n * @param {SchemaType['property']} property\n * Property.\n * @param {SchemaType['normal']} normal\n * Normal.\n * @param {Space | undefined} [space]\n * Space.\n * @returns\n * Schema.\n */\n constructor(property, normal, space) {\n this.normal = normal\n this.property = property\n\n if (space) {\n this.space = space\n }\n }\n}\n\nSchema.prototype.normal = {}\nSchema.prototype.property = {}\nSchema.prototype.space = undefined\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\nimport {Schema} from './schema.js'\n\n/**\n * @param {ReadonlyArray<Schema>} definitions\n * Definitions.\n * @param {Space | undefined} [space]\n * Space.\n * @returns {Schema}\n * Schema.\n */\nexport function merge(definitions, space) {\n /** @type {Record<string, Info>} */\n const property = {}\n /** @type {Record<string, string>} */\n const normal = {}\n\n for (const definition of definitions) {\n Object.assign(property, definition.property)\n Object.assign(normal, definition.normal)\n }\n\n return new Schema(property, normal, space)\n}\n","/**\n * @import {Info, Space} from 'property-information'\n */\n\n/**\n * @typedef Definition\n * Definition of a schema.\n * @property {Record<string, string> | undefined} [attributes]\n * Normalzed names to special attribute case.\n * @property {ReadonlyArray<string> | undefined} [mustUseProperty]\n * Normalized names that must be set as properties.\n * @property {Record<string, number | null>} properties\n * Property names to their types.\n * @property {Space | undefined} [space]\n * Space.\n * @property {Transform} transform\n * Transform a property name.\n */\n\n/**\n * @callback Transform\n * Transform.\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Attribute.\n */\n\nimport {normalize} from '../normalize.js'\nimport {DefinedInfo} from './defined-info.js'\nimport {Schema} from './schema.js'\n\n/**\n * @param {Definition} definition\n * Definition.\n * @returns {Schema}\n * Schema.\n */\nexport function create(definition) {\n /** @type {Record<string, Info>} */\n const properties = {}\n /** @type {Record<string, string>} */\n const normals = {}\n\n for (const [property, value] of Object.entries(definition.properties)) {\n const info = new DefinedInfo(\n property,\n definition.transform(definition.attributes || {}, property),\n value,\n definition.space\n )\n\n if (\n definition.mustUseProperty &&\n definition.mustUseProperty.includes(property)\n ) {\n info.mustUseProperty = true\n }\n\n properties[property] = info\n\n normals[normalize(property)] = property\n normals[normalize(info.attribute)] = property\n }\n\n return new Schema(properties, normals, definition.space)\n}\n","import {create} from './util/create.js'\nimport {booleanish, number, spaceSeparated} from './util/types.js'\n\nexport const aria = create({\n properties: {\n ariaActiveDescendant: null,\n ariaAtomic: booleanish,\n ariaAutoComplete: null,\n ariaBusy: booleanish,\n ariaChecked: booleanish,\n ariaColCount: number,\n ariaColIndex: number,\n ariaColSpan: number,\n ariaControls: spaceSeparated,\n ariaCurrent: null,\n ariaDescribedBy: spaceSeparated,\n ariaDetails: null,\n ariaDisabled: booleanish,\n ariaDropEffect: spaceSeparated,\n ariaErrorMessage: null,\n ariaExpanded: booleanish,\n ariaFlowTo: spaceSeparated,\n ariaGrabbed: booleanish,\n ariaHasPopup: null,\n ariaHidden: booleanish,\n ariaInvalid: null,\n ariaKeyShortcuts: null,\n ariaLabel: null,\n ariaLabelledBy: spaceSeparated,\n ariaLevel: number,\n ariaLive: null,\n ariaModal: booleanish,\n ariaMultiLine: booleanish,\n ariaMultiSelectable: booleanish,\n ariaOrientation: null,\n ariaOwns: spaceSeparated,\n ariaPlaceholder: null,\n ariaPosInSet: number,\n ariaPressed: booleanish,\n ariaReadOnly: booleanish,\n ariaRelevant: null,\n ariaRequired: booleanish,\n ariaRoleDescription: spaceSeparated,\n ariaRowCount: number,\n ariaRowIndex: number,\n ariaRowSpan: number,\n ariaSelected: booleanish,\n ariaSetSize: number,\n ariaSort: null,\n ariaValueMax: number,\n ariaValueMin: number,\n ariaValueNow: number,\n ariaValueText: null,\n role: null\n },\n transform(_, property) {\n return property === 'role'\n ? property\n : 'aria-' + property.slice(4).toLowerCase()\n }\n})\n","/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} attribute\n * Attribute.\n * @returns {string}\n * Transformed attribute.\n */\nexport function caseSensitiveTransform(attributes, attribute) {\n return attribute in attributes ? attributes[attribute] : attribute\n}\n","import {caseSensitiveTransform} from './case-sensitive-transform.js'\n\n/**\n * @param {Record<string, string>} attributes\n * Attributes.\n * @param {string} property\n * Property.\n * @returns {string}\n * Transformed property.\n */\nexport function caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","import {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n booleanish,\n boolean,\n commaSeparated,\n number,\n overloadedBoolean,\n spaceSeparated\n} from './util/types.js'\n\nexport const html = create({\n attributes: {\n acceptcharset: 'accept-charset',\n classname: 'class',\n htmlfor: 'for',\n httpequiv: 'http-equiv'\n },\n mustUseProperty: ['checked', 'multiple', 'muted', 'selected'],\n properties: {\n // Standard Properties.\n abbr: null,\n accept: commaSeparated,\n acceptCharset: spaceSeparated,\n accessKey: spaceSeparated,\n action: null,\n allow: null,\n allowFullScreen: boolean,\n allowPaymentRequest: boolean,\n allowUserMedia: boolean,\n alt: null,\n as: null,\n async: boolean,\n autoCapitalize: null,\n autoComplete: spaceSeparated,\n autoFocus: boolean,\n autoPlay: boolean,\n blocking: spaceSeparated,\n capture: null,\n charSet: null,\n checked: boolean,\n cite: null,\n className: spaceSeparated,\n cols: number,\n colSpan: null,\n content: null,\n contentEditable: booleanish,\n controls: boolean,\n controlsList: spaceSeparated,\n coords: number | commaSeparated,\n crossOrigin: null,\n data: null,\n dateTime: null,\n decoding: null,\n default: boolean,\n defer: boolean,\n dir: null,\n dirName: null,\n disabled: boolean,\n download: overloadedBoolean,\n draggable: booleanish,\n encType: null,\n enterKeyHint: null,\n fetchPriority: null,\n form: null,\n formAction: null,\n formEncType: null,\n formMethod: null,\n formNoValidate: boolean,\n formTarget: null,\n headers: spaceSeparated,\n height: number,\n hidden: overloadedBoolean,\n high: number,\n href: null,\n hrefLang: null,\n htmlFor: spaceSeparated,\n httpEquiv: spaceSeparated,\n id: null,\n imageSizes: null,\n imageSrcSet: null,\n inert: boolean,\n inputMode: null,\n integrity: null,\n is: null,\n isMap: boolean,\n itemId: null,\n itemProp: spaceSeparated,\n itemRef: spaceSeparated,\n itemScope: boolean,\n itemType: spaceSeparated,\n kind: null,\n label: null,\n lang: null,\n language: null,\n list: null,\n loading: null,\n loop: boolean,\n low: number,\n manifest: null,\n max: null,\n maxLength: number,\n media: null,\n method: null,\n min: null,\n minLength: number,\n multiple: boolean,\n muted: boolean,\n name: null,\n nonce: null,\n noModule: boolean,\n noValidate: boolean,\n onAbort: null,\n onAfterPrint: null,\n onAuxClick: null,\n onBeforeMatch: null,\n onBeforePrint: null,\n onBeforeToggle: null,\n onBeforeUnload: null,\n onBlur: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onContextLost: null,\n onContextMenu: null,\n onContextRestored: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFormData: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLanguageChange: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadEnd: null,\n onLoadStart: null,\n onMessage: null,\n onMessageError: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRejectionHandled: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onScrollEnd: null,\n onSecurityPolicyViolation: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onSlotChange: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnhandledRejection: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onWheel: null,\n open: boolean,\n optimum: number,\n pattern: null,\n ping: spaceSeparated,\n placeholder: null,\n playsInline: boolean,\n popover: null,\n popoverTarget: null,\n popoverTargetAction: null,\n poster: null,\n preload: null,\n readOnly: boolean,\n referrerPolicy: null,\n rel: spaceSeparated,\n required: boolean,\n reversed: boolean,\n rows: number,\n rowSpan: number,\n sandbox: spaceSeparated,\n scope: null,\n scoped: boolean,\n seamless: boolean,\n selected: boolean,\n shadowRootClonable: boolean,\n shadowRootDelegatesFocus: boolean,\n shadowRootMode: null,\n shape: null,\n size: number,\n sizes: null,\n slot: null,\n span: number,\n spellCheck: booleanish,\n src: null,\n srcDoc: null,\n srcLang: null,\n srcSet: null,\n start: number,\n step: null,\n style: null,\n tabIndex: number,\n target: null,\n title: null,\n translate: null,\n type: null,\n typeMustMatch: boolean,\n useMap: null,\n value: booleanish,\n width: number,\n wrap: null,\n writingSuggestions: null,\n\n // Legacy.\n // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis\n align: null, // Several. Use CSS `text-align` instead,\n aLink: null, // `<body>`. Use CSS `a:active {color}` instead\n archive: spaceSeparated, // `<object>`. List of URIs to archives\n axis: null, // `<td>` and `<th>`. Use `scope` on `<th>`\n background: null, // `<body>`. Use CSS `background-image` instead\n bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead\n border: number, // `<table>`. Use CSS `border-width` instead,\n borderColor: null, // `<table>`. Use CSS `border-color` instead,\n bottomMargin: number, // `<body>`\n cellPadding: null, // `<table>`\n cellSpacing: null, // `<table>`\n char: null, // Several table elements. When `align=char`, sets the character to align on\n charOff: null, // Several table elements. When `char`, offsets the alignment\n classId: null, // `<object>`\n clear: null, // `<br>`. Use CSS `clear` instead\n code: null, // `<object>`\n codeBase: null, // `<object>`\n codeType: null, // `<object>`\n color: null, // `<font>` and `<hr>`. Use CSS instead\n compact: boolean, // Lists. Use CSS to reduce space between items instead\n declare: boolean, // `<object>`\n event: null, // `<script>`\n face: null, // `<font>`. Use CSS instead\n frame: null, // `<table>`\n frameBorder: null, // `<iframe>`. Use CSS `border` instead\n hSpace: number, // `<img>` and `<object>`\n leftMargin: number, // `<body>`\n link: null, // `<body>`. Use CSS `a:link {color: *}` instead\n longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`\n lowSrc: null, // `<img>`. Use a `<picture>`\n marginHeight: number, // `<body>`\n marginWidth: number, // `<body>`\n noResize: boolean, // `<frame>`\n noHref: boolean, // `<area>`. Use no href instead of an explicit `nohref`\n noShade: boolean, // `<hr>`. Use background-color and height instead of borders\n noWrap: boolean, // `<td>` and `<th>`\n object: null, // `<applet>`\n profile: null, // `<head>`\n prompt: null, // `<isindex>`\n rev: null, // `<link>`\n rightMargin: number, // `<body>`\n rules: null, // `<table>`\n scheme: null, // `<meta>`\n scrolling: booleanish, // `<frame>`. Use overflow in the child context\n standby: null, // `<object>`\n summary: null, // `<table>`\n text: null, // `<body>`. Use CSS `color` instead\n topMargin: number, // `<body>`\n valueType: null, // `<param>`\n version: null, // `<html>`. Use a doctype.\n vAlign: null, // Several. Use CSS `vertical-align` instead\n vLink: null, // `<body>`. Use CSS `a:visited {color}` instead\n vSpace: number, // `<img>` and `<object>`\n\n // Non-standard Properties.\n allowTransparency: null,\n autoCorrect: null,\n autoSave: null,\n disablePictureInPicture: boolean,\n disableRemotePlayback: boolean,\n prefix: null,\n property: null,\n results: number,\n security: null,\n unselectable: null\n },\n space: 'html',\n transform: caseInsensitiveTransform\n})\n","import {caseSensitiveTransform} from './util/case-sensitive-transform.js'\nimport {create} from './util/create.js'\nimport {\n boolean,\n commaOrSpaceSeparated,\n commaSeparated,\n number,\n spaceSeparated\n} from './util/types.js'\n\nexport const svg = create({\n attributes: {\n accentHeight: 'accent-height',\n alignmentBaseline: 'alignment-baseline',\n arabicForm: 'arabic-form',\n baselineShift: 'baseline-shift',\n capHeight: 'cap-height',\n className: 'class',\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n crossOrigin: 'crossorigin',\n dataType: 'datatype',\n dominantBaseline: 'dominant-baseline',\n enableBackground: 'enable-background',\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n hrefLang: 'hreflang',\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n horizOriginY: 'horiz-origin-y',\n imageRendering: 'image-rendering',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n navDown: 'nav-down',\n navDownLeft: 'nav-down-left',\n navDownRight: 'nav-down-right',\n navLeft: 'nav-left',\n navNext: 'nav-next',\n navPrev: 'nav-prev',\n navRight: 'nav-right',\n navUp: 'nav-up',\n navUpLeft: 'nav-up-left',\n navUpRight: 'nav-up-right',\n onAbort: 'onabort',\n onActivate: 'onactivate',\n onAfterPrint: 'onafterprint',\n onBeforePrint: 'onbeforeprint',\n onBegin: 'onbegin',\n onCancel: 'oncancel',\n onCanPlay: 'oncanplay',\n onCanPlayThrough: 'oncanplaythrough',\n onChange: 'onchange',\n onClick: 'onclick',\n onClose: 'onclose',\n onCopy: 'oncopy',\n onCueChange: 'oncuechange',\n onCut: 'oncut',\n onDblClick: 'ondblclick',\n onDrag: 'ondrag',\n onDragEnd: 'ondragend',\n onDragEnter: 'ondragenter',\n onDragExit: 'ondragexit',\n onDragLeave: 'ondragleave',\n onDragOver: 'ondragover',\n onDragStart: 'ondragstart',\n onDrop: 'ondrop',\n onDurationChange: 'ondurationchange',\n onEmptied: 'onemptied',\n onEnd: 'onend',\n onEnded: 'onended',\n onError: 'onerror',\n onFocus: 'onfocus',\n onFocusIn: 'onfocusin',\n onFocusOut: 'onfocusout',\n onHashChange: 'onhashchange',\n onInput: 'oninput',\n onInvalid: 'oninvalid',\n onKeyDown: 'onkeydown',\n onKeyPress: 'onkeypress',\n onKeyUp: 'onkeyup',\n onLoad: 'onload',\n onLoadedData: 'onloadeddata',\n onLoadedMetadata: 'onloadedmetadata',\n onLoadStart: 'onloadstart',\n onMessage: 'onmessage',\n onMouseDown: 'onmousedown',\n onMouseEnter: 'onmouseenter',\n onMouseLeave: 'onmouseleave',\n onMouseMove: 'onmousemove',\n onMouseOut: 'onmouseout',\n onMouseOver: 'onmouseover',\n onMouseUp: 'onmouseup',\n onMouseWheel: 'onmousewheel',\n onOffline: 'onoffline',\n onOnline: 'ononline',\n onPageHide: 'onpagehide',\n onPageShow: 'onpageshow',\n onPaste: 'onpaste',\n onPause: 'onpause',\n onPlay: 'onplay',\n onPlaying: 'onplaying',\n onPopState: 'onpopstate',\n onProgress: 'onprogress',\n onRateChange: 'onratechange',\n onRepeat: 'onrepeat',\n onReset: 'onreset',\n onResize: 'onresize',\n onScroll: 'onscroll',\n onSeeked: 'onseeked',\n onSeeking: 'onseeking',\n onSelect: 'onselect',\n onShow: 'onshow',\n onStalled: 'onstalled',\n onStorage: 'onstorage',\n onSubmit: 'onsubmit',\n onSuspend: 'onsuspend',\n onTimeUpdate: 'ontimeupdate',\n onToggle: 'ontoggle',\n onUnload: 'onunload',\n onVolumeChange: 'onvolumechange',\n onWaiting: 'onwaiting',\n onZoom: 'onzoom',\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pointerEvents: 'pointer-events',\n referrerPolicy: 'referrerpolicy',\n renderingIntent: 'rendering-intent',\n shapeRendering: 'shape-rendering',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n strokeDashArray: 'stroke-dasharray',\n strokeDashOffset: 'stroke-dashoffset',\n strokeLineCap: 'stroke-linecap',\n strokeLineJoin: 'stroke-linejoin',\n strokeMiterLimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n tabIndex: 'tabindex',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n transformOrigin: 'transform-origin',\n typeOf: 'typeof',\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n vectorEffect: 'vector-effect',\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n xHeight: 'x-height',\n // These were camelcased in Tiny. Now lowercased in SVG 2\n playbackOrder: 'playbackorder',\n timelineBegin: 'timelinebegin'\n },\n properties: {\n about: commaOrSpaceSeparated,\n accentHeight: number,\n accumulate: null,\n additive: null,\n alignmentBaseline: null,\n alphabetic: number,\n amplitude: number,\n arabicForm: null,\n ascent: number,\n attributeName: null,\n attributeType: null,\n azimuth: number,\n bandwidth: null,\n baselineShift: null,\n baseFrequency: null,\n baseProfile: null,\n bbox: null,\n begin: null,\n bias: number,\n by: null,\n calcMode: null,\n capHeight: number,\n className: spaceSeparated,\n clip: null,\n clipPath: null,\n clipPathUnits: null,\n clipRule: null,\n color: null,\n colorInterpolation: null,\n colorInterpolationFilters: null,\n colorProfile: null,\n colorRendering: null,\n content: null,\n contentScriptType: null,\n contentStyleType: null,\n crossOrigin: null,\n cursor: null,\n cx: null,\n cy: null,\n d: null,\n dataType: null,\n defaultAction: null,\n descent: number,\n diffuseConstant: number,\n direction: null,\n display: null,\n dur: null,\n divisor: number,\n dominantBaseline: null,\n download: boolean,\n dx: null,\n dy: null,\n edgeMode: null,\n editable: null,\n elevation: number,\n enableBackground: null,\n end: null,\n event: null,\n exponent: number,\n externalResourcesRequired: null,\n fill: null,\n fillOpacity: number,\n fillRule: null,\n filter: null,\n filterRes: null,\n filterUnits: null,\n floodColor: null,\n floodOpacity: null,\n focusable: null,\n focusHighlight: null,\n fontFamily: null,\n fontSize: null,\n fontSizeAdjust: null,\n fontStretch: null,\n fontStyle: null,\n fontVariant: null,\n fontWeight: null,\n format: null,\n fr: null,\n from: null,\n fx: null,\n fy: null,\n g1: commaSeparated,\n g2: commaSeparated,\n glyphName: commaSeparated,\n glyphOrientationHorizontal: null,\n glyphOrientationVertical: null,\n glyphRef: null,\n gradientTransform: null,\n gradientUnits: null,\n handler: null,\n hanging: number,\n hatchContentUnits: null,\n hatchUnits: null,\n height: null,\n href: null,\n hrefLang: null,\n horizAdvX: number,\n horizOriginX: number,\n horizOriginY: number,\n id: null,\n ideographic: number,\n imageRendering: null,\n initialVisibility: null,\n in: null,\n in2: null,\n intercept: number,\n k: number,\n k1: number,\n k2: number,\n k3: number,\n k4: number,\n kernelMatrix: commaOrSpaceSeparated,\n kernelUnitLength: null,\n keyPoints: null, // SEMI_COLON_SEPARATED\n keySplines: null, // SEMI_COLON_SEPARATED\n keyTimes: null, // SEMI_COLON_SEPARATED\n kerning: null,\n lang: null,\n lengthAdjust: null,\n letterSpacing: null,\n lightingColor: null,\n limitingConeAngle: number,\n local: null,\n markerEnd: null,\n markerMid: null,\n markerStart: null,\n markerHeight: null,\n markerUnits: null,\n markerWidth: null,\n mask: null,\n maskContentUnits: null,\n maskUnits: null,\n mathematical: null,\n max: null,\n media: null,\n mediaCharacterEncoding: null,\n mediaContentEncodings: null,\n mediaSize: number,\n mediaTime: null,\n method: null,\n min: null,\n mode: null,\n name: null,\n navDown: null,\n navDownLeft: null,\n navDownRight: null,\n navLeft: null,\n navNext: null,\n navPrev: null,\n navRight: null,\n navUp: null,\n navUpLeft: null,\n navUpRight: null,\n numOctaves: null,\n observer: null,\n offset: null,\n onAbort: null,\n onActivate: null,\n onAfterPrint: null,\n onBeforePrint: null,\n onBegin: null,\n onCancel: null,\n onCanPlay: null,\n onCanPlayThrough: null,\n onChange: null,\n onClick: null,\n onClose: null,\n onCopy: null,\n onCueChange: null,\n onCut: null,\n onDblClick: null,\n onDrag: null,\n onDragEnd: null,\n onDragEnter: null,\n onDragExit: null,\n onDragLeave: null,\n onDragOver: null,\n onDragStart: null,\n onDrop: null,\n onDurationChange: null,\n onEmptied: null,\n onEnd: null,\n onEnded: null,\n onError: null,\n onFocus: null,\n onFocusIn: null,\n onFocusOut: null,\n onHashChange: null,\n onInput: null,\n onInvalid: null,\n onKeyDown: null,\n onKeyPress: null,\n onKeyUp: null,\n onLoad: null,\n onLoadedData: null,\n onLoadedMetadata: null,\n onLoadStart: null,\n onMessage: null,\n onMouseDown: null,\n onMouseEnter: null,\n onMouseLeave: null,\n onMouseMove: null,\n onMouseOut: null,\n onMouseOver: null,\n onMouseUp: null,\n onMouseWheel: null,\n onOffline: null,\n onOnline: null,\n onPageHide: null,\n onPageShow: null,\n onPaste: null,\n onPause: null,\n onPlay: null,\n onPlaying: null,\n onPopState: null,\n onProgress: null,\n onRateChange: null,\n onRepeat: null,\n onReset: null,\n onResize: null,\n onScroll: null,\n onSeeked: null,\n onSeeking: null,\n onSelect: null,\n onShow: null,\n onStalled: null,\n onStorage: null,\n onSubmit: null,\n onSuspend: null,\n onTimeUpdate: null,\n onToggle: null,\n onUnload: null,\n onVolumeChange: null,\n onWaiting: null,\n onZoom: null,\n opacity: null,\n operator: null,\n order: null,\n orient: null,\n orientation: null,\n origin: null,\n overflow: null,\n overlay: null,\n overlinePosition: number,\n overlineThickness: number,\n paintOrder: null,\n panose1: null,\n path: null,\n pathLength: number,\n patternContentUnits: null,\n patternTransform: null,\n patternUnits: null,\n phase: null,\n ping: spaceSeparated,\n pitch: null,\n playbackOrder: null,\n pointerEvents: null,\n points: null,\n pointsAtX: number,\n pointsAtY: number,\n pointsAtZ: number,\n preserveAlpha: null,\n preserveAspectRatio: null,\n primitiveUnits: null,\n propagate: null,\n property: commaOrSpaceSeparated,\n r: null,\n radius: null,\n referrerPolicy: null,\n refX: null,\n refY: null,\n rel: commaOrSpaceSeparated,\n rev: commaOrSpaceSeparated,\n renderingIntent: null,\n repeatCount: null,\n repeatDur: null,\n requiredExtensions: commaOrSpaceSeparated,\n requiredFeatures: commaOrSpaceSeparated,\n requiredFonts: commaOrSpaceSeparated,\n requiredFormats: commaOrSpaceSeparated,\n resource: null,\n restart: null,\n result: null,\n rotate: null,\n rx: null,\n ry: null,\n scale: null,\n seed: null,\n shapeRendering: null,\n side: null,\n slope: null,\n snapshotTime: null,\n specularConstant: number,\n specularExponent: number,\n spreadMethod: null,\n spacing: null,\n startOffset: null,\n stdDeviation: null,\n stemh: null,\n stemv: null,\n stitchTiles: null,\n stopColor: null,\n stopOpacity: null,\n strikethroughPosition: number,\n strikethroughThickness: number,\n string: null,\n stroke: null,\n strokeDashArray: commaOrSpaceSeparated,\n strokeDashOffset: null,\n strokeLineCap: null,\n strokeLineJoin: null,\n strokeMiterLimit: number,\n strokeOpacity: number,\n strokeWidth: null,\n style: null,\n surfaceScale: number,\n syncBehavior: null,\n syncBehaviorDefault: null,\n syncMaster: null,\n syncTolerance: null,\n syncToleranceDefault: null,\n systemLanguage: commaOrSpaceSeparated,\n tabIndex: number,\n tableValues: null,\n target: null,\n targetX: number,\n targetY: number,\n textAnchor: null,\n textDecoration: null,\n textRendering: null,\n textLength: null,\n timelineBegin: null,\n title: null,\n transformBehavior: null,\n type: null,\n typeOf: commaOrSpaceSeparated,\n to: null,\n transform: null,\n transformOrigin: null,\n u1: null,\n u2: null,\n underlinePosition: number,\n underlineThickness: number,\n unicode: null,\n unicodeBidi: null,\n unicodeRange: null,\n unitsPerEm: number,\n values: null,\n vAlphabetic: number,\n vMathematical: number,\n vectorEffect: null,\n vHanging: number,\n vIdeographic: number,\n version: null,\n vertAdvY: number,\n vertOriginX: number,\n vertOriginY: number,\n viewBox: null,\n viewTarget: null,\n visibility: null,\n width: null,\n widths: null,\n wordSpacing: null,\n writingMode: null,\n x: null,\n x1: null,\n x2: null,\n xChannelSelector: null,\n xHeight: number,\n y: null,\n y1: null,\n y2: null,\n yChannelSelector: null,\n z: null,\n zoomAndPan: null\n },\n space: 'svg',\n transform: caseSensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xlink = create({\n properties: {\n xLinkActuate: null,\n xLinkArcRole: null,\n xLinkHref: null,\n xLinkRole: null,\n xLinkShow: null,\n xLinkTitle: null,\n xLinkType: null\n },\n space: 'xlink',\n transform(_, property) {\n return 'xlink:' + property.slice(5).toLowerCase()\n }\n})\n","import {create} from './util/create.js'\nimport {caseInsensitiveTransform} from './util/case-insensitive-transform.js'\n\nexport const xmlns = create({\n attributes: {xmlnsxlink: 'xmlns:xlink'},\n properties: {xmlnsXLink: null, xmlns: null},\n space: 'xmlns',\n transform: caseInsensitiveTransform\n})\n","import {create} from './util/create.js'\n\nexport const xml = create({\n properties: {xmlBase: null, xmlLang: null, xmlSpace: null},\n space: 'xml',\n transform(_, property) {\n return 'xml:' + property.slice(3).toLowerCase()\n }\n})\n","// Note: types exposed from `index.d.ts`.\nimport {merge} from './lib/util/merge.js'\nimport {aria} from './lib/aria.js'\nimport {html as htmlBase} from './lib/html.js'\nimport {svg as svgBase} from './lib/svg.js'\nimport {xlink} from './lib/xlink.js'\nimport {xmlns} from './lib/xmlns.js'\nimport {xml} from './lib/xml.js'\n\nexport {hastToReact} from './lib/hast-to-react.js'\n\nexport const html = merge([aria, htmlBase, xlink, xmlns, xml], 'html')\n\nexport {find} from './lib/find.js'\nexport {normalize} from './lib/normalize.js'\n\nexport const svg = merge([aria, svgBase, xlink, xmlns, xml], 'svg')\n","/**\n * Parse space-separated tokens to an array of strings.\n *\n * @param {string} value\n * Space-separated tokens.\n * @returns {Array<string>}\n * List of tokens.\n */\nexport function parse(value) {\n const input = String(value || '').trim()\n return input ? input.split(/[ \\t\\n\\r\\f]+/g) : []\n}\n\n/**\n * Serialize an array of strings as space separated-tokens.\n *\n * @param {Array<string|number>} values\n * List of tokens.\n * @returns {string}\n * Space-separated tokens.\n */\nexport function stringify(values) {\n return values.join(' ').trim()\n}\n","/**\n * @import {Identifier, Literal, MemberExpression} from 'estree'\n * @import {Jsx, JsxDev, Options, Props} from 'hast-util-to-jsx-runtime'\n * @import {Element, Nodes, Parents, Root, Text} from 'hast'\n * @import {MdxFlowExpressionHast, MdxTextExpressionHast} from 'mdast-util-mdx-expression'\n * @import {MdxJsxFlowElementHast, MdxJsxTextElementHast} from 'mdast-util-mdx-jsx'\n * @import {MdxjsEsmHast} from 'mdast-util-mdxjs-esm'\n * @import {Position} from 'unist'\n * @import {Child, Create, Field, JsxElement, State, Style} from './types.js'\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {name as isIdentifierName} from 'estree-util-is-identifier-name'\nimport {whitespace} from 'hast-util-whitespace'\nimport {find, hastToReact, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport styleToJs from 'style-to-js'\nimport {pointStart} from 'unist-util-position'\nimport {VFileMessage} from 'vfile-message'\n\n// To do: next major: `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/** @type {Map<string, number>} */\nconst emptyMap = new Map()\n\nconst cap = /[A-Z]/g\n\n// `react-dom` triggers a warning for *any* white space in tables.\n// To follow GFM, `mdast-util-to-hast` injects line endings between elements.\n// Other tools might do so too, but they don’t do here, so we remove all of\n// that.\n\n// See: <https://github.com/facebook/react/pull/7081>.\n// See: <https://github.com/facebook/react/pull/7515>.\n// See: <https://github.com/remarkjs/remark-react/issues/64>.\n// See: <https://github.com/rehypejs/rehype-react/pull/29>.\n// See: <https://github.com/rehypejs/rehype-react/pull/32>.\n// See: <https://github.com/rehypejs/rehype-react/pull/45>.\nconst tableElements = new Set(['table', 'tbody', 'thead', 'tfoot', 'tr'])\n\nconst tableCellElement = new Set(['td', 'th'])\n\nconst docs = 'https://github.com/syntax-tree/hast-util-to-jsx-runtime'\n\n/**\n * Transform a hast tree to preact, react, solid, svelte, vue, etc.,\n * with an automatic JSX runtime.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options} options\n * Configuration (required).\n * @returns {JsxElement}\n * JSX element.\n */\n\nexport function toJsxRuntime(tree, options) {\n if (!options || options.Fragment === undefined) {\n throw new TypeError('Expected `Fragment` in options')\n }\n\n const filePath = options.filePath || undefined\n /** @type {Create} */\n let create\n\n if (options.development) {\n if (typeof options.jsxDEV !== 'function') {\n throw new TypeError(\n 'Expected `jsxDEV` in options when `development: true`'\n )\n }\n\n create = developmentCreate(filePath, options.jsxDEV)\n } else {\n if (typeof options.jsx !== 'function') {\n throw new TypeError('Expected `jsx` in production options')\n }\n\n if (typeof options.jsxs !== 'function') {\n throw new TypeError('Expected `jsxs` in production options')\n }\n\n create = productionCreate(filePath, options.jsx, options.jsxs)\n }\n\n /** @type {State} */\n const state = {\n Fragment: options.Fragment,\n ancestors: [],\n components: options.components || {},\n create,\n elementAttributeNameCase: options.elementAttributeNameCase || 'react',\n evaluater: options.createEvaluater ? options.createEvaluater() : undefined,\n filePath,\n ignoreInvalidStyle: options.ignoreInvalidStyle || false,\n passKeys: options.passKeys !== false,\n passNode: options.passNode || false,\n schema: options.space === 'svg' ? svg : html,\n stylePropertyNameCase: options.stylePropertyNameCase || 'dom',\n tableCellAlignToStyle: options.tableCellAlignToStyle !== false\n }\n\n const result = one(state, tree, undefined)\n\n // JSX element.\n if (result && typeof result !== 'string') {\n return result\n }\n\n // Text node or something that turned into nothing.\n return state.create(\n tree,\n state.Fragment,\n {children: result || undefined},\n undefined\n )\n}\n\n/**\n * Transform a node.\n *\n * @param {State} state\n * Info passed around.\n * @param {Nodes} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction one(state, node, key) {\n if (node.type === 'element') {\n return element(state, node, key)\n }\n\n if (node.type === 'mdxFlowExpression' || node.type === 'mdxTextExpression') {\n return mdxExpression(state, node)\n }\n\n if (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement') {\n return mdxJsxElement(state, node, key)\n }\n\n if (node.type === 'mdxjsEsm') {\n return mdxEsm(state, node)\n }\n\n if (node.type === 'root') {\n return root(state, node, key)\n }\n\n if (node.type === 'text') {\n return text(state, node)\n }\n}\n\n/**\n * Handle element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction element(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.tagName.toLowerCase() === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type = findComponentFromName(state, node.tagName, false)\n const props = createElementProps(state, node)\n let children = createChildren(state, node)\n\n if (tableElements.has(node.tagName)) {\n children = children.filter(function (child) {\n return typeof child === 'string' ? !whitespace(child) : true\n })\n }\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle MDX expression.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxFlowExpressionHast | MdxTextExpressionHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxExpression(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n const program = node.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateExpression(expression.expression)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX ESM.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxjsEsmHast} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxEsm(state, node) {\n if (node.data && node.data.estree && state.evaluater) {\n // Assume result is a child.\n return /** @type {Child | undefined} */ (\n state.evaluater.evaluateProgram(node.data.estree)\n )\n }\n\n crashEstree(state, node.position)\n}\n\n/**\n * Handle MDX JSX.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction mdxJsxElement(state, node, key) {\n const parentSchema = state.schema\n let schema = parentSchema\n\n if (node.name === 'svg' && parentSchema.space === 'html') {\n schema = svg\n state.schema = schema\n }\n\n state.ancestors.push(node)\n\n const type =\n node.name === null\n ? state.Fragment\n : findComponentFromName(state, node.name, true)\n const props = createJsxElementProps(state, node)\n const children = createChildren(state, node)\n\n addNode(state, props, type, node)\n addChildren(props, children)\n\n // Restore.\n state.ancestors.pop()\n state.schema = parentSchema\n\n return state.create(node, type, props, key)\n}\n\n/**\n * Handle root.\n *\n * @param {State} state\n * Info passed around.\n * @param {Root} node\n * Current node.\n * @param {string | undefined} key\n * Key.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction root(state, node, key) {\n /** @type {Props} */\n const props = {}\n\n addChildren(props, createChildren(state, node))\n\n return state.create(node, state.Fragment, props, key)\n}\n\n/**\n * Handle text.\n *\n * @param {State} _\n * Info passed around.\n * @param {Text} node\n * Current node.\n * @returns {Child | undefined}\n * Child, optional.\n */\nfunction text(_, node) {\n return node.value\n}\n\n/**\n * Add `node` to props.\n *\n * @param {State} state\n * Info passed around.\n * @param {Props} props\n * Props.\n * @param {unknown} type\n * Type.\n * @param {Element | MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Node.\n * @returns {undefined}\n * Nothing.\n */\nfunction addNode(state, props, type, node) {\n // If this is swapped out for a component:\n if (typeof type !== 'string' && type !== state.Fragment && state.passNode) {\n props.node = node\n }\n}\n\n/**\n * Add children to props.\n *\n * @param {Props} props\n * Props.\n * @param {Array<Child>} children\n * Children.\n * @returns {undefined}\n * Nothing.\n */\nfunction addChildren(props, children) {\n if (children.length > 0) {\n const value = children.length > 1 ? children : children[0]\n\n if (value) {\n props.children = value\n }\n }\n}\n\n/**\n * @param {string | undefined} _\n * Path to file.\n * @param {Jsx} jsx\n * Dynamic.\n * @param {Jsx} jsxs\n * Static.\n * @returns {Create}\n * Create a production element.\n */\nfunction productionCreate(_, jsx, jsxs) {\n return create\n /** @type {Create} */\n function create(_, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const fn = isStaticChildren ? jsxs : jsx\n return key ? fn(type, props, key) : fn(type, props)\n }\n}\n\n/**\n * @param {string | undefined} filePath\n * Path to file.\n * @param {JsxDev} jsxDEV\n * Development.\n * @returns {Create}\n * Create a development element.\n */\nfunction developmentCreate(filePath, jsxDEV) {\n return create\n /** @type {Create} */\n function create(node, type, props, key) {\n // Only an array when there are 2 or more children.\n const isStaticChildren = Array.isArray(props.children)\n const point = pointStart(node)\n return jsxDEV(\n type,\n props,\n key,\n isStaticChildren,\n {\n columnNumber: point ? point.column - 1 : undefined,\n fileName: filePath,\n lineNumber: point ? point.line : undefined\n },\n undefined\n )\n }\n}\n\n/**\n * Create props from an element.\n *\n * @param {State} state\n * Info passed around.\n * @param {Element} node\n * Current element.\n * @returns {Props}\n * Props.\n */\nfunction createElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n /** @type {string | undefined} */\n let alignValue\n /** @type {string} */\n let prop\n\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(state, prop, node.properties[prop])\n\n if (result) {\n const [key, value] = result\n\n if (\n state.tableCellAlignToStyle &&\n key === 'align' &&\n typeof value === 'string' &&\n tableCellElement.has(node.tagName)\n ) {\n alignValue = value\n } else {\n props[key] = value\n }\n }\n }\n }\n\n if (alignValue) {\n // Assume style is an object.\n const style = /** @type {Style} */ (props.style || (props.style = {}))\n style[state.stylePropertyNameCase === 'css' ? 'text-align' : 'textAlign'] =\n alignValue\n }\n\n return props\n}\n\n/**\n * Create props from a JSX element.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdxJsxFlowElementHast | MdxJsxTextElementHast} node\n * Current JSX element.\n * @returns {Props}\n * Props.\n */\nfunction createJsxElementProps(state, node) {\n /** @type {Props} */\n const props = {}\n\n for (const attribute of node.attributes) {\n if (attribute.type === 'mdxJsxExpressionAttribute') {\n if (attribute.data && attribute.data.estree && state.evaluater) {\n const program = attribute.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n const objectExpression = expression.expression\n assert(objectExpression.type === 'ObjectExpression')\n const property = objectExpression.properties[0]\n assert(property.type === 'SpreadElement')\n\n Object.assign(\n props,\n state.evaluater.evaluateExpression(property.argument)\n )\n } else {\n crashEstree(state, node.position)\n }\n } else {\n // For JSX, the author is responsible of passing in the correct values.\n const name = attribute.name\n /** @type {unknown} */\n let value\n\n if (attribute.value && typeof attribute.value === 'object') {\n if (\n attribute.value.data &&\n attribute.value.data.estree &&\n state.evaluater\n ) {\n const program = attribute.value.data.estree\n const expression = program.body[0]\n assert(expression.type === 'ExpressionStatement')\n value = state.evaluater.evaluateExpression(expression.expression)\n } else {\n crashEstree(state, node.position)\n }\n } else {\n value = attribute.value === null ? true : attribute.value\n }\n\n // Assume a prop.\n props[name] = /** @type {Props[keyof Props]} */ (value)\n }\n }\n\n return props\n}\n\n/**\n * Create children.\n *\n * @param {State} state\n * Info passed around.\n * @param {Parents} node\n * Current element.\n * @returns {Array<Child>}\n * Children.\n */\nfunction createChildren(state, node) {\n /** @type {Array<Child>} */\n const children = []\n let index = -1\n /** @type {Map<string, number>} */\n // Note: test this when Solid doesn’t want to merge my upcoming PR.\n /* c8 ignore next */\n const countsByName = state.passKeys ? new Map() : emptyMap\n\n while (++index < node.children.length) {\n const child = node.children[index]\n /** @type {string | undefined} */\n let key\n\n if (state.passKeys) {\n const name =\n child.type === 'element'\n ? child.tagName\n : child.type === 'mdxJsxFlowElement' ||\n child.type === 'mdxJsxTextElement'\n ? child.name\n : undefined\n\n if (name) {\n const count = countsByName.get(name) || 0\n key = name + '-' + count\n countsByName.set(name, count + 1)\n }\n }\n\n const result = one(state, child, key)\n if (result !== undefined) children.push(result)\n }\n\n return children\n}\n\n/**\n * Handle a property.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} prop\n * Key.\n * @param {Array<number | string> | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Field | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(state, prop, value) {\n const info = find(state.schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value))\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n // React only accepts `style` as object.\n if (info.property === 'style') {\n let styleObject =\n typeof value === 'object' ? value : parseStyle(state, String(value))\n\n if (state.stylePropertyNameCase === 'css') {\n styleObject = transformStylesToCssCasing(styleObject)\n }\n\n return ['style', styleObject]\n }\n\n return [\n state.elementAttributeNameCase === 'react' && info.space\n ? hastToReact[info.property] || info.property\n : info.attribute,\n value\n ]\n}\n\n/**\n * Parse a CSS declaration to an object.\n *\n * @param {State} state\n * Info passed around.\n * @param {string} value\n * CSS declarations.\n * @returns {Style}\n * Properties.\n * @throws\n * Throws `VFileMessage` when CSS cannot be parsed.\n */\nfunction parseStyle(state, value) {\n try {\n return styleToJs(value, {reactCompat: true})\n } catch (error) {\n if (state.ignoreInvalidStyle) {\n return {}\n }\n\n const cause = /** @type {Error} */ (error)\n const message = new VFileMessage('Cannot parse `style` attribute', {\n ancestors: state.ancestors,\n cause,\n ruleId: 'style',\n source: 'hast-util-to-jsx-runtime'\n })\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-parse-style-attribute'\n\n throw message\n }\n}\n\n/**\n * Create a JSX name from a string.\n *\n * @param {State} state\n * To do.\n * @param {string} name\n * Name.\n * @param {boolean} allowExpression\n * Allow member expressions and identifiers.\n * @returns {unknown}\n * To do.\n */\nfunction findComponentFromName(state, name, allowExpression) {\n /** @type {Identifier | Literal | MemberExpression} */\n let result\n\n if (!allowExpression) {\n result = {type: 'Literal', value: name}\n } else if (name.includes('.')) {\n const identifiers = name.split('.')\n let index = -1\n /** @type {Identifier | Literal | MemberExpression | undefined} */\n let node\n\n while (++index < identifiers.length) {\n /** @type {Identifier | Literal} */\n const prop = isIdentifierName(identifiers[index])\n ? {type: 'Identifier', name: identifiers[index]}\n : {type: 'Literal', value: identifiers[index]}\n node = node\n ? {\n type: 'MemberExpression',\n object: node,\n property: prop,\n computed: Boolean(index && prop.type === 'Literal'),\n optional: false\n }\n : prop\n }\n\n assert(node, 'always a result')\n result = node\n } else {\n result =\n isIdentifierName(name) && !/^[a-z]/.test(name)\n ? {type: 'Identifier', name}\n : {type: 'Literal', value: name}\n }\n\n // Only literals can be passed in `components` currently.\n // No identifiers / member expressions.\n if (result.type === 'Literal') {\n const name = /** @type {string | number} */ (result.value)\n return own.call(state.components, name) ? state.components[name] : name\n }\n\n // Assume component.\n if (state.evaluater) {\n return state.evaluater.evaluateExpression(result)\n }\n\n crashEstree(state)\n}\n\n/**\n * @param {State} state\n * @param {Position | undefined} [place]\n * @returns {never}\n */\nfunction crashEstree(state, place) {\n const message = new VFileMessage(\n 'Cannot handle MDX estrees without `createEvaluater`',\n {\n ancestors: state.ancestors,\n place,\n ruleId: 'mdx-estree',\n source: 'hast-util-to-jsx-runtime'\n }\n )\n message.file = state.filePath || undefined\n message.url = docs + '#cannot-handle-mdx-estrees-without-createevaluater'\n\n throw message\n}\n\n/**\n * Transform a DOM casing style object to a CSS casing style object.\n *\n * @param {Style} domCasing\n * @returns {Style}\n */\nfunction transformStylesToCssCasing(domCasing) {\n /** @type {Style} */\n const cssCasing = {}\n /** @type {string} */\n let from\n\n for (from in domCasing) {\n if (own.call(domCasing, from)) {\n cssCasing[transformStyleToCssCasing(from)] = domCasing[from]\n }\n }\n\n return cssCasing\n}\n\n/**\n * Transform a DOM casing style field to a CSS casing style field.\n *\n * @param {string} from\n * @returns {string}\n */\nfunction transformStyleToCssCasing(from) {\n let to = from.replace(cap, toDash)\n // Handle `ms-xxx` -> `-ms-xxx`.\n if (to.slice(0, 3) === 'ms-') to = '-' + to\n return to\n}\n\n/**\n * Make `$0` dash cased.\n *\n * @param {string} $0\n * Capitalized ASCII leter.\n * @returns {string}\n * Dash and lower letter.\n */\nfunction toDash($0) {\n return '-' + $0.toLowerCase()\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n */\n\n/**\n * Get the ending point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointEnd = point('end')\n\n/**\n * Get the starting point of `node`.\n *\n * @param node\n * Node.\n * @returns\n * Point.\n */\nexport const pointStart = point('start')\n\n/**\n * Get the positional info of `node`.\n *\n * @param {'end' | 'start'} type\n * Side.\n * @returns\n * Getter.\n */\nfunction point(type) {\n return point\n\n /**\n * Get the point info of `node` at a bound side.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * @returns {Point | undefined}\n */\n function point(node) {\n const point = (node && node.position && node.position[type]) || {}\n\n if (\n typeof point.line === 'number' &&\n point.line > 0 &&\n typeof point.column === 'number' &&\n point.column > 0\n ) {\n return {\n line: point.line,\n column: point.column,\n offset:\n typeof point.offset === 'number' && point.offset > -1\n ? point.offset\n : undefined\n }\n }\n }\n}\n\n/**\n * Get the positional info of `node`.\n *\n * @param {Node | NodeLike | null | undefined} [node]\n * Node.\n * @returns {Position | undefined}\n * Position.\n */\nexport function position(node) {\n const start = pointStart(node)\n const end = pointEnd(node)\n\n if (start && end) {\n return {start, end}\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n * @typedef {import('unist').Point} Point\n * @typedef {import('unist').Position} Position\n */\n\n/**\n * @typedef NodeLike\n * @property {string} type\n * @property {PositionLike | null | undefined} [position]\n *\n * @typedef PointLike\n * @property {number | null | undefined} [line]\n * @property {number | null | undefined} [column]\n * @property {number | null | undefined} [offset]\n *\n * @typedef PositionLike\n * @property {PointLike | null | undefined} [start]\n * @property {PointLike | null | undefined} [end]\n */\n\n/**\n * Serialize the positional info of a point, position (start and end points),\n * or node.\n *\n * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]\n * Node, position, or point.\n * @returns {string}\n * Pretty printed positional info of a node (`string`).\n *\n * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)\n * or a point `l:c` (when given `point`), where `l` stands for line, `c` for\n * column, `s` for `start`, and `e` for end.\n * An empty string (`''`) is returned if the given value is neither `node`,\n * `position`, nor `point`.\n */\nexport function stringifyPosition(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if ('position' in value || 'type' in value) {\n return position(value.position)\n }\n\n // Position.\n if ('start' in value || 'end' in value) {\n return position(value)\n }\n\n // Point.\n if ('line' in value || 'column' in value) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\n/**\n * @param {Point | PointLike | null | undefined} point\n * @returns {string}\n */\nfunction point(point) {\n return index(point && point.line) + ':' + index(point && point.column)\n}\n\n/**\n * @param {Position | PositionLike | null | undefined} pos\n * @returns {string}\n */\nfunction position(pos) {\n return point(pos && pos.start) + '-' + point(pos && pos.end)\n}\n\n/**\n * @param {number | null | undefined} value\n * @returns {number}\n */\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","/**\n * @import {Node, Point, Position} from 'unist'\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n *\n * @typedef Options\n * Configuration.\n * @property {Array<Node> | null | undefined} [ancestors]\n * Stack of (inclusive) ancestor nodes surrounding the message (optional).\n * @property {Error | null | undefined} [cause]\n * Original error cause of the message (optional).\n * @property {Point | Position | null | undefined} [place]\n * Place of message (optional).\n * @property {string | null | undefined} [ruleId]\n * Category of message (optional, example: `'my-rule'`).\n * @property {string | null | undefined} [source]\n * Namespace of who sent the message (optional, example: `'my-package'`).\n */\n\nimport {stringifyPosition} from 'unist-util-stringify-position'\n\n/**\n * Message.\n */\nexport class VFileMessage extends Error {\n /**\n * Create a message for `reason`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {Options | null | undefined} [options]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns\n * Instance of `VFileMessage`.\n */\n // eslint-disable-next-line complexity\n constructor(causeOrReason, optionsOrParentOrPlace, origin) {\n super()\n\n if (typeof optionsOrParentOrPlace === 'string') {\n origin = optionsOrParentOrPlace\n optionsOrParentOrPlace = undefined\n }\n\n /** @type {string} */\n let reason = ''\n /** @type {Options} */\n let options = {}\n let legacyCause = false\n\n if (optionsOrParentOrPlace) {\n // Point.\n if (\n 'line' in optionsOrParentOrPlace &&\n 'column' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Position.\n else if (\n 'start' in optionsOrParentOrPlace &&\n 'end' in optionsOrParentOrPlace\n ) {\n options = {place: optionsOrParentOrPlace}\n }\n // Node.\n else if ('type' in optionsOrParentOrPlace) {\n options = {\n ancestors: [optionsOrParentOrPlace],\n place: optionsOrParentOrPlace.position\n }\n }\n // Options.\n else {\n options = {...optionsOrParentOrPlace}\n }\n }\n\n if (typeof causeOrReason === 'string') {\n reason = causeOrReason\n }\n // Error.\n else if (!options.cause && causeOrReason) {\n legacyCause = true\n reason = causeOrReason.message\n options.cause = causeOrReason\n }\n\n if (!options.ruleId && !options.source && typeof origin === 'string') {\n const index = origin.indexOf(':')\n\n if (index === -1) {\n options.ruleId = origin\n } else {\n options.source = origin.slice(0, index)\n options.ruleId = origin.slice(index + 1)\n }\n }\n\n if (!options.place && options.ancestors && options.ancestors) {\n const parent = options.ancestors[options.ancestors.length - 1]\n\n if (parent) {\n options.place = parent.position\n }\n }\n\n const start =\n options.place && 'start' in options.place\n ? options.place.start\n : options.place\n\n /**\n * Stack of ancestor nodes surrounding the message.\n *\n * @type {Array<Node> | undefined}\n */\n this.ancestors = options.ancestors || undefined\n\n /**\n * Original error cause of the message.\n *\n * @type {Error | undefined}\n */\n this.cause = options.cause || undefined\n\n /**\n * Starting column of message.\n *\n * @type {number | undefined}\n */\n this.column = start ? start.column : undefined\n\n /**\n * State of problem.\n *\n * * `true` — error, file not usable\n * * `false` — warning, change may be needed\n * * `undefined` — change likely not needed\n *\n * @type {boolean | null | undefined}\n */\n this.fatal = undefined\n\n /**\n * Path of a file (used throughout the `VFile` ecosystem).\n *\n * @type {string | undefined}\n */\n this.file = ''\n\n // Field from `Error`.\n /**\n * Reason for message.\n *\n * @type {string}\n */\n this.message = reason\n\n /**\n * Starting line of error.\n *\n * @type {number | undefined}\n */\n this.line = start ? start.line : undefined\n\n // Field from `Error`.\n /**\n * Serialized positional info of message.\n *\n * On normal errors, this would be something like `ParseError`, buit in\n * `VFile` messages we use this space to show where an error happened.\n */\n this.name = stringifyPosition(options.place) || '1:1'\n\n /**\n * Place of message.\n *\n * @type {Point | Position | undefined}\n */\n this.place = options.place || undefined\n\n /**\n * Reason for message, should use markdown.\n *\n * @type {string}\n */\n this.reason = this.message\n\n /**\n * Category of message (example: `'my-rule'`).\n *\n * @type {string | undefined}\n */\n this.ruleId = options.ruleId || undefined\n\n /**\n * Namespace of message (example: `'my-package'`).\n *\n * @type {string | undefined}\n */\n this.source = options.source || undefined\n\n // Field from `Error`.\n /**\n * Stack of message.\n *\n * This is used by normal errors to show where something happened in\n * programming code, irrelevant for `VFile` messages,\n *\n * @type {string}\n */\n this.stack =\n legacyCause && options.cause && typeof options.cause.stack === 'string'\n ? options.cause.stack\n : ''\n\n // The following fields are “well known”.\n // Not standard.\n // Feel free to add other non-standard fields to your messages.\n\n /**\n * Specify the source value that’s being reported, which is deemed\n * incorrect.\n *\n * @type {string | undefined}\n */\n this.actual = undefined\n\n /**\n * Suggest acceptable values that can be used instead of `actual`.\n *\n * @type {Array<string> | undefined}\n */\n this.expected = undefined\n\n /**\n * Long form description of the message (you should use markdown).\n *\n * @type {string | undefined}\n */\n this.note = undefined\n\n /**\n * Link to docs for the message.\n *\n * > 👉 **Note**: this must be an absolute URL that can be passed as `x`\n * > to `new URL(x)`.\n *\n * @type {string | undefined}\n */\n this.url = undefined\n }\n}\n\nVFileMessage.prototype.file = ''\nVFileMessage.prototype.name = ''\nVFileMessage.prototype.reason = ''\nVFileMessage.prototype.message = ''\nVFileMessage.prototype.stack = ''\nVFileMessage.prototype.column = undefined\nVFileMessage.prototype.line = undefined\nVFileMessage.prototype.ancestors = undefined\nVFileMessage.prototype.cause = undefined\nVFileMessage.prototype.fatal = undefined\nVFileMessage.prototype.place = undefined\nVFileMessage.prototype.ruleId = undefined\nVFileMessage.prototype.source = undefined\n","/**\n * HTML URL properties.\n *\n * Each key is a property name and each value is a list of tag names it applies\n * to or `null` if it applies to all elements.\n *\n * @type {Record<string, Array<string> | null>}\n */\nexport const urlAttributes = {\n action: ['form'],\n cite: ['blockquote', 'del', 'ins', 'q'],\n data: ['object'],\n formAction: ['button', 'input'],\n href: ['a', 'area', 'base', 'link'],\n icon: ['menuitem'],\n itemId: null,\n manifest: ['html'],\n ping: ['a', 'area'],\n poster: ['video'],\n src: [\n 'audio',\n 'embed',\n 'iframe',\n 'img',\n 'input',\n 'script',\n 'source',\n 'track',\n 'video'\n ]\n}\n","/**\n * @import {Element, Nodes, Parents, Root} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {ComponentType, JSX, ReactElement, ReactNode} from 'react'\n * @import {Options as RemarkRehypeOptions} from 'remark-rehype'\n * @import {BuildVisitor} from 'unist-util-visit'\n * @import {PluggableList, Processor} from 'unified'\n */\n\n/**\n * @callback AllowElement\n * Filter elements.\n * @param {Readonly<Element>} element\n * Element to check.\n * @param {number} index\n * Index of `element` in `parent`.\n * @param {Readonly<Parents> | undefined} parent\n * Parent of `element`.\n * @returns {boolean | null | undefined}\n * Whether to allow `element` (default: `false`).\n */\n\n/**\n * @typedef ExtraProps\n * Extra fields we pass.\n * @property {Element | undefined} [node]\n * passed when `passNode` is on.\n */\n\n/**\n * @typedef {{\n * [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & ExtraProps> | keyof JSX.IntrinsicElements\n * }} Components\n * Map tag names to components.\n */\n\n/**\n * @typedef Deprecation\n * Deprecation.\n * @property {string} from\n * Old field.\n * @property {string} id\n * ID in readme.\n * @property {keyof Options} [to]\n * New field.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {AllowElement | null | undefined} [allowElement]\n * Filter elements (optional);\n * `allowedElements` / `disallowedElements` is used first.\n * @property {ReadonlyArray<string> | null | undefined} [allowedElements]\n * Tag names to allow (default: all tag names);\n * cannot combine w/ `disallowedElements`.\n * @property {string | null | undefined} [children]\n * Markdown.\n * @property {Components | null | undefined} [components]\n * Map tag names to components.\n * @property {ReadonlyArray<string> | null | undefined} [disallowedElements]\n * Tag names to disallow (default: `[]`);\n * cannot combine w/ `allowedElements`.\n * @property {PluggableList | null | undefined} [rehypePlugins]\n * List of rehype plugins to use.\n * @property {PluggableList | null | undefined} [remarkPlugins]\n * List of remark plugins to use.\n * @property {Readonly<RemarkRehypeOptions> | null | undefined} [remarkRehypeOptions]\n * Options to pass through to `remark-rehype`.\n * @property {boolean | null | undefined} [skipHtml=false]\n * Ignore HTML in markdown completely (default: `false`).\n * @property {boolean | null | undefined} [unwrapDisallowed=false]\n * Extract (unwrap) what’s in disallowed elements (default: `false`);\n * normally when say `strong` is not allowed, it and it’s children are dropped,\n * with `unwrapDisallowed` the element itself is replaced by its children.\n * @property {UrlTransform | null | undefined} [urlTransform]\n * Change URLs (default: `defaultUrlTransform`)\n */\n\n/**\n * @typedef HooksOptionsOnly\n * Configuration specifically for {@linkcode MarkdownHooks}.\n * @property {ReactNode | null | undefined} [fallback]\n * Content to render while the processor processing the markdown (optional).\n */\n\n/**\n * @typedef {Options & HooksOptionsOnly} HooksOptions\n * Configuration for {@linkcode MarkdownHooks};\n * extends the regular {@linkcode Options} with a `fallback` prop.\n */\n\n/**\n * @callback UrlTransform\n * Transform all URLs.\n * @param {string} url\n * URL.\n * @param {string} key\n * Property name (example: `'href'`).\n * @param {Readonly<Element>} node\n * Node.\n * @returns {string | null | undefined}\n * Transformed URL (optional).\n */\n\nimport {unreachable} from 'devlop'\nimport {toJsxRuntime} from 'hast-util-to-jsx-runtime'\nimport {urlAttributes} from 'html-url-attributes'\nimport {Fragment, jsx, jsxs} from 'react/jsx-runtime'\nimport {useEffect, useState} from 'react'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport {unified} from 'unified'\nimport {visit} from 'unist-util-visit'\nimport {VFile} from 'vfile'\n\nconst changelog =\n 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'\n\n/** @type {PluggableList} */\nconst emptyPlugins = []\n/** @type {Readonly<RemarkRehypeOptions>} */\nconst emptyRemarkRehypeOptions = {allowDangerousHtml: true}\nconst safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i\n\n// Mutable because we `delete` any time it’s used and a message is sent.\n/** @type {ReadonlyArray<Readonly<Deprecation>>} */\nconst deprecations = [\n {from: 'astPlugins', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'allowDangerousHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {\n from: 'allowNode',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowElement'\n },\n {\n from: 'allowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'allowedElements'\n },\n {from: 'className', id: 'remove-classname'},\n {\n from: 'disallowedTypes',\n id: 'replace-allownode-allowedtypes-and-disallowedtypes',\n to: 'disallowedElements'\n },\n {from: 'escapeHtml', id: 'remove-buggy-html-in-markdown-parser'},\n {from: 'includeElementIndex', id: '#remove-includeelementindex'},\n {\n from: 'includeNodeIndex',\n id: 'change-includenodeindex-to-includeelementindex'\n },\n {from: 'linkTarget', id: 'remove-linktarget'},\n {from: 'plugins', id: 'change-plugins-to-remarkplugins', to: 'remarkPlugins'},\n {from: 'rawSourcePos', id: '#remove-rawsourcepos'},\n {from: 'renderers', id: 'change-renderers-to-components', to: 'components'},\n {from: 'source', id: 'change-source-to-children', to: 'children'},\n {from: 'sourcePos', id: '#remove-sourcepos'},\n {from: 'transformImageUri', id: '#add-urltransform', to: 'urlTransform'},\n {from: 'transformLinkUri', id: '#add-urltransform', to: 'urlTransform'}\n]\n\n/**\n * Component to render markdown.\n *\n * This is a synchronous component.\n * When using async plugins,\n * see {@linkcode MarkdownAsync} or {@linkcode MarkdownHooks}.\n *\n * @param {Readonly<Options>} options\n * Props.\n * @returns {ReactElement}\n * React element.\n */\nexport function Markdown(options) {\n const processor = createProcessor(options)\n const file = createFile(options)\n return post(processor.runSync(processor.parse(file), file), options)\n}\n\n/**\n * Component to render markdown with support for async plugins\n * through async/await.\n *\n * Components returning promises are supported on the server.\n * For async support on the client,\n * see {@linkcode MarkdownHooks}.\n *\n * @param {Readonly<Options>} options\n * Props.\n * @returns {Promise<ReactElement>}\n * Promise to a React element.\n */\nexport async function MarkdownAsync(options) {\n const processor = createProcessor(options)\n const file = createFile(options)\n const tree = await processor.run(processor.parse(file), file)\n return post(tree, options)\n}\n\n/**\n * Component to render markdown with support for async plugins through hooks.\n *\n * This uses `useEffect` and `useState` hooks.\n * Hooks run on the client and do not immediately render something.\n * For async support on the server,\n * see {@linkcode MarkdownAsync}.\n *\n * @param {Readonly<HooksOptions>} options\n * Props.\n * @returns {ReactNode}\n * React node.\n */\nexport function MarkdownHooks(options) {\n const processor = createProcessor(options)\n const [error, setError] = useState(\n /** @type {Error | undefined} */ (undefined)\n )\n const [tree, setTree] = useState(/** @type {Root | undefined} */ (undefined))\n\n useEffect(\n function () {\n let cancelled = false\n const file = createFile(options)\n\n processor.run(processor.parse(file), file, function (error, tree) {\n if (!cancelled) {\n setError(error)\n setTree(tree)\n }\n })\n\n /**\n * @returns {undefined}\n * Nothing.\n */\n return function () {\n cancelled = true\n }\n },\n [\n options.children,\n options.rehypePlugins,\n options.remarkPlugins,\n options.remarkRehypeOptions\n ]\n )\n\n if (error) throw error\n\n return tree ? post(tree, options) : options.fallback\n}\n\n/**\n * Set up the `unified` processor.\n *\n * @param {Readonly<Options>} options\n * Props.\n * @returns {Processor<MdastRoot, MdastRoot, Root, undefined, undefined>}\n * Result.\n */\nfunction createProcessor(options) {\n const rehypePlugins = options.rehypePlugins || emptyPlugins\n const remarkPlugins = options.remarkPlugins || emptyPlugins\n const remarkRehypeOptions = options.remarkRehypeOptions\n ? {...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions}\n : emptyRemarkRehypeOptions\n\n const processor = unified()\n .use(remarkParse)\n .use(remarkPlugins)\n .use(remarkRehype, remarkRehypeOptions)\n .use(rehypePlugins)\n\n return processor\n}\n\n/**\n * Set up the virtual file.\n *\n * @param {Readonly<Options>} options\n * Props.\n * @returns {VFile}\n * Result.\n */\nfunction createFile(options) {\n const children = options.children || ''\n const file = new VFile()\n\n if (typeof children === 'string') {\n file.value = children\n } else {\n unreachable(\n 'Unexpected value `' +\n children +\n '` for `children` prop, expected `string`'\n )\n }\n\n return file\n}\n\n/**\n * Process the result from unified some more.\n *\n * @param {Nodes} tree\n * Tree.\n * @param {Readonly<Options>} options\n * Props.\n * @returns {ReactElement}\n * React element.\n */\nfunction post(tree, options) {\n const allowedElements = options.allowedElements\n const allowElement = options.allowElement\n const components = options.components\n const disallowedElements = options.disallowedElements\n const skipHtml = options.skipHtml\n const unwrapDisallowed = options.unwrapDisallowed\n const urlTransform = options.urlTransform || defaultUrlTransform\n\n for (const deprecation of deprecations) {\n if (Object.hasOwn(options, deprecation.from)) {\n unreachable(\n 'Unexpected `' +\n deprecation.from +\n '` prop, ' +\n (deprecation.to\n ? 'use `' + deprecation.to + '` instead'\n : 'remove it') +\n ' (see <' +\n changelog +\n '#' +\n deprecation.id +\n '> for more info)'\n )\n }\n }\n\n if (allowedElements && disallowedElements) {\n unreachable(\n 'Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other'\n )\n }\n\n visit(tree, transform)\n\n return toJsxRuntime(tree, {\n Fragment,\n components,\n ignoreInvalidStyle: true,\n jsx,\n jsxs,\n passKeys: true,\n passNode: true\n })\n\n /** @type {BuildVisitor<Root>} */\n function transform(node, index, parent) {\n if (node.type === 'raw' && parent && typeof index === 'number') {\n if (skipHtml) {\n parent.children.splice(index, 1)\n } else {\n parent.children[index] = {type: 'text', value: node.value}\n }\n\n return index\n }\n\n if (node.type === 'element') {\n /** @type {string} */\n let key\n\n for (key in urlAttributes) {\n if (\n Object.hasOwn(urlAttributes, key) &&\n Object.hasOwn(node.properties, key)\n ) {\n const value = node.properties[key]\n const test = urlAttributes[key]\n if (test === null || test.includes(node.tagName)) {\n node.properties[key] = urlTransform(String(value || ''), key, node)\n }\n }\n }\n }\n\n if (node.type === 'element') {\n let remove = allowedElements\n ? !allowedElements.includes(node.tagName)\n : disallowedElements\n ? disallowedElements.includes(node.tagName)\n : false\n\n if (!remove && allowElement && typeof index === 'number') {\n remove = !allowElement(node, index, parent)\n }\n\n if (remove && parent && typeof index === 'number') {\n if (unwrapDisallowed && node.children) {\n parent.children.splice(index, 1, ...node.children)\n } else {\n parent.children.splice(index, 1)\n }\n\n return index\n }\n }\n }\n}\n\n/**\n * Make a URL safe.\n *\n * @satisfies {UrlTransform}\n * @param {string} value\n * URL.\n * @returns {string}\n * Safe URL.\n */\nexport function defaultUrlTransform(value) {\n // Same as:\n // <https://github.com/micromark/micromark/blob/929275e/packages/micromark-util-sanitize-uri/dev/index.js#L34>\n // But without the `encode` part.\n const colon = value.indexOf(':')\n const questionMark = value.indexOf('?')\n const numberSign = value.indexOf('#')\n const slash = value.indexOf('/')\n\n if (\n // If there is no protocol, it’s relative.\n colon === -1 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n (slash !== -1 && colon > slash) ||\n (questionMark !== -1 && colon > questionMark) ||\n (numberSign !== -1 && colon > numberSign) ||\n // It is a protocol, it should be allowed.\n safeProtocol.test(value.slice(0, colon))\n ) {\n return value\n }\n\n return ''\n}\n","/**\n * @typedef {import('mdast').Nodes} Nodes\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [includeImageAlt=true]\n * Whether to use `alt` for `image`s (default: `true`).\n * @property {boolean | null | undefined} [includeHtml=true]\n * Whether to use `value` of HTML (default: `true`).\n */\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Get the text content of a node or list of nodes.\n *\n * Prefers the node’s plain-text fields, otherwise serializes its children,\n * and if the given value is an array, serialize the nodes in it.\n *\n * @param {unknown} [value]\n * Thing to serialize, typically `Node`.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `value`.\n */\nexport function toString(value, options) {\n const settings = options || emptyOptions\n const includeImageAlt =\n typeof settings.includeImageAlt === 'boolean'\n ? settings.includeImageAlt\n : true\n const includeHtml =\n typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true\n\n return one(value, includeImageAlt, includeHtml)\n}\n\n/**\n * One node or several nodes.\n *\n * @param {unknown} value\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized node.\n */\nfunction one(value, includeImageAlt, includeHtml) {\n if (node(value)) {\n if ('value' in value) {\n return value.type === 'html' && !includeHtml ? '' : value.value\n }\n\n if (includeImageAlt && 'alt' in value && value.alt) {\n return value.alt\n }\n\n if ('children' in value) {\n return all(value.children, includeImageAlt, includeHtml)\n }\n }\n\n if (Array.isArray(value)) {\n return all(value, includeImageAlt, includeHtml)\n }\n\n return ''\n}\n\n/**\n * Serialize a list of nodes.\n *\n * @param {Array<unknown>} values\n * Thing to serialize.\n * @param {boolean} includeImageAlt\n * Include image `alt`s.\n * @param {boolean} includeHtml\n * Include HTML.\n * @returns {string}\n * Serialized nodes.\n */\nfunction all(values, includeImageAlt, includeHtml) {\n /** @type {Array<string>} */\n const result = []\n let index = -1\n\n while (++index < values.length) {\n result[index] = one(values[index], includeImageAlt, includeHtml)\n }\n\n return result.join('')\n}\n\n/**\n * Check if `value` looks like a node.\n *\n * @param {unknown} value\n * Thing.\n * @returns {value is Nodes}\n * Whether `value` is a node.\n */\nfunction node(value) {\n return Boolean(value && typeof value === 'object')\n}\n","/**\n * Like `Array#splice`, but smarter for giant arrays.\n *\n * `Array#splice` takes all items to be inserted as individual argument which\n * causes a stack overflow in V8 when trying to insert 100k items for instance.\n *\n * Otherwise, this does not return the removed items, and takes `items` as an\n * array instead of rest parameters.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {number} start\n * Index to remove/insert at (can be negative).\n * @param {number} remove\n * Number of items to remove.\n * @param {Array<T>} items\n * Items to inject into `list`.\n * @returns {undefined}\n * Nothing.\n */\nexport function splice(list, start, remove, items) {\n const end = list.length;\n let chunkStart = 0;\n /** @type {Array<unknown>} */\n let parameters;\n\n // Make start between zero and `end` (included).\n if (start < 0) {\n start = -start > end ? 0 : end + start;\n } else {\n start = start > end ? end : start;\n }\n remove = remove > 0 ? remove : 0;\n\n // No need to chunk the items if there’s only a couple (10k) items.\n if (items.length < 10000) {\n parameters = Array.from(items);\n parameters.unshift(start, remove);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n } else {\n // Delete `remove` items starting from `start`\n if (remove) list.splice(start, remove);\n\n // Insert the items in chunks to not cause stack overflows.\n while (chunkStart < items.length) {\n parameters = items.slice(chunkStart, chunkStart + 10000);\n parameters.unshift(start, 0);\n // @ts-expect-error Hush, it’s fine.\n list.splice(...parameters);\n chunkStart += 10000;\n start += 10000;\n }\n }\n}\n\n/**\n * Append `items` (an array) at the end of `list` (another array).\n * When `list` was empty, returns `items` instead.\n *\n * This prevents a potentially expensive operation when `list` is empty,\n * and adds items in batches to prevent V8 from hanging.\n *\n * @template {unknown} T\n * Item type.\n * @param {Array<T>} list\n * List to operate on.\n * @param {Array<T>} items\n * Items to add to `list`.\n * @returns {Array<T>}\n * Either `list` or `items`.\n */\nexport function push(list, items) {\n if (list.length > 0) {\n splice(list, list.length, 0, items);\n return list;\n }\n return items;\n}","/**\n * @import {\n * Extension,\n * Handles,\n * HtmlExtension,\n * NormalizedExtension\n * } from 'micromark-util-types'\n */\n\nimport {splice} from 'micromark-util-chunked'\n\nconst hasOwnProperty = {}.hasOwnProperty\n\n/**\n * Combine multiple syntax extensions into one.\n *\n * @param {ReadonlyArray<Extension>} extensions\n * List of syntax extensions.\n * @returns {NormalizedExtension}\n * A single combined extension.\n */\nexport function combineExtensions(extensions) {\n /** @type {NormalizedExtension} */\n const all = {}\n let index = -1\n\n while (++index < extensions.length) {\n syntaxExtension(all, extensions[index])\n }\n\n return all\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {NormalizedExtension} all\n * Extension to merge into.\n * @param {Extension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction syntaxExtension(all, extension) {\n /** @type {keyof Extension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n /** @type {Record<string, unknown>} */\n const left = maybe || (all[hook] = {})\n /** @type {Record<string, unknown> | undefined} */\n const right = extension[hook]\n /** @type {string} */\n let code\n\n if (right) {\n for (code in right) {\n if (!hasOwnProperty.call(left, code)) left[code] = []\n const value = right[code]\n constructs(\n // @ts-expect-error Looks like a list.\n left[code],\n Array.isArray(value) ? value : value ? [value] : []\n )\n }\n }\n }\n}\n\n/**\n * Merge `list` into `existing` (both lists of constructs).\n * Mutates `existing`.\n *\n * @param {Array<unknown>} existing\n * List of constructs to merge into.\n * @param {Array<unknown>} list\n * List of constructs to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction constructs(existing, list) {\n let index = -1\n /** @type {Array<unknown>} */\n const before = []\n\n while (++index < list.length) {\n // @ts-expect-error Looks like an object.\n ;(list[index].add === 'after' ? existing : before).push(list[index])\n }\n\n splice(existing, 0, 0, before)\n}\n\n/**\n * Combine multiple HTML extensions into one.\n *\n * @param {ReadonlyArray<HtmlExtension>} htmlExtensions\n * List of HTML extensions.\n * @returns {HtmlExtension}\n * Single combined HTML extension.\n */\nexport function combineHtmlExtensions(htmlExtensions) {\n /** @type {HtmlExtension} */\n const handlers = {}\n let index = -1\n\n while (++index < htmlExtensions.length) {\n htmlExtension(handlers, htmlExtensions[index])\n }\n\n return handlers\n}\n\n/**\n * Merge `extension` into `all`.\n *\n * @param {HtmlExtension} all\n * Extension to merge into.\n * @param {HtmlExtension} extension\n * Extension to merge.\n * @returns {undefined}\n * Nothing.\n */\nfunction htmlExtension(all, extension) {\n /** @type {keyof HtmlExtension} */\n let hook\n\n for (hook in extension) {\n const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined\n const left = maybe || (all[hook] = {})\n const right = extension[hook]\n /** @type {keyof Handles} */\n let type\n\n if (right) {\n for (type in right) {\n // @ts-expect-error assume document vs regular handler are managed correctly.\n left[type] = right[type]\n }\n }\n }\n}\n","/**\n * @import {Code} from 'micromark-util-types'\n */\n\n/**\n * Check whether the character code represents an ASCII alpha (`a` through `z`,\n * case insensitive).\n *\n * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.\n *\n * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)\n * to U+005A (`Z`).\n *\n * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)\n * to U+007A (`z`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlpha = regexCheck(/[A-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII alphanumeric (`a`\n * through `z`, case insensitive, or `0` through `9`).\n *\n * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha\n * (see `asciiAlpha`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAlphanumeric = regexCheck(/[\\dA-Za-z]/);\n\n/**\n * Check whether the character code represents an ASCII atext.\n *\n * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in\n * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),\n * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F\n * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E\n * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE\n * (`{`) to U+007E TILDE (`~`).\n *\n * See:\n * **\\[RFC5322]**:\n * [Internet Message Format](https://tools.ietf.org/html/rfc5322).\n * P. Resnick.\n * IETF.\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiAtext = regexCheck(/[#-'*+\\--9=?A-Z^-~]/);\n\n/**\n * Check whether a character code is an ASCII control character.\n *\n * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)\n * to U+001F (US), or U+007F (DEL).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code !== null && (code < 32 || code === 127)\n );\n}\n\n/**\n * Check whether the character code represents an ASCII digit (`0` through `9`).\n *\n * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to\n * U+0039 (`9`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiDigit = regexCheck(/\\d/);\n\n/**\n * Check whether the character code represents an ASCII hex digit (`a` through\n * `f`, case insensitive, or `0` through `9`).\n *\n * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex\n * digit, or an ASCII lower hex digit.\n *\n * An **ASCII upper hex digit** is a character in the inclusive range U+0041\n * (`A`) to U+0046 (`F`).\n *\n * An **ASCII lower hex digit** is a character in the inclusive range U+0061\n * (`a`) to U+0066 (`f`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiHexDigit = regexCheck(/[\\dA-Fa-f]/);\n\n/**\n * Check whether the character code represents ASCII punctuation.\n *\n * An **ASCII punctuation** is a character in the inclusive ranges U+0021\n * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT\n * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT\n * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).\n *\n * @param code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);\n\n/**\n * Check whether a character code is a markdown line ending.\n *\n * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN\n * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).\n *\n * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE\n * RETURN (CR) are replaced by these virtual characters depending on whether\n * they occurred together.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEnding(code) {\n return code !== null && code < -2;\n}\n\n/**\n * Check whether a character code is a markdown line ending (see\n * `markdownLineEnding`) or markdown space (see `markdownSpace`).\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownLineEndingOrSpace(code) {\n return code !== null && (code < 0 || code === 32);\n}\n\n/**\n * Check whether a character code is a markdown space.\n *\n * A **markdown space** is the concrete character U+0020 SPACE (SP) and the\n * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).\n *\n * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is\n * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL\n * SPACE (VS) characters, depending on the column at which the tab occurred.\n *\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether it matches.\n */\nexport function markdownSpace(code) {\n return code === -2 || code === -1 || code === 32;\n}\n\n// Size note: removing ASCII from the regex and using `asciiPunctuation` here\n// In fact adds to the bundle size.\n/**\n * Check whether the character code represents Unicode punctuation.\n *\n * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,\n * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`\n * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`\n * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII\n * punctuation (see `asciiPunctuation`).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\n\n/**\n * Check whether the character code represents Unicode whitespace.\n *\n * Note that this does handle micromark specific markdown whitespace characters.\n * See `markdownLineEndingOrSpace` to check that.\n *\n * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,\n * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),\n * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\\[UNICODE]**).\n *\n * See:\n * **\\[UNICODE]**:\n * [The Unicode Standard](https://www.unicode.org/versions/).\n * Unicode Consortium.\n *\n * @param code\n * Code.\n * @returns\n * Whether it matches.\n */\nexport const unicodeWhitespace = regexCheck(/\\s/);\n\n/**\n * Create a code check from a regex.\n *\n * @param {RegExp} regex\n * Expression.\n * @returns {(code: Code) => boolean}\n * Check.\n */\nfunction regexCheck(regex) {\n return check;\n\n /**\n * Check whether a code matches the bound regex.\n *\n * @param {Code} code\n * Character code.\n * @returns {boolean}\n * Whether the character code matches the bound regex.\n */\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCharCode(code));\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { markdownSpace } from 'micromark-util-character';\n\n// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.\n\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * spaces in markdown are often optional, in which case this factory can be\n * used and `ok` will be switched to whether spaces were found or not\n * * one line ending or space can be detected with `markdownSpace(code)` right\n * before using `factorySpace`\n *\n * ###### Examples\n *\n * Where `␉` represents a tab (plus how much it expands) and `␠` represents a\n * single space.\n *\n * ```markdown\n * ␉\n * ␠␠␠␠\n * ␉␠\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {TokenType} type\n * Type (`' \\t'`).\n * @param {number | undefined} [max=Infinity]\n * Max (exclusive).\n * @returns {State}\n * Start state.\n */\nexport function factorySpace(effects, ok, type, max) {\n const limit = max ? max - 1 : Number.POSITIVE_INFINITY;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownSpace(code)) {\n effects.enter(type);\n return prefix(code);\n }\n return ok(code);\n }\n\n /** @type {State} */\n function prefix(code) {\n if (markdownSpace(code) && size++ < limit) {\n effects.consume(code);\n return prefix;\n }\n effects.exit(type);\n return ok(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const content = {\n tokenize: initializeContent\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n * Content.\n */\nfunction initializeContent(effects) {\n const contentStart = effects.attempt(this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial);\n /** @type {Token} */\n let previous;\n return contentStart;\n\n /** @type {State} */\n function afterContentStartConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, contentStart, \"linePrefix\");\n }\n\n /** @type {State} */\n function paragraphInitial(code) {\n effects.enter(\"paragraph\");\n return lineStart(code);\n }\n\n /** @type {State} */\n function lineStart(code) {\n const token = effects.enter(\"chunkText\", {\n contentType: \"text\",\n previous\n });\n if (previous) {\n previous.next = token;\n }\n previous = token;\n return data(code);\n }\n\n /** @type {State} */\n function data(code) {\n if (code === null) {\n effects.exit(\"chunkText\");\n effects.exit(\"paragraph\");\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n effects.exit(\"chunkText\");\n return lineStart;\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n}","/**\n * @import {\n * Construct,\n * ContainerState,\n * InitialConstruct,\n * Initializer,\n * Point,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @typedef {[Construct, ContainerState]} StackItem\n * Construct and its state.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {InitialConstruct} */\nexport const document = {\n tokenize: initializeDocument\n};\n\n/** @type {Construct} */\nconst containerConstruct = {\n tokenize: tokenizeContainer\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeDocument(effects) {\n const self = this;\n /** @type {Array<StackItem>} */\n const stack = [];\n let continued = 0;\n /** @type {TokenizeContext | undefined} */\n let childFlow;\n /** @type {Token | undefined} */\n let childToken;\n /** @type {number} */\n let lineStartOffset;\n return start;\n\n /** @type {State} */\n function start(code) {\n // First we iterate through the open blocks, starting with the root\n // document, and descending through last children down to the last open\n // block.\n // Each block imposes a condition that the line must satisfy if the block is\n // to remain open.\n // For example, a block quote requires a `>` character.\n // A paragraph requires a non-blank line.\n // In this phase we may match all or just some of the open blocks.\n // But we cannot close unmatched blocks yet, because we may have a lazy\n // continuation line.\n if (continued < stack.length) {\n const item = stack[continued];\n self.containerState = item[1];\n return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);\n }\n\n // Done.\n return checkNewContainers(code);\n }\n\n /** @type {State} */\n function documentContinue(code) {\n continued++;\n\n // Note: this field is called `_closeFlow` but it also closes containers.\n // Perhaps a good idea to rename it but it’s already used in the wild by\n // extensions.\n if (self.containerState._closeFlow) {\n self.containerState._closeFlow = undefined;\n if (childFlow) {\n closeFlow();\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when dealing with lazy lines in `writeToChild`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {Point | undefined} */\n let point;\n\n // Find the flow chunk.\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n let index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n\n // Inject the exits earlier (they’re still also at the end).\n splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n\n // Discard the duplicate exits.\n self.events.length = index;\n return checkNewContainers(code);\n }\n return start(code);\n }\n\n /** @type {State} */\n function checkNewContainers(code) {\n // Next, after consuming the continuation markers for existing blocks, we\n // look for new block starts (e.g. `>` for a block quote).\n // If we encounter a new block start, we close any blocks unmatched in\n // step 1 before creating the new block as a child of the last matched\n // block.\n if (continued === stack.length) {\n // No need to `check` whether there’s a container, of `exitContainers`\n // would be moot.\n // We can instead immediately `attempt` to parse one.\n if (!childFlow) {\n return documentContinued(code);\n }\n\n // If we have concrete content, such as block HTML or fenced code,\n // we can’t have containers “pierce” into them, so we can immediately\n // start.\n if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {\n return flowStart(code);\n }\n\n // If we do have flow, it could still be a blank line,\n // but we’d be interrupting it w/ a new container if there’s a current\n // construct.\n // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer\n // needed in micromark-extension-gfm-table@1.0.6).\n self.interrupt = Boolean(childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack);\n }\n\n // Check if there is a new container.\n self.containerState = {};\n return effects.check(containerConstruct, thereIsANewContainer, thereIsNoNewContainer)(code);\n }\n\n /** @type {State} */\n function thereIsANewContainer(code) {\n if (childFlow) closeFlow();\n exitContainers(continued);\n return documentContinued(code);\n }\n\n /** @type {State} */\n function thereIsNoNewContainer(code) {\n self.parser.lazy[self.now().line] = continued !== stack.length;\n lineStartOffset = self.now().offset;\n return flowStart(code);\n }\n\n /** @type {State} */\n function documentContinued(code) {\n // Try new containers.\n self.containerState = {};\n return effects.attempt(containerConstruct, containerContinue, flowStart)(code);\n }\n\n /** @type {State} */\n function containerContinue(code) {\n continued++;\n stack.push([self.currentConstruct, self.containerState]);\n // Try another.\n return documentContinued(code);\n }\n\n /** @type {State} */\n function flowStart(code) {\n if (code === null) {\n if (childFlow) closeFlow();\n exitContainers(0);\n effects.consume(code);\n return;\n }\n childFlow = childFlow || self.parser.flow(self.now());\n effects.enter(\"chunkFlow\", {\n _tokenizer: childFlow,\n contentType: \"flow\",\n previous: childToken\n });\n return flowContinue(code);\n }\n\n /** @type {State} */\n function flowContinue(code) {\n if (code === null) {\n writeToChild(effects.exit(\"chunkFlow\"), true);\n exitContainers(0);\n effects.consume(code);\n return;\n }\n if (markdownLineEnding(code)) {\n effects.consume(code);\n writeToChild(effects.exit(\"chunkFlow\"));\n // Get ready for the next line.\n continued = 0;\n self.interrupt = undefined;\n return start;\n }\n effects.consume(code);\n return flowContinue;\n }\n\n /**\n * @param {Token} token\n * Token.\n * @param {boolean | undefined} [endOfFile]\n * Whether the token is at the end of the file (default: `false`).\n * @returns {undefined}\n * Nothing.\n */\n function writeToChild(token, endOfFile) {\n const stream = self.sliceStream(token);\n if (endOfFile) stream.push(null);\n token.previous = childToken;\n if (childToken) childToken.next = token;\n childToken = token;\n childFlow.defineSkip(token.start);\n childFlow.write(stream);\n\n // Alright, so we just added a lazy line:\n //\n // ```markdown\n // > a\n // b.\n //\n // Or:\n //\n // > ~~~c\n // d\n //\n // Or:\n //\n // > | e |\n // f\n // ```\n //\n // The construct in the second example (fenced code) does not accept lazy\n // lines, so it marked itself as done at the end of its first line, and\n // then the content construct parses `d`.\n // Most constructs in markdown match on the first line: if the first line\n // forms a construct, a non-lazy line can’t “unmake” it.\n //\n // The construct in the third example is potentially a GFM table, and\n // those are *weird*.\n // It *could* be a table, from the first line, if the following line\n // matches a condition.\n // In this case, that second line is lazy, which “unmakes” the first line\n // and turns the whole into one content block.\n //\n // We’ve now parsed the non-lazy and the lazy line, and can figure out\n // whether the lazy line started a new flow block.\n // If it did, we exit the current containers between the two flow blocks.\n if (self.parser.lazy[token.start.line]) {\n let index = childFlow.events.length;\n while (index--) {\n if (\n // The token starts before the line ending…\n childFlow.events[index][1].start.offset < lineStartOffset && (\n // …and either is not ended yet…\n !childFlow.events[index][1].end ||\n // …or ends after it.\n childFlow.events[index][1].end.offset > lineStartOffset)) {\n // Exit: there’s still something open, which means it’s a lazy line\n // part of something.\n return;\n }\n }\n\n // Note: this algorithm for moving events around is similar to the\n // algorithm when closing flow in `documentContinue`.\n const indexBeforeExits = self.events.length;\n let indexBeforeFlow = indexBeforeExits;\n /** @type {boolean | undefined} */\n let seen;\n /** @type {Point | undefined} */\n let point;\n\n // Find the previous chunk (the one before the lazy line).\n while (indexBeforeFlow--) {\n if (self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === \"chunkFlow\") {\n if (seen) {\n point = self.events[indexBeforeFlow][1].end;\n break;\n }\n seen = true;\n }\n }\n exitContainers(continued);\n\n // Fix positions.\n index = indexBeforeExits;\n while (index < self.events.length) {\n self.events[index][1].end = {\n ...point\n };\n index++;\n }\n\n // Inject the exits earlier (they’re still also at the end).\n splice(self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits));\n\n // Discard the duplicate exits.\n self.events.length = index;\n }\n }\n\n /**\n * @param {number} size\n * Size.\n * @returns {undefined}\n * Nothing.\n */\n function exitContainers(size) {\n let index = stack.length;\n\n // Exit open containers.\n while (index-- > size) {\n const entry = stack[index];\n self.containerState = entry[1];\n entry[0].exit.call(self, effects);\n }\n stack.length = size;\n }\n function closeFlow() {\n childFlow.write([null]);\n childToken = undefined;\n childFlow = undefined;\n self.containerState._closeFlow = undefined;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n * Tokenizer.\n */\nfunction tokenizeContainer(effects, ok, nok) {\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok, nok), \"linePrefix\", this.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blankLine = {\n partial: true,\n tokenize: tokenizeBlankLine\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLine(effects, ok, nok) {\n return start;\n\n /**\n * Start of blank line.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n return markdownSpace(code) ? factorySpace(effects, after, \"linePrefix\")(code) : after(code);\n }\n\n /**\n * At eof/eol, after optional whitespace.\n *\n * > 👉 **Note**: `␠` represents a space character.\n *\n * ```markdown\n * > | ␠␠␊\n * ^\n * > | ␊\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * Some of the internal operations of micromark do lots of editing\n * operations on very large arrays. This runs into problems with two\n * properties of most circa-2020 JavaScript interpreters:\n *\n * - Array-length modifications at the high end of an array (push/pop) are\n * expected to be common and are implemented in (amortized) time\n * proportional to the number of elements added or removed, whereas\n * other operations (shift/unshift and splice) are much less efficient.\n * - Function arguments are passed on the stack, so adding tens of thousands\n * of elements to an array with `arr.push(...newElements)` will frequently\n * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)\n *\n * SpliceBuffers are an implementation of gap buffers, which are a\n * generalization of the \"queue made of two stacks\" idea. The splice buffer\n * maintains a cursor, and moving the cursor has cost proportional to the\n * distance the cursor moves, but inserting, deleting, or splicing in\n * new information at the cursor is as efficient as the push/pop operation.\n * This allows for an efficient sequence of splices (or pushes, pops, shifts,\n * or unshifts) as long such edits happen at the same part of the array or\n * generally sweep through the array from the beginning to the end.\n *\n * The interface for splice buffers also supports large numbers of inputs by\n * passing a single array argument rather passing multiple arguments on the\n * function call stack.\n *\n * @template T\n * Item type.\n */\nexport class SpliceBuffer {\n /**\n * @param {ReadonlyArray<T> | null | undefined} [initial]\n * Initial items (optional).\n * @returns\n * Splice buffer.\n */\n constructor(initial) {\n /** @type {Array<T>} */\n this.left = initial ? [...initial] : [];\n /** @type {Array<T>} */\n this.right = [];\n }\n\n /**\n * Array access;\n * does not move the cursor.\n *\n * @param {number} index\n * Index.\n * @return {T}\n * Item.\n */\n get(index) {\n if (index < 0 || index >= this.left.length + this.right.length) {\n throw new RangeError('Cannot access index `' + index + '` in a splice buffer of size `' + (this.left.length + this.right.length) + '`');\n }\n if (index < this.left.length) return this.left[index];\n return this.right[this.right.length - index + this.left.length - 1];\n }\n\n /**\n * The length of the splice buffer, one greater than the largest index in the\n * array.\n */\n get length() {\n return this.left.length + this.right.length;\n }\n\n /**\n * Remove and return `list[0]`;\n * moves the cursor to `0`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n shift() {\n this.setCursor(0);\n return this.right.pop();\n }\n\n /**\n * Slice the buffer to get an array;\n * does not move the cursor.\n *\n * @param {number} start\n * Start.\n * @param {number | null | undefined} [end]\n * End (optional).\n * @returns {Array<T>}\n * Array of items.\n */\n slice(start, end) {\n /** @type {number} */\n const stop = end === null || end === undefined ? Number.POSITIVE_INFINITY : end;\n if (stop < this.left.length) {\n return this.left.slice(start, stop);\n }\n if (start > this.left.length) {\n return this.right.slice(this.right.length - stop + this.left.length, this.right.length - start + this.left.length).reverse();\n }\n return this.left.slice(start).concat(this.right.slice(this.right.length - stop + this.left.length).reverse());\n }\n\n /**\n * Mimics the behavior of Array.prototype.splice() except for the change of\n * interface necessary to avoid segfaults when patching in very large arrays.\n *\n * This operation moves cursor is moved to `start` and results in the cursor\n * placed after any inserted items.\n *\n * @param {number} start\n * Start;\n * zero-based index at which to start changing the array;\n * negative numbers count backwards from the end of the array and values\n * that are out-of bounds are clamped to the appropriate end of the array.\n * @param {number | null | undefined} [deleteCount=0]\n * Delete count (default: `0`);\n * maximum number of elements to delete, starting from start.\n * @param {Array<T> | null | undefined} [items=[]]\n * Items to include in place of the deleted items (default: `[]`).\n * @return {Array<T>}\n * Any removed items.\n */\n splice(start, deleteCount, items) {\n /** @type {number} */\n const count = deleteCount || 0;\n this.setCursor(Math.trunc(start));\n const removed = this.right.splice(this.right.length - count, Number.POSITIVE_INFINITY);\n if (items) chunkedPush(this.left, items);\n return removed.reverse();\n }\n\n /**\n * Remove and return the highest-numbered item in the array, so\n * `list[list.length - 1]`;\n * Moves the cursor to `length`.\n *\n * @returns {T | undefined}\n * Item, optional.\n */\n pop() {\n this.setCursor(Number.POSITIVE_INFINITY);\n return this.left.pop();\n }\n\n /**\n * Inserts a single item to the high-numbered side of the array;\n * moves the cursor to `length`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n push(item) {\n this.setCursor(Number.POSITIVE_INFINITY);\n this.left.push(item);\n }\n\n /**\n * Inserts many items to the high-numbered side of the array.\n * Moves the cursor to `length`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n pushMany(items) {\n this.setCursor(Number.POSITIVE_INFINITY);\n chunkedPush(this.left, items);\n }\n\n /**\n * Inserts a single item to the low-numbered side of the array;\n * Moves the cursor to `0`.\n *\n * @param {T} item\n * Item.\n * @returns {undefined}\n * Nothing.\n */\n unshift(item) {\n this.setCursor(0);\n this.right.push(item);\n }\n\n /**\n * Inserts many items to the low-numbered side of the array;\n * moves the cursor to `0`.\n *\n * @param {Array<T>} items\n * Items.\n * @returns {undefined}\n * Nothing.\n */\n unshiftMany(items) {\n this.setCursor(0);\n chunkedPush(this.right, items.reverse());\n }\n\n /**\n * Move the cursor to a specific position in the array. Requires\n * time proportional to the distance moved.\n *\n * If `n < 0`, the cursor will end up at the beginning.\n * If `n > length`, the cursor will end up at the end.\n *\n * @param {number} n\n * Position.\n * @return {undefined}\n * Nothing.\n */\n setCursor(n) {\n if (n === this.left.length || n > this.left.length && this.right.length === 0 || n < 0 && this.left.length === 0) return;\n if (n < this.left.length) {\n // Move cursor to the this.left\n const removed = this.left.splice(n, Number.POSITIVE_INFINITY);\n chunkedPush(this.right, removed.reverse());\n } else {\n // Move cursor to the this.right\n const removed = this.right.splice(this.left.length + this.right.length - n, Number.POSITIVE_INFINITY);\n chunkedPush(this.left, removed.reverse());\n }\n }\n}\n\n/**\n * Avoid stack overflow by pushing items onto the stack in segments\n *\n * @template T\n * Item type.\n * @param {Array<T>} list\n * List to inject into.\n * @param {ReadonlyArray<T>} right\n * Items to inject.\n * @return {undefined}\n * Nothing.\n */\nfunction chunkedPush(list, right) {\n /** @type {number} */\n let chunkStart = 0;\n if (right.length < 10000) {\n list.push(...right);\n } else {\n while (chunkStart < right.length) {\n list.push(...right.slice(chunkStart, chunkStart + 10000));\n chunkStart += 10000;\n }\n }\n}","/**\n * @import {Chunk, Event, Token} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { SpliceBuffer } from './lib/splice-buffer.js';\n\n// Hidden API exposed for testing.\nexport { SpliceBuffer } from './lib/splice-buffer.js';\n\n/**\n * Tokenize subcontent.\n *\n * @param {Array<Event>} eventsArray\n * List of events.\n * @returns {boolean}\n * Whether subtokens were found.\n */\n// eslint-disable-next-line complexity\nexport function subtokenize(eventsArray) {\n /** @type {Record<string, number>} */\n const jumps = {};\n let index = -1;\n /** @type {Event} */\n let event;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number} */\n let otherIndex;\n /** @type {Event} */\n let otherEvent;\n /** @type {Array<Event>} */\n let parameters;\n /** @type {Array<Event>} */\n let subevents;\n /** @type {boolean | undefined} */\n let more;\n const events = new SpliceBuffer(eventsArray);\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index];\n }\n event = events.get(index);\n\n // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n if (index && event[1].type === \"chunkFlow\" && events.get(index - 1)[1].type === \"listItemPrefix\") {\n subevents = event[1]._tokenizer.events;\n otherIndex = 0;\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"lineEndingBlank\") {\n otherIndex += 2;\n }\n if (otherIndex < subevents.length && subevents[otherIndex][1].type === \"content\") {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === \"content\") {\n break;\n }\n if (subevents[otherIndex][1].type === \"chunkText\") {\n subevents[otherIndex][1]._isInFirstContentOfListItem = true;\n otherIndex++;\n }\n }\n }\n }\n\n // Enter.\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n Object.assign(jumps, subcontent(events, index));\n index = jumps[index];\n more = true;\n }\n }\n // Exit.\n else if (event[1]._container) {\n otherIndex = index;\n lineIndex = undefined;\n while (otherIndex--) {\n otherEvent = events.get(otherIndex);\n if (otherEvent[1].type === \"lineEnding\" || otherEvent[1].type === \"lineEndingBlank\") {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events.get(lineIndex)[1].type = \"lineEndingBlank\";\n }\n otherEvent[1].type = \"lineEnding\";\n lineIndex = otherIndex;\n }\n } else if (otherEvent[1].type === \"linePrefix\" || otherEvent[1].type === \"listItemIndent\") {\n // Move past.\n } else {\n break;\n }\n }\n if (lineIndex) {\n // Fix position.\n event[1].end = {\n ...events.get(lineIndex)[1].start\n };\n\n // Switch container exit w/ line endings.\n parameters = events.slice(lineIndex, index);\n parameters.unshift(event);\n events.splice(lineIndex, index - lineIndex + 1, parameters);\n }\n }\n }\n\n // The changes to the `events` buffer must be copied back into the eventsArray\n splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));\n return !more;\n}\n\n/**\n * Tokenize embedded tokens.\n *\n * @param {SpliceBuffer<Event>} events\n * Events.\n * @param {number} eventIndex\n * Index.\n * @returns {Record<string, number>}\n * Gaps.\n */\nfunction subcontent(events, eventIndex) {\n const token = events.get(eventIndex)[1];\n const context = events.get(eventIndex)[2];\n let startPosition = eventIndex - 1;\n /** @type {Array<number>} */\n const startPositions = [];\n let tokenizer = token._tokenizer;\n if (!tokenizer) {\n tokenizer = context.parser[token.contentType](token.start);\n if (token._contentTypeTextTrailing) {\n tokenizer._contentTypeTextTrailing = true;\n }\n }\n const childEvents = tokenizer.events;\n /** @type {Array<[number, number]>} */\n const jumps = [];\n /** @type {Record<string, number>} */\n const gaps = {};\n /** @type {Array<Chunk>} */\n let stream;\n /** @type {Token | undefined} */\n let previous;\n let index = -1;\n /** @type {Token | undefined} */\n let current = token;\n let adjust = 0;\n let start = 0;\n const breaks = [start];\n\n // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n while (current) {\n // Find the position of the event for this token.\n while (events.get(++startPosition)[1] !== current) {\n // Empty.\n }\n startPositions.push(startPosition);\n if (!current._tokenizer) {\n stream = context.sliceStream(current);\n if (!current.next) {\n stream.push(null);\n }\n if (previous) {\n tokenizer.defineSkip(current.start);\n }\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true;\n }\n tokenizer.write(stream);\n if (current._isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined;\n }\n }\n\n // Unravel the next token.\n previous = current;\n current = current.next;\n }\n\n // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n current = token;\n while (++index < childEvents.length) {\n if (\n // Find a void token that includes a break.\n childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {\n start = index + 1;\n breaks.push(start);\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n current = current.next;\n }\n }\n\n // Help GC.\n tokenizer.events = [];\n\n // If there’s one more token (which is the cases for lines that end in an\n // EOF), that’s perfect: the last point we found starts it.\n // If there isn’t then make sure any remaining content is added to it.\n if (current) {\n // Help GC.\n current._tokenizer = undefined;\n current.previous = undefined;\n } else {\n breaks.pop();\n }\n\n // Now splice the events from the subtokenizer into the current events,\n // moving back to front so that splice indices aren’t affected.\n index = breaks.length;\n while (index--) {\n const slice = childEvents.slice(breaks[index], breaks[index + 1]);\n const start = startPositions.pop();\n jumps.push([start, start + slice.length - 1]);\n events.splice(start, 2, slice);\n }\n jumps.reverse();\n index = -1;\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];\n adjust += jumps[index][1] - jumps[index][0] - 1;\n }\n return gaps;\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { subtokenize } from 'micromark-util-subtokenize';\n/**\n * No name because it must not be turned off.\n * @type {Construct}\n */\nexport const content = {\n resolve: resolveContent,\n tokenize: tokenizeContent\n};\n\n/** @type {Construct} */\nconst continuationConstruct = {\n partial: true,\n tokenize: tokenizeContinuation\n};\n\n/**\n * Content is transparent: it’s parsed right now. That way, definitions are also\n * parsed right now: before text in paragraphs (specifically, media) are parsed.\n *\n * @type {Resolver}\n */\nfunction resolveContent(events) {\n subtokenize(events);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContent(effects, ok) {\n /** @type {Token | undefined} */\n let previous;\n return chunkStart;\n\n /**\n * Before a content chunk.\n *\n * ```markdown\n * > | abc\n * ^\n * ```\n *\n * @type {State}\n */\n function chunkStart(code) {\n effects.enter(\"content\");\n previous = effects.enter(\"chunkContent\", {\n contentType: \"content\"\n });\n return chunkInside(code);\n }\n\n /**\n * In a content chunk.\n *\n * ```markdown\n * > | abc\n * ^^^\n * ```\n *\n * @type {State}\n */\n function chunkInside(code) {\n if (code === null) {\n return contentEnd(code);\n }\n\n // To do: in `markdown-rs`, each line is parsed on its own, and everything\n // is stitched together resolving.\n if (markdownLineEnding(code)) {\n return effects.check(continuationConstruct, contentContinue, contentEnd)(code);\n }\n\n // Data.\n effects.consume(code);\n return chunkInside;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentEnd(code) {\n effects.exit(\"chunkContent\");\n effects.exit(\"content\");\n return ok(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function contentContinue(code) {\n effects.consume(code);\n effects.exit(\"chunkContent\");\n previous.next = effects.enter(\"chunkContent\", {\n contentType: \"content\",\n previous\n });\n previous = previous.next;\n return chunkInside;\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeContinuation(effects, ok, nok) {\n const self = this;\n return startLookahead;\n\n /**\n *\n *\n * @type {State}\n */\n function startLookahead(code) {\n effects.exit(\"chunkContent\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, prefixed, \"linePrefix\");\n }\n\n /**\n *\n *\n * @type {State}\n */\n function prefixed(code) {\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n\n // Always populated by defaults.\n\n const tail = self.events[self.events.length - 1];\n if (!self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4) {\n return ok(code);\n }\n return effects.interrupt(self.parser.constructs.flow, nok, ok)(code);\n }\n}","/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}","/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can’t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) break;\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n events.splice(eventIndex, 0, ['enter', token, context], ['exit', token, context]);\n eventIndex += 2;\n }\n }\n eventIndex++;\n }\n }\n return events;\n}","/**\n * @import {Code} from 'micromark-util-types'\n */\n\nimport { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\n/**\n * Classify whether a code represents whitespace, punctuation, or something\n * else.\n *\n * Used for attention (emphasis, strong), whose sequences can open or close\n * based on the class of surrounding characters.\n *\n * > 👉 **Note**: eof (`null`) is seen as whitespace.\n *\n * @param {Code} code\n * Code.\n * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}\n * Group.\n */\nexport function classifyCharacter(code) {\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return 1;\n }\n if (unicodePunctuation(code)) {\n return 2;\n }\n}","/**\n * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'\n */\n\n/**\n * Call all `resolveAll`s.\n *\n * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs\n * List of constructs, optionally with `resolveAll`s.\n * @param {Array<Event>} events\n * List of events.\n * @param {TokenizeContext} context\n * Context used by `tokenize`.\n * @returns {Array<Event>}\n * Changed events.\n */\nexport function resolveAll(constructs, events, context) {\n /** @type {Array<Resolver>} */\n const called = []\n let index = -1\n\n while (++index < constructs.length) {\n const resolve = constructs[index].resolveAll\n\n if (resolve && !called.includes(resolve)) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n","/**\n * @import {\n * Code,\n * Construct,\n * Event,\n * Point,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { push, splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const attention = {\n name: 'attention',\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\n\n/**\n * Take all events and resolve attention to emphasis or strong.\n *\n * @type {Resolver}\n */\n// eslint-disable-next-line complexity\nfunction resolveAllAttention(events, context) {\n let index = -1;\n /** @type {number} */\n let open;\n /** @type {Token} */\n let group;\n /** @type {Token} */\n let text;\n /** @type {Token} */\n let openingSequence;\n /** @type {Token} */\n let closingSequence;\n /** @type {number} */\n let use;\n /** @type {Array<Event>} */\n let nextEvents;\n /** @type {number} */\n let offset;\n\n // Walk through all events.\n //\n // Note: performance of this is fine on an mb of normal markdown, but it’s\n // a bottleneck for malicious stuff.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close) {\n open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open &&\n // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n // If the opening can close or the closing can open,\n // and the close size *is not* a multiple of three,\n // but the sum of the opening and closing size *is* multiple of three,\n // then don’t match.\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n\n // Number of markers to use from the sequence.\n use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = {\n ...events[open][1].end\n };\n const end = {\n ...events[index][1].start\n };\n movePoint(start, -use);\n movePoint(end, use);\n openingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start,\n end: {\n ...events[open][1].end\n }\n };\n closingSequence = {\n type: use > 1 ? \"strongSequence\" : \"emphasisSequence\",\n start: {\n ...events[index][1].start\n },\n end\n };\n text = {\n type: use > 1 ? \"strongText\" : \"emphasisText\",\n start: {\n ...events[open][1].end\n },\n end: {\n ...events[index][1].start\n }\n };\n group = {\n type: use > 1 ? \"strong\" : \"emphasis\",\n start: {\n ...openingSequence.start\n },\n end: {\n ...closingSequence.end\n }\n };\n events[open][1].end = {\n ...openingSequence.start\n };\n events[index][1].start = {\n ...closingSequence.end\n };\n nextEvents = [];\n\n // If there are more markers in the opening, add them before.\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [['enter', events[open][1], context], ['exit', events[open][1], context]]);\n }\n\n // Opening.\n nextEvents = push(nextEvents, [['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n nextEvents = push(nextEvents, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context));\n\n // Closing.\n nextEvents = push(nextEvents, [['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context]]);\n\n // If there are more markers in the closing, add them after.\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [['enter', events[index][1], context], ['exit', events[index][1], context]]);\n } else {\n offset = 0;\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n\n // Remove remaining sequences.\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'attentionSequence') {\n events[index][1].type = 'data';\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const previous = this.previous;\n const before = classifyCharacter(previous);\n\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Before a sequence.\n *\n * ```markdown\n * > | **\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n marker = code;\n effects.enter('attentionSequence');\n return inside(code);\n }\n\n /**\n * In a sequence.\n *\n * ```markdown\n * > | **\n * ^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit('attentionSequence');\n\n // To do: next major: move this to resolver, just like `markdown-rs`.\n const after = classifyCharacter(code);\n\n // Always populated by defaults.\n\n const open = !after || after === 2 && before || attentionMarkers.includes(code);\n const close = !before || before === 2 && after || attentionMarkers.includes(previous);\n token._open = Boolean(marker === 42 ? open : open && (before || !close));\n token._close = Boolean(marker === 42 ? close : close && (after || !open));\n return ok(code);\n }\n}\n\n/**\n * Move a point a bit.\n *\n * Note: `move` only works inside lines! It’s not possible to move past other\n * chunks (replacement characters, tabs, or line endings).\n *\n * @param {Point} point\n * Point.\n * @param {number} offset\n * Amount to move.\n * @returns {undefined}\n * Nothing.\n */\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl } from 'micromark-util-character';\n/** @type {Construct} */\nexport const autolink = {\n name: 'autolink',\n tokenize: tokenizeAutolink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeAutolink(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of an autolink.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"autolink\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.enter(\"autolinkProtocol\");\n return open;\n }\n\n /**\n * After `<`, at protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (asciiAlpha(code)) {\n effects.consume(code);\n return schemeOrEmailAtext;\n }\n if (code === 64) {\n return nok(code);\n }\n return emailAtext(code);\n }\n\n /**\n * At second byte of protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeOrEmailAtext(code) {\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if (code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) {\n // Count the previous alphabetical from `open` too.\n size = 1;\n return schemeInsideOrEmailAtext(code);\n }\n return emailAtext(code);\n }\n\n /**\n * In ambiguous protocol or atext.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * > | a<user@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function schemeInsideOrEmailAtext(code) {\n if (code === 58) {\n effects.consume(code);\n size = 0;\n return urlInside;\n }\n\n // ASCII alphanumeric and `+`, `-`, and `.`.\n if ((code === 43 || code === 45 || code === 46 || asciiAlphanumeric(code)) && size++ < 32) {\n effects.consume(code);\n return schemeInsideOrEmailAtext;\n }\n size = 0;\n return emailAtext(code);\n }\n\n /**\n * After protocol, in URL.\n *\n * ```markdown\n * > | a<https://example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function urlInside(code) {\n if (code === 62) {\n effects.exit(\"autolinkProtocol\");\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n\n // ASCII control, space, or `<`.\n if (code === null || code === 32 || code === 60 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return urlInside;\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailAtext(code) {\n if (code === 64) {\n effects.consume(code);\n return emailAtSignOrDot;\n }\n if (asciiAtext(code)) {\n effects.consume(code);\n return emailAtext;\n }\n return nok(code);\n }\n\n /**\n * In label, after at-sign or dot.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function emailAtSignOrDot(code) {\n return asciiAlphanumeric(code) ? emailLabel(code) : nok(code);\n }\n\n /**\n * In label, where `.` and `>` are allowed.\n *\n * ```markdown\n * > | a<user.name@example.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailLabel(code) {\n if (code === 46) {\n effects.consume(code);\n size = 0;\n return emailAtSignOrDot;\n }\n if (code === 62) {\n // Exit, then change the token type.\n effects.exit(\"autolinkProtocol\").type = \"autolinkEmail\";\n effects.enter(\"autolinkMarker\");\n effects.consume(code);\n effects.exit(\"autolinkMarker\");\n effects.exit(\"autolink\");\n return ok;\n }\n return emailValue(code);\n }\n\n /**\n * In label, where `.` and `>` are *not* allowed.\n *\n * Though, this is also used in `emailLabel` to parse other values.\n *\n * ```markdown\n * > | a<user.name@ex-ample.com>b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailValue(code) {\n // ASCII alphanumeric or `-`.\n if ((code === 45 || asciiAlphanumeric(code)) && size++ < 63) {\n const next = code === 45 ? emailValue : emailLabel;\n effects.consume(code);\n return next;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const blockQuote = {\n continuation: {\n tokenize: tokenizeBlockQuoteContinuation\n },\n exit,\n name: 'blockQuote',\n tokenize: tokenizeBlockQuoteStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of block quote.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 62) {\n const state = self.containerState;\n if (!state.open) {\n effects.enter(\"blockQuote\", {\n _container: true\n });\n state.open = true;\n }\n effects.enter(\"blockQuotePrefix\");\n effects.enter(\"blockQuoteMarker\");\n effects.consume(code);\n effects.exit(\"blockQuoteMarker\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `>`, before optional whitespace.\n *\n * ```markdown\n * > | > a\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownSpace(code)) {\n effects.enter(\"blockQuotePrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"blockQuotePrefixWhitespace\");\n effects.exit(\"blockQuotePrefix\");\n return ok;\n }\n effects.exit(\"blockQuotePrefix\");\n return ok(code);\n }\n}\n\n/**\n * Start of block quote continuation.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlockQuoteContinuation(effects, ok, nok) {\n const self = this;\n return contStart;\n\n /**\n * Start of block quote continuation.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contStart(code) {\n if (markdownSpace(code)) {\n // Always populated by defaults.\n\n return factorySpace(effects, contBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return contBefore(code);\n }\n\n /**\n * At `>`, after optional whitespace.\n *\n * Also used to parse the first block quote opening.\n *\n * ```markdown\n * | > a\n * > | > b\n * ^\n * ```\n *\n * @type {State}\n */\n function contBefore(code) {\n return effects.attempt(blockQuote, ok, nok)(code);\n }\n}\n\n/** @type {Exiter} */\nfunction exit(effects) {\n effects.exit(\"blockQuote\");\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiPunctuation } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterEscape = {\n name: 'characterEscape',\n tokenize: tokenizeCharacterEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of character escape.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterEscape\");\n effects.enter(\"escapeMarker\");\n effects.consume(code);\n effects.exit(\"escapeMarker\");\n return inside;\n }\n\n /**\n * After `\\`, at punctuation.\n *\n * ```markdown\n * > | a\\*b\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // ASCII punctuation.\n if (asciiPunctuation(code)) {\n effects.enter(\"characterEscapeValue\");\n effects.consume(code);\n effects.exit(\"characterEscapeValue\");\n effects.exit(\"characterEscape\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * Map of named character references.\n *\n * @type {Record<string, string>}\n */\nexport const characterEntities = {\n AElig: 'Æ',\n AMP: '&',\n Aacute: 'Á',\n Abreve: 'Ă',\n Acirc: 'Â',\n Acy: 'А',\n Afr: '𝔄',\n Agrave: 'À',\n Alpha: 'Α',\n Amacr: 'Ā',\n And: '⩓',\n Aogon: 'Ą',\n Aopf: '𝔸',\n ApplyFunction: '⁡',\n Aring: 'Å',\n Ascr: '𝒜',\n Assign: '≔',\n Atilde: 'Ã',\n Auml: 'Ä',\n Backslash: '∖',\n Barv: '⫧',\n Barwed: '⌆',\n Bcy: 'Б',\n Because: '∵',\n Bernoullis: 'ℬ',\n Beta: 'Β',\n Bfr: '𝔅',\n Bopf: '𝔹',\n Breve: '˘',\n Bscr: 'ℬ',\n Bumpeq: '≎',\n CHcy: 'Ч',\n COPY: '©',\n Cacute: 'Ć',\n Cap: '⋒',\n CapitalDifferentialD: 'ⅅ',\n Cayleys: 'ℭ',\n Ccaron: 'Č',\n Ccedil: 'Ç',\n Ccirc: 'Ĉ',\n Cconint: '∰',\n Cdot: 'Ċ',\n Cedilla: '¸',\n CenterDot: '·',\n Cfr: 'ℭ',\n Chi: 'Χ',\n CircleDot: '⊙',\n CircleMinus: '⊖',\n CirclePlus: '⊕',\n CircleTimes: '⊗',\n ClockwiseContourIntegral: '∲',\n CloseCurlyDoubleQuote: '”',\n CloseCurlyQuote: '’',\n Colon: '∷',\n Colone: '⩴',\n Congruent: '≡',\n Conint: '∯',\n ContourIntegral: '∮',\n Copf: 'ℂ',\n Coproduct: '∐',\n CounterClockwiseContourIntegral: '∳',\n Cross: '⨯',\n Cscr: '𝒞',\n Cup: '⋓',\n CupCap: '≍',\n DD: 'ⅅ',\n DDotrahd: '⤑',\n DJcy: 'Ђ',\n DScy: 'Ѕ',\n DZcy: 'Џ',\n Dagger: '‡',\n Darr: '↡',\n Dashv: '⫤',\n Dcaron: 'Ď',\n Dcy: 'Д',\n Del: '∇',\n Delta: 'Δ',\n Dfr: '𝔇',\n DiacriticalAcute: '´',\n DiacriticalDot: '˙',\n DiacriticalDoubleAcute: '˝',\n DiacriticalGrave: '`',\n DiacriticalTilde: '˜',\n Diamond: '⋄',\n DifferentialD: 'ⅆ',\n Dopf: '𝔻',\n Dot: '¨',\n DotDot: '⃜',\n DotEqual: '≐',\n DoubleContourIntegral: '∯',\n DoubleDot: '¨',\n DoubleDownArrow: '⇓',\n DoubleLeftArrow: '⇐',\n DoubleLeftRightArrow: '⇔',\n DoubleLeftTee: '⫤',\n DoubleLongLeftArrow: '⟸',\n DoubleLongLeftRightArrow: '⟺',\n DoubleLongRightArrow: '⟹',\n DoubleRightArrow: '⇒',\n DoubleRightTee: '⊨',\n DoubleUpArrow: '⇑',\n DoubleUpDownArrow: '⇕',\n DoubleVerticalBar: '∥',\n DownArrow: '↓',\n DownArrowBar: '⤓',\n DownArrowUpArrow: '⇵',\n DownBreve: '̑',\n DownLeftRightVector: '⥐',\n DownLeftTeeVector: '⥞',\n DownLeftVector: '↽',\n DownLeftVectorBar: '⥖',\n DownRightTeeVector: '⥟',\n DownRightVector: '⇁',\n DownRightVectorBar: '⥗',\n DownTee: '⊤',\n DownTeeArrow: '↧',\n Downarrow: '⇓',\n Dscr: '𝒟',\n Dstrok: 'Đ',\n ENG: 'Ŋ',\n ETH: 'Ð',\n Eacute: 'É',\n Ecaron: 'Ě',\n Ecirc: 'Ê',\n Ecy: 'Э',\n Edot: 'Ė',\n Efr: '𝔈',\n Egrave: 'È',\n Element: '∈',\n Emacr: 'Ē',\n EmptySmallSquare: '◻',\n EmptyVerySmallSquare: '▫',\n Eogon: 'Ę',\n Eopf: '𝔼',\n Epsilon: 'Ε',\n Equal: '⩵',\n EqualTilde: '≂',\n Equilibrium: '⇌',\n Escr: 'ℰ',\n Esim: '⩳',\n Eta: 'Η',\n Euml: 'Ë',\n Exists: '∃',\n ExponentialE: 'ⅇ',\n Fcy: 'Ф',\n Ffr: '𝔉',\n FilledSmallSquare: '◼',\n FilledVerySmallSquare: '▪',\n Fopf: '𝔽',\n ForAll: '∀',\n Fouriertrf: 'ℱ',\n Fscr: 'ℱ',\n GJcy: 'Ѓ',\n GT: '>',\n Gamma: 'Γ',\n Gammad: 'Ϝ',\n Gbreve: 'Ğ',\n Gcedil: 'Ģ',\n Gcirc: 'Ĝ',\n Gcy: 'Г',\n Gdot: 'Ġ',\n Gfr: '𝔊',\n Gg: '⋙',\n Gopf: '𝔾',\n GreaterEqual: '≥',\n GreaterEqualLess: '⋛',\n GreaterFullEqual: '≧',\n GreaterGreater: '⪢',\n GreaterLess: '≷',\n GreaterSlantEqual: '⩾',\n GreaterTilde: '≳',\n Gscr: '𝒢',\n Gt: '≫',\n HARDcy: 'Ъ',\n Hacek: 'ˇ',\n Hat: '^',\n Hcirc: 'Ĥ',\n Hfr: 'ℌ',\n HilbertSpace: 'ℋ',\n Hopf: 'ℍ',\n HorizontalLine: '─',\n Hscr: 'ℋ',\n Hstrok: 'Ħ',\n HumpDownHump: '≎',\n HumpEqual: '≏',\n IEcy: 'Е',\n IJlig: 'IJ',\n IOcy: 'Ё',\n Iacute: 'Í',\n Icirc: 'Î',\n Icy: 'И',\n Idot: 'İ',\n Ifr: 'ℑ',\n Igrave: 'Ì',\n Im: 'ℑ',\n Imacr: 'Ī',\n ImaginaryI: 'ⅈ',\n Implies: '⇒',\n Int: '∬',\n Integral: '∫',\n Intersection: '⋂',\n InvisibleComma: '⁣',\n InvisibleTimes: '⁢',\n Iogon: 'Į',\n Iopf: '𝕀',\n Iota: 'Ι',\n Iscr: 'ℐ',\n Itilde: 'Ĩ',\n Iukcy: 'І',\n Iuml: 'Ï',\n Jcirc: 'Ĵ',\n Jcy: 'Й',\n Jfr: '𝔍',\n Jopf: '𝕁',\n Jscr: '𝒥',\n Jsercy: 'Ј',\n Jukcy: 'Є',\n KHcy: 'Х',\n KJcy: 'Ќ',\n Kappa: 'Κ',\n Kcedil: 'Ķ',\n Kcy: 'К',\n Kfr: '𝔎',\n Kopf: '𝕂',\n Kscr: '𝒦',\n LJcy: 'Љ',\n LT: '<',\n Lacute: 'Ĺ',\n Lambda: 'Λ',\n Lang: '⟪',\n Laplacetrf: 'ℒ',\n Larr: '↞',\n Lcaron: 'Ľ',\n Lcedil: 'Ļ',\n Lcy: 'Л',\n LeftAngleBracket: '⟨',\n LeftArrow: '←',\n LeftArrowBar: '⇤',\n LeftArrowRightArrow: '⇆',\n LeftCeiling: '⌈',\n LeftDoubleBracket: '⟦',\n LeftDownTeeVector: '⥡',\n LeftDownVector: '⇃',\n LeftDownVectorBar: '⥙',\n LeftFloor: '⌊',\n LeftRightArrow: '↔',\n LeftRightVector: '⥎',\n LeftTee: '⊣',\n LeftTeeArrow: '↤',\n LeftTeeVector: '⥚',\n LeftTriangle: '⊲',\n LeftTriangleBar: '⧏',\n LeftTriangleEqual: '⊴',\n LeftUpDownVector: '⥑',\n LeftUpTeeVector: '⥠',\n LeftUpVector: '↿',\n LeftUpVectorBar: '⥘',\n LeftVector: '↼',\n LeftVectorBar: '⥒',\n Leftarrow: '⇐',\n Leftrightarrow: '⇔',\n LessEqualGreater: '⋚',\n LessFullEqual: '≦',\n LessGreater: '≶',\n LessLess: '⪡',\n LessSlantEqual: '⩽',\n LessTilde: '≲',\n Lfr: '𝔏',\n Ll: '⋘',\n Lleftarrow: '⇚',\n Lmidot: 'Ŀ',\n LongLeftArrow: '⟵',\n LongLeftRightArrow: '⟷',\n LongRightArrow: '⟶',\n Longleftarrow: '⟸',\n Longleftrightarrow: '⟺',\n Longrightarrow: '⟹',\n Lopf: '𝕃',\n LowerLeftArrow: '↙',\n LowerRightArrow: '↘',\n Lscr: 'ℒ',\n Lsh: '↰',\n Lstrok: 'Ł',\n Lt: '≪',\n Map: '⤅',\n Mcy: 'М',\n MediumSpace: ' ',\n Mellintrf: 'ℳ',\n Mfr: '𝔐',\n MinusPlus: '∓',\n Mopf: '𝕄',\n Mscr: 'ℳ',\n Mu: 'Μ',\n NJcy: 'Њ',\n Nacute: 'Ń',\n Ncaron: 'Ň',\n Ncedil: 'Ņ',\n Ncy: 'Н',\n NegativeMediumSpace: '​',\n NegativeThickSpace: '​',\n NegativeThinSpace: '​',\n NegativeVeryThinSpace: '​',\n NestedGreaterGreater: '≫',\n NestedLessLess: '≪',\n NewLine: '\\n',\n Nfr: '𝔑',\n NoBreak: '⁠',\n NonBreakingSpace: ' ',\n Nopf: 'ℕ',\n Not: '⫬',\n NotCongruent: '≢',\n NotCupCap: '≭',\n NotDoubleVerticalBar: '∦',\n NotElement: '∉',\n NotEqual: '≠',\n NotEqualTilde: '≂̸',\n NotExists: '∄',\n NotGreater: '≯',\n NotGreaterEqual: '≱',\n NotGreaterFullEqual: '≧̸',\n NotGreaterGreater: '≫̸',\n NotGreaterLess: '≹',\n NotGreaterSlantEqual: '⩾̸',\n NotGreaterTilde: '≵',\n NotHumpDownHump: '≎̸',\n NotHumpEqual: '≏̸',\n NotLeftTriangle: '⋪',\n NotLeftTriangleBar: '⧏̸',\n NotLeftTriangleEqual: '⋬',\n NotLess: '≮',\n NotLessEqual: '≰',\n NotLessGreater: '≸',\n NotLessLess: '≪̸',\n NotLessSlantEqual: '⩽̸',\n NotLessTilde: '≴',\n NotNestedGreaterGreater: '⪢̸',\n NotNestedLessLess: '⪡̸',\n NotPrecedes: '⊀',\n NotPrecedesEqual: '⪯̸',\n NotPrecedesSlantEqual: '⋠',\n NotReverseElement: '∌',\n NotRightTriangle: '⋫',\n NotRightTriangleBar: '⧐̸',\n NotRightTriangleEqual: '⋭',\n NotSquareSubset: '⊏̸',\n NotSquareSubsetEqual: '⋢',\n NotSquareSuperset: '⊐̸',\n NotSquareSupersetEqual: '⋣',\n NotSubset: '⊂⃒',\n NotSubsetEqual: '⊈',\n NotSucceeds: '⊁',\n NotSucceedsEqual: '⪰̸',\n NotSucceedsSlantEqual: '⋡',\n NotSucceedsTilde: '≿̸',\n NotSuperset: '⊃⃒',\n NotSupersetEqual: '⊉',\n NotTilde: '≁',\n NotTildeEqual: '≄',\n NotTildeFullEqual: '≇',\n NotTildeTilde: '≉',\n NotVerticalBar: '∤',\n Nscr: '𝒩',\n Ntilde: 'Ñ',\n Nu: 'Ν',\n OElig: 'Œ',\n Oacute: 'Ó',\n Ocirc: 'Ô',\n Ocy: 'О',\n Odblac: 'Ő',\n Ofr: '𝔒',\n Ograve: 'Ò',\n Omacr: 'Ō',\n Omega: 'Ω',\n Omicron: 'Ο',\n Oopf: '𝕆',\n OpenCurlyDoubleQuote: '“',\n OpenCurlyQuote: '‘',\n Or: '⩔',\n Oscr: '𝒪',\n Oslash: 'Ø',\n Otilde: 'Õ',\n Otimes: '⨷',\n Ouml: 'Ö',\n OverBar: '‾',\n OverBrace: '⏞',\n OverBracket: '⎴',\n OverParenthesis: '⏜',\n PartialD: '∂',\n Pcy: 'П',\n Pfr: '𝔓',\n Phi: 'Φ',\n Pi: 'Π',\n PlusMinus: '±',\n Poincareplane: 'ℌ',\n Popf: 'ℙ',\n Pr: '⪻',\n Precedes: '≺',\n PrecedesEqual: '⪯',\n PrecedesSlantEqual: '≼',\n PrecedesTilde: '≾',\n Prime: '″',\n Product: '∏',\n Proportion: '∷',\n Proportional: '∝',\n Pscr: '𝒫',\n Psi: 'Ψ',\n QUOT: '\"',\n Qfr: '𝔔',\n Qopf: 'ℚ',\n Qscr: '𝒬',\n RBarr: '⤐',\n REG: '®',\n Racute: 'Ŕ',\n Rang: '⟫',\n Rarr: '↠',\n Rarrtl: '⤖',\n Rcaron: 'Ř',\n Rcedil: 'Ŗ',\n Rcy: 'Р',\n Re: 'ℜ',\n ReverseElement: '∋',\n ReverseEquilibrium: '⇋',\n ReverseUpEquilibrium: '⥯',\n Rfr: 'ℜ',\n Rho: 'Ρ',\n RightAngleBracket: '⟩',\n RightArrow: '→',\n RightArrowBar: '⇥',\n RightArrowLeftArrow: '⇄',\n RightCeiling: '⌉',\n RightDoubleBracket: '⟧',\n RightDownTeeVector: '⥝',\n RightDownVector: '⇂',\n RightDownVectorBar: '⥕',\n RightFloor: '⌋',\n RightTee: '⊢',\n RightTeeArrow: '↦',\n RightTeeVector: '⥛',\n RightTriangle: '⊳',\n RightTriangleBar: '⧐',\n RightTriangleEqual: '⊵',\n RightUpDownVector: '⥏',\n RightUpTeeVector: '⥜',\n RightUpVector: '↾',\n RightUpVectorBar: '⥔',\n RightVector: '⇀',\n RightVectorBar: '⥓',\n Rightarrow: '⇒',\n Ropf: 'ℝ',\n RoundImplies: '⥰',\n Rrightarrow: '⇛',\n Rscr: 'ℛ',\n Rsh: '↱',\n RuleDelayed: '⧴',\n SHCHcy: 'Щ',\n SHcy: 'Ш',\n SOFTcy: 'Ь',\n Sacute: 'Ś',\n Sc: '⪼',\n Scaron: 'Š',\n Scedil: 'Ş',\n Scirc: 'Ŝ',\n Scy: 'С',\n Sfr: '𝔖',\n ShortDownArrow: '↓',\n ShortLeftArrow: '←',\n ShortRightArrow: '→',\n ShortUpArrow: '↑',\n Sigma: 'Σ',\n SmallCircle: '∘',\n Sopf: '𝕊',\n Sqrt: '√',\n Square: '□',\n SquareIntersection: '⊓',\n SquareSubset: '⊏',\n SquareSubsetEqual: '⊑',\n SquareSuperset: '⊐',\n SquareSupersetEqual: '⊒',\n SquareUnion: '⊔',\n Sscr: '𝒮',\n Star: '⋆',\n Sub: '⋐',\n Subset: '⋐',\n SubsetEqual: '⊆',\n Succeeds: '≻',\n SucceedsEqual: '⪰',\n SucceedsSlantEqual: '≽',\n SucceedsTilde: '≿',\n SuchThat: '∋',\n Sum: '∑',\n Sup: '⋑',\n Superset: '⊃',\n SupersetEqual: '⊇',\n Supset: '⋑',\n THORN: 'Þ',\n TRADE: '™',\n TSHcy: 'Ћ',\n TScy: 'Ц',\n Tab: '\\t',\n Tau: 'Τ',\n Tcaron: 'Ť',\n Tcedil: 'Ţ',\n Tcy: 'Т',\n Tfr: '𝔗',\n Therefore: '∴',\n Theta: 'Θ',\n ThickSpace: '  ',\n ThinSpace: ' ',\n Tilde: '∼',\n TildeEqual: '≃',\n TildeFullEqual: '≅',\n TildeTilde: '≈',\n Topf: '𝕋',\n TripleDot: '⃛',\n Tscr: '𝒯',\n Tstrok: 'Ŧ',\n Uacute: 'Ú',\n Uarr: '↟',\n Uarrocir: '⥉',\n Ubrcy: 'Ў',\n Ubreve: 'Ŭ',\n Ucirc: 'Û',\n Ucy: 'У',\n Udblac: 'Ű',\n Ufr: '𝔘',\n Ugrave: 'Ù',\n Umacr: 'Ū',\n UnderBar: '_',\n UnderBrace: '⏟',\n UnderBracket: '⎵',\n UnderParenthesis: '⏝',\n Union: '⋃',\n UnionPlus: '⊎',\n Uogon: 'Ų',\n Uopf: '𝕌',\n UpArrow: '↑',\n UpArrowBar: '⤒',\n UpArrowDownArrow: '⇅',\n UpDownArrow: '↕',\n UpEquilibrium: '⥮',\n UpTee: '⊥',\n UpTeeArrow: '↥',\n Uparrow: '⇑',\n Updownarrow: '⇕',\n UpperLeftArrow: '↖',\n UpperRightArrow: '↗',\n Upsi: 'ϒ',\n Upsilon: 'Υ',\n Uring: 'Ů',\n Uscr: '𝒰',\n Utilde: 'Ũ',\n Uuml: 'Ü',\n VDash: '⊫',\n Vbar: '⫫',\n Vcy: 'В',\n Vdash: '⊩',\n Vdashl: '⫦',\n Vee: '⋁',\n Verbar: '‖',\n Vert: '‖',\n VerticalBar: '∣',\n VerticalLine: '|',\n VerticalSeparator: '❘',\n VerticalTilde: '≀',\n VeryThinSpace: ' ',\n Vfr: '𝔙',\n Vopf: '𝕍',\n Vscr: '𝒱',\n Vvdash: '⊪',\n Wcirc: 'Ŵ',\n Wedge: '⋀',\n Wfr: '𝔚',\n Wopf: '𝕎',\n Wscr: '𝒲',\n Xfr: '𝔛',\n Xi: 'Ξ',\n Xopf: '𝕏',\n Xscr: '𝒳',\n YAcy: 'Я',\n YIcy: 'Ї',\n YUcy: 'Ю',\n Yacute: 'Ý',\n Ycirc: 'Ŷ',\n Ycy: 'Ы',\n Yfr: '𝔜',\n Yopf: '𝕐',\n Yscr: '𝒴',\n Yuml: 'Ÿ',\n ZHcy: 'Ж',\n Zacute: 'Ź',\n Zcaron: 'Ž',\n Zcy: 'З',\n Zdot: 'Ż',\n ZeroWidthSpace: '​',\n Zeta: 'Ζ',\n Zfr: 'ℨ',\n Zopf: 'ℤ',\n Zscr: '𝒵',\n aacute: 'á',\n abreve: 'ă',\n ac: '∾',\n acE: '∾̳',\n acd: '∿',\n acirc: 'â',\n acute: '´',\n acy: 'а',\n aelig: 'æ',\n af: '⁡',\n afr: '𝔞',\n agrave: 'à',\n alefsym: 'ℵ',\n aleph: 'ℵ',\n alpha: 'α',\n amacr: 'ā',\n amalg: '⨿',\n amp: '&',\n and: '∧',\n andand: '⩕',\n andd: '⩜',\n andslope: '⩘',\n andv: '⩚',\n ang: '∠',\n ange: '⦤',\n angle: '∠',\n angmsd: '∡',\n angmsdaa: '⦨',\n angmsdab: '⦩',\n angmsdac: '⦪',\n angmsdad: '⦫',\n angmsdae: '⦬',\n angmsdaf: '⦭',\n angmsdag: '⦮',\n angmsdah: '⦯',\n angrt: '∟',\n angrtvb: '⊾',\n angrtvbd: '⦝',\n angsph: '∢',\n angst: 'Å',\n angzarr: '⍼',\n aogon: 'ą',\n aopf: '𝕒',\n ap: '≈',\n apE: '⩰',\n apacir: '⩯',\n ape: '≊',\n apid: '≋',\n apos: \"'\",\n approx: '≈',\n approxeq: '≊',\n aring: 'å',\n ascr: '𝒶',\n ast: '*',\n asymp: '≈',\n asympeq: '≍',\n atilde: 'ã',\n auml: 'ä',\n awconint: '∳',\n awint: '⨑',\n bNot: '⫭',\n backcong: '≌',\n backepsilon: '϶',\n backprime: '‵',\n backsim: '∽',\n backsimeq: '⋍',\n barvee: '⊽',\n barwed: '⌅',\n barwedge: '⌅',\n bbrk: '⎵',\n bbrktbrk: '⎶',\n bcong: '≌',\n bcy: 'б',\n bdquo: '„',\n becaus: '∵',\n because: '∵',\n bemptyv: '⦰',\n bepsi: '϶',\n bernou: 'ℬ',\n beta: 'β',\n beth: 'ℶ',\n between: '≬',\n bfr: '𝔟',\n bigcap: '⋂',\n bigcirc: '◯',\n bigcup: '⋃',\n bigodot: '⨀',\n bigoplus: '⨁',\n bigotimes: '⨂',\n bigsqcup: '⨆',\n bigstar: '★',\n bigtriangledown: '▽',\n bigtriangleup: '△',\n biguplus: '⨄',\n bigvee: '⋁',\n bigwedge: '⋀',\n bkarow: '⤍',\n blacklozenge: '⧫',\n blacksquare: '▪',\n blacktriangle: '▴',\n blacktriangledown: '▾',\n blacktriangleleft: '◂',\n blacktriangleright: '▸',\n blank: '␣',\n blk12: '▒',\n blk14: '░',\n blk34: '▓',\n block: '█',\n bne: '=⃥',\n bnequiv: '≡⃥',\n bnot: '⌐',\n bopf: '𝕓',\n bot: '⊥',\n bottom: '⊥',\n bowtie: '⋈',\n boxDL: '╗',\n boxDR: '╔',\n boxDl: '╖',\n boxDr: '╓',\n boxH: '═',\n boxHD: '╦',\n boxHU: '╩',\n boxHd: '╤',\n boxHu: '╧',\n boxUL: '╝',\n boxUR: '╚',\n boxUl: '╜',\n boxUr: '╙',\n boxV: '║',\n boxVH: '╬',\n boxVL: '╣',\n boxVR: '╠',\n boxVh: '╫',\n boxVl: '╢',\n boxVr: '╟',\n boxbox: '⧉',\n boxdL: '╕',\n boxdR: '╒',\n boxdl: '┐',\n boxdr: '┌',\n boxh: '─',\n boxhD: '╥',\n boxhU: '╨',\n boxhd: '┬',\n boxhu: '┴',\n boxminus: '⊟',\n boxplus: '⊞',\n boxtimes: '⊠',\n boxuL: '╛',\n boxuR: '╘',\n boxul: '┘',\n boxur: '└',\n boxv: '│',\n boxvH: '╪',\n boxvL: '╡',\n boxvR: '╞',\n boxvh: '┼',\n boxvl: '┤',\n boxvr: '├',\n bprime: '‵',\n breve: '˘',\n brvbar: '¦',\n bscr: '𝒷',\n bsemi: '⁏',\n bsim: '∽',\n bsime: '⋍',\n bsol: '\\\\',\n bsolb: '⧅',\n bsolhsub: '⟈',\n bull: '•',\n bullet: '•',\n bump: '≎',\n bumpE: '⪮',\n bumpe: '≏',\n bumpeq: '≏',\n cacute: 'ć',\n cap: '∩',\n capand: '⩄',\n capbrcup: '⩉',\n capcap: '⩋',\n capcup: '⩇',\n capdot: '⩀',\n caps: '∩︀',\n caret: '⁁',\n caron: 'ˇ',\n ccaps: '⩍',\n ccaron: 'č',\n ccedil: 'ç',\n ccirc: 'ĉ',\n ccups: '⩌',\n ccupssm: '⩐',\n cdot: 'ċ',\n cedil: '¸',\n cemptyv: '⦲',\n cent: '¢',\n centerdot: '·',\n cfr: '𝔠',\n chcy: 'ч',\n check: '✓',\n checkmark: '✓',\n chi: 'χ',\n cir: '○',\n cirE: '⧃',\n circ: 'ˆ',\n circeq: '≗',\n circlearrowleft: '↺',\n circlearrowright: '↻',\n circledR: '®',\n circledS: 'Ⓢ',\n circledast: '⊛',\n circledcirc: '⊚',\n circleddash: '⊝',\n cire: '≗',\n cirfnint: '⨐',\n cirmid: '⫯',\n cirscir: '⧂',\n clubs: '♣',\n clubsuit: '♣',\n colon: ':',\n colone: '≔',\n coloneq: '≔',\n comma: ',',\n commat: '@',\n comp: '∁',\n compfn: '∘',\n complement: '∁',\n complexes: 'ℂ',\n cong: '≅',\n congdot: '⩭',\n conint: '∮',\n copf: '𝕔',\n coprod: '∐',\n copy: '©',\n copysr: '℗',\n crarr: '↵',\n cross: '✗',\n cscr: '𝒸',\n csub: '⫏',\n csube: '⫑',\n csup: '⫐',\n csupe: '⫒',\n ctdot: '⋯',\n cudarrl: '⤸',\n cudarrr: '⤵',\n cuepr: '⋞',\n cuesc: '⋟',\n cularr: '↶',\n cularrp: '⤽',\n cup: '∪',\n cupbrcap: '⩈',\n cupcap: '⩆',\n cupcup: '⩊',\n cupdot: '⊍',\n cupor: '⩅',\n cups: '∪︀',\n curarr: '↷',\n curarrm: '⤼',\n curlyeqprec: '⋞',\n curlyeqsucc: '⋟',\n curlyvee: '⋎',\n curlywedge: '⋏',\n curren: '¤',\n curvearrowleft: '↶',\n curvearrowright: '↷',\n cuvee: '⋎',\n cuwed: '⋏',\n cwconint: '∲',\n cwint: '∱',\n cylcty: '⌭',\n dArr: '⇓',\n dHar: '⥥',\n dagger: '†',\n daleth: 'ℸ',\n darr: '↓',\n dash: '‐',\n dashv: '⊣',\n dbkarow: '⤏',\n dblac: '˝',\n dcaron: 'ď',\n dcy: 'д',\n dd: 'ⅆ',\n ddagger: '‡',\n ddarr: '⇊',\n ddotseq: '⩷',\n deg: '°',\n delta: 'δ',\n demptyv: '⦱',\n dfisht: '⥿',\n dfr: '𝔡',\n dharl: '⇃',\n dharr: '⇂',\n diam: '⋄',\n diamond: '⋄',\n diamondsuit: '♦',\n diams: '♦',\n die: '¨',\n digamma: 'ϝ',\n disin: '⋲',\n div: '÷',\n divide: '÷',\n divideontimes: '⋇',\n divonx: '⋇',\n djcy: 'ђ',\n dlcorn: '⌞',\n dlcrop: '⌍',\n dollar: '$',\n dopf: '𝕕',\n dot: '˙',\n doteq: '≐',\n doteqdot: '≑',\n dotminus: '∸',\n dotplus: '∔',\n dotsquare: '⊡',\n doublebarwedge: '⌆',\n downarrow: '↓',\n downdownarrows: '⇊',\n downharpoonleft: '⇃',\n downharpoonright: '⇂',\n drbkarow: '⤐',\n drcorn: '⌟',\n drcrop: '⌌',\n dscr: '𝒹',\n dscy: 'ѕ',\n dsol: '⧶',\n dstrok: 'đ',\n dtdot: '⋱',\n dtri: '▿',\n dtrif: '▾',\n duarr: '⇵',\n duhar: '⥯',\n dwangle: '⦦',\n dzcy: 'џ',\n dzigrarr: '⟿',\n eDDot: '⩷',\n eDot: '≑',\n eacute: 'é',\n easter: '⩮',\n ecaron: 'ě',\n ecir: '≖',\n ecirc: 'ê',\n ecolon: '≕',\n ecy: 'э',\n edot: 'ė',\n ee: 'ⅇ',\n efDot: '≒',\n efr: '𝔢',\n eg: '⪚',\n egrave: 'è',\n egs: '⪖',\n egsdot: '⪘',\n el: '⪙',\n elinters: '⏧',\n ell: 'ℓ',\n els: '⪕',\n elsdot: '⪗',\n emacr: 'ē',\n empty: '∅',\n emptyset: '∅',\n emptyv: '∅',\n emsp13: ' ',\n emsp14: ' ',\n emsp: ' ',\n eng: 'ŋ',\n ensp: ' ',\n eogon: 'ę',\n eopf: '𝕖',\n epar: '⋕',\n eparsl: '⧣',\n eplus: '⩱',\n epsi: 'ε',\n epsilon: 'ε',\n epsiv: 'ϵ',\n eqcirc: '≖',\n eqcolon: '≕',\n eqsim: '≂',\n eqslantgtr: '⪖',\n eqslantless: '⪕',\n equals: '=',\n equest: '≟',\n equiv: '≡',\n equivDD: '⩸',\n eqvparsl: '⧥',\n erDot: '≓',\n erarr: '⥱',\n escr: 'ℯ',\n esdot: '≐',\n esim: '≂',\n eta: 'η',\n eth: 'ð',\n euml: 'ë',\n euro: '€',\n excl: '!',\n exist: '∃',\n expectation: 'ℰ',\n exponentiale: 'ⅇ',\n fallingdotseq: '≒',\n fcy: 'ф',\n female: '♀',\n ffilig: 'ffi',\n fflig: 'ff',\n ffllig: 'ffl',\n ffr: '𝔣',\n filig: 'fi',\n fjlig: 'fj',\n flat: '♭',\n fllig: 'fl',\n fltns: '▱',\n fnof: 'ƒ',\n fopf: '𝕗',\n forall: '∀',\n fork: '⋔',\n forkv: '⫙',\n fpartint: '⨍',\n frac12: '½',\n frac13: '⅓',\n frac14: '¼',\n frac15: '⅕',\n frac16: '⅙',\n frac18: '⅛',\n frac23: '⅔',\n frac25: '⅖',\n frac34: '¾',\n frac35: '⅗',\n frac38: '⅜',\n frac45: '⅘',\n frac56: '⅚',\n frac58: '⅝',\n frac78: '⅞',\n frasl: '⁄',\n frown: '⌢',\n fscr: '𝒻',\n gE: '≧',\n gEl: '⪌',\n gacute: 'ǵ',\n gamma: 'γ',\n gammad: 'ϝ',\n gap: '⪆',\n gbreve: 'ğ',\n gcirc: 'ĝ',\n gcy: 'г',\n gdot: 'ġ',\n ge: '≥',\n gel: '⋛',\n geq: '≥',\n geqq: '≧',\n geqslant: '⩾',\n ges: '⩾',\n gescc: '⪩',\n gesdot: '⪀',\n gesdoto: '⪂',\n gesdotol: '⪄',\n gesl: '⋛︀',\n gesles: '⪔',\n gfr: '𝔤',\n gg: '≫',\n ggg: '⋙',\n gimel: 'ℷ',\n gjcy: 'ѓ',\n gl: '≷',\n glE: '⪒',\n gla: '⪥',\n glj: '⪤',\n gnE: '≩',\n gnap: '⪊',\n gnapprox: '⪊',\n gne: '⪈',\n gneq: '⪈',\n gneqq: '≩',\n gnsim: '⋧',\n gopf: '𝕘',\n grave: '`',\n gscr: 'ℊ',\n gsim: '≳',\n gsime: '⪎',\n gsiml: '⪐',\n gt: '>',\n gtcc: '⪧',\n gtcir: '⩺',\n gtdot: '⋗',\n gtlPar: '⦕',\n gtquest: '⩼',\n gtrapprox: '⪆',\n gtrarr: '⥸',\n gtrdot: '⋗',\n gtreqless: '⋛',\n gtreqqless: '⪌',\n gtrless: '≷',\n gtrsim: '≳',\n gvertneqq: '≩︀',\n gvnE: '≩︀',\n hArr: '⇔',\n hairsp: ' ',\n half: '½',\n hamilt: 'ℋ',\n hardcy: 'ъ',\n harr: '↔',\n harrcir: '⥈',\n harrw: '↭',\n hbar: 'ℏ',\n hcirc: 'ĥ',\n hearts: '♥',\n heartsuit: '♥',\n hellip: '…',\n hercon: '⊹',\n hfr: '𝔥',\n hksearow: '⤥',\n hkswarow: '⤦',\n hoarr: '⇿',\n homtht: '∻',\n hookleftarrow: '↩',\n hookrightarrow: '↪',\n hopf: '𝕙',\n horbar: '―',\n hscr: '𝒽',\n hslash: 'ℏ',\n hstrok: 'ħ',\n hybull: '⁃',\n hyphen: '‐',\n iacute: 'í',\n ic: '⁣',\n icirc: 'î',\n icy: 'и',\n iecy: 'е',\n iexcl: '¡',\n iff: '⇔',\n ifr: '𝔦',\n igrave: 'ì',\n ii: 'ⅈ',\n iiiint: '⨌',\n iiint: '∭',\n iinfin: '⧜',\n iiota: '℩',\n ijlig: 'ij',\n imacr: 'ī',\n image: 'ℑ',\n imagline: 'ℐ',\n imagpart: 'ℑ',\n imath: 'ı',\n imof: '⊷',\n imped: 'Ƶ',\n in: '∈',\n incare: '℅',\n infin: '∞',\n infintie: '⧝',\n inodot: 'ı',\n int: '∫',\n intcal: '⊺',\n integers: 'ℤ',\n intercal: '⊺',\n intlarhk: '⨗',\n intprod: '⨼',\n iocy: 'ё',\n iogon: 'į',\n iopf: '𝕚',\n iota: 'ι',\n iprod: '⨼',\n iquest: '¿',\n iscr: '𝒾',\n isin: '∈',\n isinE: '⋹',\n isindot: '⋵',\n isins: '⋴',\n isinsv: '⋳',\n isinv: '∈',\n it: '⁢',\n itilde: 'ĩ',\n iukcy: 'і',\n iuml: 'ï',\n jcirc: 'ĵ',\n jcy: 'й',\n jfr: '𝔧',\n jmath: 'ȷ',\n jopf: '𝕛',\n jscr: '𝒿',\n jsercy: 'ј',\n jukcy: 'є',\n kappa: 'κ',\n kappav: 'ϰ',\n kcedil: 'ķ',\n kcy: 'к',\n kfr: '𝔨',\n kgreen: 'ĸ',\n khcy: 'х',\n kjcy: 'ќ',\n kopf: '𝕜',\n kscr: '𝓀',\n lAarr: '⇚',\n lArr: '⇐',\n lAtail: '⤛',\n lBarr: '⤎',\n lE: '≦',\n lEg: '⪋',\n lHar: '⥢',\n lacute: 'ĺ',\n laemptyv: '⦴',\n lagran: 'ℒ',\n lambda: 'λ',\n lang: '⟨',\n langd: '⦑',\n langle: '⟨',\n lap: '⪅',\n laquo: '«',\n larr: '←',\n larrb: '⇤',\n larrbfs: '⤟',\n larrfs: '⤝',\n larrhk: '↩',\n larrlp: '↫',\n larrpl: '⤹',\n larrsim: '⥳',\n larrtl: '↢',\n lat: '⪫',\n latail: '⤙',\n late: '⪭',\n lates: '⪭︀',\n lbarr: '⤌',\n lbbrk: '❲',\n lbrace: '{',\n lbrack: '[',\n lbrke: '⦋',\n lbrksld: '⦏',\n lbrkslu: '⦍',\n lcaron: 'ľ',\n lcedil: 'ļ',\n lceil: '⌈',\n lcub: '{',\n lcy: 'л',\n ldca: '⤶',\n ldquo: '“',\n ldquor: '„',\n ldrdhar: '⥧',\n ldrushar: '⥋',\n ldsh: '↲',\n le: '≤',\n leftarrow: '←',\n leftarrowtail: '↢',\n leftharpoondown: '↽',\n leftharpoonup: '↼',\n leftleftarrows: '⇇',\n leftrightarrow: '↔',\n leftrightarrows: '⇆',\n leftrightharpoons: '⇋',\n leftrightsquigarrow: '↭',\n leftthreetimes: '⋋',\n leg: '⋚',\n leq: '≤',\n leqq: '≦',\n leqslant: '⩽',\n les: '⩽',\n lescc: '⪨',\n lesdot: '⩿',\n lesdoto: '⪁',\n lesdotor: '⪃',\n lesg: '⋚︀',\n lesges: '⪓',\n lessapprox: '⪅',\n lessdot: '⋖',\n lesseqgtr: '⋚',\n lesseqqgtr: '⪋',\n lessgtr: '≶',\n lesssim: '≲',\n lfisht: '⥼',\n lfloor: '⌊',\n lfr: '𝔩',\n lg: '≶',\n lgE: '⪑',\n lhard: '↽',\n lharu: '↼',\n lharul: '⥪',\n lhblk: '▄',\n ljcy: 'љ',\n ll: '≪',\n llarr: '⇇',\n llcorner: '⌞',\n llhard: '⥫',\n lltri: '◺',\n lmidot: 'ŀ',\n lmoust: '⎰',\n lmoustache: '⎰',\n lnE: '≨',\n lnap: '⪉',\n lnapprox: '⪉',\n lne: '⪇',\n lneq: '⪇',\n lneqq: '≨',\n lnsim: '⋦',\n loang: '⟬',\n loarr: '⇽',\n lobrk: '⟦',\n longleftarrow: '⟵',\n longleftrightarrow: '⟷',\n longmapsto: '⟼',\n longrightarrow: '⟶',\n looparrowleft: '↫',\n looparrowright: '↬',\n lopar: '⦅',\n lopf: '𝕝',\n loplus: '⨭',\n lotimes: '⨴',\n lowast: '∗',\n lowbar: '_',\n loz: '◊',\n lozenge: '◊',\n lozf: '⧫',\n lpar: '(',\n lparlt: '⦓',\n lrarr: '⇆',\n lrcorner: '⌟',\n lrhar: '⇋',\n lrhard: '⥭',\n lrm: '‎',\n lrtri: '⊿',\n lsaquo: '‹',\n lscr: '𝓁',\n lsh: '↰',\n lsim: '≲',\n lsime: '⪍',\n lsimg: '⪏',\n lsqb: '[',\n lsquo: '‘',\n lsquor: '‚',\n lstrok: 'ł',\n lt: '<',\n ltcc: '⪦',\n ltcir: '⩹',\n ltdot: '⋖',\n lthree: '⋋',\n ltimes: '⋉',\n ltlarr: '⥶',\n ltquest: '⩻',\n ltrPar: '⦖',\n ltri: '◃',\n ltrie: '⊴',\n ltrif: '◂',\n lurdshar: '⥊',\n luruhar: '⥦',\n lvertneqq: '≨︀',\n lvnE: '≨︀',\n mDDot: '∺',\n macr: '¯',\n male: '♂',\n malt: '✠',\n maltese: '✠',\n map: '↦',\n mapsto: '↦',\n mapstodown: '↧',\n mapstoleft: '↤',\n mapstoup: '↥',\n marker: '▮',\n mcomma: '⨩',\n mcy: 'м',\n mdash: '—',\n measuredangle: '∡',\n mfr: '𝔪',\n mho: '℧',\n micro: 'µ',\n mid: '∣',\n midast: '*',\n midcir: '⫰',\n middot: '·',\n minus: '−',\n minusb: '⊟',\n minusd: '∸',\n minusdu: '⨪',\n mlcp: '⫛',\n mldr: '…',\n mnplus: '∓',\n models: '⊧',\n mopf: '𝕞',\n mp: '∓',\n mscr: '𝓂',\n mstpos: '∾',\n mu: 'μ',\n multimap: '⊸',\n mumap: '⊸',\n nGg: '⋙̸',\n nGt: '≫⃒',\n nGtv: '≫̸',\n nLeftarrow: '⇍',\n nLeftrightarrow: '⇎',\n nLl: '⋘̸',\n nLt: '≪⃒',\n nLtv: '≪̸',\n nRightarrow: '⇏',\n nVDash: '⊯',\n nVdash: '⊮',\n nabla: '∇',\n nacute: 'ń',\n nang: '∠⃒',\n nap: '≉',\n napE: '⩰̸',\n napid: '≋̸',\n napos: 'ʼn',\n napprox: '≉',\n natur: '♮',\n natural: '♮',\n naturals: 'ℕ',\n nbsp: ' ',\n nbump: '≎̸',\n nbumpe: '≏̸',\n ncap: '⩃',\n ncaron: 'ň',\n ncedil: 'ņ',\n ncong: '≇',\n ncongdot: '⩭̸',\n ncup: '⩂',\n ncy: 'н',\n ndash: '–',\n ne: '≠',\n neArr: '⇗',\n nearhk: '⤤',\n nearr: '↗',\n nearrow: '↗',\n nedot: '≐̸',\n nequiv: '≢',\n nesear: '⤨',\n nesim: '≂̸',\n nexist: '∄',\n nexists: '∄',\n nfr: '𝔫',\n ngE: '≧̸',\n nge: '≱',\n ngeq: '≱',\n ngeqq: '≧̸',\n ngeqslant: '⩾̸',\n nges: '⩾̸',\n ngsim: '≵',\n ngt: '≯',\n ngtr: '≯',\n nhArr: '⇎',\n nharr: '↮',\n nhpar: '⫲',\n ni: '∋',\n nis: '⋼',\n nisd: '⋺',\n niv: '∋',\n njcy: 'њ',\n nlArr: '⇍',\n nlE: '≦̸',\n nlarr: '↚',\n nldr: '‥',\n nle: '≰',\n nleftarrow: '↚',\n nleftrightarrow: '↮',\n nleq: '≰',\n nleqq: '≦̸',\n nleqslant: '⩽̸',\n nles: '⩽̸',\n nless: '≮',\n nlsim: '≴',\n nlt: '≮',\n nltri: '⋪',\n nltrie: '⋬',\n nmid: '∤',\n nopf: '𝕟',\n not: '¬',\n notin: '∉',\n notinE: '⋹̸',\n notindot: '⋵̸',\n notinva: '∉',\n notinvb: '⋷',\n notinvc: '⋶',\n notni: '∌',\n notniva: '∌',\n notnivb: '⋾',\n notnivc: '⋽',\n npar: '∦',\n nparallel: '∦',\n nparsl: '⫽⃥',\n npart: '∂̸',\n npolint: '⨔',\n npr: '⊀',\n nprcue: '⋠',\n npre: '⪯̸',\n nprec: '⊀',\n npreceq: '⪯̸',\n nrArr: '⇏',\n nrarr: '↛',\n nrarrc: '⤳̸',\n nrarrw: '↝̸',\n nrightarrow: '↛',\n nrtri: '⋫',\n nrtrie: '⋭',\n nsc: '⊁',\n nsccue: '⋡',\n nsce: '⪰̸',\n nscr: '𝓃',\n nshortmid: '∤',\n nshortparallel: '∦',\n nsim: '≁',\n nsime: '≄',\n nsimeq: '≄',\n nsmid: '∤',\n nspar: '∦',\n nsqsube: '⋢',\n nsqsupe: '⋣',\n nsub: '⊄',\n nsubE: '⫅̸',\n nsube: '⊈',\n nsubset: '⊂⃒',\n nsubseteq: '⊈',\n nsubseteqq: '⫅̸',\n nsucc: '⊁',\n nsucceq: '⪰̸',\n nsup: '⊅',\n nsupE: '⫆̸',\n nsupe: '⊉',\n nsupset: '⊃⃒',\n nsupseteq: '⊉',\n nsupseteqq: '⫆̸',\n ntgl: '≹',\n ntilde: 'ñ',\n ntlg: '≸',\n ntriangleleft: '⋪',\n ntrianglelefteq: '⋬',\n ntriangleright: '⋫',\n ntrianglerighteq: '⋭',\n nu: 'ν',\n num: '#',\n numero: '№',\n numsp: ' ',\n nvDash: '⊭',\n nvHarr: '⤄',\n nvap: '≍⃒',\n nvdash: '⊬',\n nvge: '≥⃒',\n nvgt: '>⃒',\n nvinfin: '⧞',\n nvlArr: '⤂',\n nvle: '≤⃒',\n nvlt: '<⃒',\n nvltrie: '⊴⃒',\n nvrArr: '⤃',\n nvrtrie: '⊵⃒',\n nvsim: '∼⃒',\n nwArr: '⇖',\n nwarhk: '⤣',\n nwarr: '↖',\n nwarrow: '↖',\n nwnear: '⤧',\n oS: 'Ⓢ',\n oacute: 'ó',\n oast: '⊛',\n ocir: '⊚',\n ocirc: 'ô',\n ocy: 'о',\n odash: '⊝',\n odblac: 'ő',\n odiv: '⨸',\n odot: '⊙',\n odsold: '⦼',\n oelig: 'œ',\n ofcir: '⦿',\n ofr: '𝔬',\n ogon: '˛',\n ograve: 'ò',\n ogt: '⧁',\n ohbar: '⦵',\n ohm: 'Ω',\n oint: '∮',\n olarr: '↺',\n olcir: '⦾',\n olcross: '⦻',\n oline: '‾',\n olt: '⧀',\n omacr: 'ō',\n omega: 'ω',\n omicron: 'ο',\n omid: '⦶',\n ominus: '⊖',\n oopf: '𝕠',\n opar: '⦷',\n operp: '⦹',\n oplus: '⊕',\n or: '∨',\n orarr: '↻',\n ord: '⩝',\n order: 'ℴ',\n orderof: 'ℴ',\n ordf: 'ª',\n ordm: 'º',\n origof: '⊶',\n oror: '⩖',\n orslope: '⩗',\n orv: '⩛',\n oscr: 'ℴ',\n oslash: 'ø',\n osol: '⊘',\n otilde: 'õ',\n otimes: '⊗',\n otimesas: '⨶',\n ouml: 'ö',\n ovbar: '⌽',\n par: '∥',\n para: '¶',\n parallel: '∥',\n parsim: '⫳',\n parsl: '⫽',\n part: '∂',\n pcy: 'п',\n percnt: '%',\n period: '.',\n permil: '‰',\n perp: '⊥',\n pertenk: '‱',\n pfr: '𝔭',\n phi: 'φ',\n phiv: 'ϕ',\n phmmat: 'ℳ',\n phone: '☎',\n pi: 'π',\n pitchfork: '⋔',\n piv: 'ϖ',\n planck: 'ℏ',\n planckh: 'ℎ',\n plankv: 'ℏ',\n plus: '+',\n plusacir: '⨣',\n plusb: '⊞',\n pluscir: '⨢',\n plusdo: '∔',\n plusdu: '⨥',\n pluse: '⩲',\n plusmn: '±',\n plussim: '⨦',\n plustwo: '⨧',\n pm: '±',\n pointint: '⨕',\n popf: '𝕡',\n pound: '£',\n pr: '≺',\n prE: '⪳',\n prap: '⪷',\n prcue: '≼',\n pre: '⪯',\n prec: '≺',\n precapprox: '⪷',\n preccurlyeq: '≼',\n preceq: '⪯',\n precnapprox: '⪹',\n precneqq: '⪵',\n precnsim: '⋨',\n precsim: '≾',\n prime: '′',\n primes: 'ℙ',\n prnE: '⪵',\n prnap: '⪹',\n prnsim: '⋨',\n prod: '∏',\n profalar: '⌮',\n profline: '⌒',\n profsurf: '⌓',\n prop: '∝',\n propto: '∝',\n prsim: '≾',\n prurel: '⊰',\n pscr: '𝓅',\n psi: 'ψ',\n puncsp: ' ',\n qfr: '𝔮',\n qint: '⨌',\n qopf: '𝕢',\n qprime: '⁗',\n qscr: '𝓆',\n quaternions: 'ℍ',\n quatint: '⨖',\n quest: '?',\n questeq: '≟',\n quot: '\"',\n rAarr: '⇛',\n rArr: '⇒',\n rAtail: '⤜',\n rBarr: '⤏',\n rHar: '⥤',\n race: '∽̱',\n racute: 'ŕ',\n radic: '√',\n raemptyv: '⦳',\n rang: '⟩',\n rangd: '⦒',\n range: '⦥',\n rangle: '⟩',\n raquo: '»',\n rarr: '→',\n rarrap: '⥵',\n rarrb: '⇥',\n rarrbfs: '⤠',\n rarrc: '⤳',\n rarrfs: '⤞',\n rarrhk: '↪',\n rarrlp: '↬',\n rarrpl: '⥅',\n rarrsim: '⥴',\n rarrtl: '↣',\n rarrw: '↝',\n ratail: '⤚',\n ratio: '∶',\n rationals: 'ℚ',\n rbarr: '⤍',\n rbbrk: '❳',\n rbrace: '}',\n rbrack: ']',\n rbrke: '⦌',\n rbrksld: '⦎',\n rbrkslu: '⦐',\n rcaron: 'ř',\n rcedil: 'ŗ',\n rceil: '⌉',\n rcub: '}',\n rcy: 'р',\n rdca: '⤷',\n rdldhar: '⥩',\n rdquo: '”',\n rdquor: '”',\n rdsh: '↳',\n real: 'ℜ',\n realine: 'ℛ',\n realpart: 'ℜ',\n reals: 'ℝ',\n rect: '▭',\n reg: '®',\n rfisht: '⥽',\n rfloor: '⌋',\n rfr: '𝔯',\n rhard: '⇁',\n rharu: '⇀',\n rharul: '⥬',\n rho: 'ρ',\n rhov: 'ϱ',\n rightarrow: '→',\n rightarrowtail: '↣',\n rightharpoondown: '⇁',\n rightharpoonup: '⇀',\n rightleftarrows: '⇄',\n rightleftharpoons: '⇌',\n rightrightarrows: '⇉',\n rightsquigarrow: '↝',\n rightthreetimes: '⋌',\n ring: '˚',\n risingdotseq: '≓',\n rlarr: '⇄',\n rlhar: '⇌',\n rlm: '‏',\n rmoust: '⎱',\n rmoustache: '⎱',\n rnmid: '⫮',\n roang: '⟭',\n roarr: '⇾',\n robrk: '⟧',\n ropar: '⦆',\n ropf: '𝕣',\n roplus: '⨮',\n rotimes: '⨵',\n rpar: ')',\n rpargt: '⦔',\n rppolint: '⨒',\n rrarr: '⇉',\n rsaquo: '›',\n rscr: '𝓇',\n rsh: '↱',\n rsqb: ']',\n rsquo: '’',\n rsquor: '’',\n rthree: '⋌',\n rtimes: '⋊',\n rtri: '▹',\n rtrie: '⊵',\n rtrif: '▸',\n rtriltri: '⧎',\n ruluhar: '⥨',\n rx: '℞',\n sacute: 'ś',\n sbquo: '‚',\n sc: '≻',\n scE: '⪴',\n scap: '⪸',\n scaron: 'š',\n sccue: '≽',\n sce: '⪰',\n scedil: 'ş',\n scirc: 'ŝ',\n scnE: '⪶',\n scnap: '⪺',\n scnsim: '⋩',\n scpolint: '⨓',\n scsim: '≿',\n scy: 'с',\n sdot: '⋅',\n sdotb: '⊡',\n sdote: '⩦',\n seArr: '⇘',\n searhk: '⤥',\n searr: '↘',\n searrow: '↘',\n sect: '§',\n semi: ';',\n seswar: '⤩',\n setminus: '∖',\n setmn: '∖',\n sext: '✶',\n sfr: '𝔰',\n sfrown: '⌢',\n sharp: '♯',\n shchcy: 'щ',\n shcy: 'ш',\n shortmid: '∣',\n shortparallel: '∥',\n shy: '­',\n sigma: 'σ',\n sigmaf: 'ς',\n sigmav: 'ς',\n sim: '∼',\n simdot: '⩪',\n sime: '≃',\n simeq: '≃',\n simg: '⪞',\n simgE: '⪠',\n siml: '⪝',\n simlE: '⪟',\n simne: '≆',\n simplus: '⨤',\n simrarr: '⥲',\n slarr: '←',\n smallsetminus: '∖',\n smashp: '⨳',\n smeparsl: '⧤',\n smid: '∣',\n smile: '⌣',\n smt: '⪪',\n smte: '⪬',\n smtes: '⪬︀',\n softcy: 'ь',\n sol: '/',\n solb: '⧄',\n solbar: '⌿',\n sopf: '𝕤',\n spades: '♠',\n spadesuit: '♠',\n spar: '∥',\n sqcap: '⊓',\n sqcaps: '⊓︀',\n sqcup: '⊔',\n sqcups: '⊔︀',\n sqsub: '⊏',\n sqsube: '⊑',\n sqsubset: '⊏',\n sqsubseteq: '⊑',\n sqsup: '⊐',\n sqsupe: '⊒',\n sqsupset: '⊐',\n sqsupseteq: '⊒',\n squ: '□',\n square: '□',\n squarf: '▪',\n squf: '▪',\n srarr: '→',\n sscr: '𝓈',\n ssetmn: '∖',\n ssmile: '⌣',\n sstarf: '⋆',\n star: '☆',\n starf: '★',\n straightepsilon: 'ϵ',\n straightphi: 'ϕ',\n strns: '¯',\n sub: '⊂',\n subE: '⫅',\n subdot: '⪽',\n sube: '⊆',\n subedot: '⫃',\n submult: '⫁',\n subnE: '⫋',\n subne: '⊊',\n subplus: '⪿',\n subrarr: '⥹',\n subset: '⊂',\n subseteq: '⊆',\n subseteqq: '⫅',\n subsetneq: '⊊',\n subsetneqq: '⫋',\n subsim: '⫇',\n subsub: '⫕',\n subsup: '⫓',\n succ: '≻',\n succapprox: '⪸',\n succcurlyeq: '≽',\n succeq: '⪰',\n succnapprox: '⪺',\n succneqq: '⪶',\n succnsim: '⋩',\n succsim: '≿',\n sum: '∑',\n sung: '♪',\n sup1: '¹',\n sup2: '²',\n sup3: '³',\n sup: '⊃',\n supE: '⫆',\n supdot: '⪾',\n supdsub: '⫘',\n supe: '⊇',\n supedot: '⫄',\n suphsol: '⟉',\n suphsub: '⫗',\n suplarr: '⥻',\n supmult: '⫂',\n supnE: '⫌',\n supne: '⊋',\n supplus: '⫀',\n supset: '⊃',\n supseteq: '⊇',\n supseteqq: '⫆',\n supsetneq: '⊋',\n supsetneqq: '⫌',\n supsim: '⫈',\n supsub: '⫔',\n supsup: '⫖',\n swArr: '⇙',\n swarhk: '⤦',\n swarr: '↙',\n swarrow: '↙',\n swnwar: '⤪',\n szlig: 'ß',\n target: '⌖',\n tau: 'τ',\n tbrk: '⎴',\n tcaron: 'ť',\n tcedil: 'ţ',\n tcy: 'т',\n tdot: '⃛',\n telrec: '⌕',\n tfr: '𝔱',\n there4: '∴',\n therefore: '∴',\n theta: 'θ',\n thetasym: 'ϑ',\n thetav: 'ϑ',\n thickapprox: '≈',\n thicksim: '∼',\n thinsp: ' ',\n thkap: '≈',\n thksim: '∼',\n thorn: 'þ',\n tilde: '˜',\n times: '×',\n timesb: '⊠',\n timesbar: '⨱',\n timesd: '⨰',\n tint: '∭',\n toea: '⤨',\n top: '⊤',\n topbot: '⌶',\n topcir: '⫱',\n topf: '𝕥',\n topfork: '⫚',\n tosa: '⤩',\n tprime: '‴',\n trade: '™',\n triangle: '▵',\n triangledown: '▿',\n triangleleft: '◃',\n trianglelefteq: '⊴',\n triangleq: '≜',\n triangleright: '▹',\n trianglerighteq: '⊵',\n tridot: '◬',\n trie: '≜',\n triminus: '⨺',\n triplus: '⨹',\n trisb: '⧍',\n tritime: '⨻',\n trpezium: '⏢',\n tscr: '𝓉',\n tscy: 'ц',\n tshcy: 'ћ',\n tstrok: 'ŧ',\n twixt: '≬',\n twoheadleftarrow: '↞',\n twoheadrightarrow: '↠',\n uArr: '⇑',\n uHar: '⥣',\n uacute: 'ú',\n uarr: '↑',\n ubrcy: 'ў',\n ubreve: 'ŭ',\n ucirc: 'û',\n ucy: 'у',\n udarr: '⇅',\n udblac: 'ű',\n udhar: '⥮',\n ufisht: '⥾',\n ufr: '𝔲',\n ugrave: 'ù',\n uharl: '↿',\n uharr: '↾',\n uhblk: '▀',\n ulcorn: '⌜',\n ulcorner: '⌜',\n ulcrop: '⌏',\n ultri: '◸',\n umacr: 'ū',\n uml: '¨',\n uogon: 'ų',\n uopf: '𝕦',\n uparrow: '↑',\n updownarrow: '↕',\n upharpoonleft: '↿',\n upharpoonright: '↾',\n uplus: '⊎',\n upsi: 'υ',\n upsih: 'ϒ',\n upsilon: 'υ',\n upuparrows: '⇈',\n urcorn: '⌝',\n urcorner: '⌝',\n urcrop: '⌎',\n uring: 'ů',\n urtri: '◹',\n uscr: '𝓊',\n utdot: '⋰',\n utilde: 'ũ',\n utri: '▵',\n utrif: '▴',\n uuarr: '⇈',\n uuml: 'ü',\n uwangle: '⦧',\n vArr: '⇕',\n vBar: '⫨',\n vBarv: '⫩',\n vDash: '⊨',\n vangrt: '⦜',\n varepsilon: 'ϵ',\n varkappa: 'ϰ',\n varnothing: '∅',\n varphi: 'ϕ',\n varpi: 'ϖ',\n varpropto: '∝',\n varr: '↕',\n varrho: 'ϱ',\n varsigma: 'ς',\n varsubsetneq: '⊊︀',\n varsubsetneqq: '⫋︀',\n varsupsetneq: '⊋︀',\n varsupsetneqq: '⫌︀',\n vartheta: 'ϑ',\n vartriangleleft: '⊲',\n vartriangleright: '⊳',\n vcy: 'в',\n vdash: '⊢',\n vee: '∨',\n veebar: '⊻',\n veeeq: '≚',\n vellip: '⋮',\n verbar: '|',\n vert: '|',\n vfr: '𝔳',\n vltri: '⊲',\n vnsub: '⊂⃒',\n vnsup: '⊃⃒',\n vopf: '𝕧',\n vprop: '∝',\n vrtri: '⊳',\n vscr: '𝓋',\n vsubnE: '⫋︀',\n vsubne: '⊊︀',\n vsupnE: '⫌︀',\n vsupne: '⊋︀',\n vzigzag: '⦚',\n wcirc: 'ŵ',\n wedbar: '⩟',\n wedge: '∧',\n wedgeq: '≙',\n weierp: '℘',\n wfr: '𝔴',\n wopf: '𝕨',\n wp: '℘',\n wr: '≀',\n wreath: '≀',\n wscr: '𝓌',\n xcap: '⋂',\n xcirc: '◯',\n xcup: '⋃',\n xdtri: '▽',\n xfr: '𝔵',\n xhArr: '⟺',\n xharr: '⟷',\n xi: 'ξ',\n xlArr: '⟸',\n xlarr: '⟵',\n xmap: '⟼',\n xnis: '⋻',\n xodot: '⨀',\n xopf: '𝕩',\n xoplus: '⨁',\n xotime: '⨂',\n xrArr: '⟹',\n xrarr: '⟶',\n xscr: '𝓍',\n xsqcup: '⨆',\n xuplus: '⨄',\n xutri: '△',\n xvee: '⋁',\n xwedge: '⋀',\n yacute: 'ý',\n yacy: 'я',\n ycirc: 'ŷ',\n ycy: 'ы',\n yen: '¥',\n yfr: '𝔶',\n yicy: 'ї',\n yopf: '𝕪',\n yscr: '𝓎',\n yucy: 'ю',\n yuml: 'ÿ',\n zacute: 'ź',\n zcaron: 'ž',\n zcy: 'з',\n zdot: 'ż',\n zeetrf: 'ℨ',\n zeta: 'ζ',\n zfr: '𝔷',\n zhcy: 'ж',\n zigrarr: '⇝',\n zopf: '𝕫',\n zscr: '𝓏',\n zwj: '‍',\n zwnj: '‌'\n}\n","import {characterEntities} from 'character-entities'\n\n// To do: next major: use `Object.hasOwn`.\nconst own = {}.hasOwnProperty\n\n/**\n * Decode a single character reference (without the `&` or `;`).\n * You probably only need this when you’re building parsers yourself that follow\n * different rules compared to HTML.\n * This is optimized to be tiny in browsers.\n *\n * @param {string} value\n * `notin` (named), `#123` (deci), `#x123` (hexa).\n * @returns {string|false}\n * Decoded reference.\n */\nexport function decodeNamedCharacterReference(value) {\n return own.call(characterEntities, value) ? characterEntities[value] : false\n}\n","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { asciiAlphanumeric, asciiDigit, asciiHexDigit } from 'micromark-util-character';\n/** @type {Construct} */\nexport const characterReference = {\n name: 'characterReference',\n tokenize: tokenizeCharacterReference\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCharacterReference(effects, ok, nok) {\n const self = this;\n let size = 0;\n /** @type {number} */\n let max;\n /** @type {(code: Code) => boolean} */\n let test;\n return start;\n\n /**\n * Start of character reference.\n *\n * ```markdown\n * > | a&amp;b\n * ^\n * > | a&#123;b\n * ^\n * > | a&#x9;b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"characterReference\");\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n return open;\n }\n\n /**\n * After `&`, at `#` for numeric references or alphanumeric for named\n * references.\n *\n * ```markdown\n * > | a&amp;b\n * ^\n * > | a&#123;b\n * ^\n * > | a&#x9;b\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 35) {\n effects.enter(\"characterReferenceMarkerNumeric\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerNumeric\");\n return numeric;\n }\n effects.enter(\"characterReferenceValue\");\n max = 31;\n test = asciiAlphanumeric;\n return value(code);\n }\n\n /**\n * After `#`, at `x` for hexadecimals or digit for decimals.\n *\n * ```markdown\n * > | a&#123;b\n * ^\n * > | a&#x9;b\n * ^\n * ```\n *\n * @type {State}\n */\n function numeric(code) {\n if (code === 88 || code === 120) {\n effects.enter(\"characterReferenceMarkerHexadecimal\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarkerHexadecimal\");\n effects.enter(\"characterReferenceValue\");\n max = 6;\n test = asciiHexDigit;\n return value;\n }\n effects.enter(\"characterReferenceValue\");\n max = 7;\n test = asciiDigit;\n return value(code);\n }\n\n /**\n * After markers (`&#x`, `&#`, or `&`), in value, before `;`.\n *\n * The character reference kind defines what and how many characters are\n * allowed.\n *\n * ```markdown\n * > | a&amp;b\n * ^^^\n * > | a&#123;b\n * ^^^\n * > | a&#x9;b\n * ^\n * ```\n *\n * @type {State}\n */\n function value(code) {\n if (code === 59 && size) {\n const token = effects.exit(\"characterReferenceValue\");\n if (test === asciiAlphanumeric && !decodeNamedCharacterReference(self.sliceSerialize(token))) {\n return nok(code);\n }\n\n // To do: `markdown-rs` uses a different name:\n // `CharacterReferenceMarkerSemi`.\n effects.enter(\"characterReferenceMarker\");\n effects.consume(code);\n effects.exit(\"characterReferenceMarker\");\n effects.exit(\"characterReference\");\n return ok;\n }\n if (test(code) && size++ < max) {\n effects.consume(code);\n return value;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nconst nonLazyContinuation = {\n partial: true,\n tokenize: tokenizeNonLazyContinuation\n};\n\n/** @type {Construct} */\nexport const codeFenced = {\n concrete: true,\n name: 'codeFenced',\n tokenize: tokenizeCodeFenced\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n const self = this;\n /** @type {Construct} */\n const closeStart = {\n partial: true,\n tokenize: tokenizeCloseStart\n };\n let initialPrefix = 0;\n let sizeOpen = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of code.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse whitespace like `markdown-rs`.\n return beforeSequenceOpen(code);\n }\n\n /**\n * In opening fence, after prefix, at sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeSequenceOpen(code) {\n const tail = self.events[self.events.length - 1];\n initialPrefix = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n marker = code;\n effects.enter(\"codeFenced\");\n effects.enter(\"codeFencedFence\");\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === marker) {\n sizeOpen++;\n effects.consume(code);\n return sequenceOpen;\n }\n if (sizeOpen < 3) {\n return nok(code);\n }\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, infoBefore, \"whitespace\")(code) : infoBefore(code);\n }\n\n /**\n * In opening fence, after the sequence (and optional whitespace), before info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function infoBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return self.interrupt ? ok(code) : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFencedFenceInfo\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return info(code);\n }\n\n /**\n * In info.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function info(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return infoBefore(code);\n }\n if (markdownSpace(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceInfo\");\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return info;\n }\n\n /**\n * In opening fence, after info and whitespace, before meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return infoBefore(code);\n }\n effects.enter(\"codeFencedFenceMeta\");\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | ~~~js eval\n * ^\n * | alert(1)\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit(\"codeFencedFenceMeta\");\n return infoBefore(code);\n }\n if (code === 96 && code === marker) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * At eol/eof in code, before a non-lazy closing fence or content.\n *\n * ```markdown\n * > | ~~~js\n * ^\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function atNonLazyBreak(code) {\n return effects.attempt(closeStart, after, contentBefore)(code);\n }\n\n /**\n * Before code content, not a closing fence, at eol.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return contentStart;\n }\n\n /**\n * Before code content, not a closing fence.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return initialPrefix > 0 && markdownSpace(code) ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialPrefix + 1)(code) : beforeContentChunk(code);\n }\n\n /**\n * Before code content, after optional prefix.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return contentChunk(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * | ~~~js\n * > | alert(1)\n * ^^^^^^^^\n * | ~~~\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After code.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit(\"codeFenced\");\n return ok(code);\n }\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\n function tokenizeCloseStart(effects, ok, nok) {\n let size = 0;\n return startBefore;\n\n /**\n *\n *\n * @type {State}\n */\n function startBefore(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return start;\n }\n\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Always populated by defaults.\n\n // To do: `enter` here or in next state?\n effects.enter(\"codeFencedFence\");\n return markdownSpace(code) ? factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : beforeSequenceClose(code);\n }\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n if (code === marker) {\n effects.enter(\"codeFencedFenceSequence\");\n return sequenceClose(code);\n }\n return nok(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === marker) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size >= sizeOpen) {\n effects.exit(\"codeFencedFenceSequence\");\n return markdownSpace(code) ? factorySpace(effects, sequenceCloseAfter, \"whitespace\")(code) : sequenceCloseAfter(code);\n }\n return nok(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | ~~~js\n * | alert(1)\n * > | ~~~\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceCloseAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFencedFence\");\n return ok(code);\n }\n return nok(code);\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n *\n *\n * @type {State}\n */\n function start(code) {\n if (code === null) {\n return nok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineStart;\n }\n\n /**\n *\n *\n * @type {State}\n */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeIndented = {\n name: 'codeIndented',\n tokenize: tokenizeCodeIndented\n};\n\n/** @type {Construct} */\nconst furtherStart = {\n partial: true,\n tokenize: tokenizeFurtherStart\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeIndented(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of code (indented).\n *\n * > **Parsing note**: it is not needed to check if this first line is a\n * > filled line (that it has a non-whitespace character), because blank lines\n * > are parsed already, so we never run into that.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: manually check if interrupting like `markdown-rs`.\n\n effects.enter(\"codeIndented\");\n // To do: use an improved `space_or_tab` function like `markdown-rs`,\n // so that we can drop the next state.\n return factorySpace(effects, afterPrefix, \"linePrefix\", 4 + 1)(code);\n }\n\n /**\n * At start, after 1 or 4 spaces.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? atBreak(code) : nok(code);\n }\n\n /**\n * At a break.\n *\n * ```markdown\n * > | aaa\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(furtherStart, atBreak, after)(code);\n }\n effects.enter(\"codeFlowValue\");\n return inside(code);\n }\n\n /**\n * In code content.\n *\n * ```markdown\n * > | aaa\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"codeFlowValue\");\n return atBreak(code);\n }\n effects.consume(code);\n return inside;\n }\n\n /** @type {State} */\n function after(code) {\n effects.exit(\"codeIndented\");\n // To do: allow interrupting like `markdown-rs`.\n // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeFurtherStart(effects, ok, nok) {\n const self = this;\n return furtherStart;\n\n /**\n * At eol, trying to parse another indent.\n *\n * ```markdown\n * > | aaa\n * ^\n * | bbb\n * ```\n *\n * @type {State}\n */\n function furtherStart(code) {\n // To do: improve `lazy` / `pierce` handling.\n // If this is a lazy line, it can’t be code.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return furtherStart;\n }\n\n // To do: the code here in `micromark-js` is a bit different from\n // `markdown-rs` because there it can attempt spaces.\n // We can’t yet.\n //\n // To do: use an improved `space_or_tab` function like `markdown-rs`,\n // so that we can drop the next state.\n return factorySpace(effects, afterPrefix, \"linePrefix\", 4 + 1)(code);\n }\n\n /**\n * At start, after 1 or 4 spaces.\n *\n * ```markdown\n * > | aaa\n * ^\n * ```\n *\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"linePrefix\" && tail[2].sliceSerialize(tail[1], true).length >= 4 ? ok(code) : markdownLineEnding(code) ? furtherStart(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Previous,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const codeText = {\n name: 'codeText',\n previous,\n resolve: resolveCodeText,\n tokenize: tokenizeCodeText\n};\n\n// To do: next major: don’t resolve, like `markdown-rs`.\n/** @type {Resolver} */\nfunction resolveCodeText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === \"codeTextData\") {\n // Then we have padding.\n events[headEnterIndex][1].type = \"codeTextPadding\";\n events[tailExitIndex][1].type = \"codeTextPadding\";\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = \"codeTextData\";\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 96 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeCodeText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of code (text).\n *\n * ```markdown\n * > | `a`\n * ^\n * > | \\`a`\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"codeText\");\n effects.enter(\"codeTextSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 96) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n effects.exit(\"codeTextSequence\");\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | `a`\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n // EOF.\n if (code === null) {\n return nok(code);\n }\n\n // To do: next major: don’t do spaces in resolve, but when compiling,\n // like `markdown-rs`.\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n\n // Closing fence? Could also be data.\n if (code === 96) {\n token = effects.enter(\"codeTextSequence\");\n size = 0;\n return sequenceClose(code);\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter(\"codeTextData\");\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 96 || markdownLineEnding(code)) {\n effects.exit(\"codeTextData\");\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n // More.\n if (code === 96) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit(\"codeTextSequence\");\n effects.exit(\"codeText\");\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = \"codeTextData\";\n return data(code);\n }\n}","/**\n * @import {Effects, State, TokenType} from 'micromark-util-types'\n */\n\nimport { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse destinations.\n *\n * ###### Examples\n *\n * ```markdown\n * <a>\n * <a\\>b>\n * <a b>\n * <a)>\n * a\n * a\\)b\n * a(b)c\n * a(b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type for whole (`<a>` or `b`).\n * @param {TokenType} literalType\n * Type when enclosed (`<a>`).\n * @param {TokenType} literalMarkerType\n * Type for enclosing (`<` and `>`).\n * @param {TokenType} rawType\n * Type when not enclosed (`b`).\n * @param {TokenType} stringType\n * Type for the value (`a` or `b`).\n * @param {number | undefined} [max=Infinity]\n * Depth of nested parens (inclusive).\n * @returns {State}\n * Start state.\n */\nexport function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {\n const limit = max || Number.POSITIVE_INFINITY;\n let balance = 0;\n return start;\n\n /**\n * Start of destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 60) {\n effects.enter(type);\n effects.enter(literalType);\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n return enclosedBefore;\n }\n\n // ASCII control, space, closing paren.\n if (code === null || code === 32 || code === 41 || asciiControl(code)) {\n return nok(code);\n }\n effects.enter(type);\n effects.enter(rawType);\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return raw(code);\n }\n\n /**\n * After `<`, at an enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType);\n effects.consume(code);\n effects.exit(literalMarkerType);\n effects.exit(literalType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return enclosed(code);\n }\n\n /**\n * In enclosed destination.\n *\n * ```markdown\n * > | <aa>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosed(code) {\n if (code === 62) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n return enclosedBefore(code);\n }\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? enclosedEscape : enclosed;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | <a\\*a>\n * ^\n * ```\n *\n * @type {State}\n */\n function enclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code);\n return enclosed;\n }\n return enclosed(code);\n }\n\n /**\n * In raw destination.\n *\n * ```markdown\n * > | aa\n * ^\n * ```\n *\n * @type {State}\n */\n function raw(code) {\n if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {\n effects.exit(\"chunkString\");\n effects.exit(stringType);\n effects.exit(rawType);\n effects.exit(type);\n return ok(code);\n }\n if (balance < limit && code === 40) {\n effects.consume(code);\n balance++;\n return raw;\n }\n if (code === 41) {\n effects.consume(code);\n balance--;\n return raw;\n }\n\n // ASCII control (but *not* `\\0`) and space and `(`.\n // Note: in `markdown-rs`, `\\0` exists in codes, in `micromark-js` it\n // doesn’t.\n if (code === null || code === 32 || code === 40 || asciiControl(code)) {\n return nok(code);\n }\n effects.consume(code);\n return code === 92 ? rawEscape : raw;\n }\n\n /**\n * After `\\`, at special character.\n *\n * ```markdown\n * > | a\\*a\n * ^\n * ```\n *\n * @type {State}\n */\n function rawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code);\n return raw;\n }\n return raw(code);\n }\n}","/**\n * @import {\n * Effects,\n * State,\n * TokenizeContext,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse labels.\n *\n * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.\n *\n * ###### Examples\n *\n * ```markdown\n * [a]\n * [a\n * b]\n * [a\\]b]\n * ```\n *\n * @this {TokenizeContext}\n * Tokenize context.\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole label (`[a]`).\n * @param {TokenType} markerType\n * Type for the markers (`[` and `]`).\n * @param {TokenType} stringType\n * Type for the identifier (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryLabel(effects, ok, nok, type, markerType, stringType) {\n const self = this;\n let size = 0;\n /** @type {boolean} */\n let seen;\n return start;\n\n /**\n * Start of label.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.enter(stringType);\n return atBreak;\n }\n\n /**\n * In label, at something, before something else.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (size > 999 || code === null || code === 91 || code === 93 && !seen ||\n // To do: remove in the future once we’ve switched from\n // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,\n // which doesn’t need this.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit(stringType);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n\n // To do: indent? Link chunks and EOLs together?\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return atBreak;\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return labelInside(code);\n }\n\n /**\n * In label, in text.\n *\n * ```markdown\n * > | [a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n if (!seen) seen = !markdownSpace(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | [a\\*a]\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n}","/**\n * @import {\n * Code,\n * Effects,\n * State,\n * TokenType\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * Parse titles.\n *\n * ###### Examples\n *\n * ```markdown\n * \"a\"\n * 'b'\n * (c)\n * \"a\n * b\"\n * 'a\n * b'\n * (a\\)b)\n * ```\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @param {State} nok\n * State switched to when unsuccessful.\n * @param {TokenType} type\n * Type of the whole title (`\"a\"`, `'b'`, `(c)`).\n * @param {TokenType} markerType\n * Type for the markers (`\"`, `'`, `(`, and `)`).\n * @param {TokenType} stringType\n * Type for the value (`a`).\n * @returns {State}\n * Start state.\n */\nexport function factoryTitle(effects, ok, nok, type, markerType, stringType) {\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of title.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (code === 34 || code === 39 || code === 40) {\n effects.enter(type);\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n marker = code === 40 ? 41 : code;\n return begin;\n }\n return nok(code);\n }\n\n /**\n * After opening marker.\n *\n * This is also used at the closing marker.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function begin(code) {\n if (code === marker) {\n effects.enter(markerType);\n effects.consume(code);\n effects.exit(markerType);\n effects.exit(type);\n return ok;\n }\n effects.enter(stringType);\n return atBreak(code);\n }\n\n /**\n * At something, before something else.\n *\n * ```markdown\n * > | \"a\"\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.exit(stringType);\n return begin(marker);\n }\n if (code === null) {\n return nok(code);\n }\n\n // Note: blank lines can’t exist in content.\n if (markdownLineEnding(code)) {\n // To do: use `space_or_tab_eol_with_options`, connect.\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, atBreak, \"linePrefix\");\n }\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return inside(code);\n }\n\n /**\n *\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n return atBreak(code);\n }\n effects.consume(code);\n return code === 92 ? escape : inside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * ```markdown\n * > | \"a\\*b\"\n * ^\n * ```\n *\n * @type {State}\n */\n function escape(code) {\n if (code === marker || code === 92) {\n effects.consume(code);\n return inside;\n }\n return inside(code);\n }\n}","/**\n * @import {Effects, State} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/**\n * Parse spaces and tabs.\n *\n * There is no `nok` parameter:\n *\n * * line endings or spaces in markdown are often optional, in which case this\n * factory can be used and `ok` will be switched to whether spaces were found\n * or not\n * * one line ending or space can be detected with\n * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`\n *\n * @param {Effects} effects\n * Context.\n * @param {State} ok\n * State switched to when successful.\n * @returns {State}\n * Start state.\n */\nexport function factoryWhitespace(effects, ok) {\n /** @type {boolean} */\n let seen;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n seen = true;\n return start;\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, start, seen ? \"linePrefix\" : \"lineSuffix\")(code);\n }\n return ok(code);\n }\n}","/**\n * Normalize an identifier (as found in references, definitions).\n *\n * Collapses markdown whitespace, trim, and then lower- and uppercase.\n *\n * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their\n * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different\n * uppercase character (U+0398 (`Θ`)).\n * So, to get a canonical form, we perform both lower- and uppercase.\n *\n * Using uppercase last makes sure keys will never interact with default\n * prototypal values (such as `constructor`): nothing in the prototype of\n * `Object` is uppercase.\n *\n * @param {string} value\n * Identifier to normalize.\n * @returns {string}\n * Normalized identifier.\n */\nexport function normalizeIdentifier(value) {\n return value\n // Collapse markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, \" \")\n // Trim.\n .replace(/^ | $/g, '')\n // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no method is uppercase.\n .toLowerCase().toUpperCase();\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factorySpace } from 'micromark-factory-space';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\n/** @type {Construct} */\nexport const definition = {\n name: 'definition',\n tokenize: tokenizeDefinition\n};\n\n/** @type {Construct} */\nconst titleBefore = {\n partial: true,\n tokenize: tokenizeTitleBefore\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeDefinition(effects, ok, nok) {\n const self = this;\n /** @type {string} */\n let identifier;\n return start;\n\n /**\n * At start of a definition.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Do not interrupt paragraphs (but do follow definitions).\n // To do: do `interrupt` the way `markdown-rs` does.\n // To do: parse whitespace the way `markdown-rs` does.\n effects.enter(\"definition\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `[`.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n // To do: parse whitespace the way `markdown-rs` does.\n\n return factoryLabel.call(self, effects, labelAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionLabel\", \"definitionLabelMarker\", \"definitionLabelString\")(code);\n }\n\n /**\n * After label.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n identifier = normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1));\n if (code === 58) {\n effects.enter(\"definitionMarker\");\n effects.consume(code);\n effects.exit(\"definitionMarker\");\n return markerAfter;\n }\n return nok(code);\n }\n\n /**\n * After marker.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function markerAfter(code) {\n // Note: whitespace is optional.\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, destinationBefore)(code) : destinationBefore(code);\n }\n\n /**\n * Before destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationBefore(code) {\n return factoryDestination(effects, destinationAfter,\n // Note: we don’t need to reset the way `markdown-rs` does.\n nok, \"definitionDestination\", \"definitionDestinationLiteral\", \"definitionDestinationLiteralMarker\", \"definitionDestinationRaw\", \"definitionDestinationString\")(code);\n }\n\n /**\n * After destination.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function destinationAfter(code) {\n return effects.attempt(titleBefore, after, after)(code);\n }\n\n /**\n * After definition.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return markdownSpace(code) ? factorySpace(effects, afterWhitespace, \"whitespace\")(code) : afterWhitespace(code);\n }\n\n /**\n * After definition, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function afterWhitespace(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"definition\");\n\n // Note: we don’t care about uniqueness.\n // It’s likely that that doesn’t happen very frequently.\n // It is more likely that it wastes precious time.\n self.parser.defined.push(identifier);\n\n // To do: `markdown-rs` interrupt.\n // // You’d be interrupting.\n // tokenizer.interrupt = true\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeTitleBefore(effects, ok, nok) {\n return titleBefore;\n\n /**\n * After destination, at whitespace.\n *\n * ```markdown\n * > | [a]: b\n * ^\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, beforeMarker)(code) : nok(code);\n }\n\n /**\n * At title.\n *\n * ```markdown\n * | [a]: b\n * > | \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeMarker(code) {\n return factoryTitle(effects, titleAfter, nok, \"definitionTitle\", \"definitionTitleMarker\", \"definitionTitleString\")(code);\n }\n\n /**\n * After title.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfter(code) {\n return markdownSpace(code) ? factorySpace(effects, titleAfterOptionalWhitespace, \"whitespace\")(code) : titleAfterOptionalWhitespace(code);\n }\n\n /**\n * After title, after optional whitespace.\n *\n * ```markdown\n * > | [a]: b \"c\"\n * ^\n * ```\n *\n * @type {State}\n */\n function titleAfterOptionalWhitespace(code) {\n return code === null || markdownLineEnding(code) ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const hardBreakEscape = {\n name: 'hardBreakEscape',\n tokenize: tokenizeHardBreakEscape\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHardBreakEscape(effects, ok, nok) {\n return start;\n\n /**\n * Start of a hard break (escape).\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"hardBreakEscape\");\n effects.consume(code);\n return after;\n }\n\n /**\n * After `\\`, at eol.\n *\n * ```markdown\n * > | a\\\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (markdownLineEnding(code)) {\n effects.exit(\"hardBreakEscape\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { splice } from 'micromark-util-chunked';\n/** @type {Construct} */\nexport const headingAtx = {\n name: 'headingAtx',\n resolve: resolveHeadingAtx,\n tokenize: tokenizeHeadingAtx\n};\n\n/** @type {Resolver} */\nfunction resolveHeadingAtx(events, context) {\n let contentEnd = events.length - 2;\n let contentStart = 3;\n /** @type {Token} */\n let content;\n /** @type {Token} */\n let text;\n\n // Prefix whitespace, part of the opening.\n if (events[contentStart][1].type === \"whitespace\") {\n contentStart += 2;\n }\n\n // Suffix whitespace, part of the closing.\n if (contentEnd - 2 > contentStart && events[contentEnd][1].type === \"whitespace\") {\n contentEnd -= 2;\n }\n if (events[contentEnd][1].type === \"atxHeadingSequence\" && (contentStart === contentEnd - 1 || contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === \"whitespace\")) {\n contentEnd -= contentStart + 1 === contentEnd ? 2 : 4;\n }\n if (contentEnd > contentStart) {\n content = {\n type: \"atxHeadingText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end\n };\n text = {\n type: \"chunkText\",\n start: events[contentStart][1].start,\n end: events[contentEnd][1].end,\n contentType: \"text\"\n };\n splice(events, contentStart, contentEnd - contentStart + 1, [['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context]]);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHeadingAtx(effects, ok, nok) {\n let size = 0;\n return start;\n\n /**\n * Start of a heading (atx).\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n effects.enter(\"atxHeading\");\n return before(code);\n }\n\n /**\n * After optional whitespace, at `#`.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 35 && size++ < 6) {\n effects.consume(code);\n return sequenceOpen;\n }\n\n // Always at least one `#`.\n if (code === null || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n return nok(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === 35) {\n effects.enter(\"atxHeadingSequence\");\n return sequenceFurther(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"atxHeading\");\n // To do: interrupt like `markdown-rs`.\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, \"whitespace\")(code);\n }\n\n // To do: generate `data` tokens, add the `text` token later.\n // Needs edit map, see: `markdown.rs`.\n effects.enter(\"atxHeadingText\");\n return data(code);\n }\n\n /**\n * In further sequence (after whitespace).\n *\n * Could be normal “visible” hashes in the heading or a final sequence.\n *\n * ```markdown\n * > | ## aa ##\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceFurther(code) {\n if (code === 35) {\n effects.consume(code);\n return sequenceFurther;\n }\n effects.exit(\"atxHeadingSequence\");\n return atBreak(code);\n }\n\n /**\n * In text.\n *\n * ```markdown\n * > | ## aa\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 35 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"atxHeadingText\");\n return atBreak(code);\n }\n effects.consume(code);\n return data;\n }\n}","/**\n * List of lowercase HTML “block” tag names.\n *\n * The list, when parsing HTML (flow), results in more relaxed rules (condition\n * 6).\n * Because they are known blocks, the HTML-like syntax doesn’t have to be\n * strictly parsed.\n * For tag names not in this list, a more strict algorithm (condition 7) is used\n * to detect whether the HTML-like syntax is seen as HTML (flow) or not.\n *\n * This is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `search` was added in `CommonMark@0.31`.\n */\nexport const htmlBlockNames = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'search',\n 'section',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n]\n\n/**\n * List of lowercase HTML “raw” tag names.\n *\n * The list, when parsing HTML (flow), results in HTML that can include lines\n * without exiting, until a closing tag also in this list is found (condition\n * 1).\n *\n * This module is copied from:\n * <https://spec.commonmark.org/0.30/#html-blocks>.\n *\n * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.\n */\nexport const htmlRawNames = ['pre', 'script', 'style', 'textarea']\n","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\nimport { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';\nimport { blankLine } from './blank-line.js';\n\n/** @type {Construct} */\nexport const htmlFlow = {\n concrete: true,\n name: 'htmlFlow',\n resolveTo: resolveToHtmlFlow,\n tokenize: tokenizeHtmlFlow\n};\n\n/** @type {Construct} */\nconst blankLineBefore = {\n partial: true,\n tokenize: tokenizeBlankLineBefore\n};\nconst nonLazyContinuationStart = {\n partial: true,\n tokenize: tokenizeNonLazyContinuationStart\n};\n\n/** @type {Resolver} */\nfunction resolveToHtmlFlow(events) {\n let index = events.length;\n while (index--) {\n if (events[index][0] === 'enter' && events[index][1].type === \"htmlFlow\") {\n break;\n }\n }\n if (index > 1 && events[index - 2][1].type === \"linePrefix\") {\n // Add the prefix start to the HTML token.\n events[index][1].start = events[index - 2][1].start;\n // Add the prefix start to the HTML line token.\n events[index + 1][1].start = events[index - 2][1].start;\n // Remove the line prefix.\n events.splice(index - 2, 2);\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlFlow(effects, ok, nok) {\n const self = this;\n /** @type {number} */\n let marker;\n /** @type {boolean} */\n let closingTag;\n /** @type {string} */\n let buffer;\n /** @type {number} */\n let index;\n /** @type {Code} */\n let markerB;\n return start;\n\n /**\n * Start of HTML (flow).\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * At `<`, after optional whitespace.\n *\n * ```markdown\n * > | <x />\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"htmlFlow\");\n effects.enter(\"htmlFlowData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | <x />\n * ^\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n closingTag = true;\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n marker = 3;\n // To do:\n // tokenizer.concrete = true\n // To do: use `markdown-rs` style interrupt.\n // While we’re in an instruction instead of a declaration, we’re on a `?`\n // right now, so we do need to search for `>`, similar to declarations.\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * > | <!--xxx-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n marker = 2;\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n marker = 5;\n index = 0;\n return cdataOpenInside;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n marker = 4;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<!-`, inside a comment, at another `-`.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuationDeclarationInside;\n }\n return nok(code);\n }\n\n /**\n * After `<![`, inside CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n if (index === value.length) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | </x>\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n if (asciiAlpha(code)) {\n // Always the case.\n effects.consume(code);\n buffer = String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * In tag name.\n *\n * ```markdown\n * > | <ab>\n * ^^\n * > | </ab>\n * ^^\n * ```\n *\n * @type {State}\n */\n function tagName(code) {\n if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n const slash = code === 47;\n const name = buffer.toLowerCase();\n if (!slash && !closingTag && htmlRawNames.includes(name)) {\n marker = 1;\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n if (htmlBlockNames.includes(buffer.toLowerCase())) {\n marker = 6;\n if (slash) {\n effects.consume(code);\n return basicSelfClosing;\n }\n\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok(code) : continuation(code);\n }\n marker = 7;\n // Do not support complete HTML when interrupting.\n return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);\n }\n\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return tagName;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a basic tag name.\n *\n * ```markdown\n * > | <div/>\n * ^\n * ```\n *\n * @type {State}\n */\n function basicSelfClosing(code) {\n if (code === 62) {\n effects.consume(code);\n // // Do not form containers.\n // tokenizer.concrete = true\n return self.interrupt ? ok : continuation;\n }\n return nok(code);\n }\n\n /**\n * After closing slash of a complete tag name.\n *\n * ```markdown\n * > | <x/>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeClosingTagAfter(code) {\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeClosingTagAfter;\n }\n return completeEnd(code);\n }\n\n /**\n * At an attribute name.\n *\n * At first, this state is used after a complete tag name, after whitespace,\n * where it expects optional attributes or the end of the tag.\n * It is also reused after attributes, when expecting more optional\n * attributes.\n *\n * ```markdown\n * > | <a />\n * ^\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * > | <a >\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameBefore(code) {\n if (code === 47) {\n effects.consume(code);\n return completeEnd;\n }\n\n // ASCII alphanumerical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameBefore;\n }\n return completeEnd(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | <a :b>\n * ^\n * > | <a _b>\n * ^\n * > | <a b>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeName(code) {\n // ASCII alphanumerical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return completeAttributeName;\n }\n return completeAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, at an optional initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | <a b>\n * ^\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeNameAfter;\n }\n return completeAttributeNameBefore(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n markerB = code;\n return completeAttributeValueQuoted;\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAttributeValueBefore;\n }\n return completeAttributeValueUnquoted(code);\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * > | <a b='c'>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuoted(code) {\n if (code === markerB) {\n effects.consume(code);\n markerB = null;\n return completeAttributeValueQuotedAfter;\n }\n if (code === null || markdownLineEnding(code)) {\n return nok(code);\n }\n effects.consume(code);\n return completeAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | <a b=c>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {\n return completeAttributeNameAfter(code);\n }\n effects.consume(code);\n return completeAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the\n * end of the tag.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownSpace(code)) {\n return completeAttributeNameBefore(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a complete tag where only an `>` is allowed.\n *\n * ```markdown\n * > | <a b=\"c\">\n * ^\n * ```\n *\n * @type {State}\n */\n function completeEnd(code) {\n if (code === 62) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * After `>` in a complete tag.\n *\n * ```markdown\n * > | <x>\n * ^\n * ```\n *\n * @type {State}\n */\n function completeAfter(code) {\n if (code === null || markdownLineEnding(code)) {\n // // Do not form containers.\n // tokenizer.concrete = true\n return continuation(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return completeAfter;\n }\n return nok(code);\n }\n\n /**\n * In continuation of any HTML kind.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuation(code) {\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationCommentInside;\n }\n if (code === 60 && marker === 1) {\n effects.consume(code);\n return continuationRawTagOpen;\n }\n if (code === 62 && marker === 4) {\n effects.consume(code);\n return continuationClose;\n }\n if (code === 63 && marker === 3) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n if (code === 93 && marker === 5) {\n effects.consume(code);\n return continuationCdataInside;\n }\n if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {\n effects.exit(\"htmlFlowData\");\n return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationStart(code);\n }\n effects.consume(code);\n return continuation;\n }\n\n /**\n * In continuation, at eol.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStart(code) {\n return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code);\n }\n\n /**\n * In continuation, at eol, before non-lazy content.\n *\n * ```markdown\n * > | <x>\n * ^\n * | asd\n * ```\n *\n * @type {State}\n */\n function continuationStartNonLazy(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return continuationBefore;\n }\n\n /**\n * In continuation, before non-lazy content.\n *\n * ```markdown\n * | <x>\n * > | asd\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return continuationStart(code);\n }\n effects.enter(\"htmlFlowData\");\n return continuation(code);\n }\n\n /**\n * In comment continuation, after one `-`, expecting another.\n *\n * ```markdown\n * > | <!--xxx-->\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCommentInside(code) {\n if (code === 45) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `<`, at `/`.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after `</`, in a raw tag name.\n *\n * ```markdown\n * > | <script>console.log(1)</script>\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | <!-->\n * ^\n * > | <?>\n * ^\n * > | <!q>\n * ^\n * > | <!--ab-->\n * ^\n * > | <![CDATA[>&<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | <!doctype>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > | <div>\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code> | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After `<!`, at declaration, comment, or CDATA.\n *\n * ```markdown\n * > | a <!doctype> c\n * ^\n * > | a <!--b--> c\n * ^\n * > | a <![CDATA[>&<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after `<!-`, at another `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a <!--b--> c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After `<![`, in CDATA, expecting `CDATA[`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a <![CDATA[>&<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a <!b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a <?b?> c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After `</`, in closing tag, at tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After `</x`, in a tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a </b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After `<x`, in opening tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a <b> c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a <b c> d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a <b c=d> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a <b c=\"d\"> e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a <!--a\n * ^\n * | b-->\n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a <!--a\n * > | b-->\n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}","/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array<Event>} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {Token} */\n let token;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array<Event>} */\n let media;\n\n // Find an opening.\n while (index--) {\n token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can’t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n\n // Find an opening.\n while (index--) {\n if ((self.events[index][1].type === \"labelImage\" || self.events[index][1].type === \"labelLink\") && !self.events[index][1]._balanced) {\n labelStart = self.events[index][1];\n break;\n }\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we’d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can’t have that, so it’s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code);\n }\n\n /**\n * Done, it’s nothing.\n *\n * There was an okay opening, but we didn’t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there’s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > 👉 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n * <p>!<a href=\\\"b\\\">^a</a></p>\n * <p>!<a href=\\\"c\\\">^a</a></p>\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn’t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn’t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}","/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can’t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we’re closing flow, we’re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}","/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n // To do: resolve like `markdown-rs`.\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It’ll always exist: we don’t tokenize if it isn’t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we’ll add it later)\n events.splice(index, 1);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we’ll keep on having content,\n // but we need move it.\n if (definition) {\n events.splice(text, 0, ['enter', heading, context]);\n events.splice(definition + 1, 0, ['exit', events[content][1], context]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n events.push(['exit', heading, context]);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable<Code>} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}","/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};","/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}","/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn’t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record<string, number>} */\n const columnStart = {};\n /** @type {Array<Construct>} */\n const resolveAllConstructs = [];\n /** @type {Array<Chunk>} */\n let chunks = [];\n /** @type {Array<Token>} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we’re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n /** @type {number} */\n let chunkIndex;\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we’re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array<Construct> | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray<Construct>} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray<Construct>} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn’t work because `inspect` in document does a check\n // w/o a bogus, which doesn’t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a “live binding”, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it’s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {Pick<Token, 'end' | 'start'>} token\n * Token.\n * @returns {Array<Chunk>}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array<Chunk>} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray<Chunk>} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array<string>} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) continue;\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array<Event>} events\n * Events.\n * @returns {Array<Event>}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}","/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array<Chunk>}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n /** @type {Array<Chunk>} */\n const chunks = [];\n /** @type {RegExpMatchArray | null} */\n let match;\n /** @type {number} */\n let next;\n /** @type {number} */\n let startPosition;\n /** @type {number} */\n let endPosition;\n /** @type {Code} */\n let code;\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n match = search.exec(value);\n endPosition = match && match.index !== undefined ? match.index : value.length;\n code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) chunks.push(-1);\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5);\n if (buffer) chunks.push(buffer);\n chunks.push(null);\n }\n return chunks;\n }\n}","/**\n * Turn the number (in string form as either hexa- or plain decimal) coming from\n * a numeric character reference into a character.\n *\n * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes\n * non-characters and control characters safe.\n *\n * @param {string} value\n * Value to decode.\n * @param {number} base\n * Numeric base.\n * @returns {string}\n * Character.\n */\nexport function decodeNumericCharacterReference(value, base) {\n const code = Number.parseInt(value, base);\n if (\n // C0 except for HT, LF, FF, CR, space.\n code < 9 || code === 11 || code > 13 && code < 32 ||\n // Control character (DEL) of C0, and C1 controls.\n code > 126 && code < 160 ||\n // Lone high surrogates and low surrogates.\n code > 55_295 && code < 57_344 ||\n // Noncharacters.\n code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */\n (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */\n // Out of range\n code > 1_114_111) {\n return \"\\uFFFD\";\n }\n return String.fromCodePoint(code);\n}","import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The “string” content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}","/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array<Event>} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n };\n /** @type {Omit<CompileContext, 'sliceSerialize'>} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array<number>} */\n const listStack = [];\n let index = -1;\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(index);\n } else {\n const tail = listStack.pop();\n index = prepareList(events, tail, index);\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(Object.assign({\n sliceSerialize: events[index][2].sliceSerialize\n }, context), events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array<Event>} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n while (++index <= length) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]);\n index++;\n length++;\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we’ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n events.splice(index, 0, ['enter', item, event[2]]);\n index++;\n length++;\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n events[start][1]._spread = listSpread;\n return length;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it’s not open');\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array<Nodes>} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we’ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we’re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array<PhrasingContent>} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: []\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: ''\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array<Array<Extension> | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n } else {\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n }\n}","/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions\n * @typedef {import('unified').Parser<Root>} Parser\n * @typedef {import('unified').Processor<Root>} Processor\n */\n\n/**\n * @typedef {Omit<FromMarkdownOptions, 'extensions' | 'mdastExtensions'>} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * Aadd support for parsing from markdown.\n *\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkParse(options) {\n /** @type {Processor} */\n // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.\n const self = this\n\n self.parser = parser\n\n /**\n * @type {Parser}\n */\n function parser(doc) {\n return fromMarkdown(doc, {\n ...self.data('settings'),\n ...options,\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n }\n}\n","export const VOID = -1;\nexport const PRIMITIVE = 0;\nexport const ARRAY = 1;\nexport const OBJECT = 2;\nexport const DATE = 3;\nexport const REGEXP = 4;\nexport const MAP = 5;\nexport const SET = 6;\nexport const ERROR = 7;\nexport const BIGINT = 8;\n// export const SYMBOL = 9;\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst env = typeof self === 'object' ? self : globalThis;\n\nconst deserializer = ($, _) => {\n const as = (out, index) => {\n $.set(index, out);\n return out;\n };\n\n const unpair = index => {\n if ($.has(index))\n return $.get(index);\n\n const [type, value] = _[index];\n switch (type) {\n case PRIMITIVE:\n case VOID:\n return as(value, index);\n case ARRAY: {\n const arr = as([], index);\n for (const index of value)\n arr.push(unpair(index));\n return arr;\n }\n case OBJECT: {\n const object = as({}, index);\n for (const [key, index] of value)\n object[unpair(key)] = unpair(index);\n return object;\n }\n case DATE:\n return as(new Date(value), index);\n case REGEXP: {\n const {source, flags} = value;\n return as(new RegExp(source, flags), index);\n }\n case MAP: {\n const map = as(new Map, index);\n for (const [key, index] of value)\n map.set(unpair(key), unpair(index));\n return map;\n }\n case SET: {\n const set = as(new Set, index);\n for (const index of value)\n set.add(unpair(index));\n return set;\n }\n case ERROR: {\n const {name, message} = value;\n return as(new env[name](message), index);\n }\n case BIGINT:\n return as(BigInt(value), index);\n case 'BigInt':\n return as(Object(BigInt(value)), index);\n case 'ArrayBuffer':\n return as(new Uint8Array(value).buffer, value);\n case 'DataView': {\n const { buffer } = new Uint8Array(value);\n return as(new DataView(buffer), value);\n }\n }\n return as(new env[type](value), index);\n };\n\n return unpair;\n};\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns a deserialized value from a serialized array of Records.\n * @param {Record[]} serialized a previously serialized value.\n * @returns {any}\n */\nexport const deserialize = serialized => deserializer(new Map, serialized)(0);\n","import {\n VOID, PRIMITIVE,\n ARRAY, OBJECT,\n DATE, REGEXP, MAP, SET,\n ERROR, BIGINT\n} from './types.js';\n\nconst EMPTY = '';\n\nconst {toString} = {};\nconst {keys} = Object;\n\nconst typeOf = value => {\n const type = typeof value;\n if (type !== 'object' || !value)\n return [PRIMITIVE, type];\n\n const asString = toString.call(value).slice(8, -1);\n switch (asString) {\n case 'Array':\n return [ARRAY, EMPTY];\n case 'Object':\n return [OBJECT, EMPTY];\n case 'Date':\n return [DATE, EMPTY];\n case 'RegExp':\n return [REGEXP, EMPTY];\n case 'Map':\n return [MAP, EMPTY];\n case 'Set':\n return [SET, EMPTY];\n case 'DataView':\n return [ARRAY, asString];\n }\n\n if (asString.includes('Array'))\n return [ARRAY, asString];\n\n if (asString.includes('Error'))\n return [ERROR, asString];\n\n return [OBJECT, asString];\n};\n\nconst shouldSkip = ([TYPE, type]) => (\n TYPE === PRIMITIVE &&\n (type === 'function' || type === 'symbol')\n);\n\nconst serializer = (strict, json, $, _) => {\n\n const as = (out, value) => {\n const index = _.push(out) - 1;\n $.set(value, index);\n return index;\n };\n\n const pair = value => {\n if ($.has(value))\n return $.get(value);\n\n let [TYPE, type] = typeOf(value);\n switch (TYPE) {\n case PRIMITIVE: {\n let entry = value;\n switch (type) {\n case 'bigint':\n TYPE = BIGINT;\n entry = value.toString();\n break;\n case 'function':\n case 'symbol':\n if (strict)\n throw new TypeError('unable to serialize ' + type);\n entry = null;\n break;\n case 'undefined':\n return as([VOID], value);\n }\n return as([TYPE, entry], value);\n }\n case ARRAY: {\n if (type) {\n let spread = value;\n if (type === 'DataView') {\n spread = new Uint8Array(value.buffer);\n }\n else if (type === 'ArrayBuffer') {\n spread = new Uint8Array(value);\n }\n return as([type, [...spread]], value);\n }\n\n const arr = [];\n const index = as([TYPE, arr], value);\n for (const entry of value)\n arr.push(pair(entry));\n return index;\n }\n case OBJECT: {\n if (type) {\n switch (type) {\n case 'BigInt':\n return as([type, value.toString()], value);\n case 'Boolean':\n case 'Number':\n case 'String':\n return as([type, value.valueOf()], value);\n }\n }\n\n if (json && ('toJSON' in value))\n return pair(value.toJSON());\n\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const key of keys(value)) {\n if (strict || !shouldSkip(typeOf(value[key])))\n entries.push([pair(key), pair(value[key])]);\n }\n return index;\n }\n case DATE:\n return as([TYPE, value.toISOString()], value);\n case REGEXP: {\n const {source, flags} = value;\n return as([TYPE, {source, flags}], value);\n }\n case MAP: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const [key, entry] of value) {\n if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n entries.push([pair(key), pair(entry)]);\n }\n return index;\n }\n case SET: {\n const entries = [];\n const index = as([TYPE, entries], value);\n for (const entry of value) {\n if (strict || !shouldSkip(typeOf(entry)))\n entries.push(pair(entry));\n }\n return index;\n }\n }\n\n const {message} = value;\n return as([TYPE, {name: type, message}], value);\n };\n\n return pair;\n};\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} value a serializable value.\n * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,\n * if `true`, will not throw errors on incompatible types, and behave more\n * like JSON stringify would behave. Symbol and Function will be discarded.\n * @returns {Record[]}\n */\n export const serialize = (value, {json, lossy} = {}) => {\n const _ = [];\n return serializer(!(json || lossy), !!json, new Map, _)(value), _;\n};\n","import {deserialize} from './deserialize.js';\nimport {serialize} from './serialize.js';\n\n/**\n * @typedef {Array<string,any>} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} any a serializable value.\n * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with\n * a transfer option (ignored when polyfilled) and/or non standard fields that\n * fallback to the polyfill if present.\n * @returns {Record[]}\n */\nexport default typeof structuredClone === \"function\" ?\n /* c8 ignore start */\n (any, options) => (\n options && ('json' in options || 'lossy' in options) ?\n deserialize(serialize(any, options)) : structuredClone(any)\n ) :\n (any, options) => deserialize(serialize(any, options));\n /* c8 ignore stop */\n\nexport {deserialize, serialize};\n","import { asciiAlphanumeric } from 'micromark-util-character';\nimport { encode } from 'micromark-util-encode';\n/**\n * Make a value safe for injection as a URL.\n *\n * This encodes unsafe characters with percent-encoding and skips already\n * encoded sequences (see `normalizeUri`).\n * Further unsafe characters are encoded as character references (see\n * `micromark-util-encode`).\n *\n * A regex of allowed protocols can be given, in which case the URL is\n * sanitized.\n * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or\n * `/^https?$/i` for `img[src]` (this is what `github.com` allows).\n * If the URL includes an unknown protocol (one not matched by `protocol`, such\n * as a dangerous example, `javascript:`), the value is ignored.\n *\n * @param {string | null | undefined} url\n * URI to sanitize.\n * @param {RegExp | null | undefined} [protocol]\n * Allowed protocols.\n * @returns {string}\n * Sanitized URI.\n */\nexport function sanitizeUri(url, protocol) {\n const value = encode(normalizeUri(url || ''));\n if (!protocol) {\n return value;\n }\n const colon = value.indexOf(':');\n const questionMark = value.indexOf('?');\n const numberSign = value.indexOf('#');\n const slash = value.indexOf('/');\n if (\n // If there is no protocol, it’s relative.\n colon < 0 ||\n // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.\n slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign ||\n // It is a protocol, it should be allowed.\n protocol.test(value.slice(0, colon))) {\n return value;\n }\n return '';\n}\n\n/**\n * Normalize a URL.\n *\n * Encode unsafe characters with percent-encoding, skipping already encoded\n * sequences.\n *\n * @param {string} value\n * URI to normalize.\n * @returns {string}\n * Normalized URI.\n */\nexport function normalizeUri(value) {\n /** @type {Array<string>} */\n const result = [];\n let index = -1;\n let start = 0;\n let skip = 0;\n while (++index < value.length) {\n const code = value.charCodeAt(index);\n /** @type {string} */\n let replace = '';\n\n // A correct percent encoded value.\n if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) {\n skip = 2;\n }\n // ASCII.\n else if (code < 128) {\n if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {\n replace = String.fromCharCode(code);\n }\n }\n // Astral.\n else if (code > 55_295 && code < 57_344) {\n const next = value.charCodeAt(index + 1);\n\n // A correct surrogate pair.\n if (code < 56_320 && next > 56_319 && next < 57_344) {\n replace = String.fromCharCode(code, next);\n skip = 1;\n }\n // Lone surrogate.\n else {\n replace = \"\\uFFFD\";\n }\n }\n // Unicode.\n else {\n replace = String.fromCharCode(code);\n }\n if (replace) {\n result.push(value.slice(start, index), encodeURIComponent(replace));\n start = index + skip + 1;\n replace = '';\n }\n if (skip) {\n index += skip;\n skip = 0;\n }\n }\n return result.join('') + value.slice(start);\n}","/**\n * @import {ElementContent, Element} from 'hast'\n * @import {State} from './state.js'\n */\n\n/**\n * @callback FootnoteBackContentTemplate\n * Generate content for the backreference dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array<ElementContent> | ElementContent | string}\n * Content for the backreference when linking back from definitions to their\n * reference.\n *\n * @callback FootnoteBackLabelTemplate\n * Generate a back label dynamically.\n *\n * For the following markdown:\n *\n * ```markdown\n * Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n * [^remark]: things about remark\n * [^micromark]: things about micromark\n * ```\n *\n * This function will be called with:\n *\n * * `0` and `0` for the backreference from `things about micromark` to\n * `alpha`, as it is the first used definition, and the first call to it\n * * `0` and `1` for the backreference from `things about micromark` to\n * `bravo`, as it is the first used definition, and the second call to it\n * * `1` and `0` for the backreference from `things about remark` to\n * `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Back label to use when linking back from definitions to their reference.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate the default content that GitHub uses on backreferences.\n *\n * @param {number} _\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {Array<ElementContent>}\n * Content.\n */\nexport function defaultFootnoteBackContent(_, rereferenceIndex) {\n /** @type {Array<ElementContent>} */\n const result = [{type: 'text', value: '↩'}]\n\n if (rereferenceIndex > 1) {\n result.push({\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [{type: 'text', value: String(rereferenceIndex)}]\n })\n }\n\n return result\n}\n\n/**\n * Generate the default label that GitHub uses on backreferences.\n *\n * @param {number} referenceIndex\n * Index of the definition in the order that they are first referenced,\n * 0-indexed.\n * @param {number} rereferenceIndex\n * Index of calls to the same definition, 0-indexed.\n * @returns {string}\n * Label.\n */\nexport function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n return (\n 'Back to reference ' +\n (referenceIndex + 1) +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n )\n}\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n * Info passed around.\n * @returns {Element | undefined}\n * `section` element or `undefined`.\n */\n// eslint-disable-next-line complexity\nexport function footer(state) {\n const clobberPrefix =\n typeof state.options.clobberPrefix === 'string'\n ? state.options.clobberPrefix\n : 'user-content-'\n const footnoteBackContent =\n state.options.footnoteBackContent || defaultFootnoteBackContent\n const footnoteBackLabel =\n state.options.footnoteBackLabel || defaultFootnoteBackLabel\n const footnoteLabel = state.options.footnoteLabel || 'Footnotes'\n const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'\n const footnoteLabelProperties = state.options.footnoteLabelProperties || {\n className: ['sr-only']\n }\n /** @type {Array<ElementContent>} */\n const listItems = []\n let referenceIndex = -1\n\n while (++referenceIndex < state.footnoteOrder.length) {\n const definition = state.footnoteById.get(\n state.footnoteOrder[referenceIndex]\n )\n\n if (!definition) {\n continue\n }\n\n const content = state.all(definition)\n const id = String(definition.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n let rereferenceIndex = 0\n /** @type {Array<ElementContent>} */\n const backReferences = []\n const counts = state.footnoteCounts.get(id)\n\n // eslint-disable-next-line no-unmodified-loop-condition\n while (counts !== undefined && ++rereferenceIndex <= counts) {\n if (backReferences.length > 0) {\n backReferences.push({type: 'text', value: ' '})\n }\n\n let children =\n typeof footnoteBackContent === 'string'\n ? footnoteBackContent\n : footnoteBackContent(referenceIndex, rereferenceIndex)\n\n if (typeof children === 'string') {\n children = {type: 'text', value: children}\n }\n\n backReferences.push({\n type: 'element',\n tagName: 'a',\n properties: {\n href:\n '#' +\n clobberPrefix +\n 'fnref-' +\n safeId +\n (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),\n dataFootnoteBackref: '',\n ariaLabel:\n typeof footnoteBackLabel === 'string'\n ? footnoteBackLabel\n : footnoteBackLabel(referenceIndex, rereferenceIndex),\n className: ['data-footnote-backref']\n },\n children: Array.isArray(children) ? children : [children]\n })\n }\n\n const tail = content[content.length - 1]\n\n if (tail && tail.type === 'element' && tail.tagName === 'p') {\n const tailTail = tail.children[tail.children.length - 1]\n if (tailTail && tailTail.type === 'text') {\n tailTail.value += ' '\n } else {\n tail.children.push({type: 'text', value: ' '})\n }\n\n tail.children.push(...backReferences)\n } else {\n content.push(...backReferences)\n }\n\n /** @type {Element} */\n const listItem = {\n type: 'element',\n tagName: 'li',\n properties: {id: clobberPrefix + 'fn-' + safeId},\n children: state.wrap(content, true)\n }\n\n state.patch(definition, listItem)\n\n listItems.push(listItem)\n }\n\n if (listItems.length === 0) {\n return\n }\n\n return {\n type: 'element',\n tagName: 'section',\n properties: {dataFootnotes: true, className: ['footnotes']},\n children: [\n {\n type: 'element',\n tagName: footnoteLabelTagName,\n properties: {\n ...structuredClone(footnoteLabelProperties),\n id: 'footnote-label'\n },\n children: [{type: 'text', value: footnoteLabel}]\n },\n {type: 'text', value: '\\n'},\n {\n type: 'element',\n tagName: 'ol',\n properties: {},\n children: state.wrap(listItems, true)\n },\n {type: 'text', value: '\\n'}\n ]\n }\n}\n","/**\n * @import {Node, Parent} from 'unist'\n */\n\n/**\n * @template Fn\n * @template Fallback\n * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate\n */\n\n/**\n * @callback Check\n * Check that an arbitrary value is a node.\n * @param {unknown} this\n * The given context.\n * @param {unknown} [node]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | null | undefined} [parent]\n * The node’s parent.\n * @returns {boolean}\n * Whether this is a node and passes a test.\n *\n * @typedef {Record<string, unknown> | Node} Props\n * Object to check for equivalence.\n *\n * Note: `Node` is included as it is common but is not indexable.\n *\n * @typedef {Array<Props | TestFunction | string> | ReadonlyArray<Props | TestFunction | string> | Props | TestFunction | string | null | undefined} Test\n * Check for an arbitrary node.\n *\n * @callback TestFunction\n * Check if a node passes a test.\n * @param {unknown} this\n * The given context.\n * @param {Node} node\n * A node.\n * @param {number | undefined} [index]\n * The node’s position in its parent.\n * @param {Parent | undefined} [parent]\n * The node’s parent.\n * @returns {boolean | undefined | void}\n * Whether this node passes the test.\n *\n * Note: `void` is included until TS sees no return as `undefined`.\n */\n\n/**\n * Check if `node` is a `Node` and whether it passes the given test.\n *\n * @param {unknown} node\n * Thing to check, typically `Node`.\n * @param {Test} test\n * A check for a specific node.\n * @param {number | null | undefined} index\n * The node’s position in its parent.\n * @param {Parent | null | undefined} parent\n * The node’s parent.\n * @param {unknown} context\n * Context object (`this`) to pass to `test` functions.\n * @returns {boolean}\n * Whether `node` is a node and passes a test.\n */\nexport const is =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends ReadonlyArray<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n * (<Condition extends Array<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &\n * (<Condition extends string>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * (<Condition extends Props>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * (<Condition extends TestFunction>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &\n * ((node?: null | undefined) => false) &\n * ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [node]\n * @param {Test} [test]\n * @param {number | null | undefined} [index]\n * @param {Parent | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function (node, test, index, parent, context) {\n const check = convert(test)\n\n if (\n index !== undefined &&\n index !== null &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite index')\n }\n\n if (\n parent !== undefined &&\n parent !== null &&\n (!is(parent) || !parent.children)\n ) {\n throw new Error('Expected parent node')\n }\n\n if (\n (parent === undefined || parent === null) !==\n (index === undefined || index === null)\n ) {\n throw new Error('Expected both parent and index')\n }\n\n return looksLikeANode(node)\n ? check.call(context, node, index, parent)\n : false\n }\n )\n\n/**\n * Generate an assertion from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * a `node`, `index`, and `parent`.\n *\n * @param {Test} test\n * * when nullish, checks if `node` is a `Node`.\n * * when `string`, works like passing `(node) => node.type === test`.\n * * when `function` checks if function passed the node is true.\n * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.\n * * when `array`, checks if any one of the subtests pass.\n * @returns {Check}\n * An assertion.\n */\nexport const convert =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &\n * (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &\n * (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &\n * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &\n * ((test?: Test) => Check)\n * )}\n */\n (\n /**\n * @param {Test} [test]\n * @returns {Check}\n */\n function (test) {\n if (test === null || test === undefined) {\n return ok\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n if (typeof test === 'object') {\n return Array.isArray(test)\n ? anyFactory(test)\n : // Cast because `ReadonlyArray` goes into the above but `isArray`\n // narrows to `Array`.\n propertiesFactory(/** @type {Props} */ (test))\n }\n\n if (typeof test === 'string') {\n return typeFactory(test)\n }\n\n throw new Error('Expected function, string, or object as test')\n }\n )\n\n/**\n * @param {Array<Props | TestFunction | string>} tests\n * @returns {Check}\n */\nfunction anyFactory(tests) {\n /** @type {Array<Check>} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convert(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @type {TestFunction}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].apply(this, parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn an object into a test for a node with a certain fields.\n *\n * @param {Props} check\n * @returns {Check}\n */\nfunction propertiesFactory(check) {\n const checkAsRecord = /** @type {Record<string, unknown>} */ (check)\n\n return castFactory(all)\n\n /**\n * @param {Node} node\n * @returns {boolean}\n */\n function all(node) {\n const nodeAsRecord = /** @type {Record<string, unknown>} */ (\n /** @type {unknown} */ (node)\n )\n\n /** @type {string} */\n let key\n\n for (key in check) {\n if (nodeAsRecord[key] !== checkAsRecord[key]) return false\n }\n\n return true\n }\n}\n\n/**\n * Turn a string into a test for a node with a certain type.\n *\n * @param {string} check\n * @returns {Check}\n */\nfunction typeFactory(check) {\n return castFactory(type)\n\n /**\n * @param {Node} node\n */\n function type(node) {\n return node && node.type === check\n }\n}\n\n/**\n * Turn a custom test into a test for a node that passes that test.\n *\n * @param {TestFunction} testFunction\n * @returns {Check}\n */\nfunction castFactory(testFunction) {\n return check\n\n /**\n * @this {unknown}\n * @type {Check}\n */\n function check(value, index, parent) {\n return Boolean(\n looksLikeANode(value) &&\n testFunction.call(\n this,\n value,\n typeof index === 'number' ? index : undefined,\n parent || undefined\n )\n )\n }\n}\n\nfunction ok() {\n return true\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction looksLikeANode(value) {\n return value !== null && typeof value === 'object' && 'type' in value\n}\n","/**\n * @param {string} d\n * @returns {string}\n */\nexport function color(d) {\n return '\\u001B[33m' + d + '\\u001B[39m'\n}\n","/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate<Check, Value> extends Value\n * ? Predicate<Check, Value>\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends ReadonlyArray<infer T>\n * ? MatchesOne<Value, T>\n * : Check extends Array<infer T>\n * ? MatchesOne<Value, T>\n * : MatchesOne<Value, Check>\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array<infer Children>}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent<Node, Child>\n * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {'skip' | boolean} Action\n * Union of the action types.\n *\n * @typedef {number} Index\n * Move to the sibling at `index` next (after node itself is completely\n * traversed).\n *\n * Useful if mutating the tree, such as removing the node the visitor is\n * currently on, or any of its previous siblings.\n * Results less than 0 or greater than or equal to `children.length` stop\n * traversing the parent.\n *\n * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple\n * List with one or two values, the first an action, the second an index.\n *\n * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult\n * Any value that can be returned from a visitor.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform the parent of node (the last of `ancestors`).\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of an ancestor still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Array<VisitedParents>} ancestors\n * Ancestors of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [VisitedParents=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parents`.\n * @template {UnistNode} [Tree=UnistNode]\n * Tree type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {convert} from 'unist-util-is'\nimport {color} from 'unist-util-visit-parents/do-not-use-color'\n\n/** @type {Readonly<ActionTuple>} */\nconst empty = []\n\n/**\n * Continue traversing as normal.\n */\nexport const CONTINUE = true\n\n/**\n * Stop traversing immediately.\n */\nexport const EXIT = false\n\n/**\n * Do not traverse this node’s children.\n */\nexport const SKIP = 'skip'\n\n/**\n * Visit nodes, with ancestral information.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor<Tree, Check>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor<Tree>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Test} test\n * `unist-util-is`-compatible test\n * @param {Visitor | boolean | null | undefined} [visitor]\n * Handle each node.\n * @param {boolean | null | undefined} [reverse]\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visitParents(tree, test, visitor, reverse) {\n /** @type {Test} */\n let check\n\n if (typeof test === 'function' && typeof visitor !== 'function') {\n reverse = visitor\n // @ts-expect-error no visitor given, so `visitor` is test.\n visitor = test\n } else {\n // @ts-expect-error visitor given, so `test` isn’t a visitor.\n check = test\n }\n\n const is = convert(check)\n const step = reverse ? -1 : 1\n\n factory(tree, undefined, [])()\n\n /**\n * @param {UnistNode} node\n * @param {number | undefined} index\n * @param {Array<UnistParent>} parents\n */\n function factory(node, index, parents) {\n const value = /** @type {Record<string, unknown>} */ (\n node && typeof node === 'object' ? node : {}\n )\n\n if (typeof value.type === 'string') {\n const name =\n // `hast`\n typeof value.tagName === 'string'\n ? value.tagName\n : // `xast`\n typeof value.name === 'string'\n ? value.name\n : undefined\n\n Object.defineProperty(visit, 'name', {\n value:\n 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'\n })\n }\n\n return visit\n\n function visit() {\n /** @type {Readonly<ActionTuple>} */\n let result = empty\n /** @type {Readonly<ActionTuple>} */\n let subresult\n /** @type {number} */\n let offset\n /** @type {Array<UnistParent>} */\n let grandparents\n\n if (!test || is(node, index, parents[parents.length - 1] || undefined)) {\n // @ts-expect-error: `visitor` is now a visitor.\n result = toResult(visitor(node, parents))\n\n if (result[0] === EXIT) {\n return result\n }\n }\n\n if ('children' in node && node.children) {\n const nodeAsParent = /** @type {UnistParent} */ (node)\n\n if (nodeAsParent.children && result[0] !== SKIP) {\n offset = (reverse ? nodeAsParent.children.length : -1) + step\n grandparents = parents.concat(nodeAsParent)\n\n while (offset > -1 && offset < nodeAsParent.children.length) {\n const child = nodeAsParent.children[offset]\n\n subresult = factory(child, offset, grandparents)()\n\n if (subresult[0] === EXIT) {\n return subresult\n }\n\n offset =\n typeof subresult[1] === 'number' ? subresult[1] : offset + step\n }\n }\n }\n\n return result\n }\n }\n}\n\n/**\n * Turn a return value into a clean result.\n *\n * @param {VisitorResult} value\n * Valid return values from visitors.\n * @returns {Readonly<ActionTuple>}\n * Clean result.\n */\nfunction toResult(value) {\n if (Array.isArray(value)) {\n return value\n }\n\n if (typeof value === 'number') {\n return [CONTINUE, value]\n }\n\n return value === null || value === undefined ? empty : [value]\n}\n","/**\n * @import {Node as UnistNode, Parent as UnistParent} from 'unist'\n * @import {VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n// To do: use types from `unist-util-visit-parents` when it’s released.\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate<Check, Value> extends Value\n * ? Predicate<Check, Value>\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends ReadonlyArray<any>\n * ? MatchesOne<Value, Check[number]>\n * : MatchesOne<Value, Check>\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint\n * Number; capped reasonably.\n */\n\n/**\n * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment\n * Increment a number in the type system.\n * @template {Uint} [I=0]\n * Index.\n */\n\n/**\n * @typedef {(\n * Node extends UnistParent\n * ? Node extends {children: Array<infer Children>}\n * ? Child extends Children ? Node : never\n * : never\n * : never\n * )} InternalParent\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent\n * Collect nodes in `Tree` that can be parents of `Child`.\n * @template {UnistNode} Tree\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n */\n\n/**\n * @typedef {(\n * Depth extends Max\n * ? never\n * :\n * | InternalParent<Node, Child>\n * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>\n * )} InternalAncestor\n * Collect nodes in `Tree` that can be ancestors of `Child`.\n * @template {UnistNode} Node\n * All node types in a tree.\n * @template {UnistNode} Child\n * Node to search for.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @typedef {(\n * Tree extends UnistParent\n * ? Depth extends Max\n * ? Tree\n * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>\n * : Tree\n * )} InclusiveDescendant\n * Collect all (inclusive) descendants of `Tree`.\n *\n * > 👉 **Note**: for performance reasons, this seems to be the fastest way to\n * > recurse without actually running into an infinite loop, which the\n * > previous version did.\n * >\n * > Practically, a max of `2` is typically enough assuming a `Root` is\n * > passed, but it doesn’t improve performance.\n * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.\n * > Using up to `10` doesn’t hurt or help either.\n * @template {UnistNode} Tree\n * Tree type.\n * @template {Uint} [Max=10]\n * Max; searches up to this depth.\n * @template {Uint} [Depth=0]\n * Current depth.\n */\n\n/**\n * @callback Visitor\n * Handle a node (matching `test`, if given).\n *\n * Visitors are free to transform `node`.\n * They can also transform `parent`.\n *\n * Replacing `node` itself, if `SKIP` is not returned, still causes its\n * descendants to be walked (which is a bug).\n *\n * When adding or removing previous siblings of `node` (or next siblings, in\n * case of reverse), the `Visitor` should return a new `Index` to specify the\n * sibling to traverse after `node` is traversed.\n * Adding or removing next siblings of `node` (or previous siblings, in case\n * of reverse) is handled as expected without needing to return a new `Index`.\n *\n * Removing the children property of `parent` still results in them being\n * traversed.\n * @param {Visited} node\n * Found node.\n * @param {Visited extends UnistNode ? number | undefined : never} index\n * Index of `node` in `parent`.\n * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent\n * Parent of `node`.\n * @returns {VisitorResult}\n * What to do next.\n *\n * An `Index` is treated as a tuple of `[CONTINUE, Index]`.\n * An `Action` is treated as a tuple of `[Action]`.\n *\n * Passing a tuple back only makes sense if the `Action` is `SKIP`.\n * When the `Action` is `EXIT`, that action can be returned.\n * When the `Action` is `CONTINUE`, `Index` can be returned.\n * @template {UnistNode} [Visited=UnistNode]\n * Visited node type.\n * @template {UnistParent} [Ancestor=UnistParent]\n * Ancestor type.\n */\n\n/**\n * @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch\n * Build a typed `Visitor` function from a node and all possible parents.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Visited\n * Node type.\n * @template {UnistParent} Ancestor\n * Parent type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromMatch<\n * Matches<Descendant, Check>,\n * Extract<Descendant, UnistParent>\n * >\n * )} BuildVisitorFromDescendants\n * Build a typed `Visitor` function from a list of descendants and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} Descendant\n * Node type.\n * @template {Test} Check\n * Test type.\n */\n\n/**\n * @typedef {(\n * BuildVisitorFromDescendants<\n * InclusiveDescendant<Tree>,\n * Check\n * >\n * )} BuildVisitor\n * Build a typed `Visitor` function from a tree and a test.\n *\n * It will infer which values are passed as `node` and which as `parent`.\n * @template {UnistNode} [Tree=UnistNode]\n * Node type.\n * @template {Test} [Check=Test]\n * Test type.\n */\n\nimport {visitParents} from 'unist-util-visit-parents'\n\nexport {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'\n\n/**\n * Visit nodes.\n *\n * This algorithm performs *depth-first* *tree traversal* in *preorder*\n * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).\n *\n * You can choose for which nodes `visitor` is called by passing a `test`.\n * For complex tests, you should test yourself in `visitor`, as it will be\n * faster and will have improved type information.\n *\n * Walking the tree is an intensive task.\n * Make use of the return values of the visitor when possible.\n * Instead of walking a tree multiple times, walk it once, use `unist-util-is`\n * to check if a node matches, and then perform different operations.\n *\n * You can change the tree.\n * See `Visitor` for more info.\n *\n * @overload\n * @param {Tree} tree\n * @param {Check} check\n * @param {BuildVisitor<Tree, Check>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @overload\n * @param {Tree} tree\n * @param {BuildVisitor<Tree>} visitor\n * @param {boolean | null | undefined} [reverse]\n * @returns {undefined}\n *\n * @param {UnistNode} tree\n * Tree to traverse.\n * @param {Visitor | Test} testOrVisitor\n * `unist-util-is`-compatible test (optional, omit to pass a visitor).\n * @param {Visitor | boolean | null | undefined} [visitorOrReverse]\n * Handle each node (when test is omitted, pass `reverse`).\n * @param {boolean | null | undefined} [maybeReverse=false]\n * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).\n * @returns {undefined}\n * Nothing.\n *\n * @template {UnistNode} Tree\n * Node type.\n * @template {Test} Check\n * `unist-util-is`-compatible test.\n */\nexport function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {\n /** @type {boolean | null | undefined} */\n let reverse\n /** @type {Test} */\n let test\n /** @type {Visitor} */\n let visitor\n\n if (\n typeof testOrVisitor === 'function' &&\n typeof visitorOrReverse !== 'function'\n ) {\n test = undefined\n visitor = testOrVisitor\n reverse = visitorOrReverse\n } else {\n // @ts-expect-error: assume the overload with test was given.\n test = testOrVisitor\n // @ts-expect-error: assume the overload with test was given.\n visitor = visitorOrReverse\n reverse = maybeReverse\n }\n\n visitParents(tree, test, overload, reverse)\n\n /**\n * @param {UnistNode} node\n * @param {Array<UnistParent>} parents\n */\n function overload(node, parents) {\n const parent = parents[parents.length - 1]\n const index = parent ? parent.children.indexOf(node) : undefined\n return visitor(node, index, parent)\n }\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Blockquote} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {Break} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array<Element | Text>}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Code} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n /** @type {Properties} */\n const properties = {}\n // Someone can write `js&#x20;python&#x9;ruby`.\n const language = node.lang ? node.lang.split(/\\s+/) : []\n\n // GH/CM still drop the non-first languages.\n if (language.length > 0) {\n properties.className = ['language-' + language[0]]\n }\n\n // Create `<code>`.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `<pre>`.\n result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n state.patch(node, result)\n return result\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Delete} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Delete} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function strikethrough(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'del',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Emphasis} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Emphasis} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function emphasis(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'em',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {FootnoteReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {FootnoteReference} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function footnoteReference(state, node) {\n const clobberPrefix =\n typeof state.options.clobberPrefix === 'string'\n ? state.options.clobberPrefix\n : 'user-content-'\n const id = String(node.identifier).toUpperCase()\n const safeId = normalizeUri(id.toLowerCase())\n const index = state.footnoteOrder.indexOf(id)\n /** @type {number} */\n let counter\n\n let reuseCounter = state.footnoteCounts.get(id)\n\n if (reuseCounter === undefined) {\n reuseCounter = 0\n state.footnoteOrder.push(id)\n counter = state.footnoteOrder.length\n } else {\n counter = index + 1\n }\n\n reuseCounter += 1\n state.footnoteCounts.set(id, reuseCounter)\n\n /** @type {Element} */\n const link = {\n type: 'element',\n tagName: 'a',\n properties: {\n href: '#' + clobberPrefix + 'fn-' + safeId,\n id:\n clobberPrefix +\n 'fnref-' +\n safeId +\n (reuseCounter > 1 ? '-' + reuseCounter : ''),\n dataFootnoteRef: true,\n ariaDescribedBy: ['footnote-label']\n },\n children: [{type: 'text', value: String(counter)}]\n }\n state.patch(node, link)\n\n /** @type {Element} */\n const sup = {\n type: 'element',\n tagName: 'sup',\n properties: {},\n children: [link]\n }\n state.patch(node, sup)\n return state.applyData(node, sup)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Heading} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Heading} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function heading(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'h' + node.depth,\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Html} from 'mdast'\n * @import {State} from '../state.js'\n * @import {Raw} from '../../index.js'\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n * Info passed around.\n * @param {Html} node\n * mdast node.\n * @returns {Element | Raw | undefined}\n * hast node.\n */\nexport function html(state, node) {\n if (state.options.allowDangerousHtml) {\n /** @type {Raw} */\n const result = {type: 'raw', value: node.value}\n state.patch(node, result)\n return state.applyData(node, result)\n }\n\n return undefined\n}\n","/**\n * @import {ElementContent} from 'hast'\n * @import {Reference, Nodes} from 'mdast'\n * @import {State} from './state.js'\n */\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n * Info passed around.\n * @param {Extract<Nodes, Reference>} node\n * Reference node (image, link).\n * @returns {Array<ElementContent>}\n * hast content.\n */\nexport function revert(state, node) {\n const subtype = node.referenceType\n let suffix = ']'\n\n if (subtype === 'collapsed') {\n suffix += '[]'\n } else if (subtype === 'full') {\n suffix += '[' + (node.label || node.identifier) + ']'\n }\n\n if (node.type === 'imageReference') {\n return [{type: 'text', value: '![' + node.alt + suffix}]\n }\n\n const contents = state.all(node)\n const head = contents[0]\n\n if (head && head.type === 'text') {\n head.value = '[' + head.value\n } else {\n contents.unshift({type: 'text', value: '['})\n }\n\n const tail = contents[contents.length - 1]\n\n if (tail && tail.type === 'text') {\n tail.value += suffix\n } else {\n contents.push({type: 'text', value: suffix})\n }\n\n return contents\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ImageReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ImageReference} node\n * mdast node.\n * @returns {Array<ElementContent> | ElementContent}\n * hast node.\n */\nexport function imageReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const definition = state.definitionById.get(id)\n\n if (!definition) {\n return revert(state, node)\n }\n\n /** @type {Properties} */\n const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}\n\n if (definition.title !== null && definition.title !== undefined) {\n properties.title = definition.title\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'img', properties, children: []}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Image} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Image} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function image(state, node) {\n /** @type {Properties} */\n const properties = {src: normalizeUri(node.url)}\n\n if (node.alt !== null && node.alt !== undefined) {\n properties.alt = node.alt\n }\n\n if (node.title !== null && node.title !== undefined) {\n properties.title = node.title\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'img', properties, children: []}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Text} from 'hast'\n * @import {InlineCode} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {InlineCode} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function inlineCode(state, node) {\n /** @type {Text} */\n const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n state.patch(node, text)\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'code',\n properties: {},\n children: [text]\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {LinkReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {LinkReference} node\n * mdast node.\n * @returns {Array<ElementContent> | ElementContent}\n * hast node.\n */\nexport function linkReference(state, node) {\n const id = String(node.identifier).toUpperCase()\n const definition = state.definitionById.get(id)\n\n if (!definition) {\n return revert(state, node)\n }\n\n /** @type {Properties} */\n const properties = {href: normalizeUri(definition.url || '')}\n\n if (definition.title !== null && definition.title !== undefined) {\n properties.title = definition.title\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'a',\n properties,\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {Link} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Link} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function link(state, node) {\n /** @type {Properties} */\n const properties = {href: normalizeUri(node.url)}\n\n if (node.title !== null && node.title !== undefined) {\n properties.title = node.title\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'a',\n properties,\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ListItem, Parents} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ListItem} node\n * mdast node.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function listItem(state, node, parent) {\n const results = state.all(node)\n const loose = parent ? listLoose(parent) : listItemLoose(node)\n /** @type {Properties} */\n const properties = {}\n /** @type {Array<ElementContent>} */\n const children = []\n\n if (typeof node.checked === 'boolean') {\n const head = results[0]\n /** @type {Element} */\n let paragraph\n\n if (head && head.type === 'element' && head.tagName === 'p') {\n paragraph = head\n } else {\n paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n results.unshift(paragraph)\n }\n\n if (paragraph.children.length > 0) {\n paragraph.children.unshift({type: 'text', value: ' '})\n }\n\n paragraph.children.unshift({\n type: 'element',\n tagName: 'input',\n properties: {type: 'checkbox', checked: node.checked, disabled: true},\n children: []\n })\n\n // According to github-markdown-css, this class hides bullet.\n // See: <https://github.com/sindresorhus/github-markdown-css>.\n properties.className = ['task-list-item']\n }\n\n let index = -1\n\n while (++index < results.length) {\n const child = results[index]\n\n // Add eols before nodes, except if this is a loose, first paragraph.\n if (\n loose ||\n index !== 0 ||\n child.type !== 'element' ||\n child.tagName !== 'p'\n ) {\n children.push({type: 'text', value: '\\n'})\n }\n\n if (child.type === 'element' && child.tagName === 'p' && !loose) {\n children.push(...child.children)\n } else {\n children.push(child)\n }\n }\n\n const tail = results[results.length - 1]\n\n // Add a final eol.\n if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n children.push({type: 'text', value: '\\n'})\n }\n\n /** @type {Element} */\n const result = {type: 'element', tagName: 'li', properties, children}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n let loose = false\n if (node.type === 'list') {\n loose = node.spread || false\n const children = node.children\n let index = -1\n\n while (!loose && ++index < children.length) {\n loose = listItemLoose(children[index])\n }\n }\n\n return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n const spread = node.spread\n\n return spread === null || spread === undefined\n ? node.children.length > 1\n : spread\n}\n","/**\n * @import {Element, Properties} from 'hast'\n * @import {List} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {List} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function list(state, node) {\n /** @type {Properties} */\n const properties = {}\n const results = state.all(node)\n let index = -1\n\n if (typeof node.start === 'number' && node.start !== 1) {\n properties.start = node.start\n }\n\n // Like GitHub, add a class for custom styling.\n while (++index < results.length) {\n const child = results[index]\n\n if (\n child.type === 'element' &&\n child.tagName === 'li' &&\n child.properties &&\n Array.isArray(child.properties.className) &&\n child.properties.className.includes('task-list-item')\n ) {\n properties.className = ['contains-task-list']\n break\n }\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: node.ordered ? 'ol' : 'ul',\n properties,\n children: state.wrap(results, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Paragraph} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Paragraph} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function paragraph(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'p',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Parents as HastParents, Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastRoot} node\n * mdast node.\n * @returns {HastParents}\n * hast node.\n */\nexport function root(state, node) {\n /** @type {HastRoot} */\n const result = {type: 'root', children: state.wrap(state.all(node))}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {Strong} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Strong} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function strong(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'strong',\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Table} from 'mdast'\n * @import {Element} from 'hast'\n * @import {State} from '../state.js'\n */\n\nimport {pointEnd, pointStart} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Table} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function table(state, node) {\n const rows = state.all(node)\n const firstRow = rows.shift()\n /** @type {Array<Element>} */\n const tableContent = []\n\n if (firstRow) {\n /** @type {Element} */\n const head = {\n type: 'element',\n tagName: 'thead',\n properties: {},\n children: state.wrap([firstRow], true)\n }\n state.patch(node.children[0], head)\n tableContent.push(head)\n }\n\n if (rows.length > 0) {\n /** @type {Element} */\n const body = {\n type: 'element',\n tagName: 'tbody',\n properties: {},\n children: state.wrap(rows, true)\n }\n\n const start = pointStart(node.children[1])\n const end = pointEnd(node.children[node.children.length - 1])\n if (start && end) body.position = {start, end}\n tableContent.push(body)\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'table',\n properties: {},\n children: state.wrap(tableContent, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element, ElementContent, Properties} from 'hast'\n * @import {Parents, TableRow} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {TableRow} node\n * mdast node.\n * @param {Parents | undefined} parent\n * Parent of `node`.\n * @returns {Element}\n * hast node.\n */\nexport function tableRow(state, node, parent) {\n const siblings = parent ? parent.children : undefined\n // Generate a body row when without parent.\n const rowIndex = siblings ? siblings.indexOf(node) : 1\n const tagName = rowIndex === 0 ? 'th' : 'td'\n // To do: option to use `style`?\n const align = parent && parent.type === 'table' ? parent.align : undefined\n const length = align ? align.length : node.children.length\n let cellIndex = -1\n /** @type {Array<ElementContent>} */\n const cells = []\n\n while (++cellIndex < length) {\n // Note: can also be undefined.\n const cell = node.children[cellIndex]\n /** @type {Properties} */\n const properties = {}\n const alignValue = align ? align[cellIndex] : undefined\n\n if (alignValue) {\n properties.align = alignValue\n }\n\n /** @type {Element} */\n let result = {type: 'element', tagName, properties, children: []}\n\n if (cell) {\n result.children = state.all(cell)\n state.patch(cell, result)\n result = state.applyData(cell, result)\n }\n\n cells.push(result)\n }\n\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'tr',\n properties: {},\n children: state.wrap(cells, true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {TableCell} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {TableCell} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function tableCell(state, node) {\n // Note: this function is normally not called: see `table-row` for how rows\n // and their cells are compiled.\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'td', // Assume body cell.\n properties: {},\n children: state.all(node)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Trimmed value.\n */\nexport function trimLines(value) {\n const source = String(value)\n const search = /\\r?\\n|\\r/g\n let match = search.exec(source)\n let last = 0\n /** @type {Array<string>} */\n const lines = []\n\n while (match) {\n lines.push(\n trimLine(source.slice(last, match.index), last > 0, true),\n match[0]\n )\n\n last = match.index + match[0].length\n match = search.exec(source)\n }\n\n lines.push(trimLine(source.slice(last), last > 0, false))\n\n return lines.join('')\n}\n\n/**\n * @param {string} value\n * Line to trim.\n * @param {boolean} start\n * Whether to trim the start of the line.\n * @param {boolean} end\n * Whether to trim the end of the line.\n * @returns {string}\n * Trimmed line.\n */\nfunction trimLine(value, start, end) {\n let startIndex = 0\n let endIndex = value.length\n\n if (start) {\n let code = value.codePointAt(startIndex)\n\n while (code === tab || code === space) {\n startIndex++\n code = value.codePointAt(startIndex)\n }\n }\n\n if (end) {\n let code = value.codePointAt(endIndex - 1)\n\n while (code === tab || code === space) {\n endIndex--\n code = value.codePointAt(endIndex - 1)\n }\n }\n\n return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n","/**\n * @import {Element as HastElement, Text as HastText} from 'hast'\n * @import {Text as MdastText} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastText} node\n * mdast node.\n * @returns {HastElement | HastText}\n * hast node.\n */\nexport function text(state, node) {\n /** @type {HastText} */\n const result = {type: 'text', value: trimLines(String(node.value))}\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Element} from 'hast'\n * @import {ThematicBreak} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {ThematicBreak} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function thematicBreak(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'hr',\n properties: {},\n children: []\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n","/**\n * @import {Handlers} from '../state.js'\n */\n\nimport {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n *\n * @satisfies {Handlers}\n */\nexport const handlers = {\n blockquote,\n break: hardBreak,\n code,\n delete: strikethrough,\n emphasis,\n footnoteReference,\n heading,\n html,\n imageReference,\n image,\n inlineCode,\n linkReference,\n link,\n listItem,\n list,\n paragraph,\n // @ts-expect-error: root is different, but hard to type.\n root,\n strong,\n table,\n tableCell,\n tableRow,\n text,\n thematicBreak,\n toml: ignore,\n yaml: ignore,\n definition: ignore,\n footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n return undefined\n}\n","/**\n * @import {\n * ElementContent as HastElementContent,\n * Element as HastElement,\n * Nodes as HastNodes,\n * Properties as HastProperties,\n * RootContent as HastRootContent,\n * Text as HastText\n * } from 'hast'\n * @import {\n * Definition as MdastDefinition,\n * FootnoteDefinition as MdastFootnoteDefinition,\n * Nodes as MdastNodes,\n * Parents as MdastParents\n * } from 'mdast'\n * @import {VFile} from 'vfile'\n * @import {\n * FootnoteBackContentTemplate,\n * FootnoteBackLabelTemplate\n * } from './footer.js'\n */\n\n/**\n * @callback Handler\n * Handle a node.\n * @param {State} state\n * Info passed around.\n * @param {any} node\n * mdast node to handle.\n * @param {MdastParents | undefined} parent\n * Parent of `node`.\n * @returns {Array<HastElementContent> | HastElementContent | undefined}\n * hast node.\n *\n * @typedef {Partial<Record<MdastNodes['type'], Handler>>} Handlers\n * Handle nodes.\n *\n * @typedef Options\n * Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n * Whether to persist raw HTML in markdown in the hast tree (default:\n * `false`).\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n * Prefix to use before the `id` property on footnotes to prevent them from\n * *clobbering* (default: `'user-content-'`).\n *\n * Pass `''` for trusted markdown and when you are careful with\n * polyfilling.\n * You could pass a different prefix.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=\"x\"></p>\n * <script>alert(x) // `x` now refers to the `p#x` DOM element</script>\n * ```\n *\n * The above example shows that elements are made available by browsers, by\n * their ID, on the `window` object.\n * This is a security risk because you might be expecting some other variable\n * at that place.\n * It can also break polyfills.\n * Using a prefix solves these problems.\n * @property {VFile | null | undefined} [file]\n * Corresponding virtual file representing the input document (optional).\n * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent]\n * Content of the backreference back to references (default: `defaultFootnoteBackContent`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackContent(_, rereferenceIndex) {\n * const result = [{type: 'text', value: '↩'}]\n *\n * if (rereferenceIndex > 1) {\n * result.push({\n * type: 'element',\n * tagName: 'sup',\n * properties: {},\n * children: [{type: 'text', value: String(rereferenceIndex)}]\n * })\n * }\n *\n * return result\n * }\n * ```\n *\n * This content is used in the `a` element of each backreference (the `↩`\n * links).\n * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel]\n * Label to describe the backreference back to references (default:\n * `defaultFootnoteBackLabel`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n * return (\n * 'Back to reference ' +\n * (referenceIndex + 1) +\n * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n * )\n * }\n * ```\n *\n * Change it when the markdown is not in English.\n *\n * This label is used in the `ariaLabel` property on each backreference\n * (the `↩` links).\n * It affects users of assistive technology.\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n * Textual label to use for the footnotes section (default: `'Footnotes'`).\n *\n * Change it when the markdown is not in English.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label (default: `{className:\n * ['sr-only']}`).\n *\n * Change it to show the label and add other properties.\n *\n * This label is typically hidden visually (assuming an `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass an empty string.\n * You can also add different properties.\n *\n * > **Note**: `id: 'footnote-label'` is always added, because footnote\n * > calls use it with `aria-describedby` to provide an accessible label.\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n * HTML tag name to use for the footnote label element (default: `'h2'`).\n *\n * Change it to match your document structure.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {Handlers | null | undefined} [handlers]\n * Extra handlers for nodes (optional).\n * @property {Array<MdastNodes['type']> | null | undefined} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast (note that\n * the node itself is passed, but eventual children are transformed)\n * (optional).\n * @property {Handler | null | undefined} [unknownHandler]\n * Handler for all unknown nodes (optional).\n *\n * @typedef State\n * Info passed around.\n * @property {(node: MdastNodes) => Array<HastElementContent>} all\n * Transform the children of an mdast parent to hast.\n * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => HastElement | Type} applyData\n * Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {Map<string, MdastDefinition>} definitionById\n * Definitions by their identifier.\n * @property {Map<string, MdastFootnoteDefinition>} footnoteById\n * Footnote definitions by their identifier.\n * @property {Map<string, number>} footnoteCounts\n * Counts for how often the same footnote was called.\n * @property {Array<string>} footnoteOrder\n * Identifiers of order when footnote calls first appear in tree order.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array<HastElementContent> | HastElementContent | undefined} one\n * Transform an mdast node to hast.\n * @property {Options} options\n * Configuration.\n * @property {(from: MdastNodes, node: HastNodes) => undefined} patch\n * Copy a node’s positional info.\n * @property {<Type extends HastRootContent>(nodes: Array<Type>, loose?: boolean | undefined) => Array<HastText | Type>} wrap\n * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {visit} from 'unist-util-visit'\nimport {position} from 'unist-util-position'\nimport {handlers as defaultHandlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n * mdast node to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {State}\n * `state` function.\n */\nexport function createState(tree, options) {\n const settings = options || emptyOptions\n /** @type {Map<string, MdastDefinition>} */\n const definitionById = new Map()\n /** @type {Map<string, MdastFootnoteDefinition>} */\n const footnoteById = new Map()\n /** @type {Map<string, number>} */\n const footnoteCounts = new Map()\n /** @type {Handlers} */\n // @ts-expect-error: the root handler returns a root.\n // Hard to type.\n const handlers = {...defaultHandlers, ...settings.handlers}\n\n /** @type {State} */\n const state = {\n all,\n applyData,\n definitionById,\n footnoteById,\n footnoteCounts,\n footnoteOrder: [],\n handlers,\n one,\n options: settings,\n patch,\n wrap\n }\n\n visit(tree, function (node) {\n if (node.type === 'definition' || node.type === 'footnoteDefinition') {\n const map = node.type === 'definition' ? definitionById : footnoteById\n const id = String(node.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/9032189/lib/index.js#L20-L21>.\n if (!map.has(id)) {\n // @ts-expect-error: node type matches map.\n map.set(id, node)\n }\n }\n })\n\n return state\n\n /**\n * Transform an mdast node into a hast node.\n *\n * @param {MdastNodes} node\n * mdast node.\n * @param {MdastParents | undefined} [parent]\n * Parent of `node`.\n * @returns {Array<HastElementContent> | HastElementContent | undefined}\n * Resulting hast node.\n */\n function one(node, parent) {\n const type = node.type\n const handle = state.handlers[type]\n\n if (own.call(state.handlers, type) && handle) {\n return handle(state, node, parent)\n }\n\n if (state.options.passThrough && state.options.passThrough.includes(type)) {\n if ('children' in node) {\n const {children, ...shallow} = node\n const result = structuredClone(shallow)\n // @ts-expect-error: TS doesn’t understand…\n result.children = state.all(node)\n // @ts-expect-error: TS doesn’t understand…\n return result\n }\n\n // @ts-expect-error: it’s custom.\n return structuredClone(node)\n }\n\n const unknown = state.options.unknownHandler || defaultUnknownHandler\n\n return unknown(state, node, parent)\n }\n\n /**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {MdastNodes} parent\n * mdast node to compile\n * @returns {Array<HastElementContent>}\n * Resulting hast nodes.\n */\n function all(parent) {\n /** @type {Array<HastElementContent>} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n while (++index < nodes.length) {\n const result = state.one(nodes[index], parent)\n\n // To do: see if we van clean this? Can we merge texts?\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = trimMarkdownSpaceStart(result.value)\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = trimMarkdownSpaceStart(head.value)\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n }\n}\n\n/**\n * Copy a node’s positional info.\n *\n * @param {MdastNodes} from\n * mdast node to copy from.\n * @param {HastNodes} to\n * hast node to copy into.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n * Node type.\n * @param {MdastNodes} from\n * mdast node to use data from.\n * @param {Type} to\n * hast node to change.\n * @returns {HastElement | Type}\n * Nothing.\n */\nfunction applyData(from, to) {\n /** @type {HastElement | Type} */\n let result = to\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (from && from.data) {\n const hName = from.data.hName\n const hChildren = from.data.hChildren\n const hProperties = from.data.hProperties\n\n if (typeof hName === 'string') {\n // Transforming the node resulted in an element with a different name\n // than wanted:\n if (result.type === 'element') {\n result.tagName = hName\n }\n // Transforming the node resulted in a non-element, which happens for\n // raw, text, and root nodes (unless custom handlers are passed).\n // The intent of `hName` is to create an element, but likely also to keep\n // the content around (otherwise: pass `hChildren`).\n else {\n /** @type {Array<HastElementContent>} */\n // @ts-expect-error: assume no doctypes in `root`.\n const children = 'children' in result ? result.children : [result]\n result = {type: 'element', tagName: hName, properties: {}, children}\n }\n }\n\n if (result.type === 'element' && hProperties) {\n Object.assign(result.properties, structuredClone(hProperties))\n }\n\n if (\n 'children' in result &&\n result.children &&\n hChildren !== null &&\n hChildren !== undefined\n ) {\n result.children = hChildren\n }\n }\n\n return result\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastNodes} node\n * Unknown mdast node.\n * @returns {HastElement | HastText}\n * Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n const data = node.data || {}\n /** @type {HastElement | HastText} */\n const result =\n 'value' in node &&\n !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n ? {type: 'text', value: node.value}\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: state.all(node)\n }\n\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastRootContent} Type\n * Node type.\n * @param {Array<Type>} nodes\n * List of nodes to wrap.\n * @param {boolean | undefined} [loose=false]\n * Whether to add line endings at start and end (default: `false`).\n * @returns {Array<HastText | Type>}\n * Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n /** @type {Array<HastText | Type>} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push({type: 'text', value: '\\n'})\n }\n\n while (++index < nodes.length) {\n if (index) result.push({type: 'text', value: '\\n'})\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push({type: 'text', value: '\\n'})\n }\n\n return result\n}\n\n/**\n * Trim spaces and tabs at the start of `value`.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Result.\n */\nfunction trimMarkdownSpaceStart(value) {\n let index = 0\n let code = value.charCodeAt(index)\n\n while (code === 9 || code === 32) {\n index++\n code = value.charCodeAt(index)\n }\n\n return value.slice(index)\n}\n","/**\n * @import {Nodes as HastNodes} from 'hast'\n * @import {Nodes as MdastNodes} from 'mdast'\n * @import {Options} from './state.js'\n */\n\nimport {ok as assert} from 'devlop'\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don’t:\n *\n * * `hast-util-to-html` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful\n * if you completely trust authors\n * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only\n * way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=x></p>\n * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>\n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn’t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `<div>` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there’s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n","/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit<ToHastOptions, 'file'>} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise<undefined>}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > 👉 **Note**:\n * > It’s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don’t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n * <p id=x></p>\n * <script>alert(x) // `x` now refers to the DOM `p#x` element</script>\n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn’t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `<div>` element (which could be changed with `data.hName`),\n * with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @overload\n * @param {Readonly<Options> | Processor | null | undefined} [destination]\n * @param {Readonly<Options> | null | undefined} [options]\n * @returns {TransformBridge | TransformMutate}\n *\n * @param {Readonly<Options> | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly<Options> | null | undefined} [options]\n * When a processor was given,\n * configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (\n toHast(tree, {file, ...options})\n )\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree, file) {\n // Cast because root in -> root out.\n // To do: in the future, disallow ` || options` fallback.\n // With `unified-engine`, `destination` can be `undefined` but\n // `options` will be the file set.\n // We should not pass that as `options`.\n return /** @type {HastRoot} */ (\n toHast(tree, {file, ...(destination || options)})\n )\n }\n}\n","/**\n * Throw a given error.\n *\n * @param {Error|null|undefined} [error]\n * Maybe error.\n * @returns {asserts error is null|undefined}\n */\nexport function bail(error) {\n if (error) {\n throw error\n }\n}\n","/**\n * @typedef {import('trough').Pipeline} Pipeline\n *\n * @typedef {import('unist').Node} Node\n *\n * @typedef {import('vfile').Compatible} Compatible\n * @typedef {import('vfile').Value} Value\n *\n * @typedef {import('../index.js').CompileResultMap} CompileResultMap\n * @typedef {import('../index.js').Data} Data\n * @typedef {import('../index.js').Settings} Settings\n */\n\n/**\n * @typedef {CompileResultMap[keyof CompileResultMap]} CompileResults\n * Acceptable results from compilers.\n *\n * To register custom results, add them to\n * {@linkcode CompileResultMap}.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the compiler receives (default: `Node`).\n * @template {CompileResults} [Result=CompileResults]\n * The thing that the compiler yields (default: `CompileResults`).\n * @callback Compiler\n * A **compiler** handles the compiling of a syntax tree to something else\n * (in most cases, text) (TypeScript type).\n *\n * It is used in the stringify phase and called with a {@linkcode Node}\n * and {@linkcode VFile} representation of the document to compile.\n * It should return the textual representation of the given tree (typically\n * `string`).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n * @param {Tree} tree\n * Tree to compile.\n * @param {VFile} file\n * File associated with `tree`.\n * @returns {Result}\n * New content: compiled text (`string` or `Uint8Array`, for `file.value`) or\n * something else (for `file.result`).\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The node that the parser yields (default: `Node`)\n * @callback Parser\n * A **parser** handles the parsing of text to a syntax tree.\n *\n * It is used in the parse phase and is called with a `string` and\n * {@linkcode VFile} of the document to parse.\n * It must return the syntax tree representation of the given file\n * ({@linkcode Node}).\n * @param {string} document\n * Document to parse.\n * @param {VFile} file\n * File associated with `document`.\n * @returns {Tree}\n * Node representing the given file.\n */\n\n/**\n * @typedef {(\n * Plugin<Array<any>, any, any> |\n * PluginTuple<Array<any>, any, any> |\n * Preset\n * )} Pluggable\n * Union of the different ways to add plugins and settings.\n */\n\n/**\n * @typedef {Array<Pluggable>} PluggableList\n * List of plugins and presets.\n */\n\n// Note: we can’t use `callback` yet as it messes up `this`:\n// <https://github.com/microsoft/TypeScript/issues/55197>.\n/**\n * @template {Array<unknown>} [PluginParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=Node]\n * Value that is expected as input (default: `Node`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=Input]\n * Value that is yielded as output (default: `Input`).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * (this: Processor, ...parameters: PluginParameters) =>\n * Input extends string ? // Parser.\n * Output extends Node | undefined ? undefined | void : never :\n * Output extends CompileResults ? // Compiler.\n * Input extends Node | undefined ? undefined | void : never :\n * Transformer<\n * Input extends Node ? Input : Node,\n * Output extends Node ? Output : Node\n * > | undefined | void\n * )} Plugin\n * Single plugin.\n *\n * Plugins configure the processors they are applied on in the following\n * ways:\n *\n * * they change the processor, such as the parser, the compiler, or by\n * configuring data\n * * they specify how to handle trees and files\n *\n * In practice, they are functions that can receive options and configure the\n * processor (`this`).\n *\n * > **Note**: plugins are called when the processor is *frozen*, not when\n * > they are applied.\n */\n\n/**\n * Tuple of a plugin and its configuration.\n *\n * The first item is a plugin, the rest are its parameters.\n *\n * @template {Array<unknown>} [TupleParameters=[]]\n * Arguments passed to the plugin (default: `[]`, the empty tuple).\n * @template {Node | string | undefined} [Input=undefined]\n * Value that is expected as input (optional).\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node it expects.\n * * If the plugin sets a {@linkcode Parser}, this should be\n * `string`.\n * * If the plugin sets a {@linkcode Compiler}, this should be the\n * node it expects.\n * @template [Output=undefined] (optional).\n * Value that is yielded as output.\n *\n * * If the plugin returns a {@linkcode Transformer}, this\n * should be the node that that yields.\n * * If the plugin sets a {@linkcode Parser}, this should be the\n * node that it yields.\n * * If the plugin sets a {@linkcode Compiler}, this should be\n * result it yields.\n * @typedef {(\n * [\n * plugin: Plugin<TupleParameters, Input, Output>,\n * ...parameters: TupleParameters\n * ]\n * )} PluginTuple\n */\n\n/**\n * @typedef Preset\n * Sharable configuration.\n *\n * They can contain plugins and settings.\n * @property {PluggableList | undefined} [plugins]\n * List of plugins and presets (optional).\n * @property {Settings | undefined} [settings]\n * Shared settings for parsers and compilers (optional).\n */\n\n/**\n * @template {VFile} [File=VFile]\n * The file that the callback receives (default: `VFile`).\n * @callback ProcessCallback\n * Callback called when the process is done.\n *\n * Called with either an error or a result.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {File | undefined} [file]\n * Processed file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Tree=Node]\n * The tree that the callback receives (default: `Node`).\n * @callback RunCallback\n * Callback called when transformers are done.\n *\n * Called with either an error or results.\n * @param {Error | undefined} [error]\n * Fatal error (optional).\n * @param {Tree | undefined} [tree]\n * Transformed tree (optional).\n * @param {VFile | undefined} [file]\n * File (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Output=Node]\n * Node type that the transformer yields (default: `Node`).\n * @callback TransformCallback\n * Callback passed to transforms.\n *\n * If the signature of a `transformer` accepts a third argument, the\n * transformer may perform asynchronous operations, and must call it.\n * @param {Error | undefined} [error]\n * Fatal error to stop the process (optional).\n * @param {Output | undefined} [tree]\n * New, changed, tree (optional).\n * @param {VFile | undefined} [file]\n * New, changed, file (optional).\n * @returns {undefined}\n * Nothing.\n */\n\n/**\n * @template {Node} [Input=Node]\n * Node type that the transformer expects (default: `Node`).\n * @template {Node} [Output=Input]\n * Node type that the transformer yields (default: `Input`).\n * @callback Transformer\n * Transformers handle syntax trees and files.\n *\n * They are functions that are called each time a syntax tree and file are\n * passed through the run phase.\n * When an error occurs in them (either because it’s thrown, returned,\n * rejected, or passed to `next`), the process stops.\n *\n * The run phase is handled by [`trough`][trough], see its documentation for\n * the exact semantics of these functions.\n *\n * > **Note**: you should likely ignore `next`: don’t accept it.\n * > it supports callback-style async work.\n * > But promises are likely easier to reason about.\n *\n * [trough]: https://github.com/wooorm/trough#function-fninput-next\n * @param {Input} tree\n * Tree to handle.\n * @param {VFile} file\n * File to handle.\n * @param {TransformCallback<Output>} next\n * Callback.\n * @returns {(\n * Promise<Output | undefined | void> |\n * Promise<never> | // For some reason this is needed separately.\n * Output |\n * Error |\n * undefined |\n * void\n * )}\n * If you accept `next`, nothing.\n * Otherwise:\n *\n * * `Error` — fatal error to stop the process\n * * `Promise<undefined>` or `undefined` — the next transformer keeps using\n * same tree\n * * `Promise<Node>` or `Node` — new, changed, tree\n */\n\n/**\n * @template {Node | undefined} ParseTree\n * Output of `parse`.\n * @template {Node | undefined} HeadTree\n * Input for `run`.\n * @template {Node | undefined} TailTree\n * Output for `run`.\n * @template {Node | undefined} CompileTree\n * Input of `stringify`.\n * @template {CompileResults | undefined} CompileResult\n * Output of `stringify`.\n * @template {Node | string | undefined} Input\n * Input of plugin.\n * @template Output\n * Output of plugin (optional).\n * @typedef {(\n * Input extends string\n * ? Output extends Node | undefined\n * ? // Parser.\n * Processor<\n * Output extends undefined ? ParseTree : Output,\n * HeadTree,\n * TailTree,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : Output extends CompileResults\n * ? Input extends Node | undefined\n * ? // Compiler.\n * Processor<\n * ParseTree,\n * HeadTree,\n * TailTree,\n * Input extends undefined ? CompileTree : Input,\n * Output extends undefined ? CompileResult : Output\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : Input extends Node | undefined\n * ? Output extends Node | undefined\n * ? // Transform.\n * Processor<\n * ParseTree,\n * HeadTree extends undefined ? Input : HeadTree,\n * Output extends undefined ? TailTree : Output,\n * CompileTree,\n * CompileResult\n * >\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * : // Unknown.\n * Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>\n * )} UsePlugin\n * Create a processor based on the input/output of a {@link Plugin plugin}.\n */\n\n/**\n * @template {CompileResults | undefined} Result\n * Node type that the transformer yields.\n * @typedef {(\n * Result extends Value | undefined ?\n * VFile :\n * VFile & {result: Result}\n * )} VFileWithOutput\n * Type to generate a {@linkcode VFile} corresponding to a compiler result.\n *\n * If a result that is not acceptable on a `VFile` is used, that will\n * be stored on the `result` field of {@linkcode VFile}.\n */\n\nimport {bail} from 'bail'\nimport extend from 'extend'\nimport {ok as assert} from 'devlop'\nimport isPlainObj from 'is-plain-obj'\nimport {trough} from 'trough'\nimport {VFile} from 'vfile'\nimport {CallableInstance} from './callable-instance.js'\n\n// To do: next major: drop `Compiler`, `Parser`: prefer lowercase.\n\n// To do: we could start yielding `never` in TS when a parser is missing and\n// `parse` is called.\n// Currently, we allow directly setting `processor.parser`, which is untyped.\n\nconst own = {}.hasOwnProperty\n\n/**\n * @template {Node | undefined} [ParseTree=undefined]\n * Output of `parse` (optional).\n * @template {Node | undefined} [HeadTree=undefined]\n * Input for `run` (optional).\n * @template {Node | undefined} [TailTree=undefined]\n * Output for `run` (optional).\n * @template {Node | undefined} [CompileTree=undefined]\n * Input of `stringify` (optional).\n * @template {CompileResults | undefined} [CompileResult=undefined]\n * Output of `stringify` (optional).\n * @extends {CallableInstance<[], Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>>}\n */\nexport class Processor extends CallableInstance {\n /**\n * Create a processor.\n */\n constructor() {\n // If `Processor()` is called (w/o new), `copy` is called instead.\n super('copy')\n\n /**\n * Compiler to use (deprecated).\n *\n * @deprecated\n * Use `compiler` instead.\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.Compiler = undefined\n\n /**\n * Parser to use (deprecated).\n *\n * @deprecated\n * Use `parser` instead.\n * @type {(\n * Parser<ParseTree extends undefined ? Node : ParseTree> |\n * undefined\n * )}\n */\n this.Parser = undefined\n\n // Note: the following fields are considered private.\n // However, they are needed for tests, and TSC generates an untyped\n // `private freezeIndex` field for, which trips `type-coverage` up.\n // Instead, we use `@deprecated` to visualize that they shouldn’t be used.\n /**\n * Internal list of configured plugins.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Array<PluginTuple<Array<unknown>>>}\n */\n this.attachers = []\n\n /**\n * Compiler to use.\n *\n * @type {(\n * Compiler<\n * CompileTree extends undefined ? Node : CompileTree,\n * CompileResult extends undefined ? CompileResults : CompileResult\n * > |\n * undefined\n * )}\n */\n this.compiler = undefined\n\n /**\n * Internal state to track where we are while freezing.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {number}\n */\n this.freezeIndex = -1\n\n /**\n * Internal state to track whether we’re frozen.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {boolean | undefined}\n */\n this.frozen = undefined\n\n /**\n * Internal state.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Data}\n */\n this.namespace = {}\n\n /**\n * Parser to use.\n *\n * @type {(\n * Parser<ParseTree extends undefined ? Node : ParseTree> |\n * undefined\n * )}\n */\n this.parser = undefined\n\n /**\n * Internal list of configured transformers.\n *\n * @deprecated\n * This is a private internal property and should not be used.\n * @type {Pipeline}\n */\n this.transformers = trough()\n }\n\n /**\n * Copy a processor.\n *\n * @deprecated\n * This is a private internal method and should not be used.\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * New *unfrozen* processor ({@linkcode Processor}) that is\n * configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\n copy() {\n // Cast as the type parameters will be the same after attaching.\n const destination =\n /** @type {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>} */ (\n new Processor()\n )\n let index = -1\n\n while (++index < this.attachers.length) {\n const attacher = this.attachers[index]\n destination.use(...attacher)\n }\n\n destination.data(extend(true, {}, this.namespace))\n\n return destination\n }\n\n /**\n * Configure the processor with info available to all plugins.\n * Information is stored in an object.\n *\n * Typically, options can be given to a specific plugin, but sometimes it\n * makes sense to have information shared with several plugins.\n * For example, a list of HTML elements that are self-closing, which is\n * needed during all phases.\n *\n * > **Note**: setting information cannot occur on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * > **Note**: to register custom data in TypeScript, augment the\n * > {@linkcode Data} interface.\n *\n * @example\n * This example show how to get and set info:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * const processor = unified().data('alpha', 'bravo')\n *\n * processor.data('alpha') // => 'bravo'\n *\n * processor.data() // => {alpha: 'bravo'}\n *\n * processor.data({charlie: 'delta'})\n *\n * processor.data() // => {charlie: 'delta'}\n * ```\n *\n * @template {keyof Data} Key\n *\n * @overload\n * @returns {Data}\n *\n * @overload\n * @param {Data} dataset\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {Key} key\n * @returns {Data[Key]}\n *\n * @overload\n * @param {Key} key\n * @param {Data[Key]} value\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @param {Data | Key} [key]\n * Key to get or set, or entire dataset to set, or nothing to get the\n * entire dataset (optional).\n * @param {Data[Key]} [value]\n * Value to set (optional).\n * @returns {unknown}\n * The current processor when setting, the value at `key` when getting, or\n * the entire dataset when getting without key.\n */\n data(key, value) {\n if (typeof key === 'string') {\n // Set `key`.\n if (arguments.length === 2) {\n assertUnfrozen('data', this.frozen)\n this.namespace[key] = value\n return this\n }\n\n // Get `key`.\n return (own.call(this.namespace, key) && this.namespace[key]) || undefined\n }\n\n // Set space.\n if (key) {\n assertUnfrozen('data', this.frozen)\n this.namespace = key\n return this\n }\n\n // Get space.\n return this.namespace\n }\n\n /**\n * Freeze a processor.\n *\n * Frozen processors are meant to be extended and not to be configured\n * directly.\n *\n * When a processor is frozen it cannot be unfrozen.\n * New processors working the same way can be created by calling the\n * processor.\n *\n * It’s possible to freeze processors explicitly by calling `.freeze()`.\n * Processors freeze automatically when `.parse()`, `.run()`, `.runSync()`,\n * `.stringify()`, `.process()`, or `.processSync()` are called.\n *\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * The current processor.\n */\n freeze() {\n if (this.frozen) {\n return this\n }\n\n // Cast so that we can type plugins easier.\n // Plugins are supposed to be usable on different processors, not just on\n // this exact processor.\n const self = /** @type {Processor} */ (/** @type {unknown} */ (this))\n\n while (++this.freezeIndex < this.attachers.length) {\n const [attacher, ...options] = this.attachers[this.freezeIndex]\n\n if (options[0] === false) {\n continue\n }\n\n if (options[0] === true) {\n options[0] = undefined\n }\n\n const transformer = attacher.call(self, ...options)\n\n if (typeof transformer === 'function') {\n this.transformers.use(transformer)\n }\n }\n\n this.frozen = true\n this.freezeIndex = Number.POSITIVE_INFINITY\n\n return this\n }\n\n /**\n * Parse text to a syntax tree.\n *\n * > **Note**: `parse` freezes the processor if not already *frozen*.\n *\n * > **Note**: `parse` performs the parse phase, not the run phase or other\n * > phases.\n *\n * @param {Compatible | undefined} [file]\n * file to parse (optional); typically `string` or `VFile`; any value\n * accepted as `x` in `new VFile(x)`.\n * @returns {ParseTree extends undefined ? Node : ParseTree}\n * Syntax tree representing `file`.\n */\n parse(file) {\n this.freeze()\n const realFile = vfile(file)\n const parser = this.parser || this.Parser\n assertParser('parse', parser)\n return parser(String(realFile), realFile)\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * > **Note**: `process` freezes the processor if not already *frozen*.\n *\n * > **Note**: `process` performs the parse, run, and stringify phases.\n *\n * @overload\n * @param {Compatible | undefined} file\n * @param {ProcessCallback<VFileWithOutput<CompileResult>>} done\n * @returns {undefined}\n *\n * @overload\n * @param {Compatible | undefined} [file]\n * @returns {Promise<VFileWithOutput<CompileResult>>}\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`]; any value accepted as\n * `x` in `new VFile(x)`.\n * @param {ProcessCallback<VFileWithOutput<CompileResult>> | undefined} [done]\n * Callback (optional).\n * @returns {Promise<VFile> | undefined}\n * Nothing if `done` is given.\n * Otherwise a promise, rejected with a fatal error or resolved with the\n * processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n process(file, done) {\n const self = this\n\n this.freeze()\n assertParser('process', this.parser || this.Parser)\n assertCompiler('process', this.compiler || this.Compiler)\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {((file: VFileWithOutput<CompileResult>) => undefined | void) | undefined} resolve\n * @param {(error: Error | undefined) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n const realFile = vfile(file)\n // Assume `ParseTree` (the result of the parser) matches `HeadTree` (the\n // input of the first transform).\n const parseTree =\n /** @type {HeadTree extends undefined ? Node : HeadTree} */ (\n /** @type {unknown} */ (self.parse(realFile))\n )\n\n self.run(parseTree, realFile, function (error, tree, file) {\n if (error || !tree || !file) {\n return realDone(error)\n }\n\n // Assume `TailTree` (the output of the last transform) matches\n // `CompileTree` (the input of the compiler).\n const compileTree =\n /** @type {CompileTree extends undefined ? Node : CompileTree} */ (\n /** @type {unknown} */ (tree)\n )\n\n const compileResult = self.stringify(compileTree, file)\n\n if (looksLikeAValue(compileResult)) {\n file.value = compileResult\n } else {\n file.result = compileResult\n }\n\n realDone(error, /** @type {VFileWithOutput<CompileResult>} */ (file))\n })\n\n /**\n * @param {Error | undefined} error\n * @param {VFileWithOutput<CompileResult> | undefined} [file]\n * @returns {undefined}\n */\n function realDone(error, file) {\n if (error || !file) {\n reject(error)\n } else if (resolve) {\n resolve(file)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, file)\n }\n }\n }\n }\n\n /**\n * Process the given file as configured on the processor.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `processSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `processSync` performs the parse, run, and stringify phases.\n *\n * @param {Compatible | undefined} [file]\n * File (optional); typically `string` or `VFile`; any value accepted as\n * `x` in `new VFile(x)`.\n * @returns {VFileWithOutput<CompileResult>}\n * The processed file.\n *\n * The parsed, transformed, and compiled value is available at\n * `file.value` (see note).\n *\n * > **Note**: unified typically compiles by serializing: most\n * > compilers return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n processSync(file) {\n /** @type {boolean} */\n let complete = false\n /** @type {VFileWithOutput<CompileResult> | undefined} */\n let result\n\n this.freeze()\n assertParser('processSync', this.parser || this.Parser)\n assertCompiler('processSync', this.compiler || this.Compiler)\n\n this.process(file, realDone)\n assertDone('processSync', 'process', complete)\n assert(result, 'we either bailed on an error or have a tree')\n\n return result\n\n /**\n * @type {ProcessCallback<VFileWithOutput<CompileResult>>}\n */\n function realDone(error, file) {\n complete = true\n bail(error)\n result = file\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * > **Note**: `run` freezes the processor if not already *frozen*.\n *\n * > **Note**: `run` performs the run phase, not other phases.\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} file\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} done\n * @returns {undefined}\n *\n * @overload\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * @param {Compatible | undefined} [file]\n * @returns {Promise<TailTree extends undefined ? Node : TailTree>}\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {(\n * RunCallback<TailTree extends undefined ? Node : TailTree> |\n * Compatible\n * )} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @param {RunCallback<TailTree extends undefined ? Node : TailTree>} [done]\n * Callback (optional).\n * @returns {Promise<TailTree extends undefined ? Node : TailTree> | undefined}\n * Nothing if `done` is given.\n * Otherwise, a promise rejected with a fatal error or resolved with the\n * transformed tree.\n */\n run(tree, file, done) {\n assertNode(tree)\n this.freeze()\n\n const transformers = this.transformers\n\n if (!done && typeof file === 'function') {\n done = file\n file = undefined\n }\n\n return done ? executor(undefined, done) : new Promise(executor)\n\n // Note: `void`s needed for TS.\n /**\n * @param {(\n * ((tree: TailTree extends undefined ? Node : TailTree) => undefined | void) |\n * undefined\n * )} resolve\n * @param {(error: Error) => undefined | void} reject\n * @returns {undefined}\n */\n function executor(resolve, reject) {\n assert(\n typeof file !== 'function',\n '`file` can’t be a `done` anymore, we checked'\n )\n const realFile = vfile(file)\n transformers.run(tree, realFile, realDone)\n\n /**\n * @param {Error | undefined} error\n * @param {Node} outputTree\n * @param {VFile} file\n * @returns {undefined}\n */\n function realDone(error, outputTree, file) {\n const resultingTree =\n /** @type {TailTree extends undefined ? Node : TailTree} */ (\n outputTree || tree\n )\n\n if (error) {\n reject(error)\n } else if (resolve) {\n resolve(resultingTree)\n } else {\n assert(done, '`done` is defined if `resolve` is not')\n done(undefined, resultingTree, file)\n }\n }\n }\n }\n\n /**\n * Run *transformers* on a syntax tree.\n *\n * An error is thrown if asynchronous transforms are configured.\n *\n * > **Note**: `runSync` freezes the processor if not already *frozen*.\n *\n * > **Note**: `runSync` performs the run phase, not other phases.\n *\n * @param {HeadTree extends undefined ? Node : HeadTree} tree\n * Tree to transform and inspect.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {TailTree extends undefined ? Node : TailTree}\n * Transformed tree.\n */\n runSync(tree, file) {\n /** @type {boolean} */\n let complete = false\n /** @type {(TailTree extends undefined ? Node : TailTree) | undefined} */\n let result\n\n this.run(tree, file, realDone)\n\n assertDone('runSync', 'run', complete)\n assert(result, 'we either bailed on an error or have a tree')\n return result\n\n /**\n * @type {RunCallback<TailTree extends undefined ? Node : TailTree>}\n */\n function realDone(error, tree) {\n bail(error)\n result = tree\n complete = true\n }\n }\n\n /**\n * Compile a syntax tree.\n *\n * > **Note**: `stringify` freezes the processor if not already *frozen*.\n *\n * > **Note**: `stringify` performs the stringify phase, not the run phase\n * > or other phases.\n *\n * @param {CompileTree extends undefined ? Node : CompileTree} tree\n * Tree to compile.\n * @param {Compatible | undefined} [file]\n * File associated with `node` (optional); any value accepted as `x` in\n * `new VFile(x)`.\n * @returns {CompileResult extends undefined ? Value : CompileResult}\n * Textual representation of the tree (see note).\n *\n * > **Note**: unified typically compiles by serializing: most compilers\n * > return `string` (or `Uint8Array`).\n * > Some compilers, such as the one configured with\n * > [`rehype-react`][rehype-react], return other values (in this case, a\n * > React tree).\n * > If you’re using a compiler that doesn’t serialize, expect different\n * > result values.\n * >\n * > To register custom results in TypeScript, add them to\n * > {@linkcode CompileResultMap}.\n *\n * [rehype-react]: https://github.com/rehypejs/rehype-react\n */\n stringify(tree, file) {\n this.freeze()\n const realFile = vfile(file)\n const compiler = this.compiler || this.Compiler\n assertCompiler('stringify', compiler)\n assertNode(tree)\n\n return compiler(tree, realFile)\n }\n\n /**\n * Configure the processor to use a plugin, a list of usable values, or a\n * preset.\n *\n * If the processor is already using a plugin, the previous plugin\n * configuration is changed based on the options that are passed in.\n * In other words, the plugin is not added a second time.\n *\n * > **Note**: `use` cannot be called on *frozen* processors.\n * > Call the processor first to create a new unfrozen processor.\n *\n * @example\n * There are many ways to pass plugins to `.use()`.\n * This example gives an overview:\n *\n * ```js\n * import {unified} from 'unified'\n *\n * unified()\n * // Plugin with options:\n * .use(pluginA, {x: true, y: true})\n * // Passing the same plugin again merges configuration (to `{x: true, y: false, z: true}`):\n * .use(pluginA, {y: false, z: true})\n * // Plugins:\n * .use([pluginB, pluginC])\n * // Two plugins, the second with options:\n * .use([pluginD, [pluginE, {}]])\n * // Preset with plugins and settings:\n * .use({plugins: [pluginF, [pluginG, {}]], settings: {position: false}})\n * // Settings only:\n * .use({settings: {position: false}})\n * ```\n *\n * @template {Array<unknown>} [Parameters=[]]\n * @template {Node | string | undefined} [Input=undefined]\n * @template [Output=Input]\n *\n * @overload\n * @param {Preset | null | undefined} [preset]\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {PluggableList} list\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n *\n * @overload\n * @param {Plugin<Parameters, Input, Output>} plugin\n * @param {...(Parameters | [boolean])} parameters\n * @returns {UsePlugin<ParseTree, HeadTree, TailTree, CompileTree, CompileResult, Input, Output>}\n *\n * @param {PluggableList | Plugin | Preset | null | undefined} value\n * Usable value.\n * @param {...unknown} parameters\n * Parameters, when a plugin is given as a usable value.\n * @returns {Processor<ParseTree, HeadTree, TailTree, CompileTree, CompileResult>}\n * Current processor.\n */\n use(value, ...parameters) {\n const attachers = this.attachers\n const namespace = this.namespace\n\n assertUnfrozen('use', this.frozen)\n\n if (value === null || value === undefined) {\n // Empty.\n } else if (typeof value === 'function') {\n addPlugin(value, parameters)\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n addList(value)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n\n return this\n\n /**\n * @param {Pluggable} value\n * @returns {undefined}\n */\n function add(value) {\n if (typeof value === 'function') {\n addPlugin(value, [])\n } else if (typeof value === 'object') {\n if (Array.isArray(value)) {\n const [plugin, ...parameters] =\n /** @type {PluginTuple<Array<unknown>>} */ (value)\n addPlugin(plugin, parameters)\n } else {\n addPreset(value)\n }\n } else {\n throw new TypeError('Expected usable value, not `' + value + '`')\n }\n }\n\n /**\n * @param {Preset} result\n * @returns {undefined}\n */\n function addPreset(result) {\n if (!('plugins' in result) && !('settings' in result)) {\n throw new Error(\n 'Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither'\n )\n }\n\n addList(result.plugins)\n\n if (result.settings) {\n namespace.settings = extend(true, namespace.settings, result.settings)\n }\n }\n\n /**\n * @param {PluggableList | null | undefined} plugins\n * @returns {undefined}\n */\n function addList(plugins) {\n let index = -1\n\n if (plugins === null || plugins === undefined) {\n // Empty.\n } else if (Array.isArray(plugins)) {\n while (++index < plugins.length) {\n const thing = plugins[index]\n add(thing)\n }\n } else {\n throw new TypeError('Expected a list of plugins, not `' + plugins + '`')\n }\n }\n\n /**\n * @param {Plugin} plugin\n * @param {Array<unknown>} parameters\n * @returns {undefined}\n */\n function addPlugin(plugin, parameters) {\n let index = -1\n let entryIndex = -1\n\n while (++index < attachers.length) {\n if (attachers[index][0] === plugin) {\n entryIndex = index\n break\n }\n }\n\n if (entryIndex === -1) {\n attachers.push([plugin, ...parameters])\n }\n // Only set if there was at least a `primary` value, otherwise we’d change\n // `arguments.length`.\n else if (parameters.length > 0) {\n let [primary, ...rest] = parameters\n const currentPrimary = attachers[entryIndex][1]\n if (isPlainObj(currentPrimary) && isPlainObj(primary)) {\n primary = extend(true, currentPrimary, primary)\n }\n\n attachers[entryIndex] = [plugin, primary, ...rest]\n }\n }\n }\n}\n\n// Note: this returns a *callable* instance.\n// That’s why it’s documented as a function.\n/**\n * Create a new processor.\n *\n * @example\n * This example shows how a new processor can be created (from `remark`) and linked\n * to **stdin**(4) and **stdout**(4).\n *\n * ```js\n * import process from 'node:process'\n * import concatStream from 'concat-stream'\n * import {remark} from 'remark'\n *\n * process.stdin.pipe(\n * concatStream(function (buf) {\n * process.stdout.write(String(remark().processSync(buf)))\n * })\n * )\n * ```\n *\n * @returns\n * New *unfrozen* processor (`processor`).\n *\n * This processor is configured to work the same as its ancestor.\n * When the descendant processor is configured in the future it does not\n * affect the ancestral processor.\n */\nexport const unified = new Processor().freeze()\n\n/**\n * Assert a parser is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Parser}\n */\nfunction assertParser(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `parser`')\n }\n}\n\n/**\n * Assert a compiler is available.\n *\n * @param {string} name\n * @param {unknown} value\n * @returns {asserts value is Compiler}\n */\nfunction assertCompiler(name, value) {\n if (typeof value !== 'function') {\n throw new TypeError('Cannot `' + name + '` without `compiler`')\n }\n}\n\n/**\n * Assert the processor is not frozen.\n *\n * @param {string} name\n * @param {unknown} frozen\n * @returns {asserts frozen is false}\n */\nfunction assertUnfrozen(name, frozen) {\n if (frozen) {\n throw new Error(\n 'Cannot call `' +\n name +\n '` on a frozen processor.\\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.'\n )\n }\n}\n\n/**\n * Assert `node` is a unist node.\n *\n * @param {unknown} node\n * @returns {asserts node is Node}\n */\nfunction assertNode(node) {\n // `isPlainObj` unfortunately uses `any` instead of `unknown`.\n // type-coverage:ignore-next-line\n if (!isPlainObj(node) || typeof node.type !== 'string') {\n throw new TypeError('Expected node, got `' + node + '`')\n // Fine.\n }\n}\n\n/**\n * Assert that `complete` is `true`.\n *\n * @param {string} name\n * @param {string} asyncName\n * @param {unknown} complete\n * @returns {asserts complete is true}\n */\nfunction assertDone(name, asyncName, complete) {\n if (!complete) {\n throw new Error(\n '`' + name + '` finished async. Use `' + asyncName + '` instead'\n )\n }\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {VFile}\n */\nfunction vfile(value) {\n return looksLikeAVFile(value) ? value : new VFile(value)\n}\n\n/**\n * @param {Compatible | undefined} [value]\n * @returns {value is VFile}\n */\nfunction looksLikeAVFile(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'message' in value &&\n 'messages' in value\n )\n}\n\n/**\n * @param {unknown} [value]\n * @returns {value is Value}\n */\nfunction looksLikeAValue(value) {\n return typeof value === 'string' || isUint8Array(value)\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","// To do: remove `void`s\n// To do: remove `null` from output of our APIs, allow it as user APIs.\n\n/**\n * @typedef {(error?: Error | null | undefined, ...output: Array<any>) => void} Callback\n * Callback.\n *\n * @typedef {(...input: Array<any>) => any} Middleware\n * Ware.\n *\n * @typedef Pipeline\n * Pipeline.\n * @property {Run} run\n * Run the pipeline.\n * @property {Use} use\n * Add middleware.\n *\n * @typedef {(...input: Array<any>) => void} Run\n * Call all middleware.\n *\n * Calls `done` on completion with either an error or the output of the\n * last middleware.\n *\n * > 👉 **Note**: as the length of input defines whether async functions get a\n * > `next` function,\n * > it’s recommended to keep `input` at one value normally.\n\n *\n * @typedef {(fn: Middleware) => Pipeline} Use\n * Add middleware.\n */\n\n/**\n * Create new middleware.\n *\n * @returns {Pipeline}\n * Pipeline.\n */\nexport function trough() {\n /** @type {Array<Middleware>} */\n const fns = []\n /** @type {Pipeline} */\n const pipeline = {run, use}\n\n return pipeline\n\n /** @type {Run} */\n function run(...values) {\n let middlewareIndex = -1\n /** @type {Callback} */\n const callback = values.pop()\n\n if (typeof callback !== 'function') {\n throw new TypeError('Expected function as last argument, not ' + callback)\n }\n\n next(null, ...values)\n\n /**\n * Run the next `fn`, or we’re done.\n *\n * @param {Error | null | undefined} error\n * @param {Array<any>} output\n */\n function next(error, ...output) {\n const fn = fns[++middlewareIndex]\n let index = -1\n\n if (error) {\n callback(error)\n return\n }\n\n // Copy non-nullish input into values.\n while (++index < values.length) {\n if (output[index] === null || output[index] === undefined) {\n output[index] = values[index]\n }\n }\n\n // Save the newly created `output` for the next call.\n values = output\n\n // Next or done.\n if (fn) {\n wrap(fn, next)(...output)\n } else {\n callback(null, ...output)\n }\n }\n }\n\n /** @type {Use} */\n function use(middelware) {\n if (typeof middelware !== 'function') {\n throw new TypeError(\n 'Expected `middelware` to be a function, not ' + middelware\n )\n }\n\n fns.push(middelware)\n return pipeline\n }\n}\n\n/**\n * Wrap `middleware` into a uniform interface.\n *\n * You can pass all input to the resulting function.\n * `callback` is then called with the output of `middleware`.\n *\n * If `middleware` accepts more arguments than the later given in input,\n * an extra `done` function is passed to it after that input,\n * which must be called by `middleware`.\n *\n * The first value in `input` is the main input value.\n * All other input values are the rest input values.\n * The values given to `callback` are the input values,\n * merged with every non-nullish output value.\n *\n * * if `middleware` throws an error,\n * returns a promise that is rejected,\n * or calls the given `done` function with an error,\n * `callback` is called with that error\n * * if `middleware` returns a value or returns a promise that is resolved,\n * that value is the main output value\n * * if `middleware` calls `done`,\n * all non-nullish values except for the first one (the error) overwrite the\n * output values\n *\n * @param {Middleware} middleware\n * Function to wrap.\n * @param {Callback} callback\n * Callback called with the output of `middleware`.\n * @returns {Run}\n * Wrapped middleware.\n */\nexport function wrap(middleware, callback) {\n /** @type {boolean} */\n let called\n\n return wrapped\n\n /**\n * Call `middleware`.\n * @this {any}\n * @param {Array<any>} parameters\n * @returns {void}\n */\n function wrapped(...parameters) {\n const fnExpectsCallback = middleware.length > parameters.length\n /** @type {any} */\n let result\n\n if (fnExpectsCallback) {\n parameters.push(done)\n }\n\n try {\n result = middleware.apply(this, parameters)\n } catch (error) {\n const exception = /** @type {Error} */ (error)\n\n // Well, this is quite the pickle.\n // `middleware` received a callback and called it synchronously, but that\n // threw an error.\n // The only thing left to do is to throw the thing instead.\n if (fnExpectsCallback && called) {\n throw exception\n }\n\n return done(exception)\n }\n\n if (!fnExpectsCallback) {\n if (result && result.then && typeof result.then === 'function') {\n result.then(then, done)\n } else if (result instanceof Error) {\n done(result)\n } else {\n then(result)\n }\n }\n }\n\n /**\n * Call `callback`, only once.\n *\n * @type {Callback}\n */\n function done(error, ...output) {\n if (!called) {\n called = true\n callback(error, ...output)\n }\n }\n\n /**\n * Call `done` with one value.\n *\n * @param {any} [value]\n */\n function then(value) {\n done(null, value)\n }\n}\n","/**\n * Checks if a value has the shape of a WHATWG URL object.\n *\n * Using a symbol or instanceof would not be able to recognize URL objects\n * coming from other implementations (e.g. in Electron), so instead we are\n * checking some well known properties for a lack of a better test.\n *\n * We use `href` and `protocol` as they are the only properties that are\n * easy to retrieve and calculate due to the lazy nature of the getters.\n *\n * We check for auth attribute to distinguish legacy url instance with\n * WHATWG URL instance.\n *\n * @param {unknown} fileUrlOrPath\n * File path or URL.\n * @returns {fileUrlOrPath is URL}\n * Whether it’s a URL.\n */\n// From: <https://github.com/nodejs/node/blob/6a3403c/lib/internal/url.js#L720>\nexport function isUrl(fileUrlOrPath) {\n return Boolean(\n fileUrlOrPath !== null &&\n typeof fileUrlOrPath === 'object' &&\n 'href' in fileUrlOrPath &&\n fileUrlOrPath.href &&\n 'protocol' in fileUrlOrPath &&\n fileUrlOrPath.protocol &&\n // @ts-expect-error: indexing is fine.\n fileUrlOrPath.auth === undefined\n )\n}\n","/**\n * @import {Node, Point, Position} from 'unist'\n * @import {Options as MessageOptions} from 'vfile-message'\n * @import {Compatible, Data, Map, Options, Value} from 'vfile'\n */\n\n/**\n * @typedef {object & {type: string, position?: Position | undefined}} NodeLike\n */\n\nimport {VFileMessage} from 'vfile-message'\nimport {minpath} from '#minpath'\nimport {minproc} from '#minproc'\nimport {urlToPath, isUrl} from '#minurl'\n\n/**\n * Order of setting (least specific to most), we need this because otherwise\n * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a\n * stem can be set.\n */\nconst order = /** @type {const} */ ([\n 'history',\n 'path',\n 'basename',\n 'stem',\n 'extname',\n 'dirname'\n])\n\nexport class VFile {\n /**\n * Create a new virtual file.\n *\n * `options` is treated as:\n *\n * * `string` or `Uint8Array` — `{value: options}`\n * * `URL` — `{path: options}`\n * * `VFile` — shallow copies its data over to the new file\n * * `object` — all fields are shallow copied over to the new file\n *\n * Path related fields are set in the following order (least specific to\n * most specific): `history`, `path`, `basename`, `stem`, `extname`,\n * `dirname`.\n *\n * You cannot set `dirname` or `extname` without setting either `history`,\n * `path`, `basename`, or `stem` too.\n *\n * @param {Compatible | null | undefined} [value]\n * File value.\n * @returns\n * New instance.\n */\n constructor(value) {\n /** @type {Options | VFile} */\n let options\n\n if (!value) {\n options = {}\n } else if (isUrl(value)) {\n options = {path: value}\n } else if (typeof value === 'string' || isUint8Array(value)) {\n options = {value}\n } else {\n options = value\n }\n\n /* eslint-disable no-unused-expressions */\n\n /**\n * Base of `path` (default: `process.cwd()` or `'/'` in browsers).\n *\n * @type {string}\n */\n // Prevent calling `cwd` (which could be expensive) if it’s not needed;\n // the empty string will be overridden in the next block.\n this.cwd = 'cwd' in options ? '' : minproc.cwd()\n\n /**\n * Place to store custom info (default: `{}`).\n *\n * It’s OK to store custom data directly on the file but moving it to\n * `data` is recommended.\n *\n * @type {Data}\n */\n this.data = {}\n\n /**\n * List of file paths the file moved between.\n *\n * The first is the original path and the last is the current path.\n *\n * @type {Array<string>}\n */\n this.history = []\n\n /**\n * List of messages associated with the file.\n *\n * @type {Array<VFileMessage>}\n */\n this.messages = []\n\n /**\n * Raw value.\n *\n * @type {Value}\n */\n this.value\n\n // The below are non-standard, they are “well-known”.\n // As in, used in several tools.\n /**\n * Source map.\n *\n * This type is equivalent to the `RawSourceMap` type from the `source-map`\n * module.\n *\n * @type {Map | null | undefined}\n */\n this.map\n\n /**\n * Custom, non-string, compiled, representation.\n *\n * This is used by unified to store non-string results.\n * One example is when turning markdown into React nodes.\n *\n * @type {unknown}\n */\n this.result\n\n /**\n * Whether a file was saved to disk.\n *\n * This is used by vfile reporters.\n *\n * @type {boolean}\n */\n this.stored\n /* eslint-enable no-unused-expressions */\n\n // Set path related properties in the correct order.\n let index = -1\n\n while (++index < order.length) {\n const field = order[index]\n\n // Note: we specifically use `in` instead of `hasOwnProperty` to accept\n // `vfile`s too.\n if (\n field in options &&\n options[field] !== undefined &&\n options[field] !== null\n ) {\n // @ts-expect-error: TS doesn’t understand basic reality.\n this[field] = field === 'history' ? [...options[field]] : options[field]\n }\n }\n\n /** @type {string} */\n let field\n\n // Set non-path related properties.\n for (field in options) {\n // @ts-expect-error: fine to set other things.\n if (!order.includes(field)) {\n // @ts-expect-error: fine to set other things.\n this[field] = options[field]\n }\n }\n }\n\n /**\n * Get the basename (including extname) (example: `'index.min.js'`).\n *\n * @returns {string | undefined}\n * Basename.\n */\n get basename() {\n return typeof this.path === 'string'\n ? minpath.basename(this.path)\n : undefined\n }\n\n /**\n * Set basename (including extname) (`'index.min.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} basename\n * Basename.\n * @returns {undefined}\n * Nothing.\n */\n set basename(basename) {\n assertNonEmpty(basename, 'basename')\n assertPart(basename, 'basename')\n this.path = minpath.join(this.dirname || '', basename)\n }\n\n /**\n * Get the parent path (example: `'~'`).\n *\n * @returns {string | undefined}\n * Dirname.\n */\n get dirname() {\n return typeof this.path === 'string'\n ? minpath.dirname(this.path)\n : undefined\n }\n\n /**\n * Set the parent path (example: `'~'`).\n *\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} dirname\n * Dirname.\n * @returns {undefined}\n * Nothing.\n */\n set dirname(dirname) {\n assertPath(this.basename, 'dirname')\n this.path = minpath.join(dirname || '', this.basename)\n }\n\n /**\n * Get the extname (including dot) (example: `'.js'`).\n *\n * @returns {string | undefined}\n * Extname.\n */\n get extname() {\n return typeof this.path === 'string'\n ? minpath.extname(this.path)\n : undefined\n }\n\n /**\n * Set the extname (including dot) (example: `'.js'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be set if there’s no `path` yet.\n *\n * @param {string | undefined} extname\n * Extname.\n * @returns {undefined}\n * Nothing.\n */\n set extname(extname) {\n assertPart(extname, 'extname')\n assertPath(this.dirname, 'extname')\n\n if (extname) {\n if (extname.codePointAt(0) !== 46 /* `.` */) {\n throw new Error('`extname` must start with `.`')\n }\n\n if (extname.includes('.', 1)) {\n throw new Error('`extname` cannot contain multiple dots')\n }\n }\n\n this.path = minpath.join(this.dirname, this.stem + (extname || ''))\n }\n\n /**\n * Get the full path (example: `'~/index.min.js'`).\n *\n * @returns {string}\n * Path.\n */\n get path() {\n return this.history[this.history.length - 1]\n }\n\n /**\n * Set the full path (example: `'~/index.min.js'`).\n *\n * Cannot be nullified.\n * You can set a file URL (a `URL` object with a `file:` protocol) which will\n * be turned into a path with `url.fileURLToPath`.\n *\n * @param {URL | string} path\n * Path.\n * @returns {undefined}\n * Nothing.\n */\n set path(path) {\n if (isUrl(path)) {\n path = urlToPath(path)\n }\n\n assertNonEmpty(path, 'path')\n\n if (this.path !== path) {\n this.history.push(path)\n }\n }\n\n /**\n * Get the stem (basename w/o extname) (example: `'index.min'`).\n *\n * @returns {string | undefined}\n * Stem.\n */\n get stem() {\n return typeof this.path === 'string'\n ? minpath.basename(this.path, this.extname)\n : undefined\n }\n\n /**\n * Set the stem (basename w/o extname) (example: `'index.min'`).\n *\n * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\\'`\n * on windows).\n * Cannot be nullified (use `file.path = file.dirname` instead).\n *\n * @param {string} stem\n * Stem.\n * @returns {undefined}\n * Nothing.\n */\n set stem(stem) {\n assertNonEmpty(stem, 'stem')\n assertPart(stem, 'stem')\n this.path = minpath.join(this.dirname || '', stem + (this.extname || ''))\n }\n\n // Normal prototypal methods.\n /**\n * Create a fatal message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `true` (error; file not usable)\n * and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {never}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {never}\n * Never.\n * @throws {VFileMessage}\n * Message.\n */\n fail(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = true\n\n throw message\n }\n\n /**\n * Create an info message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `undefined` (info; change\n * likely not needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n info(causeOrReason, optionsOrParentOrPlace, origin) {\n // @ts-expect-error: the overloads are fine.\n const message = this.message(causeOrReason, optionsOrParentOrPlace, origin)\n\n message.fatal = undefined\n\n return message\n }\n\n /**\n * Create a message for `reason` associated with the file.\n *\n * The `fatal` field of the message is set to `false` (warning; change may be\n * needed) and the `file` field is set to the current file path.\n * The message is added to the `messages` field on `file`.\n *\n * > 🪦 **Note**: also has obsolete signatures.\n *\n * @overload\n * @param {string} reason\n * @param {MessageOptions | null | undefined} [options]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {string} reason\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Node | NodeLike | null | undefined} parent\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {Point | Position | null | undefined} place\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @overload\n * @param {Error | VFileMessage} cause\n * @param {string | null | undefined} [origin]\n * @returns {VFileMessage}\n *\n * @param {Error | VFileMessage | string} causeOrReason\n * Reason for message, should use markdown.\n * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]\n * Configuration (optional).\n * @param {string | null | undefined} [origin]\n * Place in code where the message originates (example:\n * `'my-package:my-rule'` or `'my-rule'`).\n * @returns {VFileMessage}\n * Message.\n */\n message(causeOrReason, optionsOrParentOrPlace, origin) {\n const message = new VFileMessage(\n // @ts-expect-error: the overloads are fine.\n causeOrReason,\n optionsOrParentOrPlace,\n origin\n )\n\n if (this.path) {\n message.name = this.path + ':' + message.name\n message.file = this.path\n }\n\n message.fatal = false\n\n this.messages.push(message)\n\n return message\n }\n\n /**\n * Serialize the file.\n *\n * > **Note**: which encodings are supported depends on the engine.\n * > For info on Node.js, see:\n * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.\n *\n * @param {string | null | undefined} [encoding='utf8']\n * Character encoding to understand `value` as when it’s a `Uint8Array`\n * (default: `'utf-8'`).\n * @returns {string}\n * Serialized file.\n */\n toString(encoding) {\n if (this.value === undefined) {\n return ''\n }\n\n if (typeof this.value === 'string') {\n return this.value\n }\n\n const decoder = new TextDecoder(encoding || undefined)\n return decoder.decode(this.value)\n }\n}\n\n/**\n * Assert that `part` is not a path (as in, does not contain `path.sep`).\n *\n * @param {string | null | undefined} part\n * File path part.\n * @param {string} name\n * Part name.\n * @returns {undefined}\n * Nothing.\n */\nfunction assertPart(part, name) {\n if (part && part.includes(minpath.sep)) {\n throw new Error(\n '`' + name + '` cannot be a path: did not expect `' + minpath.sep + '`'\n )\n }\n}\n\n/**\n * Assert that `part` is not empty.\n *\n * @param {string | undefined} part\n * Thing.\n * @param {string} name\n * Part name.\n * @returns {asserts part is string}\n * Nothing.\n */\nfunction assertNonEmpty(part, name) {\n if (!part) {\n throw new Error('`' + name + '` cannot be empty')\n }\n}\n\n/**\n * Assert `path` exists.\n *\n * @param {string | undefined} path\n * Path.\n * @param {string} name\n * Dependency name.\n * @returns {asserts path is string}\n * Nothing.\n */\nfunction assertPath(path, name) {\n if (!path) {\n throw new Error('Setting `' + name + '` requires `path` to be set too')\n }\n}\n\n/**\n * Assert `value` is an `Uint8Array`.\n *\n * @param {unknown} value\n * thing.\n * @returns {value is Uint8Array}\n * Whether `value` is an `Uint8Array`.\n */\nfunction isUint8Array(value) {\n return Boolean(\n value &&\n typeof value === 'object' &&\n 'byteLength' in value &&\n 'byteOffset' in value\n )\n}\n","export const CallableInstance =\n /**\n * @type {new <Parameters extends Array<unknown>, Result>(property: string | symbol) => (...parameters: Parameters) => Result}\n */\n (\n /** @type {unknown} */\n (\n /**\n * @this {Function}\n * @param {string | symbol} property\n * @returns {(...parameters: Array<unknown>) => unknown}\n */\n function (property) {\n const self = this\n const constr = self.constructor\n const proto = /** @type {Record<string | symbol, Function>} */ (\n // Prototypes do exist.\n // type-coverage:ignore-next-line\n constr.prototype\n )\n const value = proto[property]\n /** @type {(...parameters: Array<unknown>) => unknown} */\n const apply = function () {\n return value.apply(apply, arguments)\n }\n\n Object.setPrototypeOf(apply, proto)\n\n // Not needed for us in `unified`: we only call this on the `copy`\n // function,\n // and we don't need to add its fields (`length`, `name`)\n // over.\n // See also: GH-246.\n // const names = Object.getOwnPropertyNames(value)\n //\n // for (const p of names) {\n // const descriptor = Object.getOwnPropertyDescriptor(value, p)\n // if (descriptor) Object.defineProperty(apply, p, descriptor)\n // }\n\n return apply\n }\n )\n )\n","/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>\n *\n * @type {Array<ConstructName>}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n","// To do: next major: remove.\n/**\n * @typedef {Options} MarkdownTableOptions\n * Configuration.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [alignDelimiters=true]\n * Whether to align the delimiters (default: `true`);\n * they are aligned by default:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {ReadonlyArray<string | null | undefined> | string | null | undefined} [align]\n * How to align columns (default: `''`);\n * one style for all columns or styles for their respective columns;\n * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);\n * other values are treated as `''`, which doesn’t place the colon in the\n * alignment row but does align left;\n * *only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean | null | undefined} [delimiterEnd=true]\n * Whether to end each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean | null | undefined} [delimiterStart=true]\n * Whether to begin each row with the delimiter (default: `true`).\n *\n * > 👉 **Note**: please don’t use this: it could create fragile structures\n * > that aren’t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean | null | undefined} [padding=true]\n * Whether to add a space of padding between delimiters and cells\n * (default: `true`).\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {((value: string) => number) | null | undefined} [stringLength]\n * Function to detect the length of table cell content (optional);\n * this is used when aligning the delimiters (`|`) between table cells;\n * full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source;\n * to fix this, you can pass this function,\n * which receives the cell content and returns its “visible” size;\n * note that what is and isn’t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['中文', 'Charlie'],\n * ['👩‍❤️‍👩', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | 中文 | Charlie |\n * | 👩‍❤️‍👩 | Delta |\n * ```\n */\n\n/**\n * @param {string} value\n * Cell value.\n * @returns {number}\n * Cell size.\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * Generate a markdown\n * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))\n * table.\n *\n * @param {ReadonlyArray<ReadonlyArray<string | null | undefined>>} table\n * Table data (matrix of strings).\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Result.\n */\nexport function markdownTable(table, options) {\n const settings = options || {}\n // To do: next major: change to spread.\n const align = (settings.align || []).concat()\n const stringLength = settings.stringLength || defaultStringLength\n /** @type {Array<number>} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array<Array<string>>} Cells per row. */\n const cellMatrix = []\n /** @type {Array<Array<number>>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array<number>} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don’t align delimiters, but otherwise we’d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array<string>} */\n const row = []\n /** @type {Array<number>} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n settings.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array<string>} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array<string>} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (settings.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n settings.padding !== false &&\n // Don’t add the opening space if we’re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === '') &&\n (settings.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (settings.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (settings.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (settings.padding !== false) {\n line.push(' ')\n }\n\n if (\n settings.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n settings.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string | null | undefined} [value]\n * Value to serialize.\n * @returns {string}\n * Result.\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string | null | undefined} value\n * Value.\n * @returns {number}\n * Alignment.\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n","/**\n * @import {EncodeSides} from '../types.js'\n */\n\nimport {classifyCharacter} from 'micromark-util-classify-character'\n\n/**\n * Check whether to encode (as a character reference) the characters\n * surrounding an attention run.\n *\n * Which characters are around an attention run influence whether it works or\n * not.\n *\n * See <https://github.com/orgs/syntax-tree/discussions/60> for more info.\n * See this markdown in a particular renderer to see what works:\n *\n * ```markdown\n * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |\n * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |\n * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |\n * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |\n * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |\n * | 4 (nothing outside) | *x* | *.* | * * | ** |\n * ```\n *\n * @param {number} outside\n * Code point on the outer side of the run.\n * @param {number} inside\n * Code point on the inner side of the run.\n * @param {'*' | '_'} marker\n * Marker of the run.\n * Underscores are handled more strictly (they form less often) than\n * asterisks.\n * @returns {EncodeSides}\n * Whether to encode characters.\n */\n// Important: punctuation must never be encoded.\n// Punctuation is solely used by markdown constructs.\n// And by encoding itself.\n// Encoding them will break constructs or double encode things.\nexport function encodeInfo(outside, inside, marker) {\n const outsideKind = classifyCharacter(outside)\n const insideKind = classifyCharacter(inside)\n\n // Letter outside:\n if (outsideKind === undefined) {\n return insideKind === undefined\n ? // Letter inside:\n // we have to encode *both* letters for `_` as it is looser.\n // it already forms for `*` (and GFMs `~`).\n marker === '_'\n ? {inside: true, outside: true}\n : {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (letter, whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: encode outer (letter)\n {inside: false, outside: true}\n }\n\n // Whitespace outside:\n if (outsideKind === 1) {\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n }\n\n // Punctuation outside:\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode inner (whitespace).\n {inside: true, outside: false}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Heading} from 'mdast'\n */\n\nimport {EXIT, visit} from 'unist-util-visit'\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Heading} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatHeadingAsSetext(node, state) {\n let literalWithBreak = false\n\n // Look for literals with a line break.\n // Note that this also\n visit(node, function (node) {\n if (\n ('value' in node && /\\r?\\n|\\r/.test(node.value)) ||\n node.type === 'break'\n ) {\n literalWithBreak = true\n return EXIT\n }\n })\n\n return Boolean(\n (!node.depth || node.depth < 3) &&\n toString(node) &&\n (state.options.setext || literalWithBreak)\n )\n}\n","/**\n * @import {Html} from 'mdast'\n */\n\nhtml.peek = htmlPeek\n\n/**\n * @param {Html} node\n * @returns {string}\n */\nexport function html(node) {\n return node.value || ''\n}\n\n/**\n * @returns {string}\n */\nfunction htmlPeek() {\n return '<'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {ImageReference, Parents} from 'mdast'\n */\n\nimageReference.peek = imageReferencePeek\n\n/**\n * @param {ImageReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function imageReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('imageReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n const alt = state.safe(node.alt, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(alt + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !alt || alt !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imageReferencePeek() {\n return '!'\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {InlineCode, Parents} from 'mdast'\n */\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @param {InlineCode} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nexport function inlineCode(node, _, state) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @returns {string}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {LinkReference, Parents} from 'mdast'\n */\n\nlinkReference.peek = linkReferencePeek\n\n/**\n * @param {LinkReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function linkReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('linkReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n const text = state.containerPhrasing(node, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(text + '][')\n\n subexit()\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !text || text !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction linkReferencePeek() {\n return '['\n}\n","/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml(),\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml(),\n gfmTableHtml(),\n gfmTagfilterHtml(),\n gfmTaskListItemHtml()\n ])\n}\n","/**\n * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { blankLine } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n name: 'gfmFootnoteDefinition',\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: 'gfmFootnoteCall',\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: 'gfmPotentialFootnoteCall',\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {Token} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n\n // Exit if we’ve walked far enough.\n if (token.type === 'gfmFootnoteCall' || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return ok(code);\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n /** @type {Token | undefined} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === 'enter') {\n labelStart = events[index][1];\n break;\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n // Increment the end 1 character.\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n /** @type {Token} */\n const chunk = {\n type: \"chunkString\",\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n\n /** @type {Array<Event>} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1], events[index + 2], ['enter', call, context],\n // The `[`\n events[index + 3], events[index + 4],\n // The `^`.\n ['enter', marker, context], ['exit', marker, context],\n // Everything in between.\n ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2], events[events.length - 1], ['exit', call, context]];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n /** @type {boolean} */\n let data;\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can’t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start;\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall');\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return callStart;\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code);\n effects.enter('gfmFootnoteCallMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallMarker');\n effects.enter('gfmFootnoteCallString');\n effects.enter('chunkString').contentType = 'string';\n return callData;\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteCallString');\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n effects.exit('gfmFootnoteCall');\n return ok;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? callEscape : callData;\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return callData;\n }\n return callData(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {string} */\n let identifier;\n let size = 0;\n /** @type {boolean | undefined} */\n let data;\n return start;\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true;\n effects.enter('gfmFootnoteDefinitionLabel');\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n return labelAtMarker;\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionMarker');\n effects.enter('gfmFootnoteDefinitionLabelString');\n effects.enter('chunkString').contentType = 'string';\n return labelInside;\n }\n return nok(code);\n }\n\n /**\n * In label.\n *\n * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteDefinitionLabelString');\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n effects.exit('gfmFootnoteDefinitionLabel');\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > <https://github.com/github/cmark-gfm/issues/240>\n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker');\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');\n }\n return nok(code);\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition');\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);\n }\n}","/**\n * @import {Options} from 'micromark-extension-gfm-strikethrough'\n * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: 'strikethrough',\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n };\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'strikethroughSequenceTemporary' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'strikethroughSequenceTemporary' && events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = 'strikethroughSequence';\n events[open][1].type = 'strikethroughSequence';\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n\n // Opening.\n /** @type {Array<Event>} */\n const nextEvents = [['enter', strikethrough, context], ['enter', events[open][1], context], ['exit', events[open][1], context], ['enter', text, context]];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n // Between.\n splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [['exit', text, context], ['enter', events[index][1], context], ['exit', events[index][1], context], ['exit', strikethrough, context]]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = \"data\";\n }\n }\n return events;\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous;\n const events = this.events;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (previous === 126 && events[events.length - 1][1].type !== \"characterEscape\") {\n return nok(code);\n }\n effects.enter('strikethroughSequenceTemporary');\n return more(code);\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous);\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code);\n effects.consume(code);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code);\n const token = effects.exit('strikethroughSequenceTemporary');\n const after = classifyCharacter(code);\n token._open = !after || after === 2 && Boolean(before);\n token._close = !before || before === 2 && Boolean(after);\n return ok(code);\n }\n }\n}","export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it’s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n","/**\n * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: 'wwwAutolink',\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: 'protocolAutolink',\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: 'emailAutolink',\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\n\n/** @type {ConstructRecord} */\nconst text = {};\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n };\n}\n\n/** @type {Code} */\nlet code = 48;\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\n\n// To do: perform email autolink literals on events, afterwards.\n// That’s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this;\n /** @type {boolean | undefined} */\n let dot;\n /** @type {boolean} */\n let data;\n return start;\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkEmail');\n return atext(code);\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code);\n return atext;\n }\n if (code === 64) {\n effects.consume(code);\n return emailDomain;\n }\n return nok(code);\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true;\n effects.consume(code);\n return emailDomain;\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we’d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn’t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code);\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code);\n dot = true;\n return emailDomain;\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail');\n effects.exit('literalAutolink');\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this;\n return wwwStart;\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkWww');\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this;\n let buffer = '';\n let seen = false;\n return protocolStart;\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkHttp');\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n return nok(code);\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code);\n return protocolSlashesInside;\n }\n }\n return nok(code);\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code);\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0;\n return wwwPrefixInside;\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++;\n effects.consume(code);\n return wwwPrefixInside;\n }\n if (code === 46 && size === 3) {\n effects.consume(code);\n return wwwPrefixAfter;\n }\n return nok(code);\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code);\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment;\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment;\n /** @type {boolean | undefined} */\n let seen;\n return domainInside;\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code);\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.點看.com`,\n // so that’s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {\n return domainAfter(code);\n }\n seen = true;\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true;\n }\n // Otherwise, it’s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = undefined;\n }\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that’s GH says a dot is needed, but it’s not true:\n // <https://github.com/github/cmark-gfm/issues/279>\n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code);\n }\n return ok(code);\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++;\n effects.consume(code);\n return pathInside;\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don’t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code);\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {\n return effects.check(trail, ok, pathAtPunctuation)(code);\n }\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n effects.consume(code);\n return pathInside;\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++;\n }\n effects.consume(code);\n return pathInside;\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail;\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {\n effects.consume(code);\n return trail;\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code);\n return trailCharacterReferenceStart;\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // <https://github.com/github/cmark-gfm/issues/278>.\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In trail, after `]`.\n *\n * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return trail(code);\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&amp;).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceStart(code) {\n // When non-alpha, it’s not a trail.\n return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&amp;).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code);\n return trail;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return trailCharacterReferenceInside;\n }\n\n // It’s not a trail.\n return nok(code);\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start;\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code);\n return after;\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code);\n }\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);\n}\n\n/**\n * See:\n * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code);\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash “inside” atext.\n // The reference code is a bit weird, but that’s what it results in.\n // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code));\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);\n}\n\n/**\n * @param {Array<Event>} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {\n result = true;\n break;\n }\n\n // If we’ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as “walked into” w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}","/**\n * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nconst tasklistCheck = {\n name: 'tasklistCheck',\n tokenize: tokenizeTasklistCheck\n};\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this;\n return open;\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there’s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem) {\n return nok(code);\n }\n effects.enter('taskListCheck');\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n return inside;\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked');\n effects.consume(code);\n effects.exit('taskListCheckValueUnchecked');\n return close;\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked');\n effects.consume(code);\n effects.exit('taskListCheckValueChecked');\n return close;\n }\n return nok(code);\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n effects.exit('taskListCheck');\n return after;\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code);\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok, nok)(code);\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, \"whitespace\");\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there’s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code);\n }\n}","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Image, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\nimage.peek = imagePeek\n\n/**\n * @param {Image} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function image(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('image')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n value += tracker.move(\n state.safe(node.alt, {before: value, after: ']', ...tracker.current()})\n )\n value += tracker.move('](')\n\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n exit()\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imagePeek() {\n return '!'\n}\n","/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array<ConstructName>} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/gu, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array<PhrasingContent> | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n // If it’s an email, the previous character should not be a slash.\n (!email || code !== 47)\n )\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['fence'], null | undefined>}\n */\nexport function checkFence(state) {\n const marker = state.options.fence || '`'\n\n if (marker !== '`' && marker !== '~') {\n throw new Error(\n 'Cannot serialize code with `' +\n marker +\n '` for `options.fence`, expected `` ` `` or `~`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['quote'], null | undefined>}\n */\nexport function checkQuote(state) {\n const marker = state.options.quote || '\"'\n\n if (marker !== '\"' && marker !== \"'\") {\n throw new Error(\n 'Cannot serialize title with `' +\n marker +\n '` for `options.quote`, expected `\"`, or `\\'`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['emphasis'], null | undefined>}\n */\nexport function checkEmphasis(state) {\n const marker = state.options.emphasis || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize emphasis with `' +\n marker +\n '` for `options.emphasis`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['bullet'], null | undefined>}\n */\nexport function checkBullet(state) {\n const marker = state.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['bulletOrdered'], null | undefined>}\n */\nexport function checkBulletOrdered(state) {\n const marker = state.options.bulletOrdered || '.'\n\n if (marker !== '.' && marker !== ')') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bulletOrdered`, expected `.` or `)`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['rule'], null | undefined>}\n */\nexport function checkRule(state) {\n const marker = state.options.rule || '*'\n\n if (marker !== '*' && marker !== '-' && marker !== '_') {\n throw new Error(\n 'Cannot serialize rules with `' +\n marker +\n '` for `options.rule`, expected `*`, `-`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['listItemIndent'], null | undefined>}\n */\nexport function checkListItemIndent(state) {\n const style = state.options.listItemIndent || 'one'\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['strong'], null | undefined>}\n */\nexport function checkStrong(state) {\n const marker = state.options.strong || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize strong with `' +\n marker +\n '` for `options.strong`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['ruleRepetition'], null | undefined>}\n */\nexport function checkRuleRepetition(state) {\n const repetition = state.options.ruleRepetition || 3\n\n if (repetition < 3) {\n throw new Error(\n 'Cannot serialize rules with repetition `' +\n repetition +\n '` for `options.ruleRepetition`, expected `3` or more'\n )\n }\n\n return repetition\n}\n","/**\n * Encode a code point as a character reference.\n *\n * @param {number} code\n * Code point to encode.\n * @returns {string}\n * Encoded character reference.\n */\nexport function encodeCharacterReference(code) {\n return '&#x' + code.toString(16).toUpperCase() + ';'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Strong} from 'mdast'\n */\n\nimport {checkStrong} from '../util/check-strong.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nstrong.peek = strongPeek\n\n/**\n * @param {Strong} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function strong(node, _, state, info) {\n const marker = checkStrong(state)\n const exit = state.enter('strong')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker + marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker + marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Strong} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction strongPeek(_, _1, state) {\n return state.options.strong || '*'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Emphasis, Parents} from 'mdast'\n */\n\nimport {checkEmphasis} from '../util/check-emphasis.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nemphasis.peek = emphasisPeek\n\n/**\n * @param {Emphasis} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function emphasis(node, _, state, info) {\n const marker = checkEmphasis(state)\n const exit = state.enter('emphasis')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Emphasis} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction emphasisPeek(_, _1, state) {\n return state.options.emphasis || '*'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Link, Parents} from 'mdast'\n * @import {Exit} from '../types.js'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\nimport {formatLinkAsAutolink} from '../util/format-link-as-autolink.js'\n\nlink.peek = linkPeek\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function link(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const tracker = state.createTracker(info)\n /** @type {Exit} */\n let exit\n /** @type {Exit} */\n let subexit\n\n if (formatLinkAsAutolink(node, state)) {\n // Hide the fact that we’re in phrasing, because escapes don’t work.\n const stack = state.stack\n state.stack = []\n exit = state.enter('autolink')\n let value = tracker.move('<')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '>',\n ...tracker.current()\n })\n )\n value += tracker.move('>')\n exit()\n state.stack = stack\n return value\n }\n\n exit = state.enter('link')\n subexit = state.enter('label')\n let value = tracker.move('[')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '](',\n ...tracker.current()\n })\n )\n value += tracker.move('](')\n subexit()\n\n if (\n // If there’s no url but there is a title…\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n\n exit()\n return value\n}\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nfunction linkPeek(node, _, state) {\n return formatLinkAsAutolink(node, state) ? '<' : '['\n}\n","/**\n * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Array<ConstructName>} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array<ConstructName>} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (typeof list === 'string') {\n list = [list]\n }\n\n if (!list || list.length === 0) {\n return none\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['rect', { x: '9', y: '9', width: '6', height: '6', rx: '1', key: '1ssd4o' }],\n];\n\n/**\n * @component @name CircleStop\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle-stop\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleStop = createLucideIcon('circle-stop', __iconNode);\n\nexport default CircleStop;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z',\n key: '117uat',\n },\n ],\n ['path', { d: 'M6 12h16', key: 's4cdu5' }],\n];\n\n/**\n * @component @name SendHorizontal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMy43MTQgMy4wNDhhLjQ5OC40OTggMCAwIDAtLjY4My42MjdsMi44NDMgNy42MjdhMiAyIDAgMCAxIDAgMS4zOTZsLTIuODQyIDcuNjI3YS40OTguNDk4IDAgMCAwIC42ODIuNjI3bDE4LTguNWEuNS41IDAgMCAwIDAtLjkwNHoiIC8+CiAgPHBhdGggZD0iTTYgMTJoMTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/send-horizontal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SendHorizontal = createLucideIcon('send-horizontal', __iconNode);\n\nexport default SendHorizontal;\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Code} from 'mdast'\n */\n\n/**\n * @param {Code} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatCodeAsIndented(node, state) {\n return Boolean(\n state.options.fences === false &&\n node.value &&\n // If there’s no info…\n !node.lang &&\n // And there’s a non-whitespace character…\n /[^ \\r\\n]/.test(node.value) &&\n // And the value doesn’t start or end in a blank…\n !/^[\\t ]*(?:[\\r\\n]|$)|(?:^|[\\r\\n])[\\t ]*$/.test(node.value)\n )\n}\n","/**\n * Count how often a character (or substring) is used in a string.\n *\n * @param {string} value\n * Value to search in.\n * @param {string} character\n * Character (or substring) to look for.\n * @return {number}\n * Number of times `character` occurred in `value`.\n */\nexport function ccount(value, character) {\n const source = String(value)\n\n if (typeof character !== 'string') {\n throw new TypeError('Expected character')\n }\n\n let count = 0\n let index = source.indexOf(character)\n\n while (index !== -1) {\n count++\n index = source.indexOf(character, index + character.length)\n }\n\n return count\n}\n","/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n","/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\nimport {checkBullet} from './check-bullet.js'\n\n/**\n * @param {State} state\n * @returns {Exclude<Options['bullet'], null | undefined>}\n */\nexport function checkBulletOther(state) {\n const bullet = checkBullet(state)\n const bulletOther = state.options.bulletOther\n\n if (!bulletOther) {\n return bullet === '*' ? '-' : '*'\n }\n\n if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n bulletOther +\n '` for `options.bulletOther`, expected `*`, `+`, or `-`'\n )\n }\n\n if (bulletOther === bullet) {\n throw new Error(\n 'Expected `bullet` (`' +\n bullet +\n '`) and `bulletOther` (`' +\n bulletOther +\n '`) to be different'\n )\n }\n\n return bulletOther\n}\n","/**\n * @import {Root} from 'mdast'\n * @import {Options} from 'remark-gfm'\n * @import {} from 'remark-parse'\n * @import {} from 'remark-stringify'\n * @import {Processor} from 'unified'\n */\n\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {gfm} from 'micromark-extension-gfm'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Add support GFM (autolink literals, footnotes, strikethrough, tables,\n * tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkGfm(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor<Root>} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(gfm(settings))\n fromMarkdownExtensions.push(gfmFromMarkdown())\n toMarkdownExtensions.push(gfmToMarkdown(settings))\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Paragraph, Parents} from 'mdast'\n */\n\n/**\n * @param {Paragraph} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function paragraph(node, _, state, info) {\n const exit = state.enter('paragraph')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, info)\n subexit()\n exit()\n return value\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Link} from 'mdast'\n */\n\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Link} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatLinkAsAutolink(node, state) {\n const raw = toString(node)\n\n return Boolean(\n !state.options.resourceLink &&\n // If there’s a url…\n node.url &&\n // And there’s a no title…\n !node.title &&\n // And the content of `node` is a single text node…\n node.children &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n // And if the url is the same as the content…\n (raw === node.url || 'mailto:' + raw === node.url) &&\n // And that starts w/ a protocol…\n /^[a-z][a-z+.-]+:/i.test(node.url) &&\n // And that doesn’t contain ASCII control codes (character escapes and\n // references don’t work), space, or angle brackets…\n !/[\\0- <>\\u007F]/.test(node.url)\n )\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Text} from 'mdast'\n */\n\n/**\n * @param {Text} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function text(node, _, state, info) {\n return state.safe(node.value, info)\n}\n","/**\n * @import {Blockquote, Parents} from 'mdast'\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Blockquote} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function blockquote(node, _, state, info) {\n const exit = state.enter('blockquote')\n const tracker = state.createTracker(info)\n tracker.move('> ')\n tracker.shift(2)\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return '>' + (blank ? '' : ' ') + line\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Root} from 'mdast'\n */\n\nimport {phrasing} from 'mdast-util-phrasing'\n\n/**\n * @param {Root} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function root(node, _, state, info) {\n // Note: `html` nodes are ambiguous.\n const hasPhrasing = node.children.some(function (d) {\n return phrasing(d)\n })\n\n const container = hasPhrasing ? state.containerPhrasing : state.containerFlow\n return container.call(state, node, info)\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Definition, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\n/**\n * @param {Definition} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function definition(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('definition')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n value += tracker.move(\n state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n )\n value += tracker.move(']: ')\n\n subexit()\n\n if (\n // If there’s no url, or…\n !node.url ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : '\\n',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n exit()\n\n return value\n}\n","/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Parents, ThematicBreak} from 'mdast'\n */\n\nimport {checkRuleRepetition} from '../util/check-rule-repetition.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {ThematicBreak} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nexport function thematicBreak(_, _1, state) {\n const value = (\n checkRule(state) + (state.options.ruleSpaces ? ' ' : '')\n ).repeat(checkRuleRepetition(state))\n\n return state.options.ruleSpaces ? value.slice(0, -1) : value\n}\n","/**\n * @import {Break, Parents} from 'mdast'\n * @import {Info, State} from 'mdast-util-to-markdown'\n */\n\nimport {patternInScope} from '../util/pattern-in-scope.js'\n\n/**\n * @param {Break} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function hardBreak(_, _1, state, info) {\n let index = -1\n\n while (++index < state.unsafe.length) {\n // If we can’t put eols in this construct (setext headings, tables), use a\n // space instead.\n if (\n state.unsafe[index].character === '\\n' &&\n patternInScope(state.stack, state.unsafe[index])\n ) {\n return /[ \\t]/.test(info.before) ? '' : ' '\n }\n }\n\n return '\\\\\\n'\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Heading, Parents} from 'mdast'\n */\n\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'\n\n/**\n * @param {Heading} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function heading(node, _, state, info) {\n const rank = Math.max(Math.min(6, node.depth || 1), 1)\n const tracker = state.createTracker(info)\n\n if (formatHeadingAsSetext(node, state)) {\n const exit = state.enter('headingSetext')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...tracker.current(),\n before: '\\n',\n after: '\\n'\n })\n subexit()\n exit()\n\n return (\n value +\n '\\n' +\n (rank === 1 ? '=' : '-').repeat(\n // The whole size…\n value.length -\n // Minus the position of the character after the last EOL (or\n // 0 if there is none)…\n (Math.max(value.lastIndexOf('\\r'), value.lastIndexOf('\\n')) + 1)\n )\n )\n }\n\n const sequence = '#'.repeat(rank)\n const exit = state.enter('headingAtx')\n const subexit = state.enter('phrasing')\n\n // Note: for proper tracking, we should reset the output positions when there\n // is no content returned, because then the space is not output.\n // Practically, in that case, there is no content, so it doesn’t matter that\n // we’ve tracked one too many characters.\n tracker.move(sequence + ' ')\n\n let value = state.containerPhrasing(node, {\n before: '# ',\n after: '\\n',\n ...tracker.current()\n })\n\n if (/^[\\t ]/.test(value)) {\n // To do: what effect has the character reference on tracking?\n value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1)\n }\n\n value = value ? sequence + ' ' + value : sequence\n\n if (state.options.closeAtx) {\n value += ' ' + sequence\n }\n\n subexit()\n exit()\n\n return value\n}\n","/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {ListItem, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\n\n/**\n * @param {ListItem} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function listItem(node, parent, state, info) {\n const listItemIndent = checkListItemIndent(state)\n let bullet = state.bulletCurrent || checkBullet(state)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (state.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = state.createTracker(info)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = state.enter('listItem')\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n","/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {Code, Parents} from 'mdast'\n */\n\nimport {longestStreak} from 'longest-streak'\nimport {formatCodeAsIndented} from '../util/format-code-as-indented.js'\nimport {checkFence} from '../util/check-fence.js'\n\n/**\n * @param {Code} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function code(node, _, state, info) {\n const marker = checkFence(state)\n const raw = node.value || ''\n const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'\n\n if (formatCodeAsIndented(node, state)) {\n const exit = state.enter('codeIndented')\n const value = state.indentLines(raw, map)\n exit()\n return value\n }\n\n const tracker = state.createTracker(info)\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))\n const exit = state.enter('codeFenced')\n let value = tracker.move(sequence)\n\n if (node.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`)\n value += tracker.move(\n state.safe(node.lang, {\n before: value,\n after: ' ',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n if (node.lang && node.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`)\n value += tracker.move(' ')\n value += tracker.move(\n state.safe(node.meta, {\n before: value,\n after: '\\n',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return (blank ? '' : ' ') + line\n}\n","/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {List, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkBulletOther} from '../util/check-bullet-other.js'\nimport {checkBulletOrdered} from '../util/check-bullet-ordered.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {List} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function list(node, parent, state, info) {\n const exit = state.enter('list')\n const bulletCurrent = state.bulletCurrent\n /** @type {string} */\n let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state)\n /** @type {string} */\n const bulletOther = node.ordered\n ? bullet === '.'\n ? ')'\n : '.'\n : checkBulletOther(state)\n let useDifferentMarker =\n parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false\n\n if (!node.ordered) {\n const firstListItem = node.children ? node.children[0] : undefined\n\n // If there’s an empty first list item directly in two list items,\n // we have to use a different bullet:\n //\n // ```markdown\n // * - *\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (\n // Bullet could be used as a thematic break marker:\n (bullet === '*' || bullet === '-') &&\n // Empty first list item:\n firstListItem &&\n (!firstListItem.children || !firstListItem.children[0]) &&\n // Directly in two other list items:\n state.stack[state.stack.length - 1] === 'list' &&\n state.stack[state.stack.length - 2] === 'listItem' &&\n state.stack[state.stack.length - 3] === 'list' &&\n state.stack[state.stack.length - 4] === 'listItem' &&\n // That are each the first child.\n state.indexStack[state.indexStack.length - 1] === 0 &&\n state.indexStack[state.indexStack.length - 2] === 0 &&\n state.indexStack[state.indexStack.length - 3] === 0\n ) {\n useDifferentMarker = true\n }\n\n // If there’s a thematic break at the start of the first list item,\n // we have to use a different bullet:\n //\n // ```markdown\n // * ---\n // ```\n //\n // …because otherwise it would become one big thematic break.\n if (checkRule(state) === bullet && firstListItem) {\n let index = -1\n\n while (++index < node.children.length) {\n const item = node.children[index]\n\n if (\n item &&\n item.type === 'listItem' &&\n item.children &&\n item.children[0] &&\n item.children[0].type === 'thematicBreak'\n ) {\n useDifferentMarker = true\n break\n }\n }\n }\n }\n\n if (useDifferentMarker) {\n bullet = bulletOther\n }\n\n state.bulletCurrent = bullet\n const value = state.containerFlow(node, info)\n state.bulletLastUsed = bullet\n state.bulletCurrent = bulletCurrent\n exit()\n return value\n}\n","/**\n * @typedef {import('mdast').Html} Html\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Check if the given value is *phrasing content*.\n *\n * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @returns\n * Whether `value` is phrasing content.\n */\n\nexport const phrasing =\n /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */\n (\n convert([\n 'break',\n 'delete',\n 'emphasis',\n // To do: next major: removed since footnotes were added to GFM.\n 'footnote',\n 'footnoteReference',\n 'image',\n 'imageReference',\n 'inlineCode',\n // Enabled by `mdast-util-math`:\n 'inlineMath',\n 'link',\n 'linkReference',\n // Enabled by `mdast-util-mdx`:\n 'mdxJsxTextElement',\n // Enabled by `mdast-util-mdx`:\n 'mdxTextExpression',\n 'strong',\n 'text',\n // Enabled by `mdast-util-directive`:\n 'textDirective'\n ])\n )\n","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {'center' | 'left' | 'none' | 'right'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Readonly<Array<Event>>} events\n * List of events.\n * @param {number} index\n * Table enter event.\n * @returns {Array<Align>}\n * List of aligns.\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false;\n /** @type {Array<Align>} */\n const align = [];\n while (index < events.length) {\n const event = events[index];\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(events[index + 1][1].type === 'tableDelimiterMarker' ? 'left' : 'none');\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1;\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right';\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break;\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true;\n }\n index += 1;\n }\n return align;\n}","/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We’re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, state, info) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = defaultHandlers.listItem(node, parent, state, {\n ...info,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n","import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {definition} from './definition.js'\nimport {emphasis} from './emphasis.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {image} from './image.js'\nimport {imageReference} from './image-reference.js'\nimport {inlineCode} from './inline-code.js'\nimport {link} from './link.js'\nimport {linkReference} from './link-reference.js'\nimport {list} from './list.js'\nimport {listItem} from './list-item.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default (CommonMark) handlers.\n */\nexport const handle = {\n blockquote,\n break: hardBreak,\n code,\n definition,\n emphasis,\n hardBreak,\n heading,\n html,\n image,\n imageReference,\n inlineCode,\n link,\n linkReference,\n list,\n listItem,\n paragraph,\n root,\n strong,\n text,\n thematicBreak\n}\n","/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don’t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn’t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it’s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we’ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn’t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it’s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we’re here, we’re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That’s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly<TokenizeContext>} context\n * @param {Readonly<Range>} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two “between” parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly<EditMap>} map\n * @param {Readonly<TokenizeContext>} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array<Event>} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * @param {Readonly<Array<Event>>} events\n * @param {number} index\n * @returns {Readonly<Point>}\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}","/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it’s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it’s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array<Event>]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array<Change>}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array<Event>} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImplementation(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array<Event>} events\n * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array<Jump>} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array<Array<Event>>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array<Event>} add\n * @returns {undefined}\n */\nfunction addImplementation(editMap, at, remove, add) {\n let index = 0;\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return;\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove;\n\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add);\n // }\n\n return;\n }\n index += 1;\n }\n editMap.map.push([at, remove, add]);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array<Event>} events\n// * @param {Array<Jump>} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }","/**\n * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'\n * @import {Options} from 'mdast-util-gfm'\n * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array<FromMarkdownExtension>}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n","/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').TableRow} TableRow\n *\n * @typedef {import('markdown-table').Options} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').State} State\n * @typedef {import('mdast-util-to-markdown').Info} Info\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: []\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don’t (but can’t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>\n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, state, info) {\n return serializeData(handleTableAsData(node, state, info), node.align)\n }\n\n /**\n * This function isn’t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array<Array<string>>} matrix\n * @param {Array<string | null | undefined> | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array<Array<string>>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableRowAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array<string>} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, state) {\n let value = defaultHandlers.inlineCode(node, parent, state)\n\n if (state.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n","/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array<Parents>, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) — whole match\n * * `...capture` (`Array<string>`) — matches from regex capture groups\n * * `match` (`RegExpMatchObject`) — info on the match\n * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * …or when `false`, do not replace at all\n * * …or when `string`, replace with a text node of that value\n * * …or when `Node` or `Array<Node>`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array<Pair>} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {BuildVisitor<Root, 'text'>} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array<Nodes> | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array<Parents>} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array<Nodes>} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array<PhrasingContent>} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn’t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n","'use strict'\n\nconst hasBuffer = typeof Buffer !== 'undefined'\nconst suspectProtoRx = /\"(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])\"\\s*:/\nconst suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/\n\n/**\n * @description Internal parse function that parses JSON text with security checks.\n * @private\n * @param {string|Buffer} text - The JSON text string or Buffer to parse.\n * @param {Function} [reviver] - The JSON.parse() optional reviver argument.\n * @param {import('./types').ParseOptions} [options] - Optional configuration object.\n * @returns {*} The parsed object.\n * @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or\n * `options.constructorAction` is `'error'`.\n */\nfunction _parse (text, reviver, options) {\n // Normalize arguments\n if (options == null) {\n if (reviver !== null && typeof reviver === 'object') {\n options = reviver\n reviver = undefined\n }\n }\n\n if (hasBuffer && Buffer.isBuffer(text)) {\n text = text.toString()\n }\n\n // BOM checker\n if (text && text.charCodeAt(0) === 0xFEFF) {\n text = text.slice(1)\n }\n\n // Parse normally, allowing exceptions\n const obj = JSON.parse(text, reviver)\n\n // Ignore null and non-objects\n if (obj === null || typeof obj !== 'object') {\n return obj\n }\n\n const protoAction = (options && options.protoAction) || 'error'\n const constructorAction = (options && options.constructorAction) || 'error'\n\n // options: 'error' (default) / 'remove' / 'ignore'\n if (protoAction === 'ignore' && constructorAction === 'ignore') {\n return obj\n }\n\n if (protoAction !== 'ignore' && constructorAction !== 'ignore') {\n if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {\n return obj\n }\n } else if (protoAction !== 'ignore' && constructorAction === 'ignore') {\n if (suspectProtoRx.test(text) === false) {\n return obj\n }\n } else {\n if (suspectConstructorRx.test(text) === false) {\n return obj\n }\n }\n\n // Scan result for proto keys\n return filter(obj, { protoAction, constructorAction, safe: options && options.safe })\n}\n\n/**\n * @description Scans and filters an object for forbidden prototype properties.\n * @param {Object} obj - The object being scanned.\n * @param {import('./types').ParseOptions} [options] - Optional configuration object.\n * @returns {Object|null} The filtered object, or `null` if safe mode is enabled and issues are found.\n * @throws {SyntaxError} If a forbidden prototype property is found and `options.protoAction` or\n * `options.constructorAction` is `'error'`.\n */\nfunction filter (obj, { protoAction = 'error', constructorAction = 'error', safe } = {}) {\n let next = [obj]\n\n while (next.length) {\n const nodes = next\n next = []\n\n for (const node of nodes) {\n if (protoAction !== 'ignore' && Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly\n if (safe === true) {\n return null\n } else if (protoAction === 'error') {\n throw new SyntaxError('Object contains forbidden prototype property')\n }\n\n delete node.__proto__ // eslint-disable-line no-proto\n }\n\n if (constructorAction !== 'ignore' &&\n Object.prototype.hasOwnProperty.call(node, 'constructor') &&\n node.constructor !== null &&\n typeof node.constructor === 'object' &&\n Object.prototype.hasOwnProperty.call(node.constructor, 'prototype')) { // Avoid calling node.hasOwnProperty directly\n if (safe === true) {\n return null\n } else if (constructorAction === 'error') {\n throw new SyntaxError('Object contains forbidden prototype property')\n }\n\n delete node.constructor\n }\n\n for (const key in node) {\n const value = node[key]\n if (value && typeof value === 'object') {\n next.push(value)\n }\n }\n }\n }\n return obj\n}\n\n/**\n * @description Parses a given JSON-formatted text into an object.\n * @param {string|Buffer} text - The JSON text string or Buffer to parse.\n * @param {Function} [reviver] - The `JSON.parse()` optional reviver argument, or options object.\n * @param {import('./types').ParseOptions} [options] - Optional configuration object.\n * @returns {*} The parsed object.\n * @throws {SyntaxError} If the JSON text is malformed or contains forbidden prototype properties\n * when `options.protoAction` or `options.constructorAction` is `'error'`.\n */\nfunction parse (text, reviver, options) {\n const { stackTraceLimit } = Error\n Error.stackTraceLimit = 0\n try {\n return _parse(text, reviver, options)\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n}\n\n/**\n * @description Safely parses a given JSON-formatted text into an object.\n * @param {string|Buffer} text - The JSON text string or Buffer to parse.\n * @param {Function} [reviver] - The `JSON.parse()` optional reviver argument.\n * @returns {*|null|undefined} The parsed object, `null` if security issues found, or `undefined` on parse error.\n */\nfunction safeParse (text, reviver) {\n const { stackTraceLimit } = Error\n Error.stackTraceLimit = 0\n try {\n return _parse(text, reviver, { safe: true })\n } catch {\n return undefined\n } finally {\n Error.stackTraceLimit = stackTraceLimit\n }\n}\n\nmodule.exports = parse\nmodule.exports.default = parse\nmodule.exports.parse = parse\nmodule.exports.safeParse = safeParse\nmodule.exports.scan = filter\n","import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig<TData, TError, TVariables, TOnMutateResult> {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions<TData, TError, TVariables, TOnMutateResult>\n state?: MutationState<TData, TError, TVariables, TOnMutateResult>\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction<TError> {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction<TVariables, TOnMutateResult> {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction<TData> {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction<TError> {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action<TData, TError, TVariables, TOnMutateResult> =\n | ContinueAction\n | ErrorAction<TError>\n | FailedAction<TError>\n | PendingAction<TVariables, TOnMutateResult>\n | PauseAction\n | SuccessAction<TData>\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState<TData, TError, TVariables, TOnMutateResult>\n options!: MutationOptions<TData, TError, TVariables, TOnMutateResult>\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver<TData, TError, TVariables, TOnMutateResult>\n >\n #mutationCache: MutationCache\n #retryer?: Retryer<TData>\n\n constructor(\n config: MutationConfig<TData, TError, TVariables, TOnMutateResult>,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions<TData, TError, TVariables, TOnMutateResult>,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver<any, any, any, any>): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver<any, any, any, any>): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise<unknown> {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise<TData> {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation<unknown, unknown, unknown, unknown>,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation<unknown, unknown, unknown, unknown>,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action<TData, TError, TVariables, TOnMutateResult>): void {\n const reducer = (\n state: MutationState<TData, TError, TVariables, TOnMutateResult>,\n ): MutationState<TData, TError, TVariables, TOnMutateResult> => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState<TData, TError, TVariables, TOnMutateResult> {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n","/* @ts-self-types=\"./index.d.ts\" */\nlet urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\nexport let customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n let i = size | 0\n while (i--) {\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\nexport let nanoid = (size = 21) => {\n let id = ''\n let i = size | 0\n while (i--) {\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\n","'use client';\n\nimport type { FC } from 'react';\nimport { createPortal } from 'react-dom';\nimport {\n ActionBarPrimitive,\n ComposerPrimitive,\n MessagePrimitive,\n ThreadPrimitive,\n useMessage,\n} from '@assistant-ui/react';\nimport type { Components } from 'react-markdown';\nimport Markdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport { useTranslation } from 'react-i18next';\nimport { cn } from '@/lib/utils';\nimport {\n SendHorizontal,\n CircleStop,\n Copy,\n Paperclip,\n Bot,\n User,\n Maximize2,\n X,\n ChevronDown,\n ChevronUp,\n LoaderCircle,\n} from 'lucide-react';\n\n// ── Markdown components for assistant messages ──────────────────────────────\n\nconst markdownComponents: Components = {\n p: ({ children }) => <p className=\"mb-2 leading-relaxed last:mb-0\">{children}</p>,\n strong: ({ children }) => <strong className=\"font-semibold\">{children}</strong>,\n em: ({ children }) => <em className=\"italic\">{children}</em>,\n code: ({ children, className }) =>\n className ? (\n <code className={`${className} text-[11px]`}>{children}</code>\n ) : (\n <code className=\"bg-background/50 rounded-md px-1.5 py-0.5 font-mono text-xs\">\n {children}\n </code>\n ),\n pre: ({ children }) => {\n // Extract language and raw text from the nested <code> element\n const codeEl = children as React.ReactElement<{ className?: string; children?: string }>;\n const lang = codeEl?.props?.className?.replace('language-', '') ?? '';\n const rawText = typeof codeEl?.props?.children === 'string' ? codeEl.props.children : '';\n const isPreviewable = ['html', 'svg'].includes(lang) && rawText.length > 0;\n\n if (isPreviewable) {\n return <HtmlPreviewBlock code={rawText} language={lang} />;\n }\n\n return <CollapsibleCode language={lang}>{children}</CollapsibleCode>;\n },\n ul: ({ children }) => <ul className=\"mb-2 list-disc ps-4 last:mb-0\">{children}</ul>,\n ol: ({ children }) => <ol className=\"mb-2 list-decimal ps-4 last:mb-0\">{children}</ol>,\n li: ({ children }) => <li className=\"mb-0.5\">{children}</li>,\n h1: ({ children }) => <h1 className=\"mb-1 text-base font-bold\">{children}</h1>,\n h2: ({ children }) => <h2 className=\"mb-1 text-sm font-bold\">{children}</h2>,\n h3: ({ children }) => <h3 className=\"mb-1 text-sm font-semibold\">{children}</h3>,\n a: ({ children, href }) => (\n <a href={href} className=\"text-blue-500 underline\" target=\"_blank\" rel=\"noopener noreferrer\">\n {children}\n </a>\n ),\n blockquote: ({ children }) => (\n <blockquote className=\"border-muted-foreground/30 my-1 border-s-2 ps-3 italic opacity-80\">\n {children}\n </blockquote>\n ),\n table: ({ children }) => (\n <div className=\"my-2 overflow-x-auto\">\n <table className=\"min-w-full border-collapse text-xs\">{children}</table>\n </div>\n ),\n thead: ({ children }) => <thead className=\"bg-muted/50 border-b\">{children}</thead>,\n th: ({ children }) => <th className=\"px-2 py-1 text-start font-semibold\">{children}</th>,\n td: ({ children }) => <td className=\"border-muted border-t px-2 py-1\">{children}</td>,\n tr: ({ children }) => <tr>{children}</tr>,\n hr: () => <hr className=\"border-border/40 my-3 border-t\" />,\n};\n\n// ── Thread ──────────────────────────────────────────────────────────────────\n\nexport function Thread({\n className,\n statusBar,\n composer,\n}: {\n className?: string;\n statusBar?: React.ReactNode;\n composer?: React.ReactNode;\n}) {\n return (\n <ThreadPrimitive.Root className={cn('flex h-full flex-col', className)}>\n <ThreadPrimitive.Viewport className=\"flex flex-1 flex-col overflow-y-auto pt-4\">\n <ThreadPrimitive.Empty>\n <ThreadEmpty />\n </ThreadPrimitive.Empty>\n\n <ThreadPrimitive.Messages\n components={{\n UserMessage,\n AssistantMessage,\n }}\n />\n </ThreadPrimitive.Viewport>\n\n {statusBar}\n {composer ?? <Composer />}\n </ThreadPrimitive.Root>\n );\n}\n\n// ── Empty state ─────────────────────────────────────────────────────────────\n\nfunction ThreadEmpty() {\n return (\n <div className=\"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center\">\n <Bot className=\"text-muted-foreground/40 h-10 w-10\" />\n <p className=\"text-muted-foreground text-sm\">\n Send a message to start chatting with the agent.\n </p>\n </div>\n );\n}\n\n// ── User message ────────────────────────────────────────────────────────────\n\nconst UserMessage: FC = () => {\n return (\n <MessagePrimitive.Root className=\"group flex w-full items-start gap-2.5 px-4 py-0.5\">\n {/* User avatar */}\n <div className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/15\">\n <User className=\"h-3.5 w-3.5 text-violet-500\" />\n </div>\n\n <div className=\"flex max-w-[85%] min-w-0 flex-col gap-0.5\">\n <div className=\"text-foreground mt-px overflow-hidden rounded-2xl rounded-tl-sm border border-violet-500/15 bg-violet-500/8 px-4 py-2 text-sm leading-relaxed break-words shadow-sm backdrop-blur-md\">\n <MessagePrimitive.Content components={{ Text: UserMessageText }} />\n </div>\n\n <div className=\"flex items-center gap-1.5 opacity-0 transition-opacity group-hover:opacity-100\">\n <MessageMeta />\n <ActionBarPrimitive.Root className=\"flex items-center gap-1\">\n <ActionBarPrimitive.Copy asChild>\n <IconButton tooltip=\"Copy\">\n <Copy />\n </IconButton>\n </ActionBarPrimitive.Copy>\n </ActionBarPrimitive.Root>\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\nfunction UserMessageText({ text }: { text: string }) {\n return <span className=\"whitespace-pre-wrap\">{text}</span>;\n}\n\n// ── Assistant message ───────────────────────────────────────────────────────\n\nconst AssistantMessage: FC = () => {\n return (\n <MessagePrimitive.Root className=\"group flex w-full items-start gap-2.5 px-4 py-0.5\">\n {/* Avatar */}\n <div className=\"bg-muted flex h-6 w-6 shrink-0 items-center justify-center rounded-full\">\n <Bot className=\"text-muted-foreground h-3.5 w-3.5\" />\n </div>\n\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div className=\"bg-muted/50 text-foreground mt-px overflow-hidden rounded-2xl rounded-tl-sm border border-white/5 px-4 py-2 text-sm leading-relaxed break-words shadow-sm backdrop-blur-md\">\n <MessagePrimitive.Content components={{ Text: AssistantMessageText }} />\n </div>\n\n <div className=\"flex items-center gap-1.5 opacity-0 transition-opacity group-hover:opacity-100\">\n <MessageMeta />\n <ActionBarPrimitive.Root className=\"flex items-center gap-1\">\n <ActionBarPrimitive.Copy asChild>\n <IconButton tooltip=\"Copy\">\n <Copy />\n </IconButton>\n </ActionBarPrimitive.Copy>\n </ActionBarPrimitive.Root>\n </div>\n </div>\n </MessagePrimitive.Root>\n );\n};\n\n// ── Collapsible code block ───────────────────────────────────────────────\n\nconst CODE_COLLAPSED_HEIGHT = 200; // px\n\nfunction CollapsibleCode({ children, language }: { children: React.ReactNode; language?: string }) {\n const { t } = useTranslation('web');\n const [expanded, setExpanded] = useState(false);\n const [needsCollapse, setNeedsCollapse] = useState(false);\n const ref = useRef<HTMLPreElement>(null);\n\n useEffect(() => {\n if (ref.current && ref.current.scrollHeight > CODE_COLLAPSED_HEIGHT + 40) {\n setNeedsCollapse(true);\n }\n }, [children]);\n\n return (\n <div className=\"bg-background/50 relative my-2 overflow-hidden rounded-md\">\n {language ? (\n <div className=\"text-muted-foreground/50 border-b border-white/5 px-3 py-1 font-mono text-[10px] uppercase\">\n {language}\n </div>\n ) : null}\n <pre\n ref={ref}\n className=\"overflow-x-auto p-3 font-mono text-xs leading-relaxed transition-[max-height] duration-300 ease-in-out\"\n style={{\n maxHeight: expanded\n ? 'min(60vh, 500px)'\n : !needsCollapse\n ? 'min(60vh, 500px)'\n : `${CODE_COLLAPSED_HEIGHT}px`,\n overflow: expanded ? 'auto' : undefined,\n }}\n >\n {children}\n </pre>\n {needsCollapse && !expanded ? (\n <div className=\"absolute inset-x-0 bottom-0 flex items-end justify-center bg-gradient-to-t from-black/60 via-black/30 to-transparent pt-12 pb-3\">\n <button\n type=\"button\"\n onClick={() => setExpanded(true)}\n className=\"inline-flex items-center gap-1 rounded-full border border-white/10 bg-white/10 px-3 py-1 text-[11px] font-medium text-white/80 shadow-lg backdrop-blur-md transition-all hover:bg-white/20 hover:text-white\"\n >\n <ChevronDown className=\"h-3 w-3\" />\n {t('chat.showMore')}\n </button>\n </div>\n ) : null}\n {needsCollapse && expanded ? (\n <div className=\"flex justify-center border-t border-white/5 py-1.5\">\n <button\n type=\"button\"\n onClick={() => setExpanded(false)}\n className=\"inline-flex items-center gap-1 rounded-full px-3 py-0.5 text-[11px] text-white/50 transition-colors hover:text-white/80\"\n >\n <ChevronUp className=\"h-3 w-3\" />\n {t('chat.showLess')}\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n\n// ── HTML preview block with code/preview toggle ─────────────────────────\n\nfunction HtmlPreviewBlock({ code, language }: { code: string; language: string }) {\n const { t } = useTranslation('web');\n const [showPreview, setShowPreview] = useState(false);\n const [maximized, setMaximized] = useState(false);\n const [fullscreenCode, setFullscreenCode] = useState(false);\n const lines = code.split('\\n').length;\n const chars = code.length;\n\n return (\n <>\n <div className=\"bg-background/50 my-2 overflow-hidden rounded-md border\">\n <div className=\"flex items-center justify-between border-b px-3 py-1\">\n <span className=\"text-muted-foreground font-mono text-xs uppercase\">{language}</span>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setShowPreview(false)}\n className={cn(\n 'rounded px-2.5 py-0.5 text-xs font-medium transition-colors',\n !showPreview\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n {t('chat.code')}\n </button>\n <button\n type=\"button\"\n onClick={() => setShowPreview(true)}\n className={cn(\n 'rounded px-2.5 py-0.5 text-xs font-medium transition-colors',\n showPreview\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n {t('chat.preview')}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setFullscreenCode(!showPreview);\n setMaximized(true);\n }}\n className=\"text-muted-foreground hover:text-foreground ms-1 rounded p-0.5 transition-colors\"\n title={t('chat.openFullscreen')}\n >\n <Maximize2 className=\"h-3 w-3\" />\n </button>\n </div>\n </div>\n <div style={{ height: 'min(55vh, 450px)' }}>\n {showPreview ? (\n <iframe\n srcDoc={code}\n sandbox=\"allow-scripts\"\n className=\"h-full w-full border-0 bg-white\"\n title={t('chat.htmlPreview')}\n />\n ) : (\n <pre className=\"h-full overflow-auto p-3 font-mono text-xs leading-relaxed\">\n <code>{code}</code>\n </pre>\n )}\n </div>\n </div>\n\n {/* Fullscreen modal — fake browser chrome, portaled to body */}\n {maximized && typeof document !== 'undefined'\n ? createPortal(\n <div\n className=\"fixed inset-0 z-[9999] flex items-center justify-center bg-black/70 backdrop-blur-sm\"\n onClick={() => setMaximized(false)}\n >\n <div\n className=\"bg-background relative flex h-[95vh] w-[95vw] flex-col overflow-hidden rounded-xl border shadow-2xl\"\n onClick={(e) => e.stopPropagation()}\n >\n {/* Toolbar */}\n <div className=\"bg-muted/80 flex h-12 shrink-0 items-center justify-between border-b px-5\">\n {/* Left — tabs */}\n <div className=\"bg-muted flex items-center gap-0.5 rounded-lg p-1\">\n <button\n type=\"button\"\n onClick={() => setFullscreenCode(false)}\n className={cn(\n 'rounded-md px-4 py-1.5 text-sm font-medium transition-all',\n !fullscreenCode\n ? 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n {t('chat.preview')}\n </button>\n <button\n type=\"button\"\n onClick={() => setFullscreenCode(true)}\n className={cn(\n 'rounded-md px-4 py-1.5 text-sm font-medium transition-all',\n fullscreenCode\n ? 'bg-background text-foreground shadow-sm'\n : 'text-muted-foreground hover:text-foreground'\n )}\n >\n {t('chat.code')}\n </button>\n </div>\n\n {/* Center — stats */}\n <div className=\"text-muted-foreground/60 flex items-center gap-4 text-xs\">\n <span>{lines} lines</span>\n <span>{chars.toLocaleString()} chars</span>\n <span className=\"font-mono uppercase\">{language}</span>\n </div>\n\n {/* Right — close */}\n <button\n type=\"button\"\n onClick={() => setMaximized(false)}\n className=\"text-muted-foreground hover:bg-muted hover:text-foreground rounded-lg p-2 transition-colors\"\n >\n <X className=\"h-5 w-5\" />\n </button>\n </div>\n {/* Content */}\n {fullscreenCode ? (\n <pre className=\"flex-1 overflow-auto p-4 font-mono text-xs leading-relaxed\">\n <code>{code}</code>\n </pre>\n ) : (\n <iframe\n srcDoc={code}\n sandbox=\"allow-scripts\"\n className=\"flex-1 border-0 bg-white dark:bg-neutral-900\"\n title={t('chat.htmlPreviewFullscreen')}\n />\n )}\n </div>\n </div>,\n document.body\n )\n : null}\n </>\n );\n}\n\nconst ACTIVITY_MARKER_RE = /^\\*⏳ (.+)\\*$/;\n\nfunction AssistantMessageText({ text }: { text: string }) {\n if (text === '*Thinking...*' || text === '*Agent is waking up...*') {\n return <ThinkingIndicator booting={text.includes('waking')} />;\n }\n\n // Live activity indicator (e.g. \"Using tool: Bash\", \"Running: Read\")\n const activityMatch = ACTIVITY_MARKER_RE.exec(text);\n if (activityMatch) {\n return <ActivityIndicator label={activityMatch[1]} />;\n }\n\n return (\n <Markdown remarkPlugins={[remarkGfm]} components={markdownComponents}>\n {text}\n </Markdown>\n );\n}\n\nfunction ActivityIndicator({ label }: { label: string }) {\n return (\n <span className=\"text-muted-foreground inline-flex items-center gap-2 text-sm italic\">\n <LoaderCircle className=\"h-3.5 w-3.5 animate-spin\" />\n <span>{label}</span>\n </span>\n );\n}\n\n// ── Thinking indicator with cycling words ────────────────────────────────\n\nconst THINKING_WORDS = [\n 'Thinking',\n 'Reasoning',\n 'Analyzing',\n 'Processing',\n 'Evaluating',\n 'Considering',\n 'Reflecting',\n 'Pondering',\n];\n\nconst BOOTING_WORDS = ['Waking up', 'Initializing', 'Loading tools', 'Preparing', 'Connecting'];\n\nimport { useEffect, useRef, useState } from 'react';\n\nfunction ThinkingIndicator({ booting }: { booting: boolean }) {\n const words = booting ? BOOTING_WORDS : THINKING_WORDS;\n const [index, setIndex] = useState(0);\n const [fade, setFade] = useState(true);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setFade(false);\n setTimeout(() => {\n setIndex((i) => (i + 1) % words.length);\n setFade(true);\n }, 200);\n }, 2000);\n return () => clearInterval(interval);\n }, [words]);\n\n return (\n <span className=\"text-muted-foreground inline-flex w-32 items-center gap-1.5 text-sm italic\">\n <span\n className=\"inline-block transition-all duration-300 ease-in-out\"\n style={{ opacity: fade ? 1 : 0, transform: fade ? 'translateY(0)' : 'translateY(-4px)' }}\n >\n {words[index]}\n </span>\n <span className=\"inline-flex gap-0.5\">\n <span\n className=\"bg-muted-foreground/60 h-1 w-1 animate-bounce rounded-full\"\n style={{ animationDelay: '0ms' }}\n />\n <span\n className=\"bg-muted-foreground/60 h-1 w-1 animate-bounce rounded-full\"\n style={{ animationDelay: '150ms' }}\n />\n <span\n className=\"bg-muted-foreground/60 h-1 w-1 animate-bounce rounded-full\"\n style={{ animationDelay: '300ms' }}\n />\n </span>\n </span>\n );\n}\n\n// ── Message metadata (timestamp + relative time) ────────────────────────────\n\nfunction MessageMeta() {\n const message = useMessage();\n // Tick every 30s so relative timestamps stay fresh\n const [tick, setTick] = useState(0);\n useEffect(() => {\n const id = setInterval(() => setTick((t) => t + 1), 30_000);\n return () => clearInterval(id);\n }, []);\n\n const meta = useMemo(() => {\n if (!message?.createdAt) return null;\n const date = new Date(message.createdAt as unknown as string);\n if (isNaN(date.getTime())) return null;\n return {\n time: date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),\n relative: formatRelativeTime(date),\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [message?.createdAt, tick]);\n\n if (!meta) return null;\n\n return (\n <span className=\"text-muted-foreground/60 text-[10px]\" title={meta.time}>\n {meta.relative}\n </span>\n );\n}\n\nfunction formatRelativeTime(date: Date): string {\n const diff = Date.now() - date.getTime();\n if (diff < 0 || diff < 5000) return 'just now';\n const seconds = Math.floor(diff / 1000);\n if (seconds < 60) return `${seconds}s ago`;\n const minutes = Math.floor(seconds / 60);\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n return date.toLocaleDateString();\n}\n\n// ── Icon button helper ──────────────────────────────────────────────────────\n\nimport { forwardRef, useMemo } from 'react';\nimport type { ButtonHTMLAttributes } from 'react';\n\nconst IconButton = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { tooltip: string }\n>(({ tooltip, children, className, ...props }, ref) => (\n <button\n ref={ref}\n type=\"button\"\n title={tooltip}\n className={cn(\n 'text-muted-foreground hover:text-foreground hover:bg-muted inline-flex h-7 w-7 items-center justify-center rounded-md transition-colors',\n '[&>svg]:h-3.5 [&>svg]:w-3.5',\n className\n )}\n {...props}\n >\n {children}\n </button>\n));\nIconButton.displayName = 'IconButton';\n\n// ── Composer ────────────────────────────────────────────────────────────────\n\nfunction Composer() {\n return (\n <ComposerPrimitive.Root className=\"flex items-end gap-2 border-t p-3\">\n <ComposerPrimitive.AddAttachment asChild>\n <IconButton tooltip=\"Attach file\" className=\"mb-0.5\">\n <Paperclip />\n </IconButton>\n </ComposerPrimitive.AddAttachment>\n\n <ComposerPrimitive.Input\n rows={1}\n autoFocus\n placeholder=\"Write a message...\"\n className={cn(\n 'bg-muted min-h-[40px] flex-1 resize-none rounded-xl border-0 px-4 py-2.5 text-sm',\n 'focus:ring-ring/30 focus:ring-2 focus:outline-none',\n 'placeholder:text-muted-foreground/60',\n 'max-h-40 overflow-y-auto'\n )}\n />\n <ComposerAction />\n </ComposerPrimitive.Root>\n );\n}\n\nfunction ComposerAction() {\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerPrimitive.Send\n className={cn(\n 'bg-primary text-primary-foreground inline-flex h-[40px] w-[40px] shrink-0 items-center justify-center rounded-xl',\n 'hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-30',\n 'transition-colors'\n )}\n >\n <SendHorizontal className=\"size-4\" />\n </ComposerPrimitive.Send>\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerPrimitive.Cancel\n className={cn(\n 'bg-destructive/10 text-destructive inline-flex h-[40px] w-[40px] shrink-0 items-center justify-center rounded-xl',\n 'hover:bg-destructive/20',\n 'transition-colors'\n )}\n >\n <CircleStop className=\"size-4\" />\n </ComposerPrimitive.Cancel>\n </ThreadPrimitive.If>\n </>\n );\n}\n","'use client';\n\nimport { useCallback, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { AssistantRuntimeProvider } from '@assistant-ui/react';\nimport { Trash2, Cpu } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Thread } from '@/components/assistant-ui/thread';\nimport { useAttachments } from '@/hooks/use-attachments';\nimport { composeUserInput } from '@/app/actions/compose-user-input';\nimport { AgentModelPicker } from '@/components/features/settings/AgentModelPicker';\nimport { useChatRuntime } from './useChatRuntime';\nimport { ChatComposer } from './ChatComposer';\n\nexport interface ChatTabProps {\n featureId: string;\n worktreePath?: string;\n}\n\nconst IS_DEV = process.env.NODE_ENV === 'development';\n\nexport function ChatTab({ featureId, worktreePath }: ChatTabProps) {\n const [overrideAgent, setOverrideAgent] = useState<string | undefined>(undefined);\n const [overrideModel, setOverrideModel] = useState<string | undefined>(undefined);\n const [debugMode, setDebugMode] = useState(false);\n const att = useAttachments();\n\n const contentTransform = useCallback(\n (content: string) =>\n composeUserInput(\n content,\n att.completedAttachments.map((a) => ({ path: a.path, name: a.name, notes: a.notes }))\n ),\n [att.completedAttachments]\n );\n\n const { runtime, status, clearChat, sessionInfo, isChatLoading } = useChatRuntime(\n featureId,\n worktreePath,\n {\n contentTransform,\n onMessageSent: att.clearAttachments,\n model: overrideModel,\n agentType: overrideAgent,\n debugMode,\n }\n );\n\n const handlePickFiles = useCallback(async () => {\n try {\n const res = await fetch('/api/dialog/pick-files');\n if (!res.ok) return;\n const data = (await res.json()) as { paths?: string[] };\n if (!data.paths?.length) return;\n for (const filePath of data.paths) {\n const uploadRes = await fetch('/api/attachments/upload-from-path', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ path: filePath, sessionId: `chat-${featureId}` }),\n });\n if (!uploadRes.ok) continue;\n const uploaded = (await uploadRes.json()) as {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n path: string;\n };\n att.addAttachment(uploaded);\n }\n } catch {\n // Native picker not available — ignore\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- att.addAttachment is a stable callback from useAttachments\n }, [featureId, att.addAttachment]);\n\n const composer = (\n <ChatComposer\n attachments={att.attachments}\n isDragOver={att.isDragOver}\n uploadError={att.uploadError}\n onDragEnter={att.handleDragEnter}\n onDragLeave={att.handleDragLeave}\n onDragOver={att.handleDragOver}\n onDrop={att.handleDrop}\n onPaste={att.handlePaste}\n onRemoveAttachment={att.removeAttachment}\n onNotesChange={att.updateNotes}\n onPickFiles={handlePickFiles}\n agentPicker={\n <AgentModelPicker\n initialAgentType={overrideAgent ?? 'claude-code'}\n initialModel={overrideModel ?? 'claude-sonnet-4-6'}\n mode=\"override\"\n onAgentModelChange={(agent, model) => {\n setOverrideAgent(agent);\n setOverrideModel(model);\n }}\n className=\"w-55\"\n />\n }\n />\n );\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {/* Header bar — session info + stop/clear */}\n <ChatHeader\n sessionInfo={sessionInfo}\n isAgentActive={status.isRunning}\n onClear={clearChat}\n debugMode={debugMode}\n onDebugToggle={IS_DEV ? setDebugMode : undefined}\n />\n <div className=\"flex min-h-0 flex-1 flex-col\">\n {isChatLoading ? (\n <ChatSkeleton />\n ) : (\n <AssistantRuntimeProvider runtime={runtime}>\n <Thread composer={composer} />\n </AssistantRuntimeProvider>\n )}\n </div>\n </div>\n );\n}\n\n// ── Loading skeleton ────────────────────────────────────────────────────────\n\nfunction ChatSkeleton() {\n return (\n <div className=\"flex flex-1 flex-col gap-3 p-4 pt-6\">\n {/* Assistant message skeleton */}\n <div className=\"flex items-start gap-2.5\">\n <div className=\"bg-muted h-6 w-6 animate-pulse rounded-full\" />\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"bg-muted h-4 w-48 animate-pulse rounded-lg\" />\n <div className=\"bg-muted h-4 w-72 animate-pulse rounded-lg\" />\n <div className=\"bg-muted h-4 w-36 animate-pulse rounded-lg\" />\n </div>\n </div>\n {/* User message skeleton */}\n <div className=\"flex items-start gap-2.5\">\n <div className=\"bg-muted h-6 w-6 animate-pulse rounded-full\" />\n <div className=\"bg-muted h-4 w-32 animate-pulse rounded-lg\" />\n </div>\n {/* Assistant message skeleton */}\n <div className=\"flex items-start gap-2.5\">\n <div className=\"bg-muted h-6 w-6 animate-pulse rounded-full\" />\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"bg-muted h-4 w-56 animate-pulse rounded-lg\" />\n <div className=\"bg-muted h-4 w-64 animate-pulse rounded-lg\" />\n </div>\n </div>\n </div>\n );\n}\n\n// ── Session info types ──────────────────────────────────────────────────────\n\ninterface SessionInfo {\n pid: number | null;\n sessionId: string | null;\n model: string | null;\n startedAt: string;\n idleTimeoutMinutes: number;\n lastActivityAt: string;\n}\n\n// ── Chat header — compact session info + actions ─────────────────────────────\n\nfunction ChatHeader({\n sessionInfo,\n isAgentActive,\n onClear,\n debugMode,\n onDebugToggle,\n}: {\n sessionInfo: SessionInfo | null;\n isAgentActive: boolean;\n onClear: () => Promise<void>;\n debugMode: boolean;\n onDebugToggle?: (enabled: boolean) => void;\n}) {\n const { t } = useTranslation('web');\n return (\n <div className=\"flex h-8 shrink-0 items-center border-b px-3\">\n {/* Left — session info + activity */}\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {sessionInfo ? (\n <>\n {isAgentActive ? (\n <span className=\"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-emerald-500\" />\n ) : (\n <Cpu className=\"text-muted-foreground/40 h-3 w-3 shrink-0\" />\n )}\n <span className=\"text-muted-foreground font-mono text-[10px]\">\n {sessionInfo.model ?? 'agent'}\n {sessionInfo.sessionId ? ` · ${sessionInfo.sessionId.slice(0, 8)}` : ''}\n </span>\n </>\n ) : (\n <span className=\"text-muted-foreground/40 text-[11px]\">{t('chat.noSession')}</span>\n )}\n </div>\n\n {/* Right — actions */}\n <div className=\"flex items-center gap-1 ps-2\">\n {onDebugToggle ? (\n <label className=\"text-muted-foreground/60 flex cursor-pointer items-center gap-1 text-[10px]\">\n <input\n type=\"checkbox\"\n checked={debugMode}\n onChange={(e) => onDebugToggle(e.target.checked)}\n className=\"h-3 w-3 cursor-pointer rounded\"\n />\n Debug\n </label>\n ) : null}\n <ToolbarButton\n onClick={() => {\n void onClear();\n }}\n title={t('chat.clearChatHistory')}\n >\n <Trash2 className=\"h-2.5 w-2.5\" />\n <span>{t('chat.clear')}</span>\n </ToolbarButton>\n </div>\n </div>\n );\n}\n\n// ── Toolbar button ──────────────────────────────────────────────────────────\n\nfunction ToolbarButton({\n children,\n onClick,\n title,\n variant,\n}: {\n children: React.ReactNode;\n onClick: () => void;\n title: string;\n variant?: 'danger';\n}) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={title}\n className={cn(\n 'inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs transition-colors',\n variant === 'danger'\n ? 'text-destructive hover:bg-destructive/10'\n : 'text-muted-foreground hover:text-foreground hover:bg-muted'\n )}\n >\n {children}\n </button>\n );\n}\n","// src/mutationObserver.ts\nimport { getDefaultState } from \"./mutation.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { hashKey, shallowEqualObjects } from \"./utils.js\";\nvar MutationObserver = class extends Subscribable {\n #client;\n #currentResult = void 0;\n #currentMutation;\n #mutateOptions;\n constructor(client, options) {\n super();\n this.#client = client;\n this.setOptions(options);\n this.bindMethods();\n this.#updateResult();\n }\n bindMethods() {\n this.mutate = this.mutate.bind(this);\n this.reset = this.reset.bind(this);\n }\n setOptions(options) {\n const prevOptions = this.options;\n this.options = this.#client.defaultMutationOptions(options);\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: \"observerOptionsUpdated\",\n mutation: this.#currentMutation,\n observer: this\n });\n }\n if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) {\n this.reset();\n } else if (this.#currentMutation?.state.status === \"pending\") {\n this.#currentMutation.setOptions(this.options);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this);\n }\n }\n onMutationUpdate(action) {\n this.#updateResult();\n this.#notify(action);\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n reset() {\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = void 0;\n this.#updateResult();\n this.#notify();\n }\n mutate(variables, options) {\n this.#mutateOptions = options;\n this.#currentMutation?.removeObserver(this);\n this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options);\n this.#currentMutation.addObserver(this);\n return this.#currentMutation.execute(variables);\n }\n #updateResult() {\n const state = this.#currentMutation?.state ?? getDefaultState();\n this.#currentResult = {\n ...state,\n isPending: state.status === \"pending\",\n isSuccess: state.status === \"success\",\n isError: state.status === \"error\",\n isIdle: state.status === \"idle\",\n mutate: this.mutate,\n reset: this.reset\n };\n }\n #notify(action) {\n notifyManager.batch(() => {\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables;\n const onMutateResult = this.#currentResult.context;\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey\n };\n if (action?.type === \"success\") {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n } else if (action?.type === \"error\") {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n try {\n this.#mutateOptions.onSettled?.(\n void 0,\n action.error,\n variables,\n onMutateResult,\n context\n );\n } catch (e) {\n void Promise.reject(e);\n }\n }\n }\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n });\n }\n};\nexport {\n MutationObserver\n};\n//# sourceMappingURL=mutationObserver.js.map","\"use client\";\n\n// src/useMutation.ts\nimport * as React from \"react\";\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError\n} from \"@tanstack/query-core\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nfunction useMutation(options, queryClient) {\n const client = useQueryClient(queryClient);\n const [observer] = React.useState(\n () => new MutationObserver(\n client,\n options\n )\n );\n React.useEffect(() => {\n observer.setOptions(options);\n }, [observer, options]);\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n const mutate = React.useCallback(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop);\n },\n [observer]\n );\n if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) {\n throw result.error;\n }\n return { ...result, mutate, mutateAsync: result.mutate };\n}\nexport {\n useMutation\n};\n//# sourceMappingURL=useMutation.js.map","'use client';\n\nimport { useState, useEffect, useRef, useCallback, useMemo } from 'react';\nimport type { ThreadMessageLike, AppendMessage } from '@assistant-ui/react';\nimport { useExternalStoreRuntime } from '@assistant-ui/react';\nimport { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport type { InteractiveMessage } from '@shipit-ai/core/domain/generated/output';\nimport { InteractiveMessageRole } from '@shipit-ai/core/domain/generated/output';\n\n/** Chat state returned by the backend — matches ChatState from service interface */\ninterface ChatState {\n messages: InteractiveMessage[];\n sessionStatus: string | null;\n streamingText: string | null;\n sessionInfo: SessionInfo | null;\n turnStatus?: string;\n}\n\ninterface SessionInfo {\n pid: number | null;\n sessionId: string | null;\n model: string | null;\n startedAt: string;\n idleTimeoutMinutes: number;\n lastActivityAt: string;\n totalCostUsd: number | null;\n totalInputTokens: number | null;\n totalOutputTokens: number | null;\n}\n\n// ── API helpers ─────────────────────────────────────────────────────────────\n\nasync function fetchChatState(featureId: string): Promise<ChatState> {\n const res = await fetch(`/api/interactive/chat/${featureId}/messages`);\n if (!res.ok) {\n // eslint-disable-next-line no-console\n console.error(`[ChatState] fetch failed: ${res.status}`, await res.text().catch(() => ''));\n throw new Error(`Failed to fetch chat state: ${res.status}`);\n }\n return res.json() as Promise<ChatState>;\n}\n\nasync function postMessage(\n featureId: string,\n content: string,\n worktreePath: string,\n model?: string,\n agentType?: string\n): Promise<InteractiveMessage> {\n const res = await fetch(`/api/interactive/chat/${featureId}/messages`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ content, worktreePath, model, agentType }),\n });\n if (!res.ok) throw new Error(`Failed to send message: ${res.status}`);\n const data = (await res.json()) as { message: InteractiveMessage };\n return data.message;\n}\n\n// ── Convert domain message to assistant-ui format ───────────────────────────\n\nfunction toThreadMessage(msg: InteractiveMessage): ThreadMessageLike {\n return {\n id: msg.id,\n role: msg.role === InteractiveMessageRole.user ? 'user' : 'assistant',\n content: [{ type: 'text', text: msg.content }],\n createdAt: msg.createdAt ? new Date(msg.createdAt as unknown as string) : undefined,\n };\n}\n\n// ── Query key ───────────────────────────────────────────────────────────────\n\nfunction chatQueryKey(featureId: string) {\n return ['chat-messages', featureId] as const;\n}\n\n// ── Status info for the typing indicator ────────────────────────────────────\n\nexport interface ChatStatus {\n /** Whether the agent is actively working (booting, thinking, streaming). */\n isRunning: boolean;\n /** Human-readable status text (e.g. \"Agent is waking up...\", \"Using tool: Read\"). */\n statusText: string | null;\n}\n\n// ── Hook ────────────────────────────────────────────────────────────────────\n\nexport interface ChatRuntimeOptions {\n /** Transform message content before sending (e.g. append attachment refs). */\n contentTransform?: (content: string) => string;\n /** Called after a message is successfully sent (e.g. clear attachments). */\n onMessageSent?: () => void;\n /** Override model for new sessions (e.g. 'claude-sonnet-4-6'). */\n model?: string;\n /** Override agent type for new sessions (e.g. 'claude-code'). */\n agentType?: string;\n /** When true, inject debug bubbles showing SSE events, session info, etc. */\n debugMode?: boolean;\n}\n\n/** A debug event captured from SSE for display in debug mode. */\nexport interface DebugEvent {\n id: string;\n timestamp: Date;\n label: string;\n detail?: string;\n}\n\n/**\n * `featureId` is a polymorphic scope key: a feature UUID, \"repo-<id>\", or \"global\".\n * All API calls and SSE subscriptions are scoped to this key.\n */\nexport function useChatRuntime(\n featureId: string,\n worktreePath?: string,\n options?: ChatRuntimeOptions\n) {\n const queryClient = useQueryClient();\n\n // Keep a ref to the latest model/agent so the mutation closure always\n // reads the current value without depending on stale captures.\n const modelRef = useRef(options?.model);\n const agentTypeRef = useRef(options?.agentType);\n modelRef.current = options?.model;\n agentTypeRef.current = options?.agentType;\n\n // ── Debug events (dev mode only) ────────────────────────────────────────\n const debugModeRef = useRef(options?.debugMode ?? false);\n debugModeRef.current = options?.debugMode ?? false;\n const [debugEvents, setDebugEvents] = useState<DebugEvent[]>([]);\n\n const pushDebug = useCallback((label: string, detail?: string) => {\n if (!debugModeRef.current) return;\n setDebugEvents((prev) => [\n ...prev,\n { id: `dbg-${Date.now()}-${Math.random()}`, timestamp: new Date(), label, detail },\n ]);\n }, []);\n\n // ── TanStack Query: fetch messages from backend ─────────────────────────\n const { data: chatState, isLoading: isChatLoading } = useQuery({\n queryKey: chatQueryKey(featureId),\n queryFn: () => fetchChatState(featureId),\n refetchInterval: 3000, // Fallback polling every 3s\n });\n\n // Auto-mark as read when chat tab is open and turn status is 'unread'\n useEffect(() => {\n if (chatState?.turnStatus === 'unread') {\n void fetch(`/api/interactive/chat/${featureId}/mark-read`, { method: 'POST' });\n }\n }, [chatState?.turnStatus, featureId]);\n\n const messages = useMemo(() => chatState?.messages ?? [], [chatState?.messages]);\n const sessionStatus = chatState?.sessionStatus ?? null;\n\n // Track session status changes for debug\n const prevSessionStatusRef = useRef<string | null>(null);\n useEffect(() => {\n if (sessionStatus && sessionStatus !== prevSessionStatusRef.current) {\n const info = chatState?.sessionInfo;\n const detail = info\n ? `model=${info.model ?? '?'}, sid=${info.sessionId?.slice(0, 8) ?? '?'}`\n : undefined;\n pushDebug(`session_${sessionStatus}`, detail);\n }\n prevSessionStatusRef.current = sessionStatus;\n }, [sessionStatus, chatState?.sessionInfo, pushDebug]);\n const backendStreamingText = chatState?.streamingText ?? null;\n\n // Cache last known sessionInfo so PID stays visible after process exits\n const lastSessionInfoRef = useRef<ChatState['sessionInfo']>(null);\n if (chatState?.sessionInfo) {\n lastSessionInfoRef.current = chatState.sessionInfo;\n }\n const sessionInfo = chatState?.sessionInfo ?? lastSessionInfoRef.current;\n\n // ── SSE: real-time streaming deltas ─────────────────────────────────────\n\n const [streamingText, setStreamingText] = useState('');\n const [statusLog, setStatusLog] = useState<string | null>(null);\n const [awaitingResponse, setAwaitingResponse] = useState(false);\n const awaitingTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const eventSourceRef = useRef<EventSource | null>(null);\n\n // Delayed awaiting — only show Thinking bubble after 600ms to avoid flash\n const startAwaiting = useCallback(() => {\n if (awaitingTimerRef.current) clearTimeout(awaitingTimerRef.current);\n awaitingTimerRef.current = setTimeout(() => setAwaitingResponse(true), 600);\n }, []);\n const cancelAwaiting = useCallback(() => {\n if (awaitingTimerRef.current) {\n clearTimeout(awaitingTimerRef.current);\n awaitingTimerRef.current = null;\n }\n setAwaitingResponse(false);\n }, []);\n\n // Clear awaitingResponse when backend delivers a new assistant message\n const lastMsgRole = messages.length > 0 ? messages[messages.length - 1].role : null;\n useEffect(() => {\n if (lastMsgRole === InteractiveMessageRole.assistant) {\n cancelAwaiting();\n }\n }, [lastMsgRole, messages.length, cancelAwaiting]);\n\n useEffect(() => {\n const es = new EventSource(`/api/interactive/chat/${featureId}/stream`);\n eventSourceRef.current = es;\n\n es.addEventListener('delta', (event: MessageEvent) => {\n try {\n const data = JSON.parse(event.data as string) as { delta: string };\n if (data.delta) {\n cancelAwaiting();\n setStreamingText((prev) => prev + data.delta);\n setStatusLog(null);\n }\n } catch {\n // Ignore\n }\n });\n\n es.addEventListener('activity', (event: MessageEvent) => {\n cancelAwaiting();\n try {\n const data = JSON.parse(event.data as string) as {\n activity?: { kind: string; label: string; detail?: string };\n };\n if (data.activity) {\n pushDebug(`[${data.activity.kind}] ${data.activity.label}`, data.activity.detail);\n }\n } catch {\n // Ignore\n }\n // Tool events are already persisted to DB — just refetch to show them\n void queryClient.invalidateQueries({ queryKey: chatQueryKey(featureId) });\n });\n\n es.addEventListener('log', (event: MessageEvent) => {\n try {\n const data = JSON.parse(event.data as string) as { log: string };\n if (data.log) {\n cancelAwaiting();\n setStatusLog(data.log);\n pushDebug('log', data.log);\n }\n } catch {\n // Ignore\n }\n });\n\n es.addEventListener('done', () => {\n setStatusLog(null);\n cancelAwaiting();\n pushDebug('turn_done');\n // Refetch first, THEN clear local streaming state so there's no gap\n void queryClient.invalidateQueries({ queryKey: chatQueryKey(featureId) }).then(() => {\n setStreamingText('');\n });\n });\n\n es.onerror = () => {\n // SSE dropped — the 3s polling handles reliability\n };\n\n return () => {\n es.close();\n eventSourceRef.current = null;\n };\n }, [featureId, queryClient, cancelAwaiting, pushDebug]);\n\n // ── Mutation: send user message ─────────────────────────────────────────\n const sendMutation = useMutation({\n mutationFn: (content: string) =>\n postMessage(featureId, content, worktreePath ?? '', modelRef.current, agentTypeRef.current),\n onMutate: async (content: string) => {\n pushDebug(\n 'send_message',\n `model=${modelRef.current ?? 'default'}, agent=${agentTypeRef.current ?? 'default'}, len=${content.length}`\n );\n startAwaiting();\n // Cancel in-flight refetches so our optimistic update isn't overwritten\n await queryClient.cancelQueries({ queryKey: chatQueryKey(featureId) });\n\n const previous = queryClient.getQueryData<ChatState>(chatQueryKey(featureId));\n\n // Optimistically add user message\n queryClient.setQueryData<ChatState>(chatQueryKey(featureId), (old) => ({\n messages: [\n ...(old?.messages ?? []),\n {\n id: `optimistic-${Date.now()}`,\n featureId,\n role: InteractiveMessageRole.user,\n content,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n ],\n sessionStatus: old?.sessionStatus ?? 'booting',\n streamingText: null,\n sessionInfo: old?.sessionInfo ?? null,\n }));\n\n return { previous };\n },\n onError: (_err, _content, context) => {\n // Rollback on error\n if (context?.previous) {\n queryClient.setQueryData(chatQueryKey(featureId), context.previous);\n }\n },\n onSettled: () => {\n // Refetch to reconcile optimistic data with server\n void queryClient.invalidateQueries({ queryKey: chatQueryKey(featureId) });\n },\n });\n\n // ── Derive running state ────────────────────────────────────────────────\n // Note: sendMutation.isPending is excluded — the 600ms awaitingResponse\n // timer provides a smooth transition without flicker.\n const isRunning =\n awaitingResponse || !!streamingText || !!statusLog || sessionStatus === 'booting';\n\n // ── Build thread messages for assistant-ui ─────────────────────────────\n const activeStreamText = streamingText ?? backendStreamingText ?? '';\n\n const threadMessages: ThreadMessageLike[] = useMemo(() => {\n const chatMessages: ThreadMessageLike[] = messages.map(toThreadMessage);\n\n // Merge debug bubbles into the timeline by timestamp\n let result: ThreadMessageLike[];\n if (options?.debugMode && debugEvents.length > 0) {\n const debugMessages: ThreadMessageLike[] = debugEvents.map((evt) => ({\n id: evt.id,\n role: 'assistant' as const,\n content: [\n {\n type: 'text' as const,\n text: evt.detail ? `🔧 **${evt.label}** — ${evt.detail}` : `🔧 **${evt.label}**`,\n },\n ],\n createdAt: evt.timestamp,\n }));\n // Merge both arrays (both already sorted by time) into one sorted list\n result = [];\n let ci = 0;\n let di = 0;\n while (ci < chatMessages.length && di < debugMessages.length) {\n const chatTime = chatMessages[ci].createdAt\n ? new Date(chatMessages[ci].createdAt as unknown as string).getTime()\n : 0;\n const dbgTime = debugMessages[di].createdAt\n ? new Date(debugMessages[di].createdAt as unknown as string).getTime()\n : 0;\n if (chatTime <= dbgTime) {\n result.push(chatMessages[ci++]);\n } else {\n result.push(debugMessages[di++]);\n }\n }\n while (ci < chatMessages.length) result.push(chatMessages[ci++]);\n while (di < debugMessages.length) result.push(debugMessages[di++]);\n } else {\n result = chatMessages;\n }\n\n // Streaming text as the last message — may include a live activity suffix\n if (activeStreamText.trim()) {\n const parts: { type: 'text'; text: string }[] = [{ type: 'text', text: activeStreamText }];\n // Append live activity indicator when agent is doing tool work\n if (statusLog) {\n parts.push({ type: 'text', text: `*⏳ ${statusLog}*` });\n }\n result.push({ id: 'streaming', role: 'assistant', content: parts });\n } else if (statusLog) {\n // No streaming text yet but agent is actively working (tool calls, etc.)\n result.push({\n id: 'streaming',\n role: 'assistant',\n content: [{ type: 'text', text: `*⏳ ${statusLog}*` }],\n });\n } else if (awaitingResponse || sessionStatus === 'booting') {\n // Note: sendMutation.isPending is NOT included here — the 600ms\n // delay via startAwaiting() prevents flash on fast responses.\n result.push({\n id: 'streaming',\n role: 'assistant',\n content: [\n {\n type: 'text',\n text: sessionStatus === 'booting' ? '*Agent is waking up...*' : '*Thinking...*',\n },\n ],\n });\n }\n\n return result;\n }, [\n messages,\n activeStreamText,\n awaitingResponse,\n sessionStatus,\n statusLog,\n options?.debugMode,\n debugEvents,\n ]);\n\n // ── Status info for typing indicator ──────────────────────────────────\n const status: ChatStatus = useMemo(() => {\n if (!isRunning) return { isRunning: false, statusText: null };\n return { isRunning: true, statusText: statusLog };\n }, [isRunning, statusLog]);\n\n // ── onNew: called by assistant-ui when user submits ─────────────────────\n const onNew = useCallback(\n async (message: AppendMessage) => {\n const textPart = message.content.find((c) => c.type === 'text');\n if (textPart?.type !== 'text' || !textPart.text.trim()) return;\n const content = options?.contentTransform\n ? options.contentTransform(textPart.text)\n : textPart.text;\n sendMutation.mutate(content, {\n onSuccess: () => options?.onMessageSent?.(),\n });\n },\n [sendMutation, options]\n );\n\n // ── Clear chat ─────────────────────────────────────────────────────────\n const clearChat = useCallback(async () => {\n const res = await fetch(`/api/interactive/chat/${featureId}/messages`, { method: 'DELETE' });\n if (!res.ok) throw new Error(`Failed to clear chat: ${res.status}`);\n setStreamingText('');\n setDebugEvents([]);\n setStatusLog(null);\n cancelAwaiting();\n void queryClient.invalidateQueries({ queryKey: chatQueryKey(featureId) });\n }, [featureId, queryClient, cancelAwaiting]);\n\n // ── Stop agent ────────────────────────────────────────────────────────\n const stopAgent = useCallback(async () => {\n const res = await fetch(`/api/interactive/chat/${featureId}/stop`, { method: 'POST' });\n if (!res.ok) throw new Error(`Failed to stop agent: ${res.status}`);\n setStreamingText('');\n\n setStatusLog(null);\n cancelAwaiting();\n void queryClient.invalidateQueries({ queryKey: chatQueryKey(featureId) });\n }, [featureId, queryClient, cancelAwaiting]);\n\n // ── Build assistant-ui runtime ──────────────────────────────────────────\n const runtime = useExternalStoreRuntime({\n messages: threadMessages,\n convertMessage: useCallback((msg: ThreadMessageLike): ThreadMessageLike => msg, []),\n isRunning,\n onNew,\n onCancel: useCallback(async () => {\n setStreamingText('');\n\n setStatusLog(null);\n cancelAwaiting();\n }, [cancelAwaiting]),\n });\n\n return { runtime, status, clearChat, stopAgent, sessionInfo, isChatLoading };\n}\n","'use client';\n\nimport { useState, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ComposerPrimitive, ThreadPrimitive } from '@assistant-ui/react';\nimport { SendHorizontal, CircleStop, Paperclip } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\nimport { AttachmentChip } from '@/components/common/attachment-chip';\nimport type { FormAttachment } from '@/hooks/use-attachments';\n\nexport interface ChatComposerProps {\n attachments: FormAttachment[];\n isDragOver: boolean;\n uploadError: string | null;\n onDragEnter: (e: React.DragEvent) => void;\n onDragLeave: (e: React.DragEvent) => void;\n onDragOver: (e: React.DragEvent) => void;\n onDrop: (e: React.DragEvent) => void;\n onPaste: (e: React.ClipboardEvent) => void;\n onRemoveAttachment: (id: string) => void;\n onNotesChange: (id: string, notes: string) => void;\n onPickFiles: () => void;\n /** Agent/model picker rendered in the controls row. */\n agentPicker?: React.ReactNode;\n}\n\nexport function ChatComposer({\n attachments,\n isDragOver,\n uploadError,\n onDragEnter,\n onDragLeave,\n onDragOver,\n onDrop,\n onPaste,\n onRemoveAttachment,\n onNotesChange,\n onPickFiles,\n agentPicker,\n}: ChatComposerProps) {\n const { t } = useTranslation('web');\n const [isFocused, setIsFocused] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n\n return (\n <ComposerPrimitive.Root className=\"shrink-0 border-t p-3\">\n <div\n onDragEnter={onDragEnter}\n onDragLeave={onDragLeave}\n onDragOver={onDragOver}\n onDrop={onDrop}\n className={cn(\n 'flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors',\n isDragOver && 'border-primary/50 bg-primary/5'\n )}\n >\n <div\n ref={containerRef}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n className={cn(\n 'border-input flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]',\n isFocused && 'ring-ring/50 border-ring ring-[3px]'\n )}\n >\n {/* Textarea — 1 row default, expands to 3, then scrolls */}\n <ComposerPrimitive.Input\n rows={1}\n autoFocus\n placeholder={t('chat.writeMessage')}\n onPaste={onPaste}\n aria-invalid={!!uploadError}\n aria-describedby={uploadError ? 'chat-upload-error' : undefined}\n className=\"max-h-[4.5rem] min-h-0 resize-none rounded-none border-0 px-3 py-2.5 text-sm shadow-none focus:outline-none focus-visible:ring-0\"\n />\n\n {/* Attachment chips — between textarea and controls bar */}\n {attachments.length > 0 ? (\n <div className=\"flex flex-wrap items-center gap-1.5 px-3 py-2\">\n {attachments.map((file) => (\n <AttachmentChip\n key={file.id}\n name={file.name}\n size={file.size}\n mimeType={file.mimeType}\n path={file.path}\n onRemove={() => onRemoveAttachment(file.id)}\n loading={file.loading}\n notes={file.notes}\n onNotesChange={(notes) => onNotesChange(file.id, notes)}\n />\n ))}\n </div>\n ) : null}\n\n {/* Upload error */}\n {uploadError ? (\n <p id=\"chat-upload-error\" className=\"text-destructive px-3 pb-2 text-xs\" role=\"alert\">\n {uploadError}\n </p>\n ) : null}\n\n {/* Controls bar — agent picker + status left, actions right */}\n <div className=\"border-input flex items-center gap-3 border-t px-3 py-1.5\">\n {/* Agent/model picker */}\n {agentPicker}\n <div className=\"flex-1\" />\n\n {/* Attach files */}\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={onPickFiles}\n aria-label={t('chat.attachFiles')}\n className=\"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\">{t('chat.attachFiles')}</TooltipContent>\n </Tooltip>\n\n {/* Send / Cancel */}\n <ChatComposerAction />\n </div>\n </div>\n </div>\n </ComposerPrimitive.Root>\n );\n}\n\nfunction ChatComposerAction() {\n return (\n <>\n <ThreadPrimitive.If running={false}>\n <ComposerPrimitive.Send\n className={cn(\n 'bg-primary text-primary-foreground inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md',\n 'hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-30',\n 'transition-colors'\n )}\n >\n <SendHorizontal className=\"size-3.5\" />\n </ComposerPrimitive.Send>\n </ThreadPrimitive.If>\n <ThreadPrimitive.If running>\n <ComposerPrimitive.Cancel\n className={cn(\n 'bg-destructive/10 text-destructive inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md',\n 'hover:bg-destructive/20',\n 'transition-colors'\n )}\n >\n <CircleStop className=\"size-3.5\" />\n </ComposerPrimitive.Cancel>\n </ThreadPrimitive.If>\n </>\n );\n}\n","'use client';\n\nimport { useState, useCallback, useRef } from 'react';\n\nconst MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB\n\n/** Minimal set of known-safe extensions (same as feature-create-drawer). */\nconst ALLOWED_EXTENSIONS = new Set([\n 'txt',\n 'md',\n 'csv',\n 'json',\n 'yaml',\n 'yml',\n 'xml',\n 'html',\n 'css',\n 'js',\n 'ts',\n 'jsx',\n 'tsx',\n 'py',\n 'rb',\n 'go',\n 'rs',\n 'java',\n 'kt',\n 'c',\n 'cpp',\n 'h',\n 'hpp',\n 'cs',\n 'swift',\n 'sh',\n 'bash',\n 'zsh',\n 'fish',\n 'ps1',\n 'bat',\n 'cmd',\n 'sql',\n 'graphql',\n 'proto',\n 'toml',\n 'ini',\n 'cfg',\n 'conf',\n 'env',\n 'dockerfile',\n 'makefile',\n 'cmake',\n 'gradle',\n 'sbt',\n 'lock',\n 'sum',\n 'mod',\n 'png',\n 'jpg',\n 'jpeg',\n 'gif',\n 'svg',\n 'webp',\n 'bmp',\n 'ico',\n 'avif',\n 'pdf',\n 'doc',\n 'docx',\n 'xls',\n 'xlsx',\n 'ppt',\n 'pptx',\n 'odt',\n 'ods',\n 'odp',\n 'zip',\n 'tar',\n 'gz',\n 'bz2',\n 'xz',\n '7z',\n 'rar',\n 'log',\n 'diff',\n 'patch',\n]);\n\nfunction getExtension(filename: string): string | null {\n const idx = filename.lastIndexOf('.');\n return idx > 0 ? filename.slice(idx + 1).toLowerCase() : null;\n}\n\nexport interface FormAttachment {\n id: string;\n name: string;\n size: number;\n mimeType: string;\n path: string;\n loading?: boolean;\n notes?: string;\n}\n\nexport function useAttachments() {\n const [attachments, setAttachments] = useState<FormAttachment[]>([]);\n const [uploadError, setUploadError] = useState<string | null>(null);\n const [isDragOver, setIsDragOver] = useState(false);\n const dragCounterRef = useRef(0);\n const sessionIdRef = useRef(crypto.randomUUID());\n\n const handleFiles = useCallback(async (fileList: File[]) => {\n setUploadError(null);\n\n for (const file of fileList) {\n if (file.size > MAX_FILE_SIZE) {\n setUploadError(`\"${file.name}\" exceeds 10 MB limit`);\n return;\n }\n const ext = getExtension(file.name);\n if (ext && !ALLOWED_EXTENSIONS.has(ext)) {\n setUploadError(`File type \"${ext}\" is not allowed`);\n return;\n }\n }\n\n for (const file of fileList) {\n const tempId = crypto.randomUUID();\n\n setAttachments((prev) => [\n ...prev,\n {\n id: tempId,\n name: file.name,\n size: file.size,\n mimeType: file.type || 'application/octet-stream',\n path: '',\n loading: true,\n },\n ]);\n\n try {\n const formData = new FormData();\n formData.append('file', file);\n formData.append('sessionId', sessionIdRef.current);\n\n const res = await fetch('/api/attachments/upload', {\n method: 'POST',\n body: formData,\n });\n\n if (!res.ok) {\n const body = await res.json().catch(() => ({ error: 'Upload failed' }));\n setAttachments((prev) => prev.filter((a) => a.id !== tempId));\n setUploadError(body.error ?? 'Upload failed');\n return;\n }\n\n const uploaded = await res.json();\n setAttachments((prev) => {\n const isDupe = prev.some((a) => a.id !== tempId && a.path === uploaded.path);\n if (isDupe) return prev.filter((a) => a.id !== tempId);\n return prev.map((a) =>\n a.id === tempId ? { ...uploaded, id: tempId, loading: false } : a\n );\n });\n } catch {\n setAttachments((prev) => prev.filter((a) => a.id !== tempId));\n setUploadError('Upload failed');\n }\n }\n }, []);\n\n const handleDragEnter = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current += 1;\n if (dragCounterRef.current === 1) setIsDragOver(true);\n }, []);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current -= 1;\n if (dragCounterRef.current === 0) setIsDragOver(false);\n }, []);\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n dragCounterRef.current = 0;\n setIsDragOver(false);\n const files = Array.from(e.dataTransfer.files);\n if (files.length > 0) void handleFiles(files);\n },\n [handleFiles]\n );\n\n const handlePaste = useCallback(\n (e: React.ClipboardEvent) => {\n const items = e.clipboardData?.items;\n if (!items) return;\n const files: File[] = [];\n for (const item of Array.from(items)) {\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file) files.push(file);\n }\n }\n if (files.length > 0) {\n e.preventDefault();\n void handleFiles(files);\n }\n },\n [handleFiles]\n );\n\n const removeAttachment = useCallback((id: string) => {\n setAttachments((prev) => prev.filter((a) => a.id !== id));\n }, []);\n\n const updateNotes = useCallback((id: string, notes: string) => {\n setAttachments((prev) => prev.map((a) => (a.id === id ? { ...a, notes } : a)));\n }, []);\n\n const addAttachment = useCallback((file: Omit<FormAttachment, 'loading'>) => {\n setAttachments((prev) => {\n const isDupe = prev.some((a) => a.path === file.path);\n if (isDupe) return prev;\n return [...prev, { ...file, loading: false }];\n });\n }, []);\n\n const clearAttachments = useCallback(() => {\n setAttachments([]);\n setUploadError(null);\n }, []);\n\n const completedAttachments = attachments.filter((a) => !a.loading);\n\n return {\n attachments,\n completedAttachments,\n uploadError,\n isDragOver,\n handleFiles,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n handlePaste,\n addAttachment,\n removeAttachment,\n updateNotes,\n clearAttachments,\n };\n}\n","import { ReadonlyJSONValue } from \"../../utils/json/json-value\";\n\nconst TOOL_RESPONSE_SYMBOL = Symbol.for(\"aui.tool-response\");\n\nexport type ToolResponseLike<TResult> = {\n result: TResult;\n artifact?: ReadonlyJSONValue | undefined;\n isError?: boolean | undefined;\n messages?: ReadonlyJSONValue | undefined;\n};\n\nexport class ToolResponse<TResult> {\n get [TOOL_RESPONSE_SYMBOL]() {\n return true;\n }\n\n readonly artifact?: ReadonlyJSONValue;\n readonly result: TResult;\n readonly isError: boolean;\n readonly messages?: ReadonlyJSONValue;\n\n constructor(options: ToolResponseLike<TResult>) {\n if (options.artifact !== undefined) {\n this.artifact = options.artifact;\n }\n this.result = options.result;\n this.isError = options.isError ?? false;\n if (options.messages !== undefined) {\n this.messages = options.messages;\n }\n }\n\n static [Symbol.hasInstance](\n obj: unknown,\n ): obj is ToolResponse<ReadonlyJSONValue> {\n return (\n typeof obj === \"object\" && obj !== null && TOOL_RESPONSE_SYMBOL in obj\n );\n }\n\n static toResponse(result: any | ToolResponse<any>): ToolResponse<any> {\n if (result instanceof ToolResponse) {\n return result;\n }\n return new ToolResponse({\n result: result === undefined ? \"<no result>\" : result,\n });\n }\n}\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { ExternalStoreThreadRuntimeCore } from \"./external-store-thread-runtime-core\";\nimport type {\n ThreadListItemCoreState,\n ThreadListRuntimeCore,\n} from \"../../runtime/interfaces/thread-list-runtime-core\";\nimport type { ExternalStoreThreadListAdapter } from \"./external-store-adapter\";\n\nexport type ExternalStoreThreadFactory = () => ExternalStoreThreadRuntimeCore;\n\nconst EMPTY_ARRAY = Object.freeze([]);\nconst DEFAULT_THREAD_ID = \"DEFAULT_THREAD_ID\";\nconst DEFAULT_THREADS = Object.freeze([DEFAULT_THREAD_ID]);\nconst DEFAULT_THREAD = Object.freeze({\n id: DEFAULT_THREAD_ID,\n remoteId: undefined,\n externalId: undefined,\n status: \"regular\",\n});\nconst RESOLVED_PROMISE = Promise.resolve();\nconst DEFAULT_THREAD_DATA = Object.freeze({\n [DEFAULT_THREAD_ID]: DEFAULT_THREAD,\n});\n\nexport class ExternalStoreThreadListRuntimeCore\n implements ThreadListRuntimeCore\n{\n private _mainThreadId: string = DEFAULT_THREAD_ID;\n private _threads: readonly string[] = DEFAULT_THREADS;\n private _archivedThreads: readonly string[] = EMPTY_ARRAY;\n private _threadData: Readonly<Record<string, ThreadListItemCoreState>> =\n DEFAULT_THREAD_DATA;\n\n public get isLoading() {\n return this.adapter.isLoading ?? false;\n }\n\n public get newThreadId() {\n return undefined;\n }\n\n public get threadIds() {\n return this._threads;\n }\n\n public get archivedThreadIds() {\n return this._archivedThreads;\n }\n\n public get threadItems() {\n return this._threadData;\n }\n\n public getLoadThreadsPromise() {\n return RESOLVED_PROMISE;\n }\n\n private _mainThread: ExternalStoreThreadRuntimeCore;\n\n public get mainThreadId() {\n return this._mainThreadId;\n }\n\n constructor(\n private adapter: ExternalStoreThreadListAdapter = {},\n private threadFactory: ExternalStoreThreadFactory,\n ) {\n this._mainThread = this.threadFactory();\n this.__internal_setAdapter(adapter, true);\n }\n\n public getMainThreadRuntimeCore() {\n return this._mainThread;\n }\n\n public getThreadRuntimeCore(): never {\n throw new Error(\"Method not implemented.\");\n }\n\n public getItemById(threadId: string) {\n for (const thread of this.adapter.threads ?? []) {\n if (thread.id === threadId) return thread as any;\n }\n for (const thread of this.adapter.archivedThreads ?? []) {\n if (thread.id === threadId) return thread as any;\n }\n if (threadId === DEFAULT_THREAD_ID) return DEFAULT_THREAD;\n return undefined;\n }\n\n public __internal_setAdapter(\n adapter: ExternalStoreThreadListAdapter,\n initialLoad = false,\n ) {\n const previousAdapter = this.adapter;\n this.adapter = adapter;\n\n const newThreadId = adapter.threadId ?? DEFAULT_THREAD_ID;\n const newThreads = adapter.threads ?? EMPTY_ARRAY;\n const newArchivedThreads = adapter.archivedThreads ?? EMPTY_ARRAY;\n\n const previousThreadId = previousAdapter.threadId ?? DEFAULT_THREAD_ID;\n const previousThreads = previousAdapter.threads ?? EMPTY_ARRAY;\n const previousArchivedThreads =\n previousAdapter.archivedThreads ?? EMPTY_ARRAY;\n\n if (\n !initialLoad &&\n previousThreadId === newThreadId &&\n previousThreads === newThreads &&\n previousArchivedThreads === newArchivedThreads\n ) {\n return;\n }\n\n this._threadData = {\n ...DEFAULT_THREAD_DATA,\n ...Object.fromEntries(\n adapter.threads?.map((t) => [\n t.id,\n {\n ...t,\n remoteId: t.remoteId,\n externalId: t.externalId,\n status: \"regular\",\n },\n ]) ?? [],\n ),\n ...Object.fromEntries(\n adapter.archivedThreads?.map((t) => [\n t.id,\n {\n ...t,\n remoteId: t.remoteId,\n externalId: t.externalId,\n status: \"archived\",\n },\n ]) ?? [],\n ),\n };\n\n if (previousThreads !== newThreads) {\n this._threads = this.adapter.threads?.map((t) => t.id) ?? EMPTY_ARRAY;\n }\n\n if (previousArchivedThreads !== newArchivedThreads) {\n this._archivedThreads =\n this.adapter.archivedThreads?.map((t) => t.id) ?? EMPTY_ARRAY;\n }\n\n if (previousThreadId !== newThreadId) {\n this._mainThreadId = newThreadId;\n this._mainThread = this.threadFactory();\n }\n\n this._notifySubscribers();\n }\n\n public async switchToThread(threadId: string): Promise<void> {\n if (this._mainThreadId === threadId) return;\n const onSwitchToThread = this.adapter.onSwitchToThread;\n if (!onSwitchToThread)\n throw new Error(\n \"External store adapter does not support switching to thread\",\n );\n await onSwitchToThread(threadId);\n }\n\n public async switchToNewThread(): Promise<void> {\n const onSwitchToNewThread = this.adapter.onSwitchToNewThread;\n if (!onSwitchToNewThread)\n throw new Error(\n \"External store adapter does not support switching to new thread\",\n );\n\n await onSwitchToNewThread();\n }\n\n public async rename(threadId: string, newTitle: string): Promise<void> {\n const onRename = this.adapter.onRename;\n if (!onRename)\n throw new Error(\"External store adapter does not support renaming\");\n\n await onRename(threadId, newTitle);\n }\n\n public async detach(): Promise<void> {\n // no-op\n }\n\n public async archive(threadId: string): Promise<void> {\n const onArchive = this.adapter.onArchive;\n if (!onArchive)\n throw new Error(\"External store adapter does not support archiving\");\n\n await onArchive(threadId);\n }\n\n public async unarchive(threadId: string): Promise<void> {\n const onUnarchive = this.adapter.onUnarchive;\n if (!onUnarchive)\n throw new Error(\"External store adapter does not support unarchiving\");\n\n await onUnarchive(threadId);\n }\n\n public async delete(threadId: string): Promise<void> {\n const onDelete = this.adapter.onDelete;\n if (!onDelete)\n throw new Error(\"External store adapter does not support deleting\");\n\n await onDelete(threadId);\n }\n\n public initialize(\n threadId: string,\n ): Promise<{ remoteId: string; externalId: string | undefined }> {\n return Promise.resolve({ remoteId: threadId, externalId: undefined });\n }\n\n public generateTitle(): never {\n throw new Error(\"Method not implemented.\");\n }\n\n private _subscriptions = new Set<() => void>();\n\n public subscribe(callback: () => void): Unsubscribe {\n this._subscriptions.add(callback);\n return () => this._subscriptions.delete(callback);\n }\n\n private _notifySubscribers() {\n for (const callback of this._subscriptions) callback();\n }\n}\n","import type {\n ThreadAssistantMessagePart,\n ThreadUserMessagePart,\n ToolCallMessagePartStatus,\n} from \"../../types/message\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { MessagePartStatus } from \"../../types/message\";\nimport type { SubscribableWithState } from \"../../subscribable/subscribable\";\nimport type { ThreadRuntimeCoreBinding } from \"./thread-runtime\";\nimport type { MessageStateBinding } from \"./bindings\";\nimport type { MessagePartRuntimePath } from \"./paths\";\nimport { ToolResponse } from \"assistant-stream\";\n\nexport type MessagePartState = (\n | ThreadUserMessagePart\n | ThreadAssistantMessagePart\n) & {\n readonly status: MessagePartStatus | ToolCallMessagePartStatus;\n};\n\ntype MessagePartSnapshotBinding = SubscribableWithState<\n MessagePartState,\n MessagePartRuntimePath\n>;\n\nexport type MessagePartRuntime = {\n addToolResult(result: any | ToolResponse<any>): void;\n resumeToolCall(payload: unknown): void;\n\n readonly path: MessagePartRuntimePath;\n getState(): MessagePartState;\n subscribe(callback: () => void): Unsubscribe;\n};\n\nexport class MessagePartRuntimeImpl implements MessagePartRuntime {\n public get path() {\n return this.contentBinding.path;\n }\n\n constructor(\n private contentBinding: MessagePartSnapshotBinding,\n private messageApi?: MessageStateBinding,\n private threadApi?: ThreadRuntimeCoreBinding,\n ) {\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.addToolResult = this.addToolResult.bind(this);\n this.resumeToolCall = this.resumeToolCall.bind(this);\n this.getState = this.getState.bind(this);\n this.subscribe = this.subscribe.bind(this);\n }\n\n public getState() {\n return this.contentBinding.getState();\n }\n\n public addToolResult(result: any | ToolResponse<any>) {\n const state = this.contentBinding.getState();\n if (!state) throw new Error(\"Message part is not available\");\n\n if (state.type !== \"tool-call\")\n throw new Error(\"Tried to add tool result to non-tool message part\");\n\n if (!this.messageApi)\n throw new Error(\n \"Message API is not available. This is likely a bug in assistant-ui.\",\n );\n if (!this.threadApi) throw new Error(\"Thread API is not available\");\n\n const message = this.messageApi.getState();\n if (!message) throw new Error(\"Message is not available\");\n\n const toolName = state.toolName;\n const toolCallId = state.toolCallId;\n\n const response = ToolResponse.toResponse(result);\n this.threadApi.getState().addToolResult({\n messageId: message.id,\n toolName,\n toolCallId,\n result: response.result,\n artifact: response.artifact,\n isError: response.isError,\n });\n }\n\n public resumeToolCall(payload: unknown) {\n const state = this.contentBinding.getState();\n if (!state) throw new Error(\"Message part is not available\");\n\n if (state.type !== \"tool-call\")\n throw new Error(\"Tried to resume tool call on non-tool message part\");\n\n if (!this.threadApi) throw new Error(\"Thread API is not available\");\n\n const toolCallId = state.toolCallId;\n this.threadApi.getState().resumeToolCall({\n toolCallId,\n payload,\n });\n }\n\n public subscribe(callback: () => void) {\n return this.contentBinding.subscribe(callback);\n }\n}\n","import type { ThreadMessage } from \"../../types/message\";\nimport type { RunConfig } from \"../../types/message\";\nimport { generateId, generateOptimisticId } from \"../../utils/id\";\nimport type { ThreadMessageLike } from \"./thread-message-like\";\nimport { getAutoStatus } from \"./auto-status\";\nimport { fromThreadMessageLike } from \"./thread-message-like\";\n\nexport type ExportedMessageRepositoryItem = {\n message: ThreadMessage;\n parentId: string | null;\n runConfig?: RunConfig;\n};\n\nexport type ExportedMessageRepository = {\n headId?: string | null;\n messages: Array<{\n message: ThreadMessage;\n parentId: string | null;\n runConfig?: RunConfig;\n }>;\n};\n\nexport const ExportedMessageRepository = {\n fromArray: (\n messages: readonly ThreadMessageLike[],\n ): ExportedMessageRepository => {\n const conv = messages.map((m) =>\n fromThreadMessageLike(\n m,\n generateId(),\n getAutoStatus(false, false, false, false, undefined),\n ),\n );\n\n return {\n messages: conv.map((m, idx) => ({\n parentId: idx > 0 ? conv[idx - 1]!.id : null,\n message: m,\n })),\n };\n },\n};\n\ntype RepositoryParent = {\n children: string[];\n next: RepositoryMessage | null;\n};\n\ntype RepositoryMessage = RepositoryParent & {\n prev: RepositoryMessage | null;\n current: ThreadMessage;\n level: number;\n};\n\nconst findHead = (\n message: RepositoryMessage | RepositoryParent,\n): RepositoryMessage | null => {\n if (message.next) return findHead(message.next);\n if (\"current\" in message) return message;\n return null;\n};\n\nclass CachedValue<T> {\n private _value: T | null = null;\n\n constructor(private func: () => T) {}\n\n get value() {\n if (this._value === null) {\n this._value = this.func();\n }\n return this._value;\n }\n\n dirty() {\n this._value = null;\n }\n}\n\nexport class MessageRepository {\n private messages = new Map<string, RepositoryMessage>();\n private head: RepositoryMessage | null = null;\n private root: RepositoryParent = {\n children: [],\n next: null,\n };\n\n private updateLevels(message: RepositoryMessage, newLevel: number) {\n message.level = newLevel;\n for (const childId of message.children) {\n const childMessage = this.messages.get(childId);\n if (childMessage) {\n this.updateLevels(childMessage, newLevel + 1);\n }\n }\n }\n\n private performOp(\n newParent: RepositoryMessage | null,\n child: RepositoryMessage,\n operation: \"cut\" | \"link\" | \"relink\",\n ) {\n const parentOrRoot = child.prev ?? this.root;\n const newParentOrRoot = newParent ?? this.root;\n\n if (operation === \"relink\" && parentOrRoot === newParentOrRoot) return;\n\n if (operation !== \"link\") {\n parentOrRoot.children = parentOrRoot.children.filter(\n (m) => m !== child.current.id,\n );\n\n if (parentOrRoot.next === child) {\n const fallbackId = parentOrRoot.children.at(-1);\n const fallback = fallbackId ? this.messages.get(fallbackId) : null;\n if (fallback === undefined) {\n throw new Error(\n \"MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.\",\n );\n }\n parentOrRoot.next = fallback;\n }\n }\n\n if (operation !== \"cut\") {\n for (\n let current: RepositoryMessage | null = newParent;\n current;\n current = current.prev\n ) {\n if (current.current.id === child.current.id) {\n throw new Error(\n \"MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.\",\n );\n }\n }\n\n newParentOrRoot.children = [\n ...newParentOrRoot.children,\n child.current.id,\n ];\n\n if (findHead(child) === this.head || newParentOrRoot.next === null) {\n newParentOrRoot.next = child;\n }\n\n child.prev = newParent;\n\n const newLevel = newParent ? newParent.level + 1 : 0;\n this.updateLevels(child, newLevel);\n }\n }\n\n private _messages = new CachedValue<readonly ThreadMessage[]>(() => {\n const messages = new Array<ThreadMessage>((this.head?.level ?? -1) + 1);\n for (let current = this.head; current; current = current.prev) {\n messages[current.level] = current.current;\n }\n return messages;\n });\n\n get headId() {\n return this.head?.current.id ?? null;\n }\n\n getMessages(headId?: string) {\n if (headId === undefined || headId === this.head?.current.id) {\n return this._messages.value;\n }\n\n const headMessage = this.messages.get(headId);\n if (!headMessage) {\n throw new Error(\n \"MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.\",\n );\n }\n\n const messages = new Array<ThreadMessage>(headMessage.level + 1);\n for (\n let current: RepositoryMessage | null = headMessage;\n current;\n current = current.prev\n ) {\n messages[current.level] = current.current;\n }\n return messages;\n }\n\n addOrUpdateMessage(parentId: string | null, message: ThreadMessage) {\n const existingItem = this.messages.get(message.id);\n const prev = parentId ? this.messages.get(parentId) : null;\n if (prev === undefined)\n throw new Error(\n \"MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.\",\n );\n\n if (existingItem) {\n existingItem.current = message;\n this.performOp(prev, existingItem, \"relink\");\n this._messages.dirty();\n return;\n }\n\n const newItem: RepositoryMessage = {\n prev,\n current: message,\n next: null,\n children: [],\n level: prev ? prev.level + 1 : 0,\n };\n\n this.messages.set(message.id, newItem);\n this.performOp(prev, newItem, \"link\");\n\n if (this.head === prev) {\n this.head = newItem;\n }\n\n this._messages.dirty();\n }\n\n getMessage(messageId: string) {\n const message = this.messages.get(messageId);\n if (!message)\n throw new Error(\n \"MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.\",\n );\n\n return {\n parentId: message.prev?.current.id ?? null,\n message: message.current,\n index: message.level,\n };\n }\n\n appendOptimisticMessage(parentId: string | null, message: ThreadMessageLike) {\n let optimisticId: string;\n do {\n optimisticId = generateOptimisticId();\n } while (this.messages.has(optimisticId));\n\n this.addOrUpdateMessage(\n parentId,\n fromThreadMessageLike(message, optimisticId, { type: \"running\" }),\n );\n\n return optimisticId;\n }\n\n deleteMessage(messageId: string, replacementId?: string | null | undefined) {\n const message = this.messages.get(messageId);\n\n if (!message)\n throw new Error(\n \"MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.\",\n );\n\n const replacement =\n replacementId === undefined\n ? message.prev\n : replacementId === null\n ? null\n : this.messages.get(replacementId);\n if (replacement === undefined)\n throw new Error(\n \"MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.\",\n );\n\n for (const child of message.children) {\n const childMessage = this.messages.get(child);\n if (!childMessage)\n throw new Error(\n \"MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.\",\n );\n this.performOp(replacement, childMessage, \"relink\");\n }\n\n this.performOp(null, message, \"cut\");\n this.messages.delete(messageId);\n\n if (this.head === message) {\n this.head = findHead(replacement ?? this.root);\n }\n\n this._messages.dirty();\n }\n\n getBranches(messageId: string) {\n const message = this.messages.get(messageId);\n if (!message)\n throw new Error(\n \"MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.\",\n );\n\n const { children } = message.prev ?? this.root;\n return children;\n }\n\n switchToBranch(messageId: string) {\n const message = this.messages.get(messageId);\n if (!message)\n throw new Error(\n \"MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.\",\n );\n\n const prevOrRoot = message.prev ?? this.root;\n prevOrRoot.next = message;\n\n this.head = findHead(message);\n\n this._messages.dirty();\n }\n\n resetHead(messageId: string | null) {\n if (messageId === null) {\n this.clear();\n return;\n }\n\n const message = this.messages.get(messageId);\n if (!message)\n throw new Error(\n \"MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.\",\n );\n\n if (message.children.length > 0) {\n const deleteDescendants = (msg: RepositoryMessage) => {\n for (const childId of msg.children) {\n const childMessage = this.messages.get(childId);\n if (childMessage) {\n deleteDescendants(childMessage);\n this.messages.delete(childId);\n }\n }\n };\n deleteDescendants(message);\n\n message.children = [];\n message.next = null;\n }\n\n this.head = message;\n for (\n let current: RepositoryMessage | null = message;\n current;\n current = current.prev\n ) {\n if (current.prev) {\n current.prev.next = current;\n } else {\n this.root.next = current;\n }\n }\n\n this._messages.dirty();\n }\n\n clear(): void {\n this.messages.clear();\n this.head = null;\n this.root = {\n children: [],\n next: null,\n };\n this._messages.dirty();\n }\n\n export(): ExportedMessageRepository {\n const exportItems: ExportedMessageRepository[\"messages\"] = [];\n\n for (const [, message] of this.messages) {\n exportItems.push({\n message: message.current,\n parentId: message.prev?.current.id ?? null,\n });\n }\n\n return {\n headId: this.head?.current.id ?? null,\n messages: exportItems,\n };\n }\n\n import({ headId, messages }: ExportedMessageRepository) {\n for (const { message, parentId } of messages) {\n this.addOrUpdateMessage(parentId, message);\n }\n\n this.resetHead(headId ?? messages.at(-1)?.message.id ?? null);\n }\n}\n","import type { MessageStatus } from \"../../types/message\";\nimport { ReadonlyJSONValue } from \"assistant-stream/utils\";\n\nconst symbolAutoStatus = Symbol(\"autoStatus\");\n\nconst AUTO_STATUS_RUNNING = Object.freeze(\n Object.assign({ type: \"running\" as const }, { [symbolAutoStatus]: true }),\n);\nconst AUTO_STATUS_COMPLETE = Object.freeze(\n Object.assign(\n {\n type: \"complete\" as const,\n reason: \"unknown\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nconst AUTO_STATUS_PENDING = Object.freeze(\n Object.assign(\n {\n type: \"requires-action\" as const,\n reason: \"tool-calls\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nconst AUTO_STATUS_INTERRUPT = Object.freeze(\n Object.assign(\n {\n type: \"requires-action\" as const,\n reason: \"interrupt\" as const,\n },\n { [symbolAutoStatus]: true },\n ),\n);\n\nexport const isAutoStatus = (status: MessageStatus) =>\n (status as any)[symbolAutoStatus] === true;\n\nexport const getAutoStatus = (\n isLast: boolean,\n isRunning: boolean,\n hasInterruptedToolCalls: boolean,\n hasPendingToolCalls: boolean,\n error?: ReadonlyJSONValue,\n): MessageStatus => {\n if (isLast && error) {\n return Object.assign(\n {\n type: \"incomplete\" as const,\n reason: \"error\" as const,\n error: error,\n },\n { [symbolAutoStatus]: true },\n );\n }\n\n return isLast && isRunning\n ? AUTO_STATUS_RUNNING\n : hasInterruptedToolCalls\n ? AUTO_STATUS_INTERRUPT\n : hasPendingToolCalls\n ? AUTO_STATUS_PENDING\n : AUTO_STATUS_COMPLETE;\n};\n","import { customAlphabet } from \"nanoid/non-secure\";\n\nexport const generateId = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n);\n\nconst optimisticPrefix = \"__optimistic__\";\nexport const generateOptimisticId = () => `${optimisticPrefix}${generateId()}`;\nexport const isOptimisticId = (id: string) => id.startsWith(optimisticPrefix);\n\nconst errorPrefix = \"__error__\";\nexport const generateErrorMessageId = () => `${errorPrefix}${generateId()}`;\nexport const isErrorMessageId = (id: string) => id.startsWith(errorPrefix);\n","import { BaseAssistantRuntimeCore } from \"../../runtime/base/base-assistant-runtime-core\";\nimport { ExternalStoreThreadListRuntimeCore } from \"./external-store-thread-list-runtime-core\";\nimport type { ExternalStoreAdapter } from \"./external-store-adapter\";\nimport { ExternalStoreThreadRuntimeCore } from \"./external-store-thread-runtime-core\";\n\nconst getThreadListAdapter = (store: ExternalStoreAdapter<any>) => {\n return store.adapters?.threadList ?? {};\n};\n\nexport class ExternalStoreRuntimeCore extends BaseAssistantRuntimeCore {\n public readonly threads;\n\n constructor(adapter: ExternalStoreAdapter<any>) {\n super();\n this.threads = new ExternalStoreThreadListRuntimeCore(\n getThreadListAdapter(adapter),\n () => new ExternalStoreThreadRuntimeCore(this._contextProvider, adapter),\n );\n }\n\n public setAdapter(adapter: ExternalStoreAdapter<any>) {\n // Update the thread list adapter and propagate store changes to the main thread\n this.threads.__internal_setAdapter(getThreadListAdapter(adapter));\n this.threads.getMainThreadRuntimeCore().__internal_setAdapter(adapter);\n }\n}\n","import type { AppendMessage, ThreadMessage } from \"../../types/message\";\nimport type {\n AddToolResultOptions,\n ResumeRunConfig,\n ResumeToolCallOptions,\n StartRunConfig,\n ThreadSuggestion,\n} from \"../../runtime/interfaces/thread-runtime-core\";\n\nimport type { ExternalStoreAdapter } from \"./external-store-adapter\";\nimport {\n getExternalStoreMessages,\n bindExternalStoreMessage,\n} from \"../../runtime/utils/external-store-message\";\nimport { ThreadMessageConverter } from \"./thread-message-converter\";\nimport { getAutoStatus, isAutoStatus } from \"../../runtime/utils/auto-status\";\nimport {\n fromThreadMessageLike,\n type ThreadMessageLike,\n} from \"../../runtime/utils/thread-message-like\";\nimport { getThreadMessageText } from \"../../utils/text\";\nimport type {\n RuntimeCapabilities,\n ThreadRuntimeCore,\n} from \"../../runtime/interfaces/thread-runtime-core\";\nimport { BaseThreadRuntimeCore } from \"../../runtime/base/base-thread-runtime-core\";\nimport type { ModelContextProvider } from \"../../model-context/types\";\nimport {\n ExportedMessageRepository,\n MessageRepository,\n} from \"../../runtime/utils/message-repository\";\n\nconst EMPTY_ARRAY: readonly ThreadSuggestion[] = Object.freeze([]);\n\nconst shallowEqual = (a: object, b: object): boolean => {\n const aKeys = Object.keys(a);\n if (aKeys.length !== Object.keys(b).length) return false;\n for (const key of aKeys) {\n if ((a as any)[key] !== (b as any)[key]) return false;\n }\n return true;\n};\n\nexport const hasUpcomingMessage = (\n isRunning: boolean,\n messages: readonly ThreadMessage[],\n) => {\n return isRunning && messages[messages.length - 1]?.role !== \"assistant\";\n};\n\nexport class ExternalStoreThreadRuntimeCore\n extends BaseThreadRuntimeCore\n implements ThreadRuntimeCore\n{\n private _assistantOptimisticId: string | null = null;\n\n private _capabilities: RuntimeCapabilities = {\n switchToBranch: false,\n switchBranchDuringRun: false,\n edit: false,\n reload: false,\n cancel: false,\n unstable_copy: false,\n speech: false,\n dictation: false,\n voice: false,\n attachments: false,\n feedback: false,\n queue: false,\n };\n\n public get capabilities() {\n return this._capabilities;\n }\n\n private _messages!: readonly ThreadMessage[];\n public isDisabled!: boolean;\n public get isLoading() {\n return this._store.isLoading ?? false;\n }\n\n protected override _getBaseMessages(): readonly ThreadMessage[] {\n return this._messages;\n }\n\n public override get state() {\n return this._store.state ?? super.state;\n }\n\n public get adapters() {\n return this._store.adapters;\n }\n\n public suggestions: readonly ThreadSuggestion[] = [];\n public extras: unknown = undefined;\n\n private _converter = new ThreadMessageConverter();\n\n private _store!: ExternalStoreAdapter<any>;\n\n public override beginEdit(messageId: string) {\n if (!this._store.onEdit)\n throw new Error(\"Runtime does not support editing.\");\n\n super.beginEdit(messageId);\n }\n\n constructor(\n contextProvider: ModelContextProvider,\n store: ExternalStoreAdapter<any>,\n ) {\n super(contextProvider);\n this.__internal_setAdapter(store);\n }\n\n public __internal_setAdapter(store: ExternalStoreAdapter<any>) {\n if (this._store === store) return;\n\n const isRunning = store.isRunning ?? false;\n this.isDisabled = store.isDisabled ?? false;\n\n const oldStore = this._store as ExternalStoreAdapter<any> | undefined;\n this._store = store;\n if (this.extras !== store.extras) {\n this.extras = store.extras;\n }\n\n const newSuggestions = store.suggestions ?? EMPTY_ARRAY;\n if (!shallowEqual(this.suggestions, newSuggestions)) {\n this.suggestions = newSuggestions;\n }\n\n const newCapabilities: RuntimeCapabilities = {\n switchToBranch: this._store.setMessages !== undefined,\n switchBranchDuringRun: false,\n edit: this._store.onEdit !== undefined,\n reload: this._store.onReload !== undefined,\n cancel: this._store.onCancel !== undefined,\n speech: this._store.adapters?.speech !== undefined,\n dictation: this._store.adapters?.dictation !== undefined,\n voice: this._store.adapters?.voice !== undefined,\n unstable_copy: this._store.unstable_capabilities?.copy !== false,\n attachments: !!this._store.adapters?.attachments,\n feedback: !!this._store.adapters?.feedback,\n queue: false,\n };\n if (!shallowEqual(this._capabilities, newCapabilities)) {\n this._capabilities = newCapabilities;\n }\n\n let messages: readonly ThreadMessage[];\n\n if (store.messageRepository) {\n // Handle messageRepository\n if (\n oldStore &&\n oldStore.isRunning === store.isRunning &&\n oldStore.messageRepository === store.messageRepository\n ) {\n this._notifySubscribers();\n return;\n }\n\n // Clear and import the message repository\n this.repository.clear();\n this._assistantOptimisticId = null;\n this.repository.import(store.messageRepository);\n\n messages = this.repository.getMessages();\n } else if (store.messages) {\n // Handle messages array\n\n if (oldStore) {\n // flush the converter cache when the convertMessage prop changes\n if (oldStore.convertMessage !== store.convertMessage) {\n this._converter = new ThreadMessageConverter();\n } else if (\n oldStore.isRunning === store.isRunning &&\n oldStore.messages === store.messages\n ) {\n this._notifySubscribers();\n // no conversion update\n return;\n }\n }\n\n messages = !store.convertMessage\n ? store.messages\n : this._converter.convertMessages(store.messages, (cache, m, idx) => {\n if (!store.convertMessage) return m;\n\n const isLast = idx === (store.messages?.length ?? 0) - 1;\n const autoStatus = getAutoStatus(\n isLast,\n isRunning,\n false,\n false,\n undefined,\n );\n\n if (\n cache &&\n (cache.role !== \"assistant\" ||\n !isAutoStatus(cache.status) ||\n cache.status === autoStatus)\n )\n return cache;\n\n const messageLike = store.convertMessage(m, idx);\n const newMessage = fromThreadMessageLike(\n messageLike,\n idx.toString(),\n autoStatus,\n );\n bindExternalStoreMessage(newMessage, m);\n return newMessage;\n });\n\n for (let i = 0; i < messages.length; i++) {\n const message = messages[i]!;\n const parent = messages[i - 1];\n this.repository.addOrUpdateMessage(parent?.id ?? null, message);\n }\n } else {\n throw new Error(\n \"ExternalStoreAdapter must provide either 'messages' or 'messageRepository'\",\n );\n }\n\n // Common logic for both paths\n if (messages.length > 0) this.ensureInitialized();\n\n if ((oldStore?.isRunning ?? false) !== (store.isRunning ?? false)) {\n if (store.isRunning) {\n this._notifyEventSubscribers(\"runStart\");\n } else {\n this._notifyEventSubscribers(\"runEnd\");\n }\n }\n\n if (this._assistantOptimisticId) {\n this.repository.deleteMessage(this._assistantOptimisticId);\n this._assistantOptimisticId = null;\n }\n\n if (hasUpcomingMessage(isRunning, messages)) {\n this._assistantOptimisticId = this.repository.appendOptimisticMessage(\n messages.at(-1)?.id ?? null,\n {\n role: \"assistant\",\n content: [],\n },\n );\n }\n\n this.repository.resetHead(\n this._assistantOptimisticId ?? messages.at(-1)?.id ?? null,\n );\n\n this._messages = this.repository.getMessages();\n this._notifySubscribers();\n }\n\n public override switchToBranch(branchId: string): void {\n if (!this._store.setMessages)\n throw new Error(\"Runtime does not support switching branches.\");\n\n // Silently ignore branch switches while running\n if (this._store.isRunning) {\n return;\n }\n\n this.repository.switchToBranch(branchId);\n this.updateMessages(this.repository.getMessages());\n }\n\n public async append(message: AppendMessage): Promise<void> {\n if (message.parentId !== (this.messages.at(-1)?.id ?? null)) {\n if (!this._store.onEdit)\n throw new Error(\"Runtime does not support editing messages.\");\n await this._store.onEdit(message);\n } else {\n await this._store.onNew(message);\n }\n }\n\n public async startRun(config: StartRunConfig): Promise<void> {\n if (!this._store.onReload)\n throw new Error(\"Runtime does not support reloading messages.\");\n\n await this._store.onReload(config.parentId, config);\n }\n\n public async resumeRun(config: ResumeRunConfig): Promise<void> {\n if (!this._store.onResume)\n throw new Error(\"Runtime does not support resuming runs.\");\n\n await this._store.onResume(config);\n }\n\n public exportExternalState(): any {\n if (!this._store.onExportExternalState)\n throw new Error(\"Runtime does not support exporting external states.\");\n\n return this._store.onExportExternalState();\n }\n\n public importExternalState(state: any): void {\n if (!this._store.onLoadExternalState)\n throw new Error(\"Runtime does not support importing external states.\");\n\n this._store.onLoadExternalState(state);\n }\n\n public unstable_loadExternalState(state: any): void {\n this.importExternalState(state);\n }\n\n public cancelRun(): void {\n if (!this._store.onCancel)\n throw new Error(\"Runtime does not support cancelling runs.\");\n\n this._store.onCancel();\n\n if (this._assistantOptimisticId) {\n this.repository.deleteMessage(this._assistantOptimisticId);\n this._assistantOptimisticId = null;\n }\n\n let messages = this.repository.getMessages();\n const previousMessage = messages[messages.length - 1];\n if (\n previousMessage?.role === \"user\" &&\n previousMessage.id === messages.at(-1)?.id // ensure the previous message is a leaf node\n ) {\n this.repository.deleteMessage(previousMessage.id);\n if (!this.composer.text.trim()) {\n this.composer.setText(getThreadMessageText(previousMessage));\n }\n\n messages = this.repository.getMessages();\n } else {\n this._notifySubscribers();\n }\n\n // resync messages (for reloading, to restore the previous branch)\n setTimeout(() => {\n this.updateMessages(messages);\n }, 0);\n }\n\n public addToolResult(options: AddToolResultOptions) {\n if (!this._store.onAddToolResult && !this._store.onAddToolResult)\n throw new Error(\"Runtime does not support tool results.\");\n this._store.onAddToolResult?.(options);\n }\n\n public resumeToolCall(options: ResumeToolCallOptions) {\n if (!this._store.onResumeToolCall)\n throw new Error(\"Runtime does not support resuming tool calls.\");\n this._store.onResumeToolCall(options);\n }\n\n public override reset(initialMessages?: readonly ThreadMessageLike[]) {\n const repo = new MessageRepository();\n repo.import(ExportedMessageRepository.fromArray(initialMessages ?? []));\n this.updateMessages(repo.getMessages());\n }\n\n public override import(data: ExportedMessageRepository) {\n this._assistantOptimisticId = null;\n\n super.import(data);\n\n if (this._store.onImport) {\n this._store.onImport(this.repository.getMessages());\n }\n }\n\n private updateMessages = (messages: readonly ThreadMessage[]) => {\n const hasConverter = this._store.convertMessage !== undefined;\n if (hasConverter) {\n this._store.setMessages?.(messages.flatMap(getExternalStoreMessages));\n } else {\n // TODO mark this as readonly in v0.12.0\n this._store.setMessages?.(messages as ThreadMessage[]);\n }\n };\n}\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { ModelContextProvider } from \"../../model-context/types\";\nimport { CompositeContextProvider } from \"../../utils/composite-context-provider\";\nimport type { AssistantRuntimeCore } from \"../interfaces/assistant-runtime-core\";\nimport type { ThreadListRuntimeCore } from \"../interfaces/thread-list-runtime-core\";\n\nexport abstract class BaseAssistantRuntimeCore implements AssistantRuntimeCore {\n protected readonly _contextProvider = new CompositeContextProvider();\n public abstract get threads(): ThreadListRuntimeCore;\n\n public registerModelContextProvider(\n provider: ModelContextProvider,\n ): Unsubscribe {\n return this._contextProvider.registerModelContextProvider(provider);\n }\n\n public getModelContextProvider(): ModelContextProvider {\n return this._contextProvider;\n }\n}\n","import type { ThreadMessage } from \"../../types/message\";\n\nexport type ConverterCallback<TIn> = (\n cache: ThreadMessage | undefined,\n message: TIn,\n idx: number,\n) => ThreadMessage;\n\nexport class ThreadMessageConverter {\n private readonly cache = new WeakMap<WeakKey, ThreadMessage>();\n\n convertMessages<TIn extends WeakKey>(\n messages: readonly TIn[],\n converter: ConverterCallback<TIn>,\n ): ThreadMessage[] {\n return messages.map((m, idx) => {\n const cached = this.cache.get(m);\n const newMessage = converter(cached, m, idx);\n this.cache.set(m, newMessage);\n return newMessage;\n });\n }\n}\n","import type { AppendMessage, ThreadMessage } from \"../types/message\";\nimport type { TextMessagePart } from \"../types/message\";\n\nexport const getThreadMessageText = (\n message: ThreadMessage | AppendMessage,\n) => {\n const textParts = message.content.filter(\n (part) => part.type === \"text\",\n ) as TextMessagePart[];\n\n return textParts.map((part) => part.text).join(\"\\n\\n\");\n};\n","import sjson from \"secure-json-parse\";\nimport { fixJson } from \"./fix-json\";\nimport { ReadonlyJSONObject } from \"./json-value\";\n\nconst PARTIAL_JSON_OBJECT_META_SYMBOL = Symbol(\n \"aui.parse-partial-json-object.meta\",\n);\n\ntype FieldState = \"complete\" | \"partial\";\n\ntype PartialJsonObjectMeta = {\n state: \"complete\" | \"partial\";\n partialPath: string[];\n};\n\nexport const getPartialJsonObjectMeta = (\n obj: Record<symbol, unknown>,\n): PartialJsonObjectMeta | undefined => {\n return obj?.[PARTIAL_JSON_OBJECT_META_SYMBOL] as PartialJsonObjectMeta;\n};\n\nexport const parsePartialJsonObject = (\n json: string,\n):\n | (ReadonlyJSONObject & {\n [PARTIAL_JSON_OBJECT_META_SYMBOL]: PartialJsonObjectMeta;\n })\n | undefined => {\n if (json.length === 0)\n return {\n [PARTIAL_JSON_OBJECT_META_SYMBOL]: { state: \"partial\", partialPath: [] },\n };\n\n try {\n const res = sjson.parse(json);\n if (typeof res !== \"object\" || res === null)\n throw new Error(\"argsText is expected to be an object\");\n\n res[PARTIAL_JSON_OBJECT_META_SYMBOL] = {\n state: \"complete\",\n partialPath: [],\n };\n return res;\n } catch {\n try {\n const [fixedJson, partialPath] = fixJson(json);\n const res = sjson.parse(fixedJson);\n if (typeof res !== \"object\" || res === null)\n throw new Error(\"argsText is expected to be an object\");\n\n res[PARTIAL_JSON_OBJECT_META_SYMBOL] = {\n state: \"partial\",\n partialPath,\n };\n return res;\n } catch {\n return undefined;\n }\n }\n};\n\nconst getFieldState = (\n parent: unknown,\n parentMeta: PartialJsonObjectMeta,\n fieldPath: string[],\n): FieldState => {\n if (typeof parent !== \"object\" || parent === null) return parentMeta.state;\n\n // 1) parent is complete: return \"complete\"\n if (parentMeta.state === \"complete\") return \"complete\";\n\n // 2) we finished traversing: return parent state\n if (fieldPath.length === 0) return parentMeta.state;\n\n const [field, ...restPath] = fieldPath as [string, ...string[]];\n\n // 3) field doesn't yet exist in parent: return \"partial\"\n if (!Object.prototype.hasOwnProperty.call(parent, field)) return \"partial\";\n\n const [partialField, ...restPartialPath] = parentMeta.partialPath;\n\n // 4) field exists but is not partial: return \"complete\"\n if (field !== partialField) return \"complete\";\n\n // 5) field exists and is partial: return child state\n const child = (parent as Record<string, unknown>)[field];\n const childMeta: PartialJsonObjectMeta = {\n state: \"partial\",\n partialPath: restPartialPath,\n };\n\n return getFieldState(child, childMeta, restPath);\n};\n\nexport const getPartialJsonObjectFieldState = (\n obj: Record<string, unknown>,\n fieldPath: (string | number)[],\n): FieldState => {\n const meta = getPartialJsonObjectMeta(obj);\n if (!meta) throw new Error(\"unable to determine object state\");\n\n return getFieldState(obj, meta, fieldPath.map(String));\n};\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { SubscribableWithState } from \"../../subscribable/subscribable\";\nimport type { ThreadListItemRuntimePath } from \"./paths\";\nimport type { ThreadListRuntimeCoreBinding } from \"./thread-list-runtime\";\n\nexport type ThreadListItemEventType = \"switchedTo\" | \"switchedAway\";\n\nimport type { ThreadListItemState } from \"./bindings\";\nimport type { ThreadListItemStatus } from \"../interfaces/thread-list-runtime-core\";\n\nexport type { ThreadListItemState, ThreadListItemStatus };\n\nexport type ThreadListItemRuntime = {\n readonly path: ThreadListItemRuntimePath;\n getState(): ThreadListItemState;\n\n initialize(): Promise<{ remoteId: string; externalId: string | undefined }>;\n generateTitle(): Promise<void>;\n\n switchTo(): Promise<void>;\n rename(newTitle: string): Promise<void>;\n archive(): Promise<void>;\n unarchive(): Promise<void>;\n delete(): Promise<void>;\n\n detach(): void;\n\n subscribe(callback: () => void): Unsubscribe;\n\n unstable_on(\n event: ThreadListItemEventType,\n callback: () => void,\n ): Unsubscribe;\n\n __internal_getRuntime(): ThreadListItemRuntime;\n};\n\nexport type ThreadListItemStateBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport class ThreadListItemRuntimeImpl implements ThreadListItemRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: ThreadListItemStateBinding,\n private _threadListBinding: ThreadListRuntimeCoreBinding,\n ) {\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.switchTo = this.switchTo.bind(this);\n this.rename = this.rename.bind(this);\n this.archive = this.archive.bind(this);\n this.unarchive = this.unarchive.bind(this);\n this.delete = this.delete.bind(this);\n this.initialize = this.initialize.bind(this);\n this.generateTitle = this.generateTitle.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getState = this.getState.bind(this);\n this.detach = this.detach.bind(this);\n }\n\n public getState(): ThreadListItemState {\n return this._core.getState();\n }\n\n public switchTo(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.switchToThread(state.id);\n }\n\n public rename(newTitle: string): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.rename(state.id, newTitle);\n }\n\n public archive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.archive(state.id);\n }\n\n public unarchive(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.unarchive(state.id);\n }\n\n public delete(): Promise<void> {\n const state = this._core.getState();\n\n return this._threadListBinding.delete(state.id);\n }\n\n public initialize(): Promise<{\n remoteId: string;\n externalId: string | undefined;\n }> {\n const state = this._core.getState();\n return this._threadListBinding.initialize(state.id);\n }\n\n public generateTitle(): Promise<void> {\n const state = this._core.getState();\n return this._threadListBinding.generateTitle(state.id);\n }\n\n public unstable_on(event: ThreadListItemEventType, callback: () => void) {\n let prevIsMain = this._core.getState().isMain;\n let prevThreadId = this._core.getState().id;\n return this.subscribe(() => {\n const currentState = this._core.getState();\n const newIsMain = currentState.isMain;\n const newThreadId = currentState.id;\n if (prevIsMain === newIsMain && prevThreadId === newThreadId) return;\n prevIsMain = newIsMain;\n prevThreadId = newThreadId;\n\n if (event === \"switchedTo\" && !newIsMain) return;\n if (event === \"switchedAway\" && newIsMain) return;\n callback();\n });\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n\n public detach(): void {\n const state = this._core.getState();\n\n this._threadListBinding.detach(state.id);\n }\n\n public __internal_getRuntime(): ThreadListItemRuntime {\n return this;\n }\n}\n","\"use client\";\n\nimport { useEffect, useMemo, useState } from \"react\";\nimport { ExternalStoreRuntimeCore } from \"../../runtimes/internal\";\nimport type { ExternalStoreAdapter } from \"../../runtimes/external-store/external-store-adapter\";\nimport type { AssistantRuntime } from \"../../runtime/api/assistant-runtime\";\nimport { AssistantRuntimeImpl } from \"../../runtime/internal\";\nimport { useRuntimeAdapters } from \"./RuntimeAdapterProvider\";\n\nexport const useExternalStoreRuntime = <T>(\n store: ExternalStoreAdapter<T>,\n): AssistantRuntime => {\n const [runtime] = useState(() => new ExternalStoreRuntimeCore(store));\n\n useEffect(() => {\n runtime.setAdapter(store);\n });\n\n const { modelContext } = useRuntimeAdapters() ?? {};\n\n useEffect(() => {\n if (!modelContext) return undefined;\n return runtime.registerModelContextProvider(modelContext);\n }, [modelContext, runtime]);\n\n return useMemo(() => new AssistantRuntimeImpl(runtime), [runtime]);\n};\n","import type {\n AppendMessage,\n ThreadAssistantMessage,\n ThreadMessage,\n} from \"../../types/message\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { ModelContextProvider } from \"../../model-context/types\";\nimport { getThreadMessageText } from \"../../utils/text\";\nimport { generateId } from \"../../utils/id\";\nimport {\n ExportedMessageRepository,\n MessageRepository,\n} from \"../utils/message-repository\";\nimport { DefaultThreadComposerRuntimeCore } from \"./default-thread-composer-runtime-core\";\nimport type {\n AddToolResultOptions,\n ResumeToolCallOptions,\n ThreadSuggestion,\n SubmitFeedbackOptions,\n ThreadRuntimeCore,\n SpeechState,\n VoiceSessionState,\n RuntimeCapabilities,\n ThreadRuntimeEventType,\n StartRunConfig,\n ResumeRunConfig,\n} from \"../interfaces/thread-runtime-core\";\nimport { DefaultEditComposerRuntimeCore } from \"./default-edit-composer-runtime-core\";\nimport type { SpeechSynthesisAdapter } from \"../../adapters/speech\";\nimport type { FeedbackAdapter } from \"../../adapters/feedback\";\nimport type { AttachmentAdapter } from \"../../adapters/attachment\";\nimport type { RealtimeVoiceAdapter } from \"../../adapters/voice\";\nimport type { ThreadMessageLike } from \"../utils/thread-message-like\";\n\ntype BaseThreadAdapters = {\n speech?: SpeechSynthesisAdapter | undefined;\n feedback?: FeedbackAdapter | undefined;\n attachments?: AttachmentAdapter | undefined;\n voice?: RealtimeVoiceAdapter | undefined;\n};\n\nexport abstract class BaseThreadRuntimeCore implements ThreadRuntimeCore {\n private _subscriptions = new Set<() => void>();\n private _isInitialized = false;\n\n protected readonly repository = new MessageRepository();\n public abstract get adapters(): BaseThreadAdapters | undefined;\n public abstract get isDisabled(): boolean;\n public abstract get isLoading(): boolean;\n public abstract get suggestions(): readonly ThreadSuggestion[];\n public abstract get extras(): unknown;\n\n public abstract get capabilities(): RuntimeCapabilities;\n public abstract append(message: AppendMessage): void;\n public abstract startRun(config: StartRunConfig): void;\n public abstract resumeRun(config: ResumeRunConfig): void;\n public abstract addToolResult(options: AddToolResultOptions): void;\n public abstract resumeToolCall(options: ResumeToolCallOptions): void;\n public abstract cancelRun(): void;\n public abstract exportExternalState(): any;\n public abstract importExternalState(state: any): void;\n public abstract unstable_loadExternalState(state: any): void;\n\n protected _voiceMessages: ThreadMessage[] = [];\n protected _voiceGeneration = 0;\n private _cachedMergedMessages: readonly ThreadMessage[] | null = null;\n private _cachedVoiceGeneration = -1;\n private _cachedMergedBase: readonly ThreadMessage[] | null = null;\n\n protected _markVoiceMessagesDirty() {\n this._voiceGeneration++;\n this._cachedMergedMessages = null;\n }\n\n protected _getBaseMessages(): readonly ThreadMessage[] {\n return this.repository.getMessages();\n }\n\n public get messages(): readonly ThreadMessage[] {\n if (this._voiceMessages.length === 0) {\n return this._getBaseMessages();\n }\n const base = this._getBaseMessages();\n if (\n this._cachedVoiceGeneration !== this._voiceGeneration ||\n this._cachedMergedBase !== base\n ) {\n this._cachedMergedMessages = [...base, ...this._voiceMessages];\n this._cachedVoiceGeneration = this._voiceGeneration;\n this._cachedMergedBase = base;\n }\n return this._cachedMergedMessages!;\n }\n\n public get state() {\n let mostRecentAssistantMessage;\n for (const message of this.messages) {\n if (message.role === \"assistant\") {\n mostRecentAssistantMessage = message;\n }\n }\n\n return mostRecentAssistantMessage?.metadata.unstable_state ?? null;\n }\n\n public readonly composer = new DefaultThreadComposerRuntimeCore(this);\n\n constructor(private readonly _contextProvider: ModelContextProvider) {}\n\n public getModelContext() {\n return this._contextProvider.getModelContext();\n }\n\n private _editComposers = new Map<string, DefaultEditComposerRuntimeCore>();\n public getEditComposer(messageId: string) {\n return this._editComposers.get(messageId);\n }\n public beginEdit(messageId: string) {\n if (this._editComposers.has(messageId))\n throw new Error(\"Edit already in progress\");\n\n this._editComposers.set(\n messageId,\n new DefaultEditComposerRuntimeCore(\n this,\n () => this._editComposers.delete(messageId),\n this.repository.getMessage(messageId),\n ),\n );\n this._notifySubscribers();\n }\n\n public getMessageById(messageId: string) {\n try {\n return this.repository.getMessage(messageId);\n } catch {\n // Check voice messages\n const baseMessages = this.repository.getMessages();\n const voiceIdx = this._voiceMessages.findIndex((m) => m.id === messageId);\n if (voiceIdx !== -1) {\n const parentId =\n voiceIdx > 0\n ? this._voiceMessages[voiceIdx - 1]!.id\n : (baseMessages.at(-1)?.id ?? null);\n return {\n parentId,\n message: this._voiceMessages[voiceIdx]!,\n index: baseMessages.length + voiceIdx,\n };\n }\n return undefined;\n }\n }\n\n public getBranches(messageId: string): string[] {\n if (this._voiceMessages.some((m) => m.id === messageId)) {\n return [];\n }\n return this.repository.getBranches(messageId);\n }\n\n public switchToBranch(branchId: string): void {\n this.repository.switchToBranch(branchId);\n this._notifySubscribers();\n }\n\n protected _notifySubscribers() {\n for (const callback of this._subscriptions) callback();\n }\n\n public _notifyEventSubscribers(event: ThreadRuntimeEventType) {\n const subscribers = this._eventSubscribers.get(event);\n if (!subscribers) return;\n\n for (const callback of subscribers) callback();\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n this._subscriptions.add(callback);\n return () => this._subscriptions.delete(callback);\n }\n\n public submitFeedback({ messageId, type }: SubmitFeedbackOptions) {\n const adapter = this.adapters?.feedback;\n if (!adapter) throw new Error(\"Feedback adapter not configured\");\n\n const { message, parentId } = this.repository.getMessage(messageId);\n adapter.submit({ message, type });\n\n if (message.role === \"assistant\") {\n const updatedMessage: ThreadMessage = {\n ...message,\n metadata: {\n ...message.metadata,\n submittedFeedback: { type },\n },\n };\n this.repository.addOrUpdateMessage(parentId, updatedMessage);\n }\n\n this._notifySubscribers();\n }\n\n private _stopSpeaking: Unsubscribe | undefined;\n public speech: SpeechState | undefined;\n\n public speak(messageId: string) {\n const adapter = this.adapters?.speech;\n if (!adapter) throw new Error(\"Speech adapter not configured\");\n\n const { message } = this.repository.getMessage(messageId);\n\n this._stopSpeaking?.();\n\n const utterance = adapter.speak(getThreadMessageText(message));\n const unsub = utterance.subscribe(() => {\n if (utterance.status.type === \"ended\") {\n this._stopSpeaking = undefined;\n this.speech = undefined;\n } else {\n this.speech = { messageId, status: utterance.status };\n }\n this._notifySubscribers();\n });\n\n this.speech = { messageId, status: utterance.status };\n this._notifySubscribers();\n\n this._stopSpeaking = () => {\n utterance.cancel();\n unsub();\n this.speech = undefined;\n this._stopSpeaking = undefined;\n };\n }\n\n public stopSpeaking() {\n if (!this._stopSpeaking) throw new Error(\"No message is being spoken\");\n this._stopSpeaking();\n this._notifySubscribers();\n }\n\n private _voiceSession: RealtimeVoiceAdapter.Session | undefined;\n private _voiceUnsubs: Array<() => void> = [];\n public voice: VoiceSessionState | undefined;\n\n private _voiceVolume = 0;\n private _voiceVolumeSubscribers = new Set<() => void>();\n\n public getVoiceVolume = () => this._voiceVolume;\n\n public subscribeVoiceVolume = (callback: () => void): Unsubscribe => {\n this._voiceVolumeSubscribers.add(callback);\n return () => this._voiceVolumeSubscribers.delete(callback);\n };\n\n public connectVoice() {\n const adapter = this.adapters?.voice;\n if (!adapter) throw new Error(\"Voice adapter not configured\");\n\n this.disconnectVoice();\n\n const session = adapter.connect({});\n this._voiceSession = session;\n const unsubs: Array<() => void> = [];\n\n let currentMode: RealtimeVoiceAdapter.Mode = \"listening\";\n\n this.voice = {\n status: session.status,\n isMuted: session.isMuted,\n mode: currentMode,\n };\n this._voiceVolume = 0;\n this._notifySubscribers();\n\n unsubs.push(\n session.onStatusChange((status) => {\n if (status.type === \"ended\") {\n this._finishVoiceAssistantMessage();\n this._voiceSession = undefined;\n this.voice = undefined;\n } else {\n this.voice = {\n status,\n isMuted: session.isMuted,\n mode: currentMode,\n };\n }\n this._notifySubscribers();\n }),\n );\n\n unsubs.push(\n session.onModeChange((mode) => {\n currentMode = mode;\n if (this.voice) {\n this.voice = { ...this.voice, mode };\n this._notifySubscribers();\n }\n }),\n );\n\n unsubs.push(\n session.onVolumeChange((volume) => {\n this._voiceVolume = volume;\n for (const cb of this._voiceVolumeSubscribers) cb();\n }),\n );\n\n unsubs.push(\n session.onTranscript((transcript) => {\n this._handleVoiceTranscript(transcript);\n }),\n );\n\n this._voiceUnsubs = unsubs;\n }\n\n private _currentAssistantMsg: ThreadAssistantMessage | null = null;\n\n private _handleVoiceTranscript(\n transcript: RealtimeVoiceAdapter.TranscriptItem,\n ) {\n this.ensureInitialized();\n\n if (transcript.role === \"user\") {\n this._finishVoiceAssistantMessage();\n this._currentAssistantMsg = null;\n\n if (transcript.isFinal) {\n this._voiceMessages.push({\n id: generateId(),\n role: \"user\",\n content: [{ type: \"text\", text: transcript.text }],\n metadata: { custom: {} },\n createdAt: new Date(),\n status: { type: \"complete\", reason: \"unknown\" },\n attachments: [],\n });\n this._markVoiceMessagesDirty();\n this._notifySubscribers();\n }\n } else {\n if (!this._currentAssistantMsg) {\n this._currentAssistantMsg = {\n id: generateId(),\n role: \"assistant\",\n content: [{ type: \"text\", text: transcript.text }],\n metadata: {\n unstable_state: this.state,\n unstable_annotations: [],\n unstable_data: [],\n steps: [],\n custom: {},\n },\n status: { type: \"running\" },\n createdAt: new Date(),\n };\n this._voiceMessages.push(this._currentAssistantMsg);\n } else {\n const idx = this._voiceMessages.indexOf(this._currentAssistantMsg);\n if (idx === -1) return;\n const updated: ThreadAssistantMessage = {\n ...this._currentAssistantMsg,\n content: [{ type: \"text\", text: transcript.text }],\n ...(transcript.isFinal\n ? { status: { type: \"complete\", reason: \"stop\" } }\n : {}),\n };\n this._voiceMessages[idx] = updated;\n this._currentAssistantMsg = updated;\n }\n\n if (transcript.isFinal) {\n this._currentAssistantMsg = null;\n }\n\n this._markVoiceMessagesDirty();\n this._notifySubscribers();\n }\n }\n\n private _finishVoiceAssistantMessage() {\n const last = this._voiceMessages.at(-1);\n if (last?.role === \"assistant\" && last.status.type === \"running\") {\n const idx = this._voiceMessages.length - 1;\n this._voiceMessages[idx] = {\n ...(last as ThreadAssistantMessage),\n status: { type: \"complete\", reason: \"stop\" },\n };\n this._markVoiceMessagesDirty();\n this._notifySubscribers();\n }\n }\n\n public disconnectVoice() {\n this._finishVoiceAssistantMessage();\n this._currentAssistantMsg = null;\n for (const unsub of this._voiceUnsubs) unsub();\n this._voiceUnsubs = [];\n this._voiceSession?.disconnect();\n this._voiceSession = undefined;\n this.voice = undefined;\n this._voiceVolume = 0;\n for (const cb of this._voiceVolumeSubscribers) cb();\n this._voiceMessages = [];\n this._markVoiceMessagesDirty();\n this._notifySubscribers();\n }\n\n public muteVoice() {\n if (!this._voiceSession) throw new Error(\"No active voice session\");\n this._voiceSession.mute();\n this.voice = {\n ...this.voice!,\n isMuted: true,\n };\n this._notifySubscribers();\n }\n\n public unmuteVoice() {\n if (!this._voiceSession) throw new Error(\"No active voice session\");\n this._voiceSession.unmute();\n this.voice = {\n ...this.voice!,\n isMuted: false,\n };\n this._notifySubscribers();\n }\n\n protected ensureInitialized() {\n if (!this._isInitialized) {\n this._isInitialized = true;\n this._notifyEventSubscribers(\"initialize\");\n }\n }\n\n public export() {\n return this.repository.export();\n }\n\n public import(data: ExportedMessageRepository) {\n this.ensureInitialized();\n this.repository.clear();\n this.repository.import(data);\n this._notifySubscribers();\n }\n\n public reset(initialMessages?: readonly ThreadMessageLike[]) {\n this.import(ExportedMessageRepository.fromArray(initialMessages ?? []));\n }\n\n private _eventSubscribers = new Map<\n ThreadRuntimeEventType,\n Set<() => void>\n >();\n\n public unstable_on(event: ThreadRuntimeEventType, callback: () => void) {\n if (event === \"modelContextUpdate\") {\n return this._contextProvider.subscribe?.(callback) ?? (() => {});\n }\n\n const subscribers = this._eventSubscribers.get(event);\n if (!subscribers) {\n this._eventSubscribers.set(event, new Set([callback]));\n } else {\n subscribers.add(callback);\n }\n\n return () => {\n const subscribers = this._eventSubscribers.get(event)!;\n subscribers.delete(callback);\n };\n }\n}\n","import { parsePartialJsonObject } from \"assistant-stream/utils\";\nimport { generateId } from \"../../utils/id\";\nimport type {\n ReasoningMessagePart,\n SourceMessagePart,\n ThreadStep,\n MessageStatus,\n ImageMessagePart,\n ThreadMessage,\n ThreadAssistantMessagePart,\n ThreadAssistantMessage,\n ThreadUserMessagePart,\n ThreadUserMessage,\n ThreadSystemMessage,\n FileMessagePart,\n DataMessagePart,\n Unstable_AudioMessagePart,\n} from \"../../types/message\";\nimport type { CompleteAttachment } from \"../../types/attachment\";\nimport type { MessageTiming, TextMessagePart } from \"../../types/message\";\nimport { ReadonlyJSONObject, ReadonlyJSONValue } from \"assistant-stream/utils\";\n\ntype DataPrefixedPart = {\n readonly type: `data-${string}`;\n readonly data: any;\n};\n\nexport type ThreadMessageLike = {\n readonly role: \"assistant\" | \"user\" | \"system\";\n readonly content:\n | string\n | readonly (\n | TextMessagePart\n | ReasoningMessagePart\n | SourceMessagePart\n | ImageMessagePart\n | FileMessagePart\n | DataMessagePart\n | Unstable_AudioMessagePart\n | DataPrefixedPart\n | {\n readonly type: \"tool-call\";\n readonly toolCallId?: string;\n readonly toolName: string;\n readonly args?: ReadonlyJSONObject;\n readonly argsText?: string;\n readonly artifact?: any;\n readonly result?: any | undefined;\n readonly isError?: boolean | undefined;\n readonly parentId?: string | undefined;\n readonly messages?: readonly ThreadMessage[] | undefined;\n }\n )[];\n readonly id?: string | undefined;\n readonly createdAt?: Date | undefined;\n readonly status?: MessageStatus | undefined;\n readonly attachments?:\n | readonly (Omit<CompleteAttachment, \"content\"> & {\n readonly content: readonly (ThreadUserMessagePart | DataPrefixedPart)[];\n })[]\n | undefined;\n readonly metadata?:\n | {\n readonly unstable_state?: ReadonlyJSONValue;\n readonly unstable_annotations?:\n | readonly ReadonlyJSONValue[]\n | undefined;\n readonly unstable_data?: readonly ReadonlyJSONValue[] | undefined;\n readonly steps?: readonly ThreadStep[] | undefined;\n readonly timing?: MessageTiming | undefined;\n readonly submittedFeedback?: { readonly type: \"positive\" | \"negative\" };\n readonly custom?: Record<string, unknown> | undefined;\n }\n | undefined;\n};\n\nconst convertDataPrefixedPart = (\n type: string,\n data: unknown,\n): DataMessagePart | undefined => {\n if (!type.startsWith(\"data-\")) return undefined;\n return { type: \"data\", name: type.substring(5), data };\n};\n\nexport const fromThreadMessageLike = (\n like: ThreadMessageLike,\n fallbackId: string,\n fallbackStatus: MessageStatus,\n): ThreadMessage => {\n const { role, id, createdAt, attachments, status, metadata } = like;\n const common = {\n id: id ?? fallbackId,\n createdAt: createdAt ?? new Date(),\n };\n\n const content =\n typeof like.content === \"string\"\n ? [{ type: \"text\" as const, text: like.content }]\n : like.content;\n\n const sanitizeImageContent = ({\n image,\n ...rest\n }: ImageMessagePart): ImageMessagePart | null => {\n const match = image.match(\n /^data:image\\/(png|jpeg|jpg|gif|webp);base64,(.*)$/,\n );\n if (match) {\n return { ...rest, image };\n }\n console.warn(`Invalid image data format detected`);\n return null;\n };\n\n if (role !== \"user\" && attachments?.length)\n throw new Error(\"attachments are only supported for user messages\");\n\n if (role !== \"assistant\" && status)\n throw new Error(\"status is only supported for assistant messages\");\n\n if (role !== \"assistant\" && metadata?.steps)\n throw new Error(\"metadata.steps is only supported for assistant messages\");\n\n switch (role) {\n case \"assistant\":\n return {\n ...common,\n role,\n content: content\n .map((part): ThreadAssistantMessagePart | null => {\n const type = part.type;\n switch (type) {\n case \"text\":\n case \"reasoning\":\n if (part.text.trim().length === 0) return null;\n return part;\n\n case \"file\":\n case \"source\":\n return part;\n\n case \"image\":\n return sanitizeImageContent(part);\n\n case \"data\":\n return part;\n\n case \"tool-call\": {\n const { parentId, messages, ...basePart } = part;\n const commonProps = {\n ...basePart,\n toolCallId: part.toolCallId ?? `tool-${generateId()}`,\n ...(parentId !== undefined && { parentId }),\n ...(messages !== undefined && { messages }),\n };\n\n if (part.args) {\n return {\n ...commonProps,\n args: part.args,\n argsText: part.argsText ?? JSON.stringify(part.args),\n };\n }\n return {\n ...commonProps,\n args: parsePartialJsonObject(part.argsText ?? \"\") ?? {},\n argsText: part.argsText ?? \"\",\n };\n }\n\n default: {\n const converted = convertDataPrefixedPart(\n type,\n (part as DataPrefixedPart).data,\n );\n if (converted) return converted;\n throw new Error(\n `Unsupported assistant message part type: ${type}`,\n );\n }\n }\n })\n .filter((c) => !!c),\n status: status ?? fallbackStatus,\n metadata: {\n unstable_state: metadata?.unstable_state ?? null,\n unstable_annotations: metadata?.unstable_annotations ?? [],\n unstable_data: metadata?.unstable_data ?? [],\n custom: metadata?.custom ?? {},\n steps: metadata?.steps ?? [],\n ...(metadata?.timing && { timing: metadata.timing }),\n ...(metadata?.submittedFeedback && {\n submittedFeedback: metadata.submittedFeedback,\n }),\n },\n } satisfies ThreadAssistantMessage;\n\n case \"user\":\n return {\n ...common,\n role,\n content: content.map((part): ThreadUserMessagePart => {\n const type = part.type;\n switch (type) {\n case \"text\":\n case \"image\":\n case \"audio\":\n case \"file\":\n case \"data\":\n return part;\n\n default: {\n const converted = convertDataPrefixedPart(\n type,\n (part as DataPrefixedPart).data,\n );\n if (converted) return converted;\n throw new Error(`Unsupported user message part type: ${type}`);\n }\n }\n }),\n attachments: (attachments ?? []).map((att) => ({\n ...att,\n content: att.content.map((part): ThreadUserMessagePart => {\n const converted = convertDataPrefixedPart(\n part.type,\n (part as DataPrefixedPart).data,\n );\n return converted ?? (part as ThreadUserMessagePart);\n }),\n })),\n metadata: {\n custom: metadata?.custom ?? {},\n },\n } satisfies ThreadUserMessage;\n\n case \"system\":\n if (content.length !== 1 || content[0]!.type !== \"text\")\n throw new Error(\n \"System messages must have exactly one text message part.\",\n );\n\n return {\n ...common,\n role,\n content: content as [TextMessagePart],\n metadata: {\n custom: metadata?.custom ?? {},\n },\n } satisfies ThreadSystemMessage;\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport {\n LazyMemoizeSubject,\n NestedSubscriptionSubject,\n} from \"../../subscribable/subscribable\";\nimport {\n SKIP_UPDATE,\n ShallowMemoizeSubject,\n} from \"../../subscribable/subscribable\";\nimport type { ThreadListRuntimeCore } from \"../interfaces/thread-list-runtime-core\";\nimport {\n ThreadListItemRuntime,\n ThreadListItemRuntimeImpl,\n ThreadListItemState,\n} from \"./thread-list-item-runtime\";\nimport {\n ThreadListItemRuntimeBinding,\n ThreadRuntime,\n ThreadRuntimeCoreBinding,\n ThreadRuntimeImpl,\n} from \"./thread-runtime\";\n\nexport type ThreadListState = {\n readonly mainThreadId: string;\n readonly newThreadId: string | undefined;\n readonly threadIds: readonly string[];\n readonly archivedThreadIds: readonly string[];\n readonly isLoading: boolean;\n readonly threadItems: Readonly<\n Record<string, Omit<ThreadListItemState, \"isMain\" | \"threadId\">>\n >;\n};\n\nexport type ThreadListRuntime = {\n getState(): ThreadListState;\n\n subscribe(callback: () => void): Unsubscribe;\n\n readonly main: ThreadRuntime;\n getById(threadId: string): ThreadRuntime;\n\n readonly mainItem: ThreadListItemRuntime;\n getItemById(threadId: string): ThreadListItemRuntime;\n getItemByIndex(idx: number): ThreadListItemRuntime;\n getArchivedItemByIndex(idx: number): ThreadListItemRuntime;\n\n switchToThread(threadId: string): Promise<void>;\n switchToNewThread(): Promise<void>;\n};\n\nconst getThreadListState = (\n threadList: ThreadListRuntimeCore,\n): ThreadListState => {\n return {\n mainThreadId: threadList.mainThreadId,\n newThreadId: threadList.newThreadId,\n threadIds: threadList.threadIds,\n archivedThreadIds: threadList.archivedThreadIds,\n isLoading: threadList.isLoading,\n threadItems: threadList.threadItems,\n };\n};\n\nconst getThreadListItemState = (\n threadList: ThreadListRuntimeCore,\n threadId: string | undefined,\n): ThreadListItemState | SKIP_UPDATE => {\n if (threadId === undefined) return SKIP_UPDATE;\n\n const threadData = threadList.getItemById(threadId);\n if (!threadData) return SKIP_UPDATE;\n return {\n id: threadData.id,\n remoteId: threadData.remoteId,\n externalId: threadData.externalId,\n title: threadData.title,\n status: threadData.status,\n isMain: threadData.id === threadList.mainThreadId,\n };\n};\n\nexport type ThreadListRuntimeCoreBinding = ThreadListRuntimeCore;\n\nexport class ThreadListRuntimeImpl implements ThreadListRuntime {\n private _getState;\n constructor(\n private _core: ThreadListRuntimeCoreBinding,\n private _runtimeFactory: new (\n binding: ThreadRuntimeCoreBinding,\n threadListItemBinding: ThreadListItemRuntimeBinding,\n ) => ThreadRuntime = ThreadRuntimeImpl,\n ) {\n const stateBinding = new LazyMemoizeSubject({\n path: {},\n getState: () => getThreadListState(_core),\n subscribe: (callback) => _core.subscribe(callback),\n });\n\n this._getState = stateBinding.getState.bind(stateBinding);\n\n this._mainThreadListItemRuntime = new ThreadListItemRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ref: `threadItems[main]`,\n threadSelector: { type: \"main\" },\n },\n getState: () => {\n return getThreadListItemState(this._core, this._core.mainThreadId);\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n\n this.main = new _runtimeFactory(\n new NestedSubscriptionSubject({\n path: {\n ref: \"threads.main\",\n threadSelector: { type: \"main\" },\n },\n getState: () => _core.getMainThreadRuntimeCore(),\n subscribe: (callback) => _core.subscribe(callback),\n }),\n this._mainThreadListItemRuntime,\n );\n\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.switchToThread = this.switchToThread.bind(this);\n this.switchToNewThread = this.switchToNewThread.bind(this);\n this.getState = this.getState.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.getById = this.getById.bind(this);\n this.getItemById = this.getItemById.bind(this);\n this.getItemByIndex = this.getItemByIndex.bind(this);\n this.getArchivedItemByIndex = this.getArchivedItemByIndex.bind(this);\n }\n\n public switchToThread(threadId: string): Promise<void> {\n return this._core.switchToThread(threadId);\n }\n\n public switchToNewThread(): Promise<void> {\n return this._core.switchToNewThread();\n }\n\n public getState(): ThreadListState {\n return this._getState();\n }\n\n public subscribe(callback: () => void): Unsubscribe {\n return this._core.subscribe(callback);\n }\n\n private _mainThreadListItemRuntime;\n\n public readonly main: ThreadRuntime;\n\n public get mainItem() {\n return this._mainThreadListItemRuntime;\n }\n\n public getById(threadId: string) {\n return new this._runtimeFactory(\n new NestedSubscriptionSubject({\n path: {\n ref: `threads[threadId=${JSON.stringify(threadId)}]`,\n threadSelector: { type: \"threadId\", threadId },\n },\n getState: () => this._core.getThreadRuntimeCore(threadId),\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this.mainItem,\n );\n }\n\n public getItemByIndex(idx: number) {\n return new ThreadListItemRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ref: `threadItems[${idx}]`,\n threadSelector: { type: \"index\", index: idx },\n },\n getState: () => {\n return getThreadListItemState(this._core, this._core.threadIds[idx]);\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n }\n\n public getArchivedItemByIndex(idx: number) {\n return new ThreadListItemRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ref: `archivedThreadItems[${idx}]`,\n threadSelector: { type: \"archiveIndex\", index: idx },\n },\n getState: () => {\n return getThreadListItemState(\n this._core,\n this._core.archivedThreadIds[idx],\n );\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n }\n\n public getItemById(threadId: string) {\n return new ThreadListItemRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ref: `threadItems[threadId=${threadId}]`,\n threadSelector: { type: \"threadId\", threadId },\n },\n getState: () => {\n return getThreadListItemState(this._core, threadId);\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n }\n}\n","import {\n SpeechState,\n SubmittedFeedback,\n} from \"../interfaces/thread-runtime-core\";\nimport { symbolInnerMessage } from \"../utils/external-store-message\";\nimport type {\n ToolCallMessagePartStatus,\n ThreadMessage,\n ThreadAssistantMessagePart,\n ThreadUserMessagePart,\n} from \"../../types/message\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { MessagePartStatus, RunConfig } from \"../../types/message\";\nimport { getThreadMessageText } from \"../../utils/text\";\nimport { NestedSubscriptionSubject } from \"../../subscribable/subscribable\";\nimport {\n SKIP_UPDATE,\n ShallowMemoizeSubject,\n} from \"../../subscribable/subscribable\";\nimport {\n AttachmentRuntime,\n AttachmentState,\n MessageAttachmentRuntimeImpl,\n} from \"./attachment-runtime\";\nimport {\n EditComposerRuntime,\n EditComposerRuntimeImpl,\n} from \"./composer-runtime\";\nimport {\n MessagePartRuntime,\n MessagePartRuntimeImpl,\n MessagePartState,\n} from \"./message-part-runtime\";\nimport { MessageRuntimePath } from \"./paths\";\nimport { ThreadRuntimeCoreBinding } from \"./thread-runtime\";\nimport type { MessageStateBinding } from \"./bindings\";\n\nconst COMPLETE_STATUS: MessagePartStatus = Object.freeze({\n type: \"complete\",\n});\n\nexport const toMessagePartStatus = (\n message: ThreadMessage,\n partIndex: number,\n part: ThreadUserMessagePart | ThreadAssistantMessagePart,\n): ToolCallMessagePartStatus => {\n if (message.role !== \"assistant\") return COMPLETE_STATUS;\n\n if (part.type === \"tool-call\") {\n if (!part.result) {\n return message.status as ToolCallMessagePartStatus;\n } else {\n return COMPLETE_STATUS;\n }\n }\n\n const isLastPart = partIndex === Math.max(0, message.content.length - 1);\n if (message.status.type === \"requires-action\") return COMPLETE_STATUS;\n return isLastPart ? (message.status as MessagePartStatus) : COMPLETE_STATUS;\n};\n\nconst getMessagePartState = (\n message: MessageState,\n partIndex: number,\n): MessagePartState | SKIP_UPDATE => {\n const part = message.content[partIndex];\n if (!part) {\n return SKIP_UPDATE;\n }\n\n // if the message part is the same, don't update\n const status = toMessagePartStatus(message, partIndex, part);\n return Object.freeze({\n ...part,\n ...{ [symbolInnerMessage]: (part as any)[symbolInnerMessage] },\n status,\n });\n};\n\nexport type MessageState = ThreadMessage & {\n readonly parentId: string | null;\n /** The position of this message in the thread (0 for first message) */\n readonly index: number;\n readonly isLast: boolean;\n\n readonly branchNumber: number;\n readonly branchCount: number;\n\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n readonly speech: SpeechState | undefined;\n /**\n * @deprecated Use `message.metadata.submittedFeedback` instead. This will be removed in 0.12.0.\n */\n readonly submittedFeedback: SubmittedFeedback | undefined;\n};\n\nexport type { MessageStateBinding } from \"./bindings\";\n\ntype ReloadConfig = {\n runConfig?: RunConfig;\n};\n\nexport type MessageRuntime = {\n readonly path: MessageRuntimePath;\n\n readonly composer: EditComposerRuntime;\n\n getState(): MessageState;\n reload(config?: ReloadConfig): void;\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n speak(): void;\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n stopSpeaking(): void;\n submitFeedback({ type }: { type: \"positive\" | \"negative\" }): void;\n switchToBranch({\n position,\n branchId,\n }: {\n position?: \"previous\" | \"next\" | undefined;\n branchId?: string | undefined;\n }): void;\n unstable_getCopyText(): string;\n\n subscribe(callback: () => void): Unsubscribe;\n\n getMessagePartByIndex(idx: number): MessagePartRuntime;\n getMessagePartByToolCallId(toolCallId: string): MessagePartRuntime;\n\n getAttachmentByIndex(idx: number): AttachmentRuntime & { source: \"message\" };\n};\n\nexport class MessageRuntimeImpl implements MessageRuntime {\n public get path() {\n return this._core.path;\n }\n\n constructor(\n private _core: MessageStateBinding,\n private _threadBinding: ThreadRuntimeCoreBinding,\n ) {\n this.composer = new EditComposerRuntimeImpl(\n new NestedSubscriptionSubject({\n path: {\n ...this.path,\n ref: `${this.path.ref}${this.path.ref}.composer`,\n composerSource: \"edit\",\n },\n getState: this._getEditComposerRuntimeCore,\n subscribe: (callback) => this._threadBinding.subscribe(callback),\n }),\n () => this._threadBinding.getState().beginEdit(this._core.getState().id),\n );\n\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.reload = this.reload.bind(this);\n this.getState = this.getState.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.getMessagePartByIndex = this.getMessagePartByIndex.bind(this);\n this.getMessagePartByToolCallId =\n this.getMessagePartByToolCallId.bind(this);\n this.getAttachmentByIndex = this.getAttachmentByIndex.bind(this);\n this.unstable_getCopyText = this.unstable_getCopyText.bind(this);\n this.speak = this.speak.bind(this);\n this.stopSpeaking = this.stopSpeaking.bind(this);\n this.submitFeedback = this.submitFeedback.bind(this);\n this.switchToBranch = this.switchToBranch.bind(this);\n }\n\n public readonly composer;\n\n private _getEditComposerRuntimeCore = () => {\n return this._threadBinding\n .getState()\n .getEditComposer(this._core.getState().id);\n };\n\n public getState() {\n return this._core.getState();\n }\n\n public reload(reloadConfig: ReloadConfig = {}) {\n const editComposerRuntimeCore = this._getEditComposerRuntimeCore();\n const composerRuntimeCore =\n editComposerRuntimeCore ?? this._threadBinding.getState().composer;\n const composer = editComposerRuntimeCore ?? composerRuntimeCore;\n\n const { runConfig = composer.runConfig } = reloadConfig;\n const state = this._core.getState();\n if (state.role !== \"assistant\")\n throw new Error(\"Can only reload assistant messages\");\n\n this._threadBinding.getState().startRun({\n parentId: state.parentId,\n sourceId: state.id,\n runConfig,\n });\n }\n\n public speak() {\n const state = this._core.getState();\n return this._threadBinding.getState().speak(state.id);\n }\n\n public stopSpeaking() {\n const state = this._core.getState();\n const thread = this._threadBinding.getState();\n if (thread.speech?.messageId === state.id) {\n this._threadBinding.getState().stopSpeaking();\n } else {\n throw new Error(\"Message is not being spoken\");\n }\n }\n\n public submitFeedback({ type }: { type: \"positive\" | \"negative\" }) {\n const state = this._core.getState();\n this._threadBinding.getState().submitFeedback({\n messageId: state.id,\n type,\n });\n }\n\n public switchToBranch({\n position,\n branchId,\n }: {\n position?: \"previous\" | \"next\" | undefined;\n branchId?: string | undefined;\n }) {\n const state = this._core.getState();\n if (branchId && position) {\n throw new Error(\"May not specify both branchId and position\");\n } else if (!branchId && !position) {\n throw new Error(\"Must specify either branchId or position\");\n }\n\n const thread = this._threadBinding.getState();\n const branches = thread.getBranches(state.id);\n let targetBranch = branchId;\n if (position === \"previous\") {\n targetBranch = branches[state.branchNumber - 2];\n } else if (position === \"next\") {\n targetBranch = branches[state.branchNumber];\n }\n if (!targetBranch) throw new Error(\"Branch not found\");\n\n this._threadBinding.getState().switchToBranch(targetBranch);\n }\n\n public unstable_getCopyText() {\n return getThreadMessageText(this.getState());\n }\n\n public subscribe(callback: () => void) {\n return this._core.subscribe(callback);\n }\n\n public getMessagePartByIndex(idx: number) {\n if (idx < 0) throw new Error(\"Message part index must be >= 0\");\n return new MessagePartRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ...this.path,\n ref: `${this.path.ref}${this.path.ref}.content[${idx}]`,\n messagePartSelector: { type: \"index\", index: idx },\n },\n getState: () => {\n return getMessagePartState(this.getState(), idx);\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n this._threadBinding,\n );\n }\n\n public getMessagePartByToolCallId(toolCallId: string) {\n return new MessagePartRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ...this.path,\n ref:\n this.path.ref +\n `${this.path.ref}.content[toolCallId=${JSON.stringify(toolCallId)}]`,\n messagePartSelector: { type: \"toolCallId\", toolCallId },\n },\n getState: () => {\n const state = this._core.getState();\n const idx = state.content.findIndex(\n (part) =>\n part.type === \"tool-call\" && part.toolCallId === toolCallId,\n );\n if (idx === -1) return SKIP_UPDATE;\n return getMessagePartState(state, idx);\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n this._threadBinding,\n );\n }\n\n public getAttachmentByIndex(idx: number) {\n return new MessageAttachmentRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ...this.path,\n ref: `${this.path.ref}${this.path.ref}.attachments[${idx}]`,\n attachmentSource: \"message\",\n attachmentSelector: { type: \"index\", index: idx },\n },\n getState: () => {\n const attachments = this.getState().attachments;\n const attachment = attachments?.[idx];\n if (!attachment) return SKIP_UPDATE;\n\n return {\n ...attachment,\n source: \"message\",\n } satisfies AttachmentState & { source: \"message\" };\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n );\n }\n}\n","import type { Attachment, CreateAttachment } from \"../../types/attachment\";\nimport type { MessageRole } from \"../../types/message\";\nimport type { QuoteInfo } from \"../../types/quote\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { RunConfig } from \"../../types/message\";\nimport {\n LazyMemoizeSubject,\n EventSubscriptionSubject,\n} from \"../../subscribable/subscribable\";\nimport {\n ShallowMemoizeSubject,\n SKIP_UPDATE,\n} from \"../../subscribable/subscribable\";\nimport type {\n ComposerRuntimeCore,\n ComposerRuntimeEventType,\n DictationState,\n ThreadComposerRuntimeCore,\n} from \"../interfaces/composer-runtime-core\";\nimport type {\n ThreadComposerRuntimeCoreBinding,\n EditComposerRuntimeCoreBinding,\n ComposerRuntimeCoreBinding,\n} from \"./bindings\";\nimport type { ComposerRuntimePath } from \"./paths\";\n\nimport {\n type AttachmentRuntime,\n type AttachmentState,\n EditComposerAttachmentRuntimeImpl,\n ThreadComposerAttachmentRuntimeImpl,\n} from \"./attachment-runtime\";\n\nexport type {\n ThreadComposerRuntimeCoreBinding,\n EditComposerRuntimeCoreBinding,\n ComposerRuntimeCoreBinding,\n};\n\ntype BaseComposerState = {\n readonly canCancel: boolean;\n readonly isEditing: boolean;\n readonly isEmpty: boolean;\n\n readonly text: string;\n readonly role: MessageRole;\n readonly attachments: readonly Attachment[];\n readonly runConfig: RunConfig;\n\n readonly attachmentAccept: string;\n\n /**\n * The current state of dictation.\n * Undefined when dictation is not active.\n */\n readonly dictation: DictationState | undefined;\n\n /**\n * The currently quoted text, if any.\n * Undefined when no quote is set.\n */\n readonly quote: QuoteInfo | undefined;\n};\n\nexport type ThreadComposerState = BaseComposerState & {\n readonly type: \"thread\";\n};\n\nexport type EditComposerState = BaseComposerState & {\n readonly type: \"edit\";\n};\n\nexport type ComposerState = ThreadComposerState | EditComposerState;\n\nconst EMPTY_ARRAY = Object.freeze([]);\nconst EMPTY_OBJECT = Object.freeze({});\nconst getThreadComposerState = (\n runtime: ThreadComposerRuntimeCore | undefined,\n): ThreadComposerState => {\n return Object.freeze({\n type: \"thread\",\n\n isEditing: runtime?.isEditing ?? false,\n canCancel: runtime?.canCancel ?? false,\n isEmpty: runtime?.isEmpty ?? true,\n\n attachments: runtime?.attachments ?? EMPTY_ARRAY,\n text: runtime?.text ?? \"\",\n role: runtime?.role ?? \"user\",\n runConfig: runtime?.runConfig ?? EMPTY_OBJECT,\n attachmentAccept: runtime?.attachmentAccept ?? \"\",\n dictation: runtime?.dictation,\n quote: runtime?.quote,\n\n value: runtime?.text ?? \"\",\n });\n};\n\nconst getEditComposerState = (\n runtime: ComposerRuntimeCore | undefined,\n): EditComposerState => {\n return Object.freeze({\n type: \"edit\",\n\n isEditing: runtime?.isEditing ?? false,\n canCancel: runtime?.canCancel ?? false,\n isEmpty: runtime?.isEmpty ?? true,\n\n text: runtime?.text ?? \"\",\n role: runtime?.role ?? \"user\",\n attachments: runtime?.attachments ?? EMPTY_ARRAY,\n runConfig: runtime?.runConfig ?? EMPTY_OBJECT,\n attachmentAccept: runtime?.attachmentAccept ?? \"\",\n dictation: runtime?.dictation,\n quote: runtime?.quote,\n\n value: runtime?.text ?? \"\",\n });\n};\n\nexport type ComposerRuntime = {\n readonly path: ComposerRuntimePath;\n readonly type: \"edit\" | \"thread\";\n\n /**\n * Get the current state of the composer. Includes any data that has been added to the composer.\n */\n getState(): ComposerState;\n\n /**\n * Add an attachment to the composer. Accepts either a standard File object\n * (processed through the AttachmentAdapter) or a CreateAttachment descriptor\n * for external-source attachments (URLs, API data, CMS references) that\n * bypasses the adapter entirely.\n * @param fileOrAttachment The file or attachment descriptor to add.\n */\n addAttachment(fileOrAttachment: File | CreateAttachment): Promise<void>;\n\n /**\n * Set the text of the composer.\n * @param text The text to set in the composer.\n */\n setText(text: string): void;\n\n /**\n * Set the role of the composer. For instance, if you'd like a specific message to have the 'assistant' role, you can do so here.\n * @param role The role to set in the composer.\n */\n setRole(role: MessageRole): void;\n\n /**\n * Set the run config of the composer. This is used to send custom configuration data to the model.\n * Within your backend, you can use the `runConfig` object.\n * Example:\n * ```ts\n * composerRuntime.setRunConfig({\n * custom: { customField: \"customValue\" }\n * });\n * ```\n * @param runConfig The run config to set in the composer.\n */\n setRunConfig(runConfig: RunConfig): void;\n\n /**\n * Reset the composer. This will clear the entire state of the composer, including all text and attachments.\n */\n reset(): Promise<void>;\n\n /**\n * Clear all attachments from the composer.\n */\n clearAttachments(): Promise<void>;\n\n /**\n * Send a message. This will send whatever text or attachments are in the composer.\n */\n send(): void;\n\n /**\n * Cancel the current run. In edit mode, this will exit edit mode.\n */\n cancel(): void;\n\n /**\n * Listens for changes to the composer state.\n * @param callback The callback to call when the composer state changes.\n */\n subscribe(callback: () => void): Unsubscribe;\n\n /**\n * Get an attachment by index.\n * @param idx The index of the attachment to get.\n */\n getAttachmentByIndex(idx: number): AttachmentRuntime;\n\n /**\n * Start dictation to convert voice to text input.\n * Requires a DictationAdapter to be configured.\n */\n startDictation(): void;\n\n /**\n * Stop the current dictation session.\n */\n stopDictation(): void;\n\n /**\n * Set a quote for the next message. Pass undefined to clear.\n * @param quote The quote info to set, or undefined to clear.\n */\n setQuote(quote: QuoteInfo | undefined): void;\n\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n unstable_on(\n event: ComposerRuntimeEventType,\n callback: () => void,\n ): Unsubscribe;\n};\n\nexport abstract class ComposerRuntimeImpl implements ComposerRuntime {\n public get path() {\n return this._core.path;\n }\n\n public abstract get type(): \"edit\" | \"thread\";\n\n constructor(protected _core: ComposerRuntimeCoreBinding) {}\n\n protected __internal_bindMethods() {\n this.setText = this.setText.bind(this);\n this.setRunConfig = this.setRunConfig.bind(this);\n this.getState = this.getState.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.addAttachment = this.addAttachment.bind(this);\n this.reset = this.reset.bind(this);\n this.clearAttachments = this.clearAttachments.bind(this);\n this.send = this.send.bind(this);\n this.cancel = this.cancel.bind(this);\n this.setRole = this.setRole.bind(this);\n this.getAttachmentByIndex = this.getAttachmentByIndex.bind(this);\n this.startDictation = this.startDictation.bind(this);\n this.stopDictation = this.stopDictation.bind(this);\n this.setQuote = this.setQuote.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n }\n\n public abstract getState(): ComposerState;\n\n public setText(text: string) {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.setText(text);\n }\n\n public setRunConfig(runConfig: RunConfig) {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.setRunConfig(runConfig);\n }\n\n public addAttachment(fileOrAttachment: File | CreateAttachment) {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n return core.addAttachment(fileOrAttachment);\n }\n\n public reset() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n return core.reset();\n }\n\n public clearAttachments() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n return core.clearAttachments();\n }\n\n public send() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.send();\n }\n\n public cancel() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.cancel();\n }\n\n public setRole(role: MessageRole) {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.setRole(role);\n }\n\n public startDictation() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.startDictation();\n }\n\n public stopDictation() {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.stopDictation();\n }\n\n public setQuote(quote: QuoteInfo | undefined) {\n const core = this._core.getState();\n if (!core) throw new Error(\"Composer is not available\");\n core.setQuote(quote);\n }\n\n public subscribe(callback: () => void) {\n return this._core.subscribe(callback);\n }\n\n private _eventSubscriptionSubjects = new Map<\n string,\n EventSubscriptionSubject<ComposerRuntimeEventType>\n >();\n\n public unstable_on(\n event: ComposerRuntimeEventType,\n callback: () => void,\n ): Unsubscribe {\n let subject = this._eventSubscriptionSubjects.get(event);\n if (!subject) {\n subject = new EventSubscriptionSubject({\n event: event,\n binding: this._core,\n });\n this._eventSubscriptionSubjects.set(event, subject);\n }\n return subject.subscribe(callback);\n }\n\n public abstract getAttachmentByIndex(idx: number): AttachmentRuntime;\n}\n\nexport type ThreadComposerRuntime = Omit<\n ComposerRuntime,\n \"getState\" | \"getAttachmentByIndex\"\n> & {\n readonly path: ComposerRuntimePath & { composerSource: \"thread\" };\n readonly type: \"thread\";\n getState(): ThreadComposerState;\n\n getAttachmentByIndex(\n idx: number,\n ): AttachmentRuntime & { source: \"thread-composer\" };\n};\n\nexport class ThreadComposerRuntimeImpl\n extends ComposerRuntimeImpl\n implements ThreadComposerRuntime\n{\n public override get path() {\n return this._core.path as ComposerRuntimePath & {\n composerSource: \"thread\";\n };\n }\n\n public get type() {\n return \"thread\" as const;\n }\n\n private _getState;\n\n constructor(core: ThreadComposerRuntimeCoreBinding) {\n const stateBinding = new LazyMemoizeSubject({\n path: core.path,\n getState: () => getThreadComposerState(core.getState()),\n subscribe: (callback) => core.subscribe(callback),\n });\n super({\n path: core.path,\n getState: () => core.getState(),\n subscribe: (callback) => stateBinding.subscribe(callback),\n });\n this._getState = stateBinding.getState.bind(stateBinding);\n\n this.__internal_bindMethods();\n }\n\n public override getState(): ThreadComposerState {\n return this._getState();\n }\n\n public getAttachmentByIndex(idx: number) {\n return new ThreadComposerAttachmentRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ...this.path,\n attachmentSource: \"thread-composer\",\n attachmentSelector: { type: \"index\", index: idx },\n ref: `${this.path.ref}.attachments[${idx}]`,\n },\n getState: () => {\n const attachments = this.getState().attachments;\n const attachment = attachments[idx];\n if (!attachment) return SKIP_UPDATE;\n\n return {\n ...attachment,\n source: \"thread-composer\",\n } satisfies AttachmentState & { source: \"thread-composer\" };\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n }\n}\n\nexport type EditComposerRuntime = Omit<\n ComposerRuntime,\n \"getState\" | \"getAttachmentByIndex\"\n> & {\n readonly path: ComposerRuntimePath & { composerSource: \"edit\" };\n readonly type: \"edit\";\n\n getState(): EditComposerState;\n beginEdit(): void;\n\n getAttachmentByIndex(\n idx: number,\n ): AttachmentRuntime & { source: \"edit-composer\" };\n};\n\nexport class EditComposerRuntimeImpl\n extends ComposerRuntimeImpl\n implements EditComposerRuntime\n{\n public override get path() {\n return this._core.path as ComposerRuntimePath & { composerSource: \"edit\" };\n }\n\n public get type() {\n return \"edit\" as const;\n }\n\n private _getState;\n constructor(\n core: EditComposerRuntimeCoreBinding,\n private _beginEdit: () => void,\n ) {\n const stateBinding = new LazyMemoizeSubject({\n path: core.path,\n getState: () => getEditComposerState(core.getState()),\n subscribe: (callback) => core.subscribe(callback),\n });\n\n super({\n path: core.path,\n getState: () => core.getState(),\n subscribe: (callback) => stateBinding.subscribe(callback),\n });\n\n this._getState = stateBinding.getState.bind(stateBinding);\n\n this.__internal_bindMethods();\n }\n\n public override __internal_bindMethods() {\n super.__internal_bindMethods();\n this.beginEdit = this.beginEdit.bind(this);\n }\n\n public override getState(): EditComposerState {\n return this._getState();\n }\n\n public beginEdit() {\n this._beginEdit();\n }\n\n public getAttachmentByIndex(idx: number) {\n return new EditComposerAttachmentRuntimeImpl(\n new ShallowMemoizeSubject({\n path: {\n ...this.path,\n attachmentSource: \"edit-composer\",\n attachmentSelector: { type: \"index\", index: idx },\n ref: `${this.path.ref}.attachments[${idx}]`,\n },\n getState: () => {\n const attachments = this.getState().attachments;\n const attachment = attachments[idx];\n if (!attachment) return SKIP_UPDATE;\n\n return {\n ...attachment,\n source: \"edit-composer\",\n } satisfies AttachmentState & { source: \"edit-composer\" };\n },\n subscribe: (callback) => this._core.subscribe(callback),\n }),\n this._core,\n );\n }\n}\n","import type { AppendMessage, ThreadMessage } from \"../../types/message\";\nimport { getThreadMessageText } from \"../../utils/text\";\nimport type { AttachmentAdapter } from \"../../adapters/attachment\";\nimport type { DictationAdapter } from \"../../adapters/speech\";\nimport type { ThreadRuntimeCore } from \"../interfaces/thread-runtime-core\";\nimport { BaseComposerRuntimeCore } from \"./base-composer-runtime-core\";\n\nexport class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {\n public get canCancel() {\n return true;\n }\n\n protected getAttachmentAdapter() {\n return this.runtime.adapters?.attachments;\n }\n\n protected getDictationAdapter() {\n return this.runtime.adapters?.dictation;\n }\n\n private _nonTextParts;\n private _previousText;\n private _parentId;\n private _sourceId;\n constructor(\n private runtime: ThreadRuntimeCore & {\n adapters?:\n | {\n attachments?: AttachmentAdapter | undefined;\n dictation?: DictationAdapter | undefined;\n }\n | undefined;\n },\n private endEditCallback: () => void,\n { parentId, message }: { parentId: string | null; message: ThreadMessage },\n ) {\n super();\n this._parentId = parentId;\n this._sourceId = message.id;\n this._previousText = getThreadMessageText(message);\n this.setText(this._previousText);\n\n this.setRole(message.role);\n this.setAttachments(message.attachments ?? []);\n\n this._nonTextParts = message.content.filter((part) => part.type !== \"text\");\n\n this.setRunConfig({ ...runtime.composer.runConfig });\n }\n\n public async handleSend(\n message: Omit<AppendMessage, \"parentId\" | \"sourceId\">,\n ) {\n const text = getThreadMessageText(message as AppendMessage);\n if (text !== this._previousText) {\n this.runtime.append({\n ...message,\n content: [...message.content, ...this._nonTextParts] as any,\n parentId: this._parentId,\n sourceId: this._sourceId,\n });\n }\n\n this.handleCancel();\n }\n\n public handleCancel() {\n this.endEditCallback();\n this._notifySubscribers();\n }\n}\n","import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener<TData, TError, TVariables, TOnMutateResult> = (\n result: MutationObserverResult<TData, TError, TVariables, TOnMutateResult>,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener<TData, TError, TVariables, TOnMutateResult>\n> {\n options!: MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation<TData, TError, TVariables, TOnMutateResult>\n #mutateOptions?: MutateOptions<TData, TError, TVariables, TOnMutateResult>\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions<TData, TError, TVariables, TOnMutateResult>\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action<TData, TError, TVariables, TOnMutateResult>,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions<TData, TError, TVariables, TOnMutateResult>,\n ): Promise<TData> {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState<TData, TError, TVariables, TOnMutateResult>()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult<TData, TError, TVariables, TOnMutateResult>\n }\n\n #notify(action?: Action<TData, TError, TVariables, TOnMutateResult>): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n","import { createContext, FC, ReactNode, useContext } from \"react\";\nimport type { ThreadHistoryAdapter } from \"../../adapters/thread-history\";\nimport type { AttachmentAdapter } from \"../../adapters/attachment\";\nimport type { ModelContextProvider } from \"../../model-context/types\";\n\nexport type RuntimeAdapters = {\n modelContext?: ModelContextProvider | undefined;\n history?: ThreadHistoryAdapter | undefined;\n attachments?: AttachmentAdapter | undefined;\n};\n\nconst RuntimeAdaptersContext = createContext<RuntimeAdapters | null>(null);\n\nexport namespace RuntimeAdapterProvider {\n export type Props = {\n adapters: RuntimeAdapters;\n children: ReactNode;\n };\n}\n\nexport const RuntimeAdapterProvider: FC<RuntimeAdapterProvider.Props> = ({\n adapters,\n children,\n}) => {\n const context = useContext(RuntimeAdaptersContext);\n return (\n <RuntimeAdaptersContext.Provider\n value={{\n ...context,\n ...adapters,\n }}\n >\n {children}\n </RuntimeAdaptersContext.Provider>\n );\n};\n\nexport const useRuntimeAdapters = () => {\n return useContext(RuntimeAdaptersContext);\n};\n","import {\n ThreadSuggestion,\n RuntimeCapabilities,\n ThreadRuntimeCore,\n SpeechState,\n VoiceSessionState,\n ThreadRuntimeEventType,\n StartRunConfig,\n ResumeRunConfig,\n} from \"../interfaces/thread-runtime-core\";\nimport { ExportedMessageRepository } from \"../utils/message-repository\";\nimport { ThreadMessageLike } from \"../utils/thread-message-like\";\nimport {\n MessageRuntime,\n MessageRuntimeImpl,\n MessageState,\n} from \"./message-runtime\";\nimport { NestedSubscriptionSubject } from \"../../subscribable/subscribable\";\nimport {\n ShallowMemoizeSubject,\n SKIP_UPDATE,\n} from \"../../subscribable/subscribable\";\nimport type { SubscribableWithState } from \"../../subscribable/subscribable\";\nimport {\n ThreadComposerRuntime,\n ThreadComposerRuntimeImpl,\n} from \"./composer-runtime\";\nimport {\n MessageRuntimePath,\n ThreadListItemRuntimePath,\n ThreadRuntimePath,\n} from \"./paths\";\nimport type { ThreadListItemState } from \"./bindings\";\nimport type { AppendMessage, ThreadMessage } from \"../../types/message\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { RunConfig } from \"../../types/message\";\nimport { EventSubscriptionSubject } from \"../../subscribable/subscribable\";\nimport { symbolInnerMessage } from \"../utils/external-store-message\";\nimport { ModelContext } from \"../../model-context/types\";\nimport {\n ChatModelRunOptions,\n ChatModelRunResult,\n} from \"../utils/chat-model-adapter\";\nimport { ReadonlyJSONValue } from \"assistant-stream/utils\";\n\nexport type CreateStartRunConfig = {\n parentId: string | null;\n sourceId?: string | null | undefined;\n runConfig?: RunConfig | undefined;\n};\n\nexport type CreateResumeRunConfig = CreateStartRunConfig & {\n stream?: (\n options: ChatModelRunOptions,\n ) => AsyncGenerator<ChatModelRunResult, void, unknown>;\n};\n\nconst toResumeRunConfig = (message: CreateResumeRunConfig): ResumeRunConfig => {\n return {\n parentId: message.parentId ?? null,\n sourceId: message.sourceId ?? null,\n runConfig: message.runConfig ?? {},\n ...(message.stream ? { stream: message.stream } : {}),\n };\n};\n\nconst toStartRunConfig = (message: CreateStartRunConfig): StartRunConfig => {\n return {\n parentId: message.parentId ?? null,\n sourceId: message.sourceId ?? null,\n runConfig: message.runConfig ?? {},\n };\n};\n\nexport type CreateAppendMessage =\n | string\n | {\n parentId?: string | null | undefined;\n sourceId?: string | null | undefined;\n role?: AppendMessage[\"role\"] | undefined;\n content: AppendMessage[\"content\"];\n attachments?: AppendMessage[\"attachments\"] | undefined;\n metadata?: AppendMessage[\"metadata\"] | undefined;\n createdAt?: Date | undefined;\n runConfig?: AppendMessage[\"runConfig\"] | undefined;\n startRun?: boolean | undefined;\n };\n\nconst toAppendMessage = (\n messages: readonly ThreadMessage[],\n message: CreateAppendMessage,\n): AppendMessage => {\n if (typeof message === \"string\") {\n return {\n createdAt: new Date(),\n parentId: messages.at(-1)?.id ?? null,\n sourceId: null,\n runConfig: {},\n role: \"user\",\n content: [{ type: \"text\", text: message }],\n attachments: [],\n metadata: { custom: {} },\n };\n }\n\n return {\n createdAt: message.createdAt ?? new Date(),\n parentId: message.parentId ?? messages.at(-1)?.id ?? null,\n sourceId: message.sourceId ?? null,\n role: message.role ?? \"user\",\n content: message.content,\n attachments: message.attachments ?? [],\n metadata: message.metadata ?? { custom: {} },\n runConfig: message.runConfig ?? {},\n startRun: message.startRun,\n } as AppendMessage;\n};\n\nexport type ThreadRuntimeCoreBinding = SubscribableWithState<\n ThreadRuntimeCore,\n ThreadRuntimePath\n> & {\n outerSubscribe(callback: () => void): Unsubscribe;\n};\n\nexport type ThreadListItemRuntimeBinding = SubscribableWithState<\n ThreadListItemState,\n ThreadListItemRuntimePath\n>;\n\nexport type ThreadState = {\n /**\n * The thread ID.\n * @deprecated This field is deprecated and will be removed in 0.12.0. Use `useThreadListItem().id` instead.\n */\n readonly threadId: string;\n\n /**\n * The thread metadata.\n *\n * @deprecated Use `useThreadListItem()` instead. This field is deprecated and will be removed in 0.12.0.\n */\n readonly metadata: ThreadListItemState;\n\n /**\n * Whether the thread is disabled. Disabled threads cannot receive new messages.\n */\n readonly isDisabled: boolean;\n\n /**\n * Whether the thread is loading its history.\n */\n readonly isLoading: boolean;\n\n /**\n * Whether the thread is running. A thread is considered running when there is an active stream connection to the backend.\n */\n readonly isRunning: boolean;\n\n /**\n * The capabilities of the thread, such as whether the thread supports editing, branch switching, etc.\n */\n readonly capabilities: RuntimeCapabilities;\n\n /**\n * The messages in the currently selected branch of the thread.\n */\n readonly messages: readonly ThreadMessage[];\n\n /**\n * The thread state.\n *\n * @deprecated This feature is experimental\n */\n readonly state: ReadonlyJSONValue;\n\n /**\n * Follow up message suggestions to show the user.\n */\n readonly suggestions: readonly ThreadSuggestion[];\n\n /**\n * Custom extra information provided by the runtime.\n */\n readonly extras: unknown;\n\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n readonly speech: SpeechState | undefined;\n\n readonly voice: VoiceSessionState | undefined;\n};\n\nexport const getThreadState = (\n runtime: ThreadRuntimeCore,\n threadListItemState: ThreadListItemState,\n): ThreadState => {\n const lastMessage = runtime.messages.at(-1);\n return Object.freeze({\n threadId: threadListItemState.id,\n metadata: threadListItemState,\n capabilities: runtime.capabilities,\n isDisabled: runtime.isDisabled,\n isLoading: runtime.isLoading,\n isRunning:\n lastMessage?.role !== \"assistant\"\n ? false\n : lastMessage.status.type === \"running\",\n messages: runtime.messages,\n state: runtime.state,\n suggestions: runtime.suggestions,\n extras: runtime.extras,\n speech: runtime.speech,\n voice: runtime.voice,\n });\n};\n\nexport type ThreadRuntime = {\n /**\n * The selector for the thread runtime.\n */\n readonly path: ThreadRuntimePath;\n\n /**\n * The thread composer runtime.\n */\n readonly composer: ThreadComposerRuntime;\n\n /**\n * Gets a snapshot of the thread state.\n */\n getState(): ThreadState;\n\n /**\n * Append a new message to the thread.\n *\n * @example ```ts\n * // append a new user message with the text \"Hello, world!\"\n * threadRuntime.append(\"Hello, world!\");\n * ```\n *\n * @example ```ts\n * // append a new assistant message with the text \"Hello, world!\"\n * threadRuntime.append({\n * role: \"assistant\",\n * content: [{ type: \"text\", text: \"Hello, world!\" }],\n * });\n * ```\n */\n append(message: CreateAppendMessage): void;\n\n /**\n * @deprecated pass an object with `parentId` instead. This will be removed in 0.12.0.\n */\n startRun(parentId: string | null): void;\n /**\n * Start a new run with the given configuration.\n * @param config The configuration for starting the run\n */\n startRun(config: CreateStartRunConfig): void;\n\n /**\n * Resume a run with the given configuration.\n * @param config The configuration for resuming the run\n **/\n resumeRun(config: CreateResumeRunConfig): void;\n\n /**\n * @deprecated Use `resumeRun` instead.\n */\n unstable_resumeRun(config: CreateResumeRunConfig): void;\n\n /**\n * Export the thread state in the external store format.\n * For AI SDK runtimes, this returns the AI SDK message format.\n * For other runtimes, this may return different formats or throw an error.\n * @returns The thread state in the external format (typed as any)\n */\n exportExternalState(): any;\n\n /**\n * Import thread state from the external store format.\n * For AI SDK runtimes, this accepts AI SDK messages.\n * For other runtimes, this may accept different formats or throw an error.\n * @param state The thread state in the external format (typed as any)\n */\n importExternalState(state: any): void;\n\n /**\n * Load external state into the thread.\n * @deprecated Use importExternalState instead. This method will be removed in 0.12.0.\n * @param state The state to load into the thread\n */\n unstable_loadExternalState(state: any): void;\n\n subscribe(callback: () => void): Unsubscribe;\n cancelRun(): void;\n getModelContext(): ModelContext;\n\n /**\n * @deprecated This method was renamed to `getModelContext`.\n */\n getModelConfig(): ModelContext;\n\n export(): ExportedMessageRepository;\n import(repository: ExportedMessageRepository): void;\n\n /**\n * Reset the thread with optional initial messages.\n *\n * @param initialMessages - Optional array of initial messages to populate the thread\n */\n reset(initialMessages?: readonly ThreadMessageLike[]): void;\n\n getMessageByIndex(idx: number): MessageRuntime;\n getMessageById(messageId: string): MessageRuntime;\n\n /**\n * @deprecated This API is still under active development and might change without notice.\n */\n stopSpeaking(): void;\n\n connectVoice(): void;\n disconnectVoice(): void;\n getVoiceVolume(): number;\n subscribeVoiceVolume(callback: () => void): Unsubscribe;\n muteVoice(): void;\n unmuteVoice(): void;\n\n unstable_on(event: ThreadRuntimeEventType, callback: () => void): Unsubscribe;\n};\n\nexport class ThreadRuntimeImpl implements ThreadRuntime {\n public get path() {\n return this._threadBinding.path;\n }\n\n public get __internal_threadBinding() {\n return this._threadBinding;\n }\n\n private readonly _threadBinding: ThreadRuntimeCoreBinding & {\n getStateState(): ThreadState;\n };\n\n constructor(\n threadBinding: ThreadRuntimeCoreBinding,\n threadListItemBinding: ThreadListItemRuntimeBinding,\n ) {\n const stateBinding = new ShallowMemoizeSubject({\n path: threadBinding.path,\n getState: () =>\n getThreadState(\n threadBinding.getState(),\n threadListItemBinding.getState(),\n ),\n subscribe: (callback) => {\n const sub1 = threadBinding.subscribe(callback);\n const sub2 = threadListItemBinding.subscribe(callback);\n return () => {\n sub1();\n sub2();\n };\n },\n });\n\n this._threadBinding = {\n path: threadBinding.path,\n getState: () => threadBinding.getState(),\n getStateState: () => stateBinding.getState(),\n outerSubscribe: (callback) => threadBinding.outerSubscribe(callback),\n subscribe: (callback) => threadBinding.subscribe(callback),\n };\n\n this.composer = new ThreadComposerRuntimeImpl(\n new NestedSubscriptionSubject({\n path: {\n ...this.path,\n ref: `${this.path.ref}.composer`,\n composerSource: \"thread\",\n },\n getState: () => this._threadBinding.getState().composer,\n subscribe: (callback) => this._threadBinding.subscribe(callback),\n }),\n );\n\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.append = this.append.bind(this);\n this.resumeRun = this.resumeRun.bind(this);\n this.unstable_resumeRun = this.unstable_resumeRun.bind(this);\n this.unstable_loadExternalState =\n this.unstable_loadExternalState.bind(this);\n this.importExternalState = this.importExternalState.bind(this);\n this.exportExternalState = this.exportExternalState.bind(this);\n this.startRun = this.startRun.bind(this);\n this.cancelRun = this.cancelRun.bind(this);\n this.stopSpeaking = this.stopSpeaking.bind(this);\n this.connectVoice = this.connectVoice.bind(this);\n this.disconnectVoice = this.disconnectVoice.bind(this);\n this.muteVoice = this.muteVoice.bind(this);\n this.unmuteVoice = this.unmuteVoice.bind(this);\n this.getVoiceVolume = this.getVoiceVolume.bind(this);\n this.subscribeVoiceVolume = this.subscribeVoiceVolume.bind(this);\n this.export = this.export.bind(this);\n this.import = this.import.bind(this);\n this.reset = this.reset.bind(this);\n this.getMessageByIndex = this.getMessageByIndex.bind(this);\n this.getMessageById = this.getMessageById.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.unstable_on = this.unstable_on.bind(this);\n this.getModelContext = this.getModelContext.bind(this);\n this.getModelConfig = this.getModelConfig.bind(this);\n this.getState = this.getState.bind(this);\n }\n\n public readonly composer;\n\n public getState() {\n return this._threadBinding.getStateState();\n }\n\n public append(message: CreateAppendMessage) {\n this._threadBinding\n .getState()\n .append(\n toAppendMessage(this._threadBinding.getState().messages, message),\n );\n }\n\n public subscribe(callback: () => void) {\n return this._threadBinding.subscribe(callback);\n }\n\n public getModelContext() {\n return this._threadBinding.getState().getModelContext();\n }\n\n public getModelConfig() {\n return this.getModelContext();\n }\n\n public startRun(configOrParentId: string | null | CreateStartRunConfig) {\n const config =\n configOrParentId === null || typeof configOrParentId === \"string\"\n ? { parentId: configOrParentId }\n : configOrParentId;\n return this._threadBinding.getState().startRun(toStartRunConfig(config));\n }\n\n public resumeRun(config: CreateResumeRunConfig) {\n return this._threadBinding.getState().resumeRun(toResumeRunConfig(config));\n }\n\n /** @deprecated Use `resumeRun` instead. */\n public unstable_resumeRun(config: CreateResumeRunConfig) {\n return this.resumeRun(config);\n }\n\n public exportExternalState() {\n return this._threadBinding.getState().exportExternalState();\n }\n\n public importExternalState(state: any) {\n this._threadBinding.getState().importExternalState(state);\n }\n\n public unstable_loadExternalState(state: any) {\n this._threadBinding.getState().unstable_loadExternalState(state);\n }\n\n public cancelRun() {\n this._threadBinding.getState().cancelRun();\n }\n\n public stopSpeaking() {\n return this._threadBinding.getState().stopSpeaking();\n }\n\n public connectVoice() {\n this._threadBinding.getState().connectVoice();\n }\n\n public disconnectVoice() {\n this._threadBinding.getState().disconnectVoice();\n }\n\n public getVoiceVolume() {\n return this._threadBinding.getState().getVoiceVolume();\n }\n\n public subscribeVoiceVolume(callback: () => void) {\n return this._threadBinding.getState().subscribeVoiceVolume(callback);\n }\n\n public muteVoice() {\n this._threadBinding.getState().muteVoice();\n }\n\n public unmuteVoice() {\n this._threadBinding.getState().unmuteVoice();\n }\n\n public export() {\n return this._threadBinding.getState().export();\n }\n\n public import(data: ExportedMessageRepository) {\n this._threadBinding.getState().import(data);\n }\n\n public reset(initialMessages?: readonly ThreadMessageLike[]) {\n this._threadBinding.getState().reset(initialMessages);\n }\n\n public getMessageByIndex(idx: number) {\n if (idx < 0) throw new Error(\"Message index must be >= 0\");\n\n return this._getMessageRuntime(\n {\n ...this.path,\n ref: `${this.path.ref}.messages[${idx}]`,\n messageSelector: { type: \"index\", index: idx },\n },\n () => {\n const messages = this._threadBinding.getState().messages;\n const message = messages[idx];\n if (!message) return undefined;\n return {\n message,\n parentId: messages[idx - 1]?.id ?? null,\n index: idx,\n };\n },\n );\n }\n\n public getMessageById(messageId: string) {\n return this._getMessageRuntime(\n {\n ...this.path,\n ref: `${this.path.ref}.messages[messageId=${JSON.stringify(messageId)}]`,\n messageSelector: { type: \"messageId\", messageId: messageId },\n },\n () => this._threadBinding.getState().getMessageById(messageId),\n );\n }\n\n private _getMessageRuntime(\n path: MessageRuntimePath,\n callback: () =>\n | { parentId: string | null; message: ThreadMessage; index: number }\n | undefined,\n ) {\n return new MessageRuntimeImpl(\n new ShallowMemoizeSubject({\n path,\n getState: () => {\n const { message, parentId, index } = callback() ?? {};\n\n const { messages, speech: speechState } =\n this._threadBinding.getState();\n\n if (!message || parentId === undefined || index === undefined)\n return SKIP_UPDATE;\n\n const thread = this._threadBinding.getState();\n\n const branches = thread.getBranches(message.id);\n const submittedFeedback = message.metadata.submittedFeedback;\n\n return {\n ...message,\n ...{ [symbolInnerMessage]: (message as any)[symbolInnerMessage] },\n\n index,\n isLast: messages.at(-1)?.id === message.id,\n parentId,\n\n branchNumber: branches.indexOf(message.id) + 1,\n branchCount: branches.length,\n\n speech:\n speechState?.messageId === message.id ? speechState : undefined,\n\n submittedFeedback,\n } satisfies MessageState;\n },\n subscribe: (callback) => this._threadBinding.subscribe(callback),\n }),\n this._threadBinding,\n );\n }\n\n private _eventSubscriptionSubjects = new Map<\n string,\n EventSubscriptionSubject<ThreadRuntimeEventType>\n >();\n\n public unstable_on(\n event: ThreadRuntimeEventType,\n callback: () => void,\n ): Unsubscribe {\n let subject = this._eventSubscriptionSubjects.get(event);\n if (!subject) {\n subject = new EventSubscriptionSubject({\n event: event,\n binding: this._threadBinding,\n });\n this._eventSubscriptionSubjects.set(event, subject);\n }\n return subject.subscribe(callback);\n }\n}\n","import type { ThreadMessage } from \"../../types/message\";\n\nexport const symbolInnerMessage = Symbol(\"innerMessage\");\nconst symbolInnerMessages = Symbol(\"innerMessages\");\n\ntype WithInnerMessages<T> = {\n [symbolInnerMessage]?: T | T[];\n [symbolInnerMessages]?: T[];\n};\n\n/**\n * @deprecated Use `getExternalStoreMessages` (plural) instead. This function will be removed in 0.12.0.\n */\nexport const getExternalStoreMessage = <T>(input: ThreadMessage) => {\n const withInnerMessages = input as WithInnerMessages<T>;\n return withInnerMessages[symbolInnerMessage];\n};\n\nconst EMPTY_ARRAY: never[] = [];\n\n/**\n * Attach the original external store message(s) to a ThreadMessage or message part.\n * This is a no-op if the target already has a bound message.\n * Use `getExternalStoreMessages` to retrieve the bound messages later.\n *\n * @deprecated This API is experimental and may change without notice.\n */\nexport const bindExternalStoreMessage = <T>(\n target: object,\n message: T | T[],\n): void => {\n if (symbolInnerMessage in target) return;\n (target as WithInnerMessages<T>)[symbolInnerMessage] = message;\n};\n\nexport const getExternalStoreMessages = <T>(\n input:\n | { messages: readonly ThreadMessage[] }\n | ThreadMessage\n | ThreadMessage[\"content\"][number],\n) => {\n const container = (\n \"messages\" in input ? input.messages : input\n ) as WithInnerMessages<T>;\n const value = container[symbolInnerMessages] || container[symbolInnerMessage];\n if (!value) return EMPTY_ARRAY;\n if (Array.isArray(value)) {\n return value;\n }\n container[symbolInnerMessages] = [value];\n return container[symbolInnerMessages];\n};\n","import type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { ModelContextProvider } from \"../../model-context/types\";\nimport type { AssistantRuntimeCore } from \"../interfaces/assistant-runtime-core\";\nimport type { ThreadRuntime } from \"./thread-runtime\";\nimport {\n ThreadListRuntime,\n ThreadListRuntimeImpl,\n} from \"./thread-list-runtime\";\nimport { ExportedMessageRepository } from \"../utils/message-repository\";\nimport type { ThreadMessageLike } from \"../utils/thread-message-like\";\n\nexport type AssistantRuntime = {\n /**\n * The threads in this assistant.\n */\n readonly threads: ThreadListRuntime;\n\n /**\n * The currently selected main thread. Equivalent to `threads.main`.\n */\n readonly thread: ThreadRuntime;\n\n /**\n * @deprecated This field was renamed to `threads`.\n */\n readonly threadList: ThreadListRuntime;\n\n /**\n * Switch to a new thread.\n *\n * @deprecated This method was moved to `threads.switchToNewThread`.\n */\n switchToNewThread(): void;\n\n /**\n * Switch to a thread.\n *\n * @param threadId The thread ID to switch to.\n * @deprecated This method was moved to `threads.switchToThread`.\n */\n switchToThread(threadId: string): void;\n\n /**\n * Register a model context provider. Model context providers are configuration such as system message, temperature, etc. that are set in the frontend.\n *\n * @param provider The model context provider to register.\n */\n registerModelContextProvider(provider: ModelContextProvider): Unsubscribe;\n\n /**\n * @deprecated This method was renamed to `registerModelContextProvider`.\n */\n registerModelConfigProvider(provider: ModelContextProvider): Unsubscribe;\n\n /**\n * @deprecated Use `runtime.thread.reset(initialMessages)`.\n */\n reset: unknown; // make it a type error\n};\n\nexport class AssistantRuntimeImpl implements AssistantRuntime {\n public readonly threads;\n public get threadList() {\n return this.threads;\n }\n\n public readonly _thread: ThreadRuntime;\n\n public constructor(private readonly _core: AssistantRuntimeCore) {\n this.threads = new ThreadListRuntimeImpl(_core.threads);\n this._thread = this.threads.main;\n\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.switchToNewThread = this.switchToNewThread.bind(this);\n this.switchToThread = this.switchToThread.bind(this);\n this.registerModelContextProvider =\n this.registerModelContextProvider.bind(this);\n this.registerModelConfigProvider =\n this.registerModelConfigProvider.bind(this);\n this.reset = this.reset.bind(this);\n }\n\n public get thread() {\n return this._thread;\n }\n\n public switchToNewThread() {\n return this._core.threads.switchToNewThread();\n }\n\n public switchToThread(threadId: string) {\n return this._core.threads.switchToThread(threadId);\n }\n\n public registerModelContextProvider(provider: ModelContextProvider) {\n return this._core.registerModelContextProvider(provider);\n }\n\n public registerModelConfigProvider(provider: ModelContextProvider) {\n return this.registerModelContextProvider(provider);\n }\n\n public reset({\n initialMessages,\n }: {\n initialMessages?: ThreadMessageLike[];\n } = {}) {\n return this._core.threads\n .getMainThreadRuntimeCore()\n .import(ExportedMessageRepository.fromArray(initialMessages ?? []));\n }\n}\n","import type {\n Attachment,\n PendingAttachment,\n CompleteAttachment,\n} from \"../types/attachment\";\n\n// =============================================================================\n// Adapter Type\n// =============================================================================\n\nexport type AttachmentAdapter = {\n accept: string;\n add(state: {\n file: File;\n }): Promise<PendingAttachment> | AsyncGenerator<PendingAttachment, void>;\n remove(attachment: Attachment): Promise<void>;\n send(attachment: PendingAttachment): Promise<CompleteAttachment>;\n};\n\n// =============================================================================\n// Simple Image Attachment Adapter\n// =============================================================================\n\nexport class SimpleImageAttachmentAdapter implements AttachmentAdapter {\n public accept = \"image/*\";\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"image\",\n name: state.file.name,\n contentType: state.file.type,\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [\n {\n type: \"image\",\n image: await getFileDataURL(attachment.file),\n },\n ],\n };\n }\n\n public async remove() {\n // noop\n }\n}\n\nconst getFileDataURL = (file: File) =>\n new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(file);\n });\n\n// =============================================================================\n// Simple Text Attachment Adapter\n// =============================================================================\n\nexport class SimpleTextAttachmentAdapter implements AttachmentAdapter {\n public accept =\n \"text/plain,text/html,text/markdown,text/csv,text/xml,text/json,text/css\";\n\n public async add(state: { file: File }): Promise<PendingAttachment> {\n return {\n id: state.file.name,\n type: \"document\",\n name: state.file.name,\n contentType: state.file.type,\n file: state.file,\n status: { type: \"requires-action\", reason: \"composer-send\" },\n };\n }\n\n public async send(\n attachment: PendingAttachment,\n ): Promise<CompleteAttachment> {\n return {\n ...attachment,\n status: { type: \"complete\" },\n content: [\n {\n type: \"text\",\n text: `<attachment name=${attachment.name}>\\n${await getFileText(attachment.file)}\\n</attachment>`,\n },\n ],\n };\n }\n\n public async remove() {\n // noop\n }\n}\n\nconst getFileText = (file: File) =>\n new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = (error) => reject(error);\n reader.readAsText(file);\n });\n\n// =============================================================================\n// Composite Attachment Adapter\n// =============================================================================\n\nexport function fileMatchesAccept(\n file: { name: string; type: string },\n acceptString: string,\n) {\n if (acceptString === \"*\") {\n return true;\n }\n\n const allowedTypes = acceptString\n .split(\",\")\n .map((type) => type.trim().toLowerCase());\n\n const fileExtension = `.${file.name.split(\".\").pop()!.toLowerCase()}`;\n const fileMimeType = file.type.toLowerCase();\n\n for (const type of allowedTypes) {\n if (type.startsWith(\".\") && type === fileExtension) {\n return true;\n }\n\n if (type.includes(\"/\") && type === fileMimeType) {\n return true;\n }\n\n if (type.endsWith(\"/*\")) {\n const generalType = type.split(\"/\")[0]!;\n if (fileMimeType.startsWith(`${generalType}/`)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nexport class CompositeAttachmentAdapter implements AttachmentAdapter {\n private _adapters: AttachmentAdapter[];\n\n public accept: string;\n\n constructor(adapters: AttachmentAdapter[]) {\n this._adapters = adapters;\n\n const wildcardIdx = adapters.findIndex((a) => a.accept === \"*\");\n if (wildcardIdx !== -1) {\n if (wildcardIdx !== adapters.length - 1)\n throw new Error(\n \"A wildcard adapter (handling all files) can only be specified as the last adapter.\",\n );\n\n this.accept = \"*\";\n } else {\n this.accept = adapters.map((a) => a.accept).join(\",\");\n }\n }\n\n public add(state: { file: File }) {\n for (const adapter of this._adapters) {\n if (fileMatchesAccept(state.file, adapter.accept)) {\n return adapter.add(state);\n }\n }\n throw new Error(\"No matching adapter found for file\");\n }\n\n public async send(attachment: PendingAttachment) {\n const adapters = this._adapters.slice();\n for (const adapter of adapters) {\n if (fileMatchesAccept(attachment.file, adapter.accept)) {\n return adapter.send(attachment);\n }\n }\n throw new Error(\"No matching adapter found for attachment\");\n }\n\n public async remove(attachment: Attachment) {\n const adapters = this._adapters.slice();\n for (const adapter of adapters) {\n if (\n fileMatchesAccept(\n {\n name: attachment.name,\n type: attachment.contentType ?? \"\",\n },\n adapter.accept,\n )\n ) {\n return adapter.remove(attachment);\n }\n }\n throw new Error(\"No matching adapter found for attachment\");\n }\n}\n","// LICENSE for this file only\n\n// MIT License\n\n// Copyright (c) 2025 AgentbaseAI Inc.\n// Copyright (c) 2023 Lars Grammel\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\ntype State =\n | \"ROOT\"\n | \"FINISH\"\n | \"INSIDE_STRING\"\n | \"INSIDE_STRING_ESCAPE\"\n | \"INSIDE_LITERAL\"\n | \"INSIDE_NUMBER\"\n | \"INSIDE_OBJECT_START\"\n | \"INSIDE_OBJECT_KEY\"\n | \"INSIDE_OBJECT_AFTER_KEY\"\n | \"INSIDE_OBJECT_BEFORE_VALUE\"\n | \"INSIDE_OBJECT_AFTER_VALUE\"\n | \"INSIDE_OBJECT_AFTER_COMMA\"\n | \"INSIDE_ARRAY_START\"\n | \"INSIDE_ARRAY_AFTER_VALUE\"\n | \"INSIDE_ARRAY_AFTER_COMMA\";\n\n// Implemented as a scanner with additional fixing\n// that performs a single linear time scan pass over the partial JSON.\n//\n// The states should ideally match relevant states from the JSON spec:\n// https://www.json.org/json-en.html\n//\n// Please note that invalid JSON is not considered/covered, because it\n// is assumed that the resulting JSON will be processed by a standard\n// JSON parser that will detect any invalid JSON.\n\n// Returns a tuple of [fixedJson, partialPath]\n// partialPath is an array of object/array keys that represent\n// the currently partial values. An object is considered partial\n// if through appending extra characters to the JSON string, its\n// value could change.\n\n// Example input: '{\"foo\":[{\"a\":f'\n// Example output: ['{\"foo\":[{\"a\":false}]}', ['foo', '0']]\n// Example input: '{\"foo\":'\n// Example output: ['{}', []]\n\nexport function fixJson(input: string): [string, string[]] {\n const stack: State[] = [\"ROOT\"];\n let lastValidIndex = -1;\n let literalStart: number | null = null;\n const path: string[] = [];\n let currentKey: string | undefined;\n\n function pushCurrentKeyToPath(): void {\n if (currentKey !== undefined) {\n path.push(JSON.parse(`\"${currentKey}\"`));\n currentKey = undefined;\n }\n }\n\n function processValueStart(char: string, i: number, swapState: State) {\n switch (char) {\n case '\"': {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_STRING\");\n\n pushCurrentKeyToPath();\n break;\n }\n\n case \"f\":\n case \"t\":\n case \"n\": {\n lastValidIndex = i;\n literalStart = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_LITERAL\");\n break;\n }\n\n case \"-\": {\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n\n pushCurrentKeyToPath();\n break;\n }\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n\n pushCurrentKeyToPath();\n break;\n }\n\n case \"{\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_OBJECT_START\");\n\n pushCurrentKeyToPath();\n break;\n }\n\n case \"[\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_ARRAY_START\");\n\n pushCurrentKeyToPath();\n break;\n }\n }\n }\n\n function processAfterObjectValue(char: string, i: number) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_COMMA\");\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n currentKey = path.pop();\n break;\n }\n }\n }\n\n function processAfterArrayValue(char: string, i: number) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n currentKey = (Number(currentKey) + 1).toString();\n break;\n }\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n currentKey = path.pop();\n break;\n }\n }\n }\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i]!;\n const currentState = stack[stack.length - 1];\n\n switch (currentState) {\n case \"ROOT\":\n processValueStart(char, i, \"FINISH\");\n break;\n\n case \"INSIDE_OBJECT_START\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n currentKey = \"\";\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n currentKey = path.pop();\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_COMMA\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n currentKey = \"\";\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_KEY\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_KEY\");\n break;\n }\n case \"\\\\\": {\n stack.push(\"INSIDE_STRING_ESCAPE\");\n currentKey += char;\n break;\n }\n default: {\n currentKey += char;\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_KEY\": {\n switch (char) {\n case \":\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_BEFORE_VALUE\");\n\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_BEFORE_VALUE\": {\n processValueStart(char, i, \"INSIDE_OBJECT_AFTER_VALUE\");\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n processAfterObjectValue(char, i);\n break;\n }\n\n case \"INSIDE_STRING\": {\n switch (char) {\n case '\"': {\n stack.pop();\n lastValidIndex = i;\n\n currentKey = path.pop();\n break;\n }\n\n case \"\\\\\": {\n stack.push(\"INSIDE_STRING_ESCAPE\");\n break;\n }\n\n default: {\n lastValidIndex = i;\n }\n }\n\n break;\n }\n\n case \"INSIDE_ARRAY_START\": {\n switch (char) {\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n currentKey = path.pop();\n break;\n }\n\n default: {\n lastValidIndex = i;\n currentKey = \"0\";\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n\n currentKey = (Number(currentKey) + 1).toString();\n break;\n }\n\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n currentKey = path.pop();\n break;\n }\n\n default: {\n lastValidIndex = i;\n break;\n }\n }\n\n break;\n }\n\n case \"INSIDE_ARRAY_AFTER_COMMA\": {\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n\n case \"INSIDE_STRING_ESCAPE\": {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_STRING\") {\n lastValidIndex = i;\n } else if (stack[stack.length - 1] === \"INSIDE_OBJECT_KEY\") {\n currentKey += char;\n }\n\n break;\n }\n\n case \"INSIDE_NUMBER\": {\n switch (char) {\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n break;\n }\n\n case \"e\":\n case \"E\":\n case \"-\":\n case \".\": {\n break;\n }\n\n case \",\": {\n stack.pop();\n currentKey = path.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n\n break;\n }\n\n case \"}\": {\n stack.pop();\n currentKey = path.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n\n break;\n }\n\n case \"]\": {\n stack.pop();\n currentKey = path.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n\n break;\n }\n\n default: {\n stack.pop();\n currentKey = path.pop();\n break;\n }\n }\n\n break;\n }\n\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart!, i + 1);\n\n if (\n !\"false\".startsWith(partialLiteral) &&\n !\"true\".startsWith(partialLiteral) &&\n !\"null\".startsWith(partialLiteral)\n ) {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n } else if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n } else {\n lastValidIndex = i;\n }\n\n break;\n }\n }\n }\n\n let result = input.slice(0, lastValidIndex + 1);\n\n for (let i = stack.length - 1; i >= 0; i--) {\n const state = stack[i];\n\n switch (state) {\n case \"INSIDE_STRING\": {\n result += '\"';\n break;\n }\n\n case \"INSIDE_OBJECT_KEY\":\n case \"INSIDE_OBJECT_AFTER_KEY\":\n case \"INSIDE_OBJECT_AFTER_COMMA\":\n case \"INSIDE_OBJECT_START\":\n case \"INSIDE_OBJECT_BEFORE_VALUE\":\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n result += \"}\";\n break;\n }\n\n case \"INSIDE_ARRAY_START\":\n case \"INSIDE_ARRAY_AFTER_COMMA\":\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n result += \"]\";\n break;\n }\n\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart!, input.length);\n\n if (\"true\".startsWith(partialLiteral)) {\n result += \"true\".slice(partialLiteral.length);\n } else if (\"false\".startsWith(partialLiteral)) {\n result += \"false\".slice(partialLiteral.length);\n } else if (\"null\".startsWith(partialLiteral)) {\n result += \"null\".slice(partialLiteral.length);\n }\n }\n }\n }\n\n return [result, path];\n}\n","import type { AppendMessage } from \"../../types/message\";\nimport type { AttachmentAdapter } from \"../../adapters/attachment\";\nimport type { DictationAdapter } from \"../../adapters/speech\";\nimport type { ThreadComposerRuntimeCore } from \"../interfaces/composer-runtime-core\";\nimport type { ThreadRuntimeCore } from \"../interfaces/thread-runtime-core\";\nimport { BaseComposerRuntimeCore } from \"./base-composer-runtime-core\";\n\nexport class DefaultThreadComposerRuntimeCore\n extends BaseComposerRuntimeCore\n implements ThreadComposerRuntimeCore\n{\n private _canCancel = false;\n public get canCancel() {\n return this._canCancel;\n }\n\n protected getAttachmentAdapter() {\n return this.runtime.adapters?.attachments;\n }\n\n protected getDictationAdapter() {\n return this.runtime.adapters?.dictation;\n }\n\n constructor(\n private runtime: Omit<ThreadRuntimeCore, \"composer\"> & {\n adapters?:\n | {\n attachments?: AttachmentAdapter | undefined;\n dictation?: DictationAdapter | undefined;\n }\n | undefined;\n },\n ) {\n super();\n this.connect();\n }\n\n public connect() {\n return this.runtime.subscribe(() => {\n if (this.canCancel !== this.runtime.capabilities.cancel) {\n this._canCancel = this.runtime.capabilities.cancel;\n this._notifySubscribers();\n }\n });\n }\n\n public async handleSend(\n message: Omit<AppendMessage, \"parentId\" | \"sourceId\">,\n ) {\n this.runtime.append({\n ...(message as AppendMessage),\n parentId: this.runtime.messages.at(-1)?.id ?? null,\n sourceId: null,\n });\n }\n\n public async handleCancel() {\n this.runtime.cancelRun();\n }\n}\n","import type { Attachment, CompleteAttachment } from \"../../types/attachment\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { SubscribableWithState } from \"../../subscribable/subscribable\";\n\nimport type { ComposerRuntimeCoreBinding } from \"./bindings\";\nimport type { AttachmentRuntimePath } from \"./paths\";\n\ntype MessageAttachmentState = CompleteAttachment & {\n readonly source: \"message\";\n};\n\ntype ThreadComposerAttachmentState = Attachment & {\n readonly source: \"thread-composer\";\n};\n\ntype EditComposerAttachmentState = Attachment & {\n readonly source: \"edit-composer\";\n};\n\nexport type AttachmentState =\n | ThreadComposerAttachmentState\n | EditComposerAttachmentState\n | MessageAttachmentState;\n\ntype AttachmentSnapshotBinding<Source extends AttachmentRuntimeSource> =\n SubscribableWithState<\n AttachmentState & { source: Source },\n AttachmentRuntimePath & { attachmentSource: Source }\n >;\n\ntype AttachmentRuntimeSource = AttachmentState[\"source\"];\n\nexport type AttachmentRuntime<\n TSource extends AttachmentRuntimeSource = AttachmentRuntimeSource,\n> = {\n readonly path: AttachmentRuntimePath & { attachmentSource: TSource };\n readonly source: TSource;\n getState(): AttachmentState & { source: TSource };\n remove(): Promise<void>;\n subscribe(callback: () => void): Unsubscribe;\n};\n\nexport abstract class AttachmentRuntimeImpl<\n Source extends AttachmentRuntimeSource = AttachmentRuntimeSource,\n> implements AttachmentRuntime\n{\n public get path() {\n return this._core.path;\n }\n\n public abstract get source(): Source;\n\n constructor(private _core: AttachmentSnapshotBinding<Source>) {\n this.__internal_bindMethods();\n }\n\n protected __internal_bindMethods() {\n this.getState = this.getState.bind(this);\n this.remove = this.remove.bind(this);\n this.subscribe = this.subscribe.bind(this);\n }\n\n public getState(): AttachmentState & { source: Source } {\n return this._core.getState();\n }\n\n public abstract remove(): Promise<void>;\n\n public subscribe(callback: () => void) {\n return this._core.subscribe(callback);\n }\n}\n\nabstract class ComposerAttachmentRuntime<\n Source extends \"thread-composer\" | \"edit-composer\",\n> extends AttachmentRuntimeImpl<Source> {\n constructor(\n core: AttachmentSnapshotBinding<Source>,\n private _composerApi: ComposerRuntimeCoreBinding,\n ) {\n super(core);\n }\n\n public remove() {\n const core = this._composerApi.getState();\n if (!core) throw new Error(\"Composer is not available\");\n return core.removeAttachment(this.getState().id);\n }\n}\n\nexport class ThreadComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<\"thread-composer\"> {\n public get source(): \"thread-composer\" {\n return \"thread-composer\";\n }\n}\n\nexport class EditComposerAttachmentRuntimeImpl extends ComposerAttachmentRuntime<\"edit-composer\"> {\n public get source(): \"edit-composer\" {\n return \"edit-composer\";\n }\n}\n\nexport class MessageAttachmentRuntimeImpl extends AttachmentRuntimeImpl<\"message\"> {\n public get source(): \"message\" {\n return \"message\";\n }\n\n constructor(core: AttachmentSnapshotBinding<\"message\">) {\n super(core);\n }\n\n public remove(): never {\n throw new Error(\"Message attachments cannot be removed\");\n }\n}\n","import type {\n Attachment,\n CompleteAttachment,\n CreateAttachment,\n PendingAttachment,\n} from \"../../types/attachment\";\nimport type { MessageRole, AppendMessage } from \"../../types/message\";\nimport type { QuoteInfo } from \"../../types/quote\";\nimport type { Unsubscribe } from \"../../types/unsubscribe\";\nimport type { RunConfig } from \"../../types/message\";\nimport { BaseSubscribable } from \"../../subscribable/subscribable\";\nimport {\n type AttachmentAdapter,\n fileMatchesAccept,\n} from \"../../adapters/attachment\";\nimport type {\n ComposerRuntimeCore,\n ComposerRuntimeEventType,\n DictationState,\n} from \"../interfaces/composer-runtime-core\";\nimport type { DictationAdapter } from \"../../adapters/speech\";\nimport { generateId } from \"../../utils/id\";\n\nconst isAttachmentComplete = (a: Attachment): a is CompleteAttachment =>\n a.status.type === \"complete\";\n\nexport abstract class BaseComposerRuntimeCore\n extends BaseSubscribable\n implements ComposerRuntimeCore\n{\n public readonly isEditing = true;\n\n protected abstract getAttachmentAdapter(): AttachmentAdapter | undefined;\n protected abstract getDictationAdapter(): DictationAdapter | undefined;\n\n public get attachmentAccept(): string {\n return this.getAttachmentAdapter()?.accept ?? \"*\";\n }\n\n private _attachments: readonly Attachment[] = [];\n public get attachments() {\n return this._attachments;\n }\n\n protected setAttachments(value: readonly Attachment[]) {\n this._attachments = value;\n this._notifySubscribers();\n }\n\n public abstract get canCancel(): boolean;\n\n public get isEmpty() {\n return !this.text.trim() && !this.attachments.length;\n }\n\n private _text = \"\";\n\n get text() {\n return this._text;\n }\n\n private _role: MessageRole = \"user\";\n\n get role() {\n return this._role;\n }\n\n private _runConfig: RunConfig = {};\n\n get runConfig() {\n return this._runConfig;\n }\n\n private _quote: QuoteInfo | undefined = undefined;\n\n get quote() {\n return this._quote;\n }\n\n public setQuote(quote: QuoteInfo | undefined) {\n if (this._quote === quote) return;\n\n this._quote = quote;\n this._notifySubscribers();\n }\n\n public setText(value: string) {\n if (this._text === value) return;\n\n this._text = value;\n if (this._dictation) {\n this._dictationBaseText = value;\n this._currentInterimText = \"\";\n const { status, inputDisabled } = this._dictation;\n this._dictation = inputDisabled ? { status, inputDisabled } : { status };\n }\n this._notifySubscribers();\n }\n\n public setRole(role: MessageRole) {\n if (this._role === role) return;\n\n this._role = role;\n this._notifySubscribers();\n }\n\n public setRunConfig(runConfig: RunConfig) {\n if (this._runConfig === runConfig) return;\n\n this._runConfig = runConfig;\n this._notifySubscribers();\n }\n\n private _emptyTextAndAttachments() {\n this._attachments = [];\n this._text = \"\";\n this._notifySubscribers();\n }\n\n private async _onClearAttachments() {\n const adapter = this.getAttachmentAdapter();\n if (adapter) {\n const pending = this._attachments.filter((a) => !isAttachmentComplete(a));\n await Promise.all(pending.map((a) => adapter.remove(a)));\n }\n }\n\n public async reset() {\n if (\n this._attachments.length === 0 &&\n this._text === \"\" &&\n this._role === \"user\" &&\n Object.keys(this._runConfig).length === 0 &&\n this._quote === undefined\n ) {\n return;\n }\n\n this._role = \"user\";\n this._runConfig = {};\n this._quote = undefined;\n\n const task = this._onClearAttachments();\n this._emptyTextAndAttachments();\n await task;\n }\n\n public async clearAttachments() {\n const task = this._onClearAttachments();\n this.setAttachments([]);\n\n await task;\n }\n\n public async send() {\n if (this.isEmpty) return;\n\n if (this._dictationSession) {\n this._dictationSession.cancel();\n this._cleanupDictation();\n }\n\n const adapter = this.getAttachmentAdapter();\n const attachments =\n this.attachments.length > 0\n ? Promise.all(\n this.attachments.map(async (a) => {\n if (isAttachmentComplete(a)) return a;\n if (!adapter) throw new Error(\"Attachments are not supported\");\n const result = await adapter.send(a);\n return result as CompleteAttachment;\n }),\n )\n : [];\n\n const text = this.text;\n const quote = this._quote;\n this._quote = undefined;\n this._emptyTextAndAttachments();\n\n const message: Omit<AppendMessage, \"parentId\" | \"sourceId\"> = {\n createdAt: new Date(),\n role: this.role,\n content: text ? [{ type: \"text\", text }] : [],\n attachments: await attachments,\n runConfig: this.runConfig,\n metadata: { custom: { ...(quote ? { quote } : {}) } },\n };\n\n this.handleSend(message);\n this._notifyEventSubscribers(\"send\");\n }\n\n public cancel() {\n this.handleCancel();\n }\n\n protected abstract handleSend(\n message: Omit<AppendMessage, \"parentId\" | \"sourceId\">,\n ): void;\n protected abstract handleCancel(): void;\n\n async addAttachment(fileOrAttachment: File | CreateAttachment) {\n if (!(fileOrAttachment instanceof File)) {\n const a: CompleteAttachment = {\n id: fileOrAttachment.id ?? generateId(),\n type: fileOrAttachment.type ?? \"document\",\n name: fileOrAttachment.name,\n contentType: fileOrAttachment.contentType,\n content: fileOrAttachment.content,\n status: { type: \"complete\" },\n };\n this._attachments = [...this._attachments, a];\n this._notifyEventSubscribers(\"attachmentAdd\");\n this._notifySubscribers();\n return;\n }\n\n const adapter = this.getAttachmentAdapter();\n if (!adapter) throw new Error(\"Attachments are not supported\");\n\n if (\n !fileMatchesAccept(\n { name: fileOrAttachment.name, type: fileOrAttachment.type },\n adapter.accept,\n )\n ) {\n throw new Error(\n `File type ${fileOrAttachment.type || \"unknown\"} is not accepted. Accepted types: ${adapter.accept}`,\n );\n }\n\n const upsertAttachment = (a: PendingAttachment) => {\n const idx = this._attachments.findIndex(\n (attachment) => attachment.id === a.id,\n );\n if (idx !== -1)\n this._attachments = [\n ...this._attachments.slice(0, idx),\n a,\n ...this._attachments.slice(idx + 1),\n ];\n else {\n this._attachments = [...this._attachments, a];\n }\n\n this._notifySubscribers();\n };\n\n let lastAttachment: PendingAttachment | undefined;\n try {\n const promiseOrGenerator = adapter.add({ file: fileOrAttachment });\n if (Symbol.asyncIterator in promiseOrGenerator) {\n for await (const r of promiseOrGenerator) {\n lastAttachment = r;\n upsertAttachment(r);\n }\n } else {\n lastAttachment = await promiseOrGenerator;\n upsertAttachment(lastAttachment);\n }\n } catch (e) {\n if (lastAttachment) {\n upsertAttachment({\n ...lastAttachment,\n status: { type: \"incomplete\", reason: \"error\" },\n });\n }\n try {\n this._notifyEventSubscribers(\"attachmentAddError\");\n } catch {\n // prevent subscriber errors from masking the adapter error\n }\n throw e;\n }\n\n const hasError =\n lastAttachment?.status.type === \"incomplete\" &&\n lastAttachment.status.reason === \"error\";\n this._notifyEventSubscribers(\n hasError ? \"attachmentAddError\" : \"attachmentAdd\",\n );\n }\n\n async removeAttachment(attachmentId: string) {\n const index = this._attachments.findIndex((a) => a.id === attachmentId);\n if (index === -1) throw new Error(\"Attachment not found\");\n const attachment = this._attachments[index]!;\n\n if (!isAttachmentComplete(attachment)) {\n const adapter = this.getAttachmentAdapter();\n if (!adapter) throw new Error(\"Attachments are not supported\");\n await adapter.remove(attachment);\n }\n\n this._attachments = this._attachments.filter((a) => a.id !== attachmentId);\n this._notifySubscribers();\n }\n\n private _dictation: DictationState | undefined;\n private _dictationSession: DictationAdapter.Session | undefined;\n private _dictationUnsubscribes: Unsubscribe[] = [];\n private _dictationBaseText = \"\";\n private _currentInterimText = \"\";\n private _dictationSessionIdCounter = 0;\n private _activeDictationSessionId: number | undefined;\n private _isCleaningDictation = false;\n\n public get dictation(): DictationState | undefined {\n return this._dictation;\n }\n\n private _isActiveSession(\n sessionId: number,\n session: DictationAdapter.Session,\n ): boolean {\n return (\n this._activeDictationSessionId === sessionId &&\n this._dictationSession === session\n );\n }\n\n public startDictation(): void {\n const adapter = this.getDictationAdapter();\n if (!adapter) {\n throw new Error(\"Dictation adapter not configured\");\n }\n\n if (this._dictationSession) {\n for (const unsub of this._dictationUnsubscribes) {\n unsub();\n }\n this._dictationUnsubscribes = [];\n const oldSession = this._dictationSession;\n oldSession.stop().catch(() => {});\n this._dictationSession = undefined;\n }\n\n const inputDisabled = adapter.disableInputDuringDictation ?? false;\n\n this._dictationBaseText = this._text;\n this._currentInterimText = \"\";\n\n const session = adapter.listen();\n this._dictationSession = session;\n const sessionId = ++this._dictationSessionIdCounter;\n this._activeDictationSessionId = sessionId;\n this._dictation = { status: session.status, inputDisabled };\n this._notifySubscribers();\n\n const unsubSpeech = session.onSpeech((result) => {\n if (!this._isActiveSession(sessionId, session)) return;\n const isFinal = result.isFinal !== false;\n\n const needsSeparator =\n this._dictationBaseText &&\n !this._dictationBaseText.endsWith(\" \") &&\n result.transcript;\n const separator = needsSeparator ? \" \" : \"\";\n\n if (isFinal) {\n this._dictationBaseText =\n this._dictationBaseText + separator + result.transcript;\n this._currentInterimText = \"\";\n this._text = this._dictationBaseText;\n\n if (this._dictation) {\n const { transcript: _, ...rest } = this._dictation;\n this._dictation = rest;\n }\n this._notifySubscribers();\n } else {\n this._currentInterimText = separator + result.transcript;\n this._text = this._dictationBaseText + this._currentInterimText;\n\n if (this._dictation) {\n this._dictation = {\n ...this._dictation,\n transcript: result.transcript,\n };\n }\n this._notifySubscribers();\n }\n });\n this._dictationUnsubscribes.push(unsubSpeech);\n\n const unsubStart = session.onSpeechStart(() => {\n if (!this._isActiveSession(sessionId, session)) return;\n\n this._dictation = {\n status: { type: \"running\" },\n inputDisabled,\n ...(this._dictation?.transcript && {\n transcript: this._dictation.transcript,\n }),\n };\n this._notifySubscribers();\n });\n this._dictationUnsubscribes.push(unsubStart);\n\n const unsubEnd = session.onSpeechEnd(() => {\n this._cleanupDictation({ sessionId });\n });\n this._dictationUnsubscribes.push(unsubEnd);\n\n const statusInterval = setInterval(() => {\n if (!this._isActiveSession(sessionId, session)) return;\n\n if (session.status.type === \"ended\") {\n this._cleanupDictation({ sessionId });\n }\n }, 100);\n this._dictationUnsubscribes.push(() => clearInterval(statusInterval));\n }\n\n public stopDictation(): void {\n if (!this._dictationSession) return;\n\n const session = this._dictationSession;\n const sessionId = this._activeDictationSessionId;\n session.stop().finally(() => {\n this._cleanupDictation({ sessionId });\n });\n }\n\n private _cleanupDictation(options?: { sessionId: number | undefined }): void {\n const isStaleSession =\n options?.sessionId !== undefined &&\n options.sessionId !== this._activeDictationSessionId;\n if (isStaleSession || this._isCleaningDictation) return;\n\n this._isCleaningDictation = true;\n try {\n for (const unsub of this._dictationUnsubscribes) {\n unsub();\n }\n this._dictationUnsubscribes = [];\n this._dictationSession = undefined;\n this._activeDictationSessionId = undefined;\n this._dictation = undefined;\n this._dictationBaseText = \"\";\n this._currentInterimText = \"\";\n this._notifySubscribers();\n } finally {\n this._isCleaningDictation = false;\n }\n }\n\n private _eventSubscribers = new Map<\n ComposerRuntimeEventType,\n Set<() => void>\n >();\n\n protected _notifyEventSubscribers(event: ComposerRuntimeEventType) {\n const subscribers = this._eventSubscribers.get(event);\n if (!subscribers) return;\n\n for (const callback of subscribers) callback();\n }\n\n public unstable_on(event: ComposerRuntimeEventType, callback: () => void) {\n const subscribers = this._eventSubscribers.get(event);\n if (!subscribers) {\n this._eventSubscribers.set(event, new Set([callback]));\n } else {\n subscribers.add(callback);\n }\n\n return () => {\n const subscribers = this._eventSubscribers.get(event);\n if (!subscribers) return;\n subscribers.delete(callback);\n };\n }\n}\n","import type { Unsubscribe } from \"../types/unsubscribe\";\n\n// =============================================================================\n// Sentinel\n// =============================================================================\n\nexport const SKIP_UPDATE = Symbol(\"skip-update\");\nexport type SKIP_UPDATE = typeof SKIP_UPDATE;\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type Subscribable = {\n subscribe: (callback: () => void) => Unsubscribe;\n};\n\nexport type SubscribableWithState<TState, TPath> = Subscribable & {\n path: TPath;\n getState: () => TState;\n};\n\nexport type NestedSubscribable<\n TState extends Subscribable | undefined,\n TPath,\n> = SubscribableWithState<TState, TPath>;\n\nexport type EventSubscribable<TEvent extends string> = {\n event: TEvent;\n binding: SubscribableWithState<\n | {\n unstable_on: (event: TEvent, callback: () => void) => Unsubscribe;\n }\n | undefined,\n unknown\n >;\n};\n\n// =============================================================================\n// Utilities\n// =============================================================================\n\nfunction shallowEqual<T extends object>(\n objA: T | undefined,\n objB: T | undefined,\n) {\n if (objA === undefined && objB === undefined) return true;\n if (objA === undefined) return false;\n if (objB === undefined) return false;\n\n for (const key of Object.keys(objA)) {\n const valueA = objA[key as keyof T];\n const valueB = objB[key as keyof T];\n if (!Object.is(valueA, valueB)) return false;\n }\n\n return true;\n}\n\n// =============================================================================\n// Base Subscribable (simple pub-sub)\n// =============================================================================\n\nexport class BaseSubscribable {\n private _subscribers = new Set<() => void>();\n\n public subscribe(callback: () => void): Unsubscribe {\n this._subscribers.add(callback);\n return () => this._subscribers.delete(callback);\n }\n\n public waitForUpdate() {\n return new Promise<void>((resolve) => {\n const unsubscribe = this.subscribe(() => {\n unsubscribe();\n resolve();\n });\n });\n }\n\n protected _notifySubscribers() {\n const errors = [];\n for (const callback of this._subscribers) {\n try {\n callback();\n } catch (error) {\n errors.push(error);\n }\n }\n\n if (errors.length > 0) {\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (const error of errors) {\n console.error(error);\n }\n throw new AggregateError(errors);\n }\n }\n }\n}\n\n// =============================================================================\n// Base Subject (lazy connect/disconnect)\n// =============================================================================\n\nexport abstract class BaseSubject {\n private _subscriptions = new Set<() => void>();\n private _connection: Unsubscribe | undefined;\n\n protected get isConnected() {\n return !!this._connection;\n }\n\n protected abstract _connect(): Unsubscribe;\n\n protected notifySubscribers() {\n for (const callback of this._subscriptions) callback();\n }\n\n private _updateConnection() {\n if (this._subscriptions.size > 0) {\n if (this._connection) return;\n this._connection = this._connect();\n } else {\n this._connection?.();\n this._connection = undefined;\n }\n }\n\n public subscribe(callback: () => void) {\n this._subscriptions.add(callback);\n this._updateConnection();\n\n return () => {\n this._subscriptions.delete(callback);\n this._updateConnection();\n };\n }\n}\n\n// =============================================================================\n// Subject Implementations\n// =============================================================================\n\nexport class ShallowMemoizeSubject<TState extends object, TPath>\n extends BaseSubject\n implements SubscribableWithState<TState, TPath>\n{\n public get path() {\n return this.binding.path;\n }\n\n constructor(\n private binding: SubscribableWithState<TState | SKIP_UPDATE, TPath>,\n ) {\n super();\n const state = binding.getState();\n if (state === SKIP_UPDATE)\n throw new Error(\"Entry not available in the store\");\n this._previousState = state;\n }\n\n private _previousState: TState;\n public getState = () => {\n if (!this.isConnected) this._syncState();\n return this._previousState;\n };\n\n private _syncState() {\n const state = this.binding.getState();\n if (state === SKIP_UPDATE) return false;\n if (shallowEqual(state, this._previousState)) return false;\n this._previousState = state;\n return true;\n }\n\n protected _connect() {\n const callback = () => {\n if (this._syncState()) {\n this.notifySubscribers();\n }\n };\n\n return this.binding.subscribe(callback);\n }\n}\n\nexport class LazyMemoizeSubject<TState extends object, TPath>\n extends BaseSubject\n implements SubscribableWithState<TState, TPath>\n{\n public get path() {\n return this.binding.path;\n }\n\n constructor(\n private binding: SubscribableWithState<TState | SKIP_UPDATE, TPath>,\n ) {\n super();\n }\n\n private _previousStateDirty = true;\n private _previousState: TState | undefined;\n public getState = () => {\n if (!this.isConnected || this._previousStateDirty) {\n const newState = this.binding.getState();\n if (newState !== SKIP_UPDATE) {\n this._previousState = newState;\n }\n this._previousStateDirty = false;\n }\n if (this._previousState === undefined)\n throw new Error(\"Entry not available in the store\");\n return this._previousState;\n };\n\n protected _connect() {\n const callback = () => {\n this._previousStateDirty = true;\n this.notifySubscribers();\n };\n\n return this.binding.subscribe(callback);\n }\n}\n\nexport class NestedSubscriptionSubject<\n TState extends Subscribable | undefined,\n TPath,\n >\n extends BaseSubject\n implements\n SubscribableWithState<TState, TPath>,\n NestedSubscribable<TState, TPath>\n{\n public get path() {\n return this.binding.path;\n }\n\n constructor(private binding: NestedSubscribable<TState, TPath>) {\n super();\n }\n\n public getState() {\n return this.binding.getState();\n }\n\n public outerSubscribe(callback: () => void) {\n return this.binding.subscribe(callback);\n }\n\n protected _connect(): Unsubscribe {\n const callback = () => {\n this.notifySubscribers();\n };\n\n let lastState = this.binding.getState();\n let innerUnsubscribe = lastState?.subscribe(callback);\n const onRuntimeUpdate = () => {\n const newState = this.binding.getState();\n if (newState === lastState) return;\n lastState = newState;\n\n innerUnsubscribe?.();\n innerUnsubscribe = newState?.subscribe(callback);\n\n callback();\n };\n\n const outerUnsubscribe = this.outerSubscribe(onRuntimeUpdate);\n return () => {\n outerUnsubscribe?.();\n innerUnsubscribe?.();\n };\n }\n}\n\nexport class EventSubscriptionSubject<\n TEvent extends string,\n> extends BaseSubject {\n constructor(private config: EventSubscribable<TEvent>) {\n super();\n }\n\n public getState() {\n return this.config.binding.getState();\n }\n\n public outerSubscribe(callback: () => void) {\n return this.config.binding.subscribe(callback);\n }\n\n protected _connect(): Unsubscribe {\n const callback = () => {\n this.notifySubscribers();\n };\n\n let lastState = this.config.binding.getState();\n let innerUnsubscribe = lastState?.unstable_on(this.config.event, callback);\n const onRuntimeUpdate = () => {\n const newState = this.config.binding.getState();\n if (newState === lastState) return;\n lastState = newState;\n\n innerUnsubscribe?.();\n innerUnsubscribe = newState?.unstable_on(this.config.event, callback);\n };\n\n const outerUnsubscribe = this.outerSubscribe(onRuntimeUpdate);\n return () => {\n outerUnsubscribe?.();\n innerUnsubscribe?.();\n };\n }\n}\n","interface Attachment {\n path: string;\n name: string;\n notes?: string;\n}\n\nexport function composeUserInput(\n description: string,\n attachments: Attachment[] | undefined\n): string {\n if (!attachments || attachments.length === 0) {\n return description;\n }\n\n const refs = attachments\n .map((a) => (a.notes?.trim() ? `@${a.path} [Note: ${a.notes.trim()}]` : `@${a.path}`))\n .join(' ');\n return `${description}\\n\\n${refs}`;\n}\n","'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions<TData, TError, TVariables, TOnMutateResult>,\n queryClient?: QueryClient,\n): UseMutationResult<TData, TError, TVariables, TOnMutateResult> {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver<TData, TError, TVariables, TOnMutateResult>(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction<TData, TError, TVariables, TOnMutateResult>\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n"],"names":["error","AggregateError","cleanupAllEffects","cell","executionContext","cells","hasOwn","Object","prototype","hasOwnProperty","toStr","toString","defineProperty","gOPD","getOwnPropertyDescriptor","isArray","arr","Array","call","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","key","setProperty","target","options","name","enumerable","configurable","value","newValue","writable","getProperty","module","exports","extend","src","copy","copyIsArray","clone","arguments","i","length","deep","deprecate","fn","equal","ok","unreachable","TypeError","ccount","character","String","source","indexOf","count","index","hasBuffer","Buffer","suspectProtoRx","suspectConstructorRx","_parse","text","reviver","undefined","isBuffer","charCodeAt","slice","JSON","parse","protoAction","constructorAction","test","filter","safe","next","nodes","node","SyntaxError","__proto__","push","stackTraceLimit","Error","safeParse","default","scan","className","children","strong","code","markdownComponents","p","codeEl","em","props","pre","lang","replace","rawText","isPreviewable","language","includes","ul","HtmlPreviewBlock","li","CollapsibleCode","h1","ol","h2","h3","a","href","rel","blockquote","table","thead","th","td","tr","hr","Thread","statusBar","composer","Root","Viewport","Empty","ThreadEmpty","Messages","components","UserMessage","AssistantMessage","Composer","Text","Content","UserMessageText","MessageMeta","Copy","asChild","IconButton","tooltip","AssistantMessageText","t","setExpanded","current","CODE_COLLAPSED_HEIGHT","expanded","needsCollapse","setNeedsCollapse","ref","scrollHeight","style","maxHeight","overflow","type","onClick","showPreview","setShowPreview","maximized","setMaximized","fullscreenCode","setFullscreenCode","lines","split","chars","title","height","srcDoc","sandbox","document","e","stopPropagation","toLocaleString","body","ACTIVITY_MARKER_RE","ThinkingIndicator","booting","activityMatch","exec","ActivityIndicator","label","remarkPlugins","THINKING_WORDS","interval","BOOTING_WORDS","words","setIndex","fade","setFade","setInterval","setTimeout","clearInterval","opacity","transform","animationDelay","message","tick","setTick","id","meta","createdAt","date","Date","isNaN","getTime","time","toLocaleTimeString","hour","minute","relative","formatRelativeTime","diff","now","seconds","Math","floor","minutes","hours","toLocaleDateString","displayName","AddAttachment","Input","rows","autoFocus","placeholder","ComposerAction","If","running","Send","Cancel"],"mappings":"uCAqBA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAN,CAAM,CAAA,EAAY,CAAA,CAAA,CAAA,CAAZ,AAAY,CAAZ,AAAY,CAAZ,AAAY,CAAA,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,CACxB,mBAAoB,EAAI,gBAAgB,CACxC,cAAe,EAAI,WAAW,CAC9B,YAAa,EACb,YACE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,gBAAgB,CAAA,CACf,iBAAkB,GAAiB,cACnC,aAAc,GAAiB,oBAC/B,KAAK,WACL,mBAAoB,CAAC,EAAO,KAC1B,EAAiB,GACjB,EAAiB,EACnB,EACA,UAAU,WAMlB,MACE,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,yCAEb,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,CACC,YAAa,EACb,cAAe,EAAO,SAAS,CAC/B,QAAS,EACT,UAAW,EACX,cAAuC,CAAxB,QAEjB,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,GAFW,qCAGvB,EACC,CAAA,EAAA,EAAA,GAAA,EAAC,GAAA,CAAA,GAED,CAAA,EAAA,EAAA,GAAA,EAAC2C,EAAAA,wBAAwB,CAAA,CAACC,QAAS,WACjC,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAO,SAAU,UAM9B","ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,363,366,367,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,403]}