studiograph 1.3.48-next.21 → 1.3.48-next.210

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 (966) hide show
  1. package/README.md +26 -16
  2. package/dist/agent/agent-pool.d.ts +87 -3
  3. package/dist/agent/agent-pool.js +188 -15
  4. package/dist/agent/agent-pool.js.map +1 -1
  5. package/dist/agent/followups.d.ts +34 -0
  6. package/dist/agent/followups.js +52 -0
  7. package/dist/agent/followups.js.map +1 -0
  8. package/dist/agent/orchestrator.d.ts +101 -4
  9. package/dist/agent/orchestrator.js +464 -66
  10. package/dist/agent/orchestrator.js.map +1 -1
  11. package/dist/agent/prompts/entity-types-section.d.ts +34 -0
  12. package/dist/agent/prompts/entity-types-section.js +76 -0
  13. package/dist/agent/prompts/entity-types-section.js.map +1 -0
  14. package/dist/agent/prompts/system.md +112 -54
  15. package/dist/agent/skill-loader.d.ts +30 -17
  16. package/dist/agent/skill-loader.js +63 -30
  17. package/dist/agent/skill-loader.js.map +1 -1
  18. package/dist/agent/skills/artifact-canvas/skill.md +152 -0
  19. package/dist/agent/skills/entity-schema.md +75 -431
  20. package/dist/agent/skills/interview/entity-templates.md +38 -37
  21. package/dist/agent/skills/interview/question-domains.md +54 -49
  22. package/dist/agent/skills/interview/skill.md +84 -16
  23. package/dist/agent/skills/schema-rules.md +28 -28
  24. package/dist/agent/tools/artifact-tools.d.ts +124 -0
  25. package/dist/agent/tools/artifact-tools.js +207 -0
  26. package/dist/agent/tools/artifact-tools.js.map +1 -0
  27. package/dist/agent/tools/capture-tools.d.ts +31 -0
  28. package/dist/agent/tools/capture-tools.js +40 -0
  29. package/dist/agent/tools/capture-tools.js.map +1 -0
  30. package/dist/agent/tools/folder-tools.d.ts +47 -0
  31. package/dist/agent/tools/folder-tools.js +249 -0
  32. package/dist/agent/tools/folder-tools.js.map +1 -0
  33. package/dist/agent/tools/fs-tools.d.ts +6 -5
  34. package/dist/agent/tools/fs-tools.js +5 -5
  35. package/dist/agent/tools/fs-tools.js.map +1 -1
  36. package/dist/agent/tools/graph-tools.d.ts +48 -72
  37. package/dist/agent/tools/graph-tools.js +852 -329
  38. package/dist/agent/tools/graph-tools.js.map +1 -1
  39. package/dist/agent/tools/history-tools.d.ts +95 -0
  40. package/dist/agent/tools/history-tools.js +461 -0
  41. package/dist/agent/tools/history-tools.js.map +1 -0
  42. package/dist/agent/tools/load-skill.d.ts +6 -5
  43. package/dist/agent/tools/load-skill.js +3 -3
  44. package/dist/agent/tools/load-skill.js.map +1 -1
  45. package/dist/agent/tools/ops-tools.d.ts +5 -4
  46. package/dist/agent/tools/ops-tools.js +130 -236
  47. package/dist/agent/tools/ops-tools.js.map +1 -1
  48. package/dist/agent/tools/permission-tools.d.ts +87 -17
  49. package/dist/agent/tools/permission-tools.js +233 -43
  50. package/dist/agent/tools/permission-tools.js.map +1 -1
  51. package/dist/agent/tools/tool-loader.js +5 -4
  52. package/dist/agent/tools/tool-loader.js.map +1 -1
  53. package/dist/agent/tools/web-tools.js +58 -9
  54. package/dist/agent/tools/web-tools.js.map +1 -1
  55. package/dist/cli/commands/about.d.ts +1 -0
  56. package/dist/cli/commands/about.js +55 -3
  57. package/dist/cli/commands/about.js.map +1 -1
  58. package/dist/cli/commands/admin/audit-workspace.d.ts +23 -0
  59. package/dist/cli/commands/admin/audit-workspace.js +133 -0
  60. package/dist/cli/commands/admin/audit-workspace.js.map +1 -0
  61. package/dist/cli/commands/admin/audit.d.ts +21 -0
  62. package/dist/cli/commands/admin/audit.js +174 -0
  63. package/dist/cli/commands/admin/audit.js.map +1 -0
  64. package/dist/cli/commands/admin/backup.d.ts +54 -0
  65. package/dist/cli/commands/admin/backup.js +207 -0
  66. package/dist/cli/commands/admin/backup.js.map +1 -0
  67. package/dist/cli/commands/admin/folder.d.ts +11 -0
  68. package/dist/cli/commands/{collection.js → admin/folder.js} +33 -32
  69. package/dist/cli/commands/admin/folder.js.map +1 -0
  70. package/dist/cli/commands/admin/index.d.ts +16 -0
  71. package/dist/cli/commands/admin/index.js +46 -0
  72. package/dist/cli/commands/admin/index.js.map +1 -0
  73. package/dist/cli/commands/admin/migrate-assets.d.ts +53 -0
  74. package/dist/cli/commands/admin/migrate-assets.js +184 -0
  75. package/dist/cli/commands/admin/migrate-assets.js.map +1 -0
  76. package/dist/cli/commands/admin/migrate.d.ts +56 -0
  77. package/dist/cli/commands/admin/migrate.js +263 -0
  78. package/dist/cli/commands/admin/migrate.js.map +1 -0
  79. package/dist/cli/commands/admin/restore.d.ts +24 -0
  80. package/dist/cli/commands/admin/restore.js +228 -0
  81. package/dist/cli/commands/admin/restore.js.map +1 -0
  82. package/dist/cli/commands/admin/secrets.d.ts +23 -0
  83. package/dist/cli/commands/admin/secrets.js +256 -0
  84. package/dist/cli/commands/admin/secrets.js.map +1 -0
  85. package/dist/cli/commands/admin/settings.d.ts +28 -0
  86. package/dist/cli/commands/admin/settings.js +284 -0
  87. package/dist/cli/commands/admin/settings.js.map +1 -0
  88. package/dist/cli/commands/admin/token.d.ts +42 -0
  89. package/dist/cli/commands/admin/token.js +126 -0
  90. package/dist/cli/commands/admin/token.js.map +1 -0
  91. package/dist/cli/commands/admin/transfer-ownership.d.ts +15 -0
  92. package/dist/cli/commands/admin/transfer-ownership.js +106 -0
  93. package/dist/cli/commands/admin/transfer-ownership.js.map +1 -0
  94. package/dist/cli/commands/admin/user.d.ts +11 -0
  95. package/dist/cli/commands/admin/user.js +187 -0
  96. package/dist/cli/commands/admin/user.js.map +1 -0
  97. package/dist/cli/commands/clone.d.ts +25 -3
  98. package/dist/cli/commands/clone.js +142 -36
  99. package/dist/cli/commands/clone.js.map +1 -1
  100. package/dist/cli/commands/config.d.ts +23 -107
  101. package/dist/cli/commands/config.js +52 -260
  102. package/dist/cli/commands/config.js.map +1 -1
  103. package/dist/cli/commands/connector.d.ts +10 -13
  104. package/dist/cli/commands/connector.js +16 -58
  105. package/dist/cli/commands/connector.js.map +1 -1
  106. package/dist/cli/commands/deploy.js +215 -68
  107. package/dist/cli/commands/deploy.js.map +1 -1
  108. package/dist/cli/commands/index.js +5 -1
  109. package/dist/cli/commands/index.js.map +1 -1
  110. package/dist/cli/commands/init.js +10 -30
  111. package/dist/cli/commands/init.js.map +1 -1
  112. package/dist/cli/commands/mcp.js +54 -6
  113. package/dist/cli/commands/mcp.js.map +1 -1
  114. package/dist/cli/commands/r2.d.ts +3 -0
  115. package/dist/cli/commands/r2.js +223 -204
  116. package/dist/cli/commands/r2.js.map +1 -1
  117. package/dist/cli/commands/redeploy.js +65 -12
  118. package/dist/cli/commands/redeploy.js.map +1 -1
  119. package/dist/cli/commands/reset.d.ts +22 -6
  120. package/dist/cli/commands/reset.js +132 -34
  121. package/dist/cli/commands/reset.js.map +1 -1
  122. package/dist/cli/commands/serve.js +231 -26
  123. package/dist/cli/commands/serve.js.map +1 -1
  124. package/dist/cli/commands/sync.d.ts +1 -1
  125. package/dist/cli/commands/sync.js +237 -227
  126. package/dist/cli/commands/sync.js.map +1 -1
  127. package/dist/cli/crypto-bundle.d.ts +39 -0
  128. package/dist/cli/crypto-bundle.js +94 -0
  129. package/dist/cli/crypto-bundle.js.map +1 -0
  130. package/dist/cli/index.js +24 -26
  131. package/dist/cli/index.js.map +1 -1
  132. package/dist/cli/railway-pin.d.ts +68 -0
  133. package/dist/cli/railway-pin.js +96 -0
  134. package/dist/cli/railway-pin.js.map +1 -0
  135. package/dist/cli/railway-provisioning.d.ts +53 -0
  136. package/dist/cli/railway-provisioning.js +85 -0
  137. package/dist/cli/railway-provisioning.js.map +1 -0
  138. package/dist/cli/setup-wizard.d.ts +30 -49
  139. package/dist/cli/setup-wizard.js +39 -40
  140. package/dist/cli/setup-wizard.js.map +1 -1
  141. package/dist/core/accent-palette.d.ts +22 -0
  142. package/dist/core/accent-palette.js +47 -0
  143. package/dist/core/accent-palette.js.map +1 -0
  144. package/dist/core/artifact-asset-urls.d.ts +51 -0
  145. package/dist/core/artifact-asset-urls.js +79 -0
  146. package/dist/core/artifact-asset-urls.js.map +1 -0
  147. package/dist/core/artifact-bundle.d.ts +69 -0
  148. package/dist/core/artifact-bundle.js +305 -0
  149. package/dist/core/artifact-bundle.js.map +1 -0
  150. package/dist/core/artifact-escape.d.ts +5 -0
  151. package/dist/core/artifact-escape.js +26 -0
  152. package/dist/core/artifact-escape.js.map +1 -0
  153. package/dist/core/artifact-export.d.ts +17 -0
  154. package/dist/core/artifact-export.js +529 -0
  155. package/dist/core/artifact-export.js.map +1 -0
  156. package/dist/core/cell-anchor.d.ts +29 -0
  157. package/dist/core/cell-anchor.js +53 -0
  158. package/dist/core/cell-anchor.js.map +1 -0
  159. package/dist/core/comment-anchor.d.ts +41 -0
  160. package/dist/core/comment-anchor.js +147 -0
  161. package/dist/core/comment-anchor.js.map +1 -0
  162. package/dist/core/commit-messages.d.ts +57 -0
  163. package/dist/core/commit-messages.js +85 -0
  164. package/dist/core/commit-messages.js.map +1 -0
  165. package/dist/core/embeds.d.ts +96 -0
  166. package/dist/core/embeds.js +187 -0
  167. package/dist/core/embeds.js.map +1 -0
  168. package/dist/core/entity-body-templates.d.ts +21 -0
  169. package/dist/core/entity-body-templates.js +67 -0
  170. package/dist/core/entity-body-templates.js.map +1 -0
  171. package/dist/core/entity-types-catalog.d.ts +65 -0
  172. package/dist/core/entity-types-catalog.js +142 -0
  173. package/dist/core/entity-types-catalog.js.map +1 -0
  174. package/dist/core/field-library.d.ts +62 -0
  175. package/dist/core/field-library.js +129 -0
  176. package/dist/core/field-library.js.map +1 -0
  177. package/dist/core/folder-paths.d.ts +41 -0
  178. package/dist/core/folder-paths.js +95 -0
  179. package/dist/core/folder-paths.js.map +1 -0
  180. package/dist/core/folder-sidecar.d.ts +36 -0
  181. package/dist/core/folder-sidecar.js +91 -0
  182. package/dist/core/folder-sidecar.js.map +1 -0
  183. package/dist/core/format-registry.d.ts +170 -0
  184. package/dist/core/format-registry.js +412 -0
  185. package/dist/core/format-registry.js.map +1 -0
  186. package/dist/core/graph.d.ts +773 -14
  187. package/dist/core/graph.js +2269 -308
  188. package/dist/core/graph.js.map +1 -1
  189. package/dist/core/history-diff.d.ts +35 -0
  190. package/dist/core/history-diff.js +114 -0
  191. package/dist/core/history-diff.js.map +1 -0
  192. package/dist/core/refs.d.ts +41 -0
  193. package/dist/core/refs.js +80 -0
  194. package/dist/core/refs.js.map +1 -0
  195. package/dist/core/schema-registry.d.ts +66 -0
  196. package/dist/core/schema-registry.js +198 -37
  197. package/dist/core/schema-registry.js.map +1 -1
  198. package/dist/core/schemas/connector.d.ts +67 -0
  199. package/dist/core/schemas/connector.js +100 -0
  200. package/dist/core/schemas/connector.js.map +1 -0
  201. package/dist/core/schemas/workspace.d.ts +122 -0
  202. package/dist/core/schemas/workspace.js +211 -0
  203. package/dist/core/schemas/workspace.js.map +1 -0
  204. package/dist/core/secrets/SecretStore.d.ts +77 -0
  205. package/dist/core/secrets/SecretStore.js +13 -0
  206. package/dist/core/secrets/SecretStore.js.map +1 -0
  207. package/dist/core/secrets/SettingsResolver.d.ts +54 -0
  208. package/dist/core/secrets/SettingsResolver.js +80 -0
  209. package/dist/core/secrets/SettingsResolver.js.map +1 -0
  210. package/dist/core/secrets/SettingsStore.d.ts +30 -0
  211. package/dist/core/secrets/SettingsStore.js +9 -0
  212. package/dist/core/secrets/SettingsStore.js.map +1 -0
  213. package/dist/core/secrets/SqliteEncryptedStore.d.ts +90 -0
  214. package/dist/core/secrets/SqliteEncryptedStore.js +598 -0
  215. package/dist/core/secrets/SqliteEncryptedStore.js.map +1 -0
  216. package/dist/core/secrets/audit.d.ts +36 -0
  217. package/dist/core/secrets/audit.js +60 -0
  218. package/dist/core/secrets/audit.js.map +1 -0
  219. package/dist/core/secrets/auth-db-migration.d.ts +129 -0
  220. package/dist/core/secrets/auth-db-migration.js +653 -0
  221. package/dist/core/secrets/auth-db-migration.js.map +1 -0
  222. package/dist/core/secrets/bundle.d.ts +141 -0
  223. package/dist/core/secrets/bundle.js +435 -0
  224. package/dist/core/secrets/bundle.js.map +1 -0
  225. package/dist/core/secrets/dual-write.d.ts +81 -0
  226. package/dist/core/secrets/dual-write.js +247 -0
  227. package/dist/core/secrets/dual-write.js.map +1 -0
  228. package/dist/core/secrets/encryption.d.ts +44 -0
  229. package/dist/core/secrets/encryption.js +97 -0
  230. package/dist/core/secrets/encryption.js.map +1 -0
  231. package/dist/core/secrets/index.d.ts +49 -0
  232. package/dist/core/secrets/index.js +74 -0
  233. package/dist/core/secrets/index.js.map +1 -0
  234. package/dist/core/secrets/master-key.d.ts +38 -0
  235. package/dist/core/secrets/master-key.js +122 -0
  236. package/dist/core/secrets/master-key.js.map +1 -0
  237. package/dist/core/secrets/probes/anthropic.d.ts +98 -0
  238. package/dist/core/secrets/probes/anthropic.js +300 -0
  239. package/dist/core/secrets/probes/anthropic.js.map +1 -0
  240. package/dist/core/secrets/probes/brave.d.ts +9 -0
  241. package/dist/core/secrets/probes/brave.js +15 -0
  242. package/dist/core/secrets/probes/brave.js.map +1 -0
  243. package/dist/core/secrets/probes/r2.d.ts +15 -0
  244. package/dist/core/secrets/probes/r2.js +14 -0
  245. package/dist/core/secrets/probes/r2.js.map +1 -0
  246. package/dist/core/secrets/probes/tavily.d.ts +18 -0
  247. package/dist/core/secrets/probes/tavily.js +58 -0
  248. package/dist/core/secrets/probes/tavily.js.map +1 -0
  249. package/dist/core/secrets/probes/voyage.d.ts +13 -0
  250. package/dist/core/secrets/probes/voyage.js +52 -0
  251. package/dist/core/secrets/probes/voyage.js.map +1 -0
  252. package/dist/core/secrets/r2-structural-migration.d.ts +39 -0
  253. package/dist/core/secrets/r2-structural-migration.js +109 -0
  254. package/dist/core/secrets/r2-structural-migration.js.map +1 -0
  255. package/dist/core/secrets/read-flip.d.ts +59 -0
  256. package/dist/core/secrets/read-flip.js +87 -0
  257. package/dist/core/secrets/read-flip.js.map +1 -0
  258. package/dist/core/secrets/registry.d.ts +188 -0
  259. package/dist/core/secrets/registry.js +616 -0
  260. package/dist/core/secrets/registry.js.map +1 -0
  261. package/dist/core/types.d.ts +77 -483
  262. package/dist/core/types.js +25 -3
  263. package/dist/core/types.js.map +1 -1
  264. package/dist/core/user-config.d.ts +75 -12
  265. package/dist/core/user-config.js +155 -14
  266. package/dist/core/user-config.js.map +1 -1
  267. package/dist/core/validation.d.ts +786 -1373
  268. package/dist/core/validation.js +458 -147
  269. package/dist/core/validation.js.map +1 -1
  270. package/dist/core/workspace-manager.d.ts +87 -14
  271. package/dist/core/workspace-manager.js +222 -94
  272. package/dist/core/workspace-manager.js.map +1 -1
  273. package/dist/core/workspace.d.ts +19 -5
  274. package/dist/core/workspace.js +67 -39
  275. package/dist/core/workspace.js.map +1 -1
  276. package/dist/mcp/comment-virtual-entity.d.ts +36 -0
  277. package/dist/mcp/comment-virtual-entity.js +71 -0
  278. package/dist/mcp/comment-virtual-entity.js.map +1 -0
  279. package/dist/mcp/connector-manager.d.ts +72 -2
  280. package/dist/mcp/connector-manager.js +211 -32
  281. package/dist/mcp/connector-manager.js.map +1 -1
  282. package/dist/mcp/oauth-provider.d.ts +0 -5
  283. package/dist/mcp/oauth-provider.js +10 -22
  284. package/dist/mcp/oauth-provider.js.map +1 -1
  285. package/dist/mcp/oauth-registry.d.ts +46 -8
  286. package/dist/mcp/oauth-registry.js +52 -13
  287. package/dist/mcp/oauth-registry.js.map +1 -1
  288. package/dist/mcp/server-discovery.d.ts +73 -0
  289. package/dist/mcp/server-discovery.js +164 -0
  290. package/dist/mcp/server-discovery.js.map +1 -0
  291. package/dist/mcp/server.d.ts +24 -3
  292. package/dist/mcp/server.js +53 -10
  293. package/dist/mcp/server.js.map +1 -1
  294. package/dist/mcp/state-signer.d.ts +62 -0
  295. package/dist/mcp/state-signer.js +205 -0
  296. package/dist/mcp/state-signer.js.map +1 -0
  297. package/dist/mcp/stdio-proxy.d.ts +67 -0
  298. package/dist/mcp/stdio-proxy.js +149 -0
  299. package/dist/mcp/stdio-proxy.js.map +1 -0
  300. package/dist/mcp/tools.d.ts +65 -2
  301. package/dist/mcp/tools.js +1772 -124
  302. package/dist/mcp/tools.js.map +1 -1
  303. package/dist/server/__tests__/helpers/graph-api.d.ts +16 -0
  304. package/dist/server/__tests__/helpers/graph-api.js +16 -0
  305. package/dist/server/__tests__/helpers/graph-api.js.map +1 -0
  306. package/dist/server/artifact-asset-mint.d.ts +41 -0
  307. package/dist/server/artifact-asset-mint.js +59 -0
  308. package/dist/server/artifact-asset-mint.js.map +1 -0
  309. package/dist/server/asset-index-queue.d.ts +98 -0
  310. package/dist/server/asset-index-queue.js +193 -0
  311. package/dist/server/asset-index-queue.js.map +1 -0
  312. package/dist/server/body-write-coordinator.d.ts +161 -0
  313. package/dist/server/body-write-coordinator.js +182 -0
  314. package/dist/server/body-write-coordinator.js.map +1 -0
  315. package/dist/server/cloud-billing-flow.d.ts +32 -0
  316. package/dist/server/cloud-billing-flow.js +75 -0
  317. package/dist/server/cloud-billing-flow.js.map +1 -0
  318. package/dist/server/commit-audit.d.ts +26 -0
  319. package/dist/server/commit-audit.js +30 -0
  320. package/dist/server/commit-audit.js.map +1 -0
  321. package/dist/server/index.d.ts +29 -3
  322. package/dist/server/index.js +657 -269
  323. package/dist/server/index.js.map +1 -1
  324. package/dist/server/middleware/sanitize.d.ts +46 -0
  325. package/dist/server/middleware/sanitize.js +182 -0
  326. package/dist/server/middleware/sanitize.js.map +1 -0
  327. package/dist/server/routes/artifact-export-api.d.ts +11 -0
  328. package/dist/server/routes/artifact-export-api.js +159 -0
  329. package/dist/server/routes/artifact-export-api.js.map +1 -0
  330. package/dist/server/routes/asset-api.d.ts +76 -1
  331. package/dist/server/routes/asset-api.js +761 -61
  332. package/dist/server/routes/asset-api.js.map +1 -1
  333. package/dist/server/routes/audit-api.d.ts +24 -0
  334. package/dist/server/routes/audit-api.js +117 -0
  335. package/dist/server/routes/audit-api.js.map +1 -0
  336. package/dist/server/routes/auth-api.js +532 -63
  337. package/dist/server/routes/auth-api.js.map +1 -1
  338. package/dist/server/routes/capture-api.d.ts +10 -3
  339. package/dist/server/routes/capture-api.js +213 -25
  340. package/dist/server/routes/capture-api.js.map +1 -1
  341. package/dist/server/routes/chat-sessions-api.d.ts +13 -0
  342. package/dist/server/routes/chat-sessions-api.js +455 -0
  343. package/dist/server/routes/chat-sessions-api.js.map +1 -0
  344. package/dist/server/routes/chat.d.ts +35 -1
  345. package/dist/server/routes/chat.js +699 -54
  346. package/dist/server/routes/chat.js.map +1 -1
  347. package/dist/server/routes/comments-api.d.ts +15 -0
  348. package/dist/server/routes/comments-api.js +444 -0
  349. package/dist/server/routes/comments-api.js.map +1 -0
  350. package/dist/server/routes/config-api.d.ts +3 -2
  351. package/dist/server/routes/config-api.js +179 -49
  352. package/dist/server/routes/config-api.js.map +1 -1
  353. package/dist/server/routes/connectors-api.js +177 -42
  354. package/dist/server/routes/connectors-api.js.map +1 -1
  355. package/dist/server/routes/event-ingest-api.d.ts +15 -0
  356. package/dist/server/routes/{meeting-ingest-api.js → event-ingest-api.js} +35 -20
  357. package/dist/server/routes/event-ingest-api.js.map +1 -0
  358. package/dist/server/routes/field-library-api.d.ts +28 -0
  359. package/dist/server/routes/field-library-api.js +126 -0
  360. package/dist/server/routes/field-library-api.js.map +1 -0
  361. package/dist/server/routes/git-http.d.ts +2 -2
  362. package/dist/server/routes/git-http.js +86 -39
  363. package/dist/server/routes/git-http.js.map +1 -1
  364. package/dist/server/routes/graph-api-access.d.ts +57 -0
  365. package/dist/server/routes/graph-api-access.js +112 -0
  366. package/dist/server/routes/graph-api-access.js.map +1 -0
  367. package/dist/server/routes/graph-api.d.ts +1 -1
  368. package/dist/server/routes/graph-api.js +1455 -325
  369. package/dist/server/routes/graph-api.js.map +1 -1
  370. package/dist/server/routes/health.d.ts +18 -0
  371. package/dist/server/routes/health.js +74 -0
  372. package/dist/server/routes/health.js.map +1 -0
  373. package/dist/server/routes/import-batch.d.ts +24 -0
  374. package/dist/server/routes/import-batch.js +33 -0
  375. package/dist/server/routes/import-batch.js.map +1 -0
  376. package/dist/server/routes/insights-api.d.ts +9 -2
  377. package/dist/server/routes/insights-api.js +355 -61
  378. package/dist/server/routes/insights-api.js.map +1 -1
  379. package/dist/server/routes/mcp.d.ts +7 -3
  380. package/dist/server/routes/mcp.js +24 -8
  381. package/dist/server/routes/mcp.js.map +1 -1
  382. package/dist/server/routes/oauth-api.d.ts +67 -0
  383. package/dist/server/routes/oauth-api.js +421 -0
  384. package/dist/server/routes/oauth-api.js.map +1 -0
  385. package/dist/server/routes/permissions-api.d.ts +9 -2
  386. package/dist/server/routes/permissions-api.js +87 -31
  387. package/dist/server/routes/permissions-api.js.map +1 -1
  388. package/dist/server/routes/r2-api.d.ts +25 -0
  389. package/dist/server/routes/r2-api.js +276 -0
  390. package/dist/server/routes/r2-api.js.map +1 -0
  391. package/dist/server/routes/secrets-api.d.ts +36 -0
  392. package/dist/server/routes/secrets-api.js +308 -0
  393. package/dist/server/routes/secrets-api.js.map +1 -0
  394. package/dist/server/routes/settings-api.d.ts +29 -0
  395. package/dist/server/routes/settings-api.js +180 -0
  396. package/dist/server/routes/settings-api.js.map +1 -0
  397. package/dist/server/routes/share-api.d.ts +32 -0
  398. package/dist/server/routes/share-api.js +234 -0
  399. package/dist/server/routes/share-api.js.map +1 -0
  400. package/dist/server/routes/views-api.js +51 -0
  401. package/dist/server/routes/views-api.js.map +1 -1
  402. package/dist/server/routes/workspace-api.d.ts +2 -1
  403. package/dist/server/routes/workspace-api.js +142 -23
  404. package/dist/server/routes/workspace-api.js.map +1 -1
  405. package/dist/server/routes/ws.d.ts +3 -2
  406. package/dist/server/routes/ws.js +68 -17
  407. package/dist/server/routes/ws.js.map +1 -1
  408. package/dist/server/session-manager.d.ts +48 -5
  409. package/dist/server/session-manager.js +182 -14
  410. package/dist/server/session-manager.js.map +1 -1
  411. package/dist/server/ws-hub.d.ts +124 -37
  412. package/dist/server/ws-hub.js +0 -0
  413. package/dist/server/ws-hub.js.map +1 -1
  414. package/dist/server/yjs-manager.d.ts +278 -7
  415. package/dist/server/yjs-manager.js +830 -38
  416. package/dist/server/yjs-manager.js.map +1 -1
  417. package/dist/server/yjs-persistence.d.ts +165 -0
  418. package/dist/server/yjs-persistence.js +557 -0
  419. package/dist/server/yjs-persistence.js.map +1 -0
  420. package/dist/server/yjs-text-diff.d.ts +32 -0
  421. package/dist/server/yjs-text-diff.js +61 -0
  422. package/dist/server/yjs-text-diff.js.map +1 -0
  423. package/dist/services/access-control.d.ts +73 -0
  424. package/dist/services/access-control.js +165 -0
  425. package/dist/services/access-control.js.map +1 -0
  426. package/dist/services/artifact-asset-token.d.ts +69 -0
  427. package/dist/services/artifact-asset-token.js +94 -0
  428. package/dist/services/artifact-asset-token.js.map +1 -0
  429. package/dist/services/artifact-library-sources.d.ts +3 -0
  430. package/dist/services/artifact-library-sources.js +44 -0
  431. package/dist/services/artifact-library-sources.js.map +1 -0
  432. package/dist/services/artifact-render-export.d.ts +97 -0
  433. package/dist/services/artifact-render-export.js +467 -0
  434. package/dist/services/artifact-render-export.js.map +1 -0
  435. package/dist/services/asset-caption-service.d.ts +103 -0
  436. package/dist/services/asset-caption-service.js +186 -0
  437. package/dist/services/asset-caption-service.js.map +1 -0
  438. package/dist/services/asset-delete-authz.d.ts +31 -0
  439. package/dist/services/asset-delete-authz.js +61 -0
  440. package/dist/services/asset-delete-authz.js.map +1 -0
  441. package/dist/services/asset-finalize-service.d.ts +58 -0
  442. package/dist/services/asset-finalize-service.js +216 -0
  443. package/dist/services/asset-finalize-service.js.map +1 -0
  444. package/dist/services/asset-import-service.d.ts +111 -0
  445. package/dist/services/asset-import-service.js +394 -0
  446. package/dist/services/asset-import-service.js.map +1 -0
  447. package/dist/services/asset-index-sweep.d.ts +95 -0
  448. package/dist/services/asset-index-sweep.js +249 -0
  449. package/dist/services/asset-index-sweep.js.map +1 -0
  450. package/dist/services/asset-lifecycle-check.d.ts +22 -0
  451. package/dist/services/asset-lifecycle-check.js +80 -0
  452. package/dist/services/asset-lifecycle-check.js.map +1 -0
  453. package/dist/services/asset-listing.d.ts +72 -0
  454. package/dist/services/asset-listing.js +321 -0
  455. package/dist/services/asset-listing.js.map +1 -0
  456. package/dist/services/asset-presign-service.d.ts +68 -0
  457. package/dist/services/asset-presign-service.js +124 -0
  458. package/dist/services/asset-presign-service.js.map +1 -0
  459. package/dist/services/asset-sidecar-service.d.ts +28 -0
  460. package/dist/services/asset-sidecar-service.js +79 -0
  461. package/dist/services/asset-sidecar-service.js.map +1 -0
  462. package/dist/services/asset-upload-errors.d.ts +41 -0
  463. package/dist/services/asset-upload-errors.js +45 -0
  464. package/dist/services/asset-upload-errors.js.map +1 -0
  465. package/dist/services/asset-upload-service.d.ts +56 -0
  466. package/dist/services/asset-upload-service.js +200 -0
  467. package/dist/services/asset-upload-service.js.map +1 -0
  468. package/dist/services/asset-upload-token.d.ts +58 -0
  469. package/dist/services/asset-upload-token.js +75 -0
  470. package/dist/services/asset-upload-token.js.map +1 -0
  471. package/dist/services/assets/asset-index-service.d.ts +127 -0
  472. package/dist/services/assets/asset-index-service.js +227 -0
  473. package/dist/services/assets/asset-index-service.js.map +1 -0
  474. package/dist/services/assets/base.d.ts +128 -2
  475. package/dist/services/assets/base.js +98 -1
  476. package/dist/services/assets/base.js.map +1 -1
  477. package/dist/services/assets/index.d.ts +114 -1
  478. package/dist/services/assets/index.js +221 -0
  479. package/dist/services/assets/index.js.map +1 -1
  480. package/dist/services/assets/local.d.ts +16 -1
  481. package/dist/services/assets/local.js +110 -1
  482. package/dist/services/assets/local.js.map +1 -1
  483. package/dist/services/assets/r2-sync.d.ts +88 -0
  484. package/dist/services/assets/r2-sync.js +412 -0
  485. package/dist/services/assets/r2-sync.js.map +1 -0
  486. package/dist/services/assets/r2.d.ts +87 -1
  487. package/dist/services/assets/r2.js +203 -1
  488. package/dist/services/assets/r2.js.map +1 -1
  489. package/dist/services/auth-service.d.ts +312 -45
  490. package/dist/services/auth-service.js +1011 -195
  491. package/dist/services/auth-service.js.map +1 -1
  492. package/dist/services/chat-session-service.d.ts +188 -0
  493. package/dist/services/chat-session-service.js +512 -0
  494. package/dist/services/chat-session-service.js.map +1 -0
  495. package/dist/services/cloud-inference-billing.d.ts +64 -0
  496. package/dist/services/cloud-inference-billing.js +313 -0
  497. package/dist/services/cloud-inference-billing.js.map +1 -0
  498. package/dist/services/comment-service.d.ts +97 -0
  499. package/dist/services/comment-service.js +341 -0
  500. package/dist/services/comment-service.js.map +1 -0
  501. package/dist/services/comment-virtual-entity.d.ts +36 -0
  502. package/dist/services/comment-virtual-entity.js +71 -0
  503. package/dist/services/comment-virtual-entity.js.map +1 -0
  504. package/dist/services/convert-service.d.ts +64 -0
  505. package/dist/services/convert-service.js +68 -0
  506. package/dist/services/convert-service.js.map +1 -0
  507. package/dist/services/csv-service.d.ts +22 -17
  508. package/dist/services/csv-service.js +55 -92
  509. package/dist/services/csv-service.js.map +1 -1
  510. package/dist/services/entity-mutations.d.ts +213 -0
  511. package/dist/services/entity-mutations.js +380 -0
  512. package/dist/services/entity-mutations.js.map +1 -0
  513. package/dist/services/{meeting-processor.d.ts → event-processor.d.ts} +15 -8
  514. package/dist/services/{meeting-processor.js → event-processor.js} +124 -65
  515. package/dist/services/event-processor.js.map +1 -0
  516. package/dist/services/extract/docx.d.ts +1 -0
  517. package/dist/services/extract/docx.js +233 -0
  518. package/dist/services/extract/docx.js.map +1 -0
  519. package/dist/services/extract/index.d.ts +9 -0
  520. package/dist/services/extract/index.js +10 -0
  521. package/dist/services/extract/index.js.map +1 -0
  522. package/dist/services/extract/pdf.d.ts +13 -0
  523. package/dist/services/extract/pdf.js +69 -0
  524. package/dist/services/extract/pdf.js.map +1 -0
  525. package/dist/services/folder-creation.d.ts +33 -0
  526. package/dist/services/folder-creation.js +103 -0
  527. package/dist/services/folder-creation.js.map +1 -0
  528. package/dist/services/git.d.ts +58 -0
  529. package/dist/services/git.js +194 -55
  530. package/dist/services/git.js.map +1 -1
  531. package/dist/services/graph-maintenance.js +4 -4
  532. package/dist/services/graph-maintenance.js.map +1 -1
  533. package/dist/services/import-service.d.ts +51 -2
  534. package/dist/services/import-service.js +254 -107
  535. package/dist/services/import-service.js.map +1 -1
  536. package/dist/services/lint-service.js +10 -17
  537. package/dist/services/lint-service.js.map +1 -1
  538. package/dist/services/markdown.d.ts +12 -1
  539. package/dist/services/markdown.js +77 -9
  540. package/dist/services/markdown.js.map +1 -1
  541. package/dist/services/mention-detector.d.ts +23 -0
  542. package/dist/services/mention-detector.js +47 -0
  543. package/dist/services/mention-detector.js.map +1 -0
  544. package/dist/services/model-capabilities.d.ts +41 -0
  545. package/dist/services/model-capabilities.js +107 -0
  546. package/dist/services/model-capabilities.js.map +1 -0
  547. package/dist/services/notification-broadcast.d.ts +32 -0
  548. package/dist/services/notification-broadcast.js +38 -0
  549. package/dist/services/notification-broadcast.js.map +1 -0
  550. package/dist/services/notification-service.d.ts +41 -0
  551. package/dist/services/notification-service.js +100 -0
  552. package/dist/services/notification-service.js.map +1 -0
  553. package/dist/services/oauth-server-store.d.ts +147 -0
  554. package/dist/services/oauth-server-store.js +319 -0
  555. package/dist/services/oauth-server-store.js.map +1 -0
  556. package/dist/services/orphan-service.js +2 -2
  557. package/dist/services/orphan-service.js.map +1 -1
  558. package/dist/services/personal-folder.d.ts +40 -0
  559. package/dist/services/personal-folder.js +101 -0
  560. package/dist/services/personal-folder.js.map +1 -0
  561. package/dist/services/scratch-asset-promote.d.ts +57 -0
  562. package/dist/services/scratch-asset-promote.js +95 -0
  563. package/dist/services/scratch-asset-promote.js.map +1 -0
  564. package/dist/services/scratch-attachment-service.d.ts +196 -0
  565. package/dist/services/scratch-attachment-service.js +347 -0
  566. package/dist/services/scratch-attachment-service.js.map +1 -0
  567. package/dist/services/share-link-service.d.ts +57 -0
  568. package/dist/services/share-link-service.js +142 -0
  569. package/dist/services/share-link-service.js.map +1 -0
  570. package/dist/services/user-person-bridge.d.ts +136 -0
  571. package/dist/services/user-person-bridge.js +340 -0
  572. package/dist/services/user-person-bridge.js.map +1 -0
  573. package/dist/services/vector-service.d.ts +282 -5
  574. package/dist/services/vector-service.js +585 -29
  575. package/dist/services/vector-service.js.map +1 -1
  576. package/dist/services/workspace-access.d.ts +108 -0
  577. package/dist/services/workspace-access.js +149 -0
  578. package/dist/services/workspace-access.js.map +1 -0
  579. package/dist/services/workspace-assets-folder.d.ts +46 -0
  580. package/dist/services/workspace-assets-folder.js +75 -0
  581. package/dist/services/workspace-assets-folder.js.map +1 -0
  582. package/dist/utils/git.d.ts +17 -2
  583. package/dist/utils/git.js +23 -7
  584. package/dist/utils/git.js.map +1 -1
  585. package/dist/utils/log.d.ts +42 -0
  586. package/dist/utils/log.js +137 -0
  587. package/dist/utils/log.js.map +1 -0
  588. package/dist/utils/preflight.js +2 -2
  589. package/dist/utils/preflight.js.map +1 -1
  590. package/dist/utils/version-checker.d.ts +12 -19
  591. package/dist/utils/version-checker.js +14 -104
  592. package/dist/utils/version-checker.js.map +1 -1
  593. package/dist/web/_app/immutable/assets/0.Bs_z3Z86.css +2 -0
  594. package/dist/web/_app/immutable/assets/12.DlIf1mKh.css +1 -0
  595. package/dist/web/_app/immutable/assets/14.7d-Q37wc.css +1 -0
  596. package/dist/web/_app/immutable/assets/15.BwBFdc1D.css +1 -0
  597. package/dist/web/_app/immutable/assets/16.CmLrbzZp.css +1 -0
  598. package/dist/web/_app/immutable/assets/17.DcuK5ZVm.css +1 -0
  599. package/dist/web/_app/immutable/assets/2.DATnR31c.css +1 -0
  600. package/dist/web/_app/immutable/assets/3.Cz4H8n_O.css +1 -0
  601. package/dist/web/_app/immutable/assets/4.aDHteTDy.css +1 -0
  602. package/dist/web/_app/immutable/assets/6.CF1i5Bon.css +1 -0
  603. package/dist/web/_app/immutable/assets/ArtifactEntityView.C4ooklFD.css +1 -0
  604. package/dist/web/_app/immutable/assets/AssetLibraryPicker.BOFW0MvF.css +1 -0
  605. package/dist/web/_app/immutable/assets/BulkActionsBar.cmKvHzRK.css +1 -0
  606. package/dist/web/_app/immutable/assets/CalendarView.lBCvS3X5.css +1 -0
  607. package/dist/web/_app/immutable/assets/CodeMirrorEditor.D6hf2pNJ.css +1 -0
  608. package/dist/web/_app/immutable/assets/CopyField.DVGZtw4U.css +1 -0
  609. package/dist/web/_app/immutable/assets/FolderMembersPanel.kiYnDFHu.css +1 -0
  610. package/dist/web/_app/immutable/assets/FolderMutationDialogs.BMRF6Z3z.css +1 -0
  611. package/dist/web/_app/immutable/assets/FolderPicker.Cp46GHe2.css +1 -0
  612. package/dist/web/_app/immutable/assets/GalleryView.WBGxxUQc.css +1 -0
  613. package/dist/web/_app/immutable/assets/GraphView.BJtGL9py.css +1 -0
  614. package/dist/web/_app/immutable/assets/KanbanView.BOaI5KFL.css +1 -0
  615. package/dist/web/_app/immutable/assets/Link.vV0ne105.css +1 -0
  616. package/dist/web/_app/immutable/assets/Markdown.BZnsSOSf.css +1 -0
  617. package/dist/web/_app/immutable/assets/Rail.ilusFgD4.css +1 -0
  618. package/dist/web/_app/immutable/assets/SettingsDialog.D7-BO6S_.css +1 -0
  619. package/dist/web/_app/immutable/assets/Spinner.UBfl0pab.css +1 -0
  620. package/dist/web/_app/immutable/assets/StopFilledAlt.fNlDN65D.css +1 -0
  621. package/dist/web/_app/immutable/assets/TimelineView.xAZBJhHw.css +1 -0
  622. package/dist/web/_app/immutable/assets/WorkspaceView.C8ErUJAY.css +1 -0
  623. package/dist/web/_app/immutable/assets/button.BlLm4Dg1.css +1 -0
  624. package/dist/web/_app/immutable/assets/history-summary.LpmHXasl.css +1 -0
  625. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.CvHOgSBP.woff +0 -0
  626. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.DMJ8VG8y.woff2 +0 -0
  627. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.CB9ihrfo.woff +0 -0
  628. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.DSY6xOcd.woff2 +0 -0
  629. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CZTNEAuW.woff2 +0 -0
  630. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CsGl1sm0.woff +0 -0
  631. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CDDApCn2.woff2 +0 -0
  632. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CYLoc0-x.woff +0 -0
  633. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.BNK2_mGO.woff2 +0 -0
  634. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.DpEwFAQM.woff +0 -0
  635. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.6ng42L7E.woff2 +0 -0
  636. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.BgVn5rGT.woff +0 -0
  637. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.Cu4Hd6ag.woff +0 -0
  638. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.CuJfVYMP.woff2 +0 -0
  639. package/dist/web/_app/immutable/assets/inline-list.cqga56xT.css +1 -0
  640. package/dist/web/_app/immutable/assets/list-columns.BgnafZ4K.css +1 -0
  641. package/dist/web/_app/immutable/assets/realtime.DDCWxn3B.css +1 -0
  642. package/dist/web/_app/immutable/assets/select.B90KUqR4.css +1 -0
  643. package/dist/web/_app/immutable/assets/sheet.RF9RBmml.css +1 -0
  644. package/dist/web/_app/immutable/chunks/22qYtvr82.js +1 -0
  645. package/dist/web/_app/immutable/chunks/3anKjXOb.js +1 -0
  646. package/dist/web/_app/immutable/chunks/6S9WOky52.js +1 -0
  647. package/dist/web/_app/immutable/chunks/7xJ91z7d.js +2 -0
  648. package/dist/web/_app/immutable/chunks/9K8VREGP.js +1 -0
  649. package/dist/web/_app/immutable/chunks/B-TGZnCt2.js +1 -0
  650. package/dist/web/_app/immutable/chunks/B-n5q6ku.js +1 -0
  651. package/dist/web/_app/immutable/chunks/B0p2fSEV2.js +1 -0
  652. package/dist/web/_app/immutable/chunks/B2oi87jG.js +2 -0
  653. package/dist/web/_app/immutable/chunks/B4DG5QOL.js +1 -0
  654. package/dist/web/_app/immutable/chunks/B6Lt-qaJ.js +1 -0
  655. package/dist/web/_app/immutable/chunks/B6qeIQZz.js +2 -0
  656. package/dist/web/_app/immutable/chunks/B9KfEsQw2.js +1 -0
  657. package/dist/web/_app/immutable/chunks/B9VRF5aH2.js +1 -0
  658. package/dist/web/_app/immutable/chunks/BCQQzpbj.js +1 -0
  659. package/dist/web/_app/immutable/chunks/BF0vIqH9.js +1 -0
  660. package/dist/web/_app/immutable/chunks/BFp1K70l.js +8 -0
  661. package/dist/web/_app/immutable/chunks/BFr7Funh.js +1 -0
  662. package/dist/web/_app/immutable/chunks/BFx32D20.js +2 -0
  663. package/dist/web/_app/immutable/chunks/BLs1h0Rh2.js +1 -0
  664. package/dist/web/_app/immutable/chunks/BPzV_xOS2.js +1 -0
  665. package/dist/web/_app/immutable/chunks/BRvMjAzW.js +2 -0
  666. package/dist/web/_app/immutable/chunks/BV-iCKqa.js +1 -0
  667. package/dist/web/_app/immutable/chunks/BZi3uKF4.js +1 -0
  668. package/dist/web/_app/immutable/chunks/B_PyL87x.js +2 -0
  669. package/dist/web/_app/immutable/chunks/BbfHGU9n2.js +1 -0
  670. package/dist/web/_app/immutable/chunks/Bbqu2-5G2.js +1 -0
  671. package/dist/web/_app/immutable/chunks/BdWZJpmv.js +2 -0
  672. package/dist/web/_app/immutable/chunks/BfnFtsiY.js +1 -0
  673. package/dist/web/_app/immutable/chunks/BlgjVmFM2.js +14 -0
  674. package/dist/web/_app/immutable/chunks/BmgXvmIG.js +5 -0
  675. package/dist/web/_app/immutable/chunks/BpCG9m962.js +1 -0
  676. package/dist/web/_app/immutable/chunks/BrveeylZ.js +1 -0
  677. package/dist/web/_app/immutable/chunks/BsW72fyR2.js +1 -0
  678. package/dist/web/_app/immutable/chunks/Bti_XKwx.js +2692 -0
  679. package/dist/web/_app/immutable/chunks/BuhW5Fr0.js +689 -0
  680. package/dist/web/_app/immutable/chunks/Bx74EEyn2.js +1 -0
  681. package/dist/web/_app/immutable/chunks/BxPN0T61.js +1 -0
  682. package/dist/web/_app/immutable/chunks/Bxk27YWG.js +1 -0
  683. package/dist/web/_app/immutable/chunks/Bz9lrgGs.js +1 -0
  684. package/dist/web/_app/immutable/chunks/BzaxZ6j12.js +1 -0
  685. package/dist/web/_app/immutable/chunks/C1B4xDs0.js +1 -0
  686. package/dist/web/_app/immutable/chunks/C1trcC8M.js +7 -0
  687. package/dist/web/_app/immutable/chunks/C3F_NMTk.js +3 -0
  688. package/dist/web/_app/immutable/chunks/C4PZmGUQ.js +2 -0
  689. package/dist/web/_app/immutable/chunks/C6wYiSz8.js +1 -0
  690. package/dist/web/_app/immutable/chunks/C70saxIl.js +1 -0
  691. package/dist/web/_app/immutable/chunks/C9tvkk7Y2.js +22 -0
  692. package/dist/web/_app/immutable/chunks/CE1XZ5DE.js +1 -0
  693. package/dist/web/_app/immutable/chunks/CEahbtnP.js +1 -0
  694. package/dist/web/_app/immutable/chunks/CGkd0a-c2.js +2 -0
  695. package/dist/web/_app/immutable/chunks/CIoNEHQ82.js +184 -0
  696. package/dist/web/_app/immutable/chunks/CK4z74w5.js +1 -0
  697. package/dist/web/_app/immutable/chunks/COo3HgCZ.js +1 -0
  698. package/dist/web/_app/immutable/chunks/CP8_U450.js +1 -0
  699. package/dist/web/_app/immutable/chunks/CQ1eQ93t2.js +6 -0
  700. package/dist/web/_app/immutable/chunks/CQyBDccA.js +1 -0
  701. package/dist/web/_app/immutable/chunks/CUFQMEBn2.js +1 -0
  702. package/dist/web/_app/immutable/chunks/CV5OSCJc.js +1 -0
  703. package/dist/web/_app/immutable/chunks/CYEYDNwO2.js +1 -0
  704. package/dist/web/_app/immutable/chunks/CZgFaimi2.js +83 -0
  705. package/dist/web/_app/immutable/chunks/CZqvCTCv.js +1 -0
  706. package/dist/web/_app/immutable/chunks/CcWaWbrI2.js +1 -0
  707. package/dist/web/_app/immutable/chunks/CdtzRVZK.js +1 -0
  708. package/dist/web/_app/immutable/chunks/CfYG72Hc.js +1 -0
  709. package/dist/web/_app/immutable/chunks/Cg-ND0cl.js +1 -0
  710. package/dist/web/_app/immutable/chunks/Ch1kmm3J2.js +1 -0
  711. package/dist/web/_app/immutable/chunks/CjiMLTwX2.js +1 -0
  712. package/dist/web/_app/immutable/chunks/CkoeSJ8K.js +6 -0
  713. package/dist/web/_app/immutable/chunks/Cp87MaaW.js +1 -0
  714. package/dist/web/_app/immutable/chunks/Cqm5wAin.js +1 -0
  715. package/dist/web/_app/immutable/chunks/Ct1uesdW.js +2 -0
  716. package/dist/web/_app/immutable/chunks/CuYPXpWU.js +1 -0
  717. package/dist/web/_app/immutable/chunks/Cuq8J2Td.js +1 -0
  718. package/dist/web/_app/immutable/chunks/CvSEodTA.js +1 -0
  719. package/dist/web/_app/immutable/chunks/CvqqrTrj.js +1 -0
  720. package/dist/web/_app/immutable/chunks/CzXdOgVl2.js +7 -0
  721. package/dist/web/_app/immutable/chunks/D0W7c6Sg.js +185 -0
  722. package/dist/web/_app/immutable/chunks/D0rBhnqB2.js +1 -0
  723. package/dist/web/_app/immutable/chunks/D1-GZSN1.js +1 -0
  724. package/dist/web/_app/immutable/chunks/D1BLcNJ7.js +1 -0
  725. package/dist/web/_app/immutable/chunks/D1yvtriI.js +1 -0
  726. package/dist/web/_app/immutable/chunks/D25NMRpl.js +1 -0
  727. package/dist/web/_app/immutable/chunks/D3F675fu2.js +2 -0
  728. package/dist/web/_app/immutable/chunks/D4UrtGC1.js +1 -0
  729. package/dist/web/_app/immutable/chunks/D8wZ2xul.js +4 -0
  730. package/dist/web/_app/immutable/chunks/DA3HEX3X.js +1 -0
  731. package/dist/web/_app/immutable/chunks/DE2TCESD2.js +1 -0
  732. package/dist/web/_app/immutable/chunks/DN-gIRdd2.js +1 -0
  733. package/dist/web/_app/immutable/chunks/DPUVu0T0.js +1 -0
  734. package/dist/web/_app/immutable/chunks/DPcejqKZ.js +1 -0
  735. package/dist/web/_app/immutable/chunks/DQMWa2t7.js +1 -0
  736. package/dist/web/_app/immutable/chunks/DRPMJ-3M.js +2 -0
  737. package/dist/web/_app/immutable/chunks/DRPnwQAm.js +1 -0
  738. package/dist/web/_app/immutable/chunks/DXmfl4Hq2.js +1 -0
  739. package/dist/web/_app/immutable/chunks/DXsFrDer2.js +1 -0
  740. package/dist/web/_app/immutable/chunks/DYc5KW3F.js +1 -0
  741. package/dist/web/_app/immutable/chunks/DcPrzUMJ.js +1 -0
  742. package/dist/web/_app/immutable/chunks/DdQVGKgM.js +1 -0
  743. package/dist/web/_app/immutable/chunks/DiFfW--R2.js +2 -0
  744. package/dist/web/_app/immutable/chunks/DjIqa1_y.js +2 -0
  745. package/dist/web/_app/immutable/chunks/Dl63IUnH2.js +224 -0
  746. package/dist/web/_app/immutable/chunks/DmFdD6zT.js +1 -0
  747. package/dist/web/_app/immutable/chunks/Dn3R8S-U.js +1 -0
  748. package/dist/web/_app/immutable/chunks/DpNr1GQ2.js +1 -0
  749. package/dist/web/_app/immutable/chunks/DsFEd8vL2.js +1 -0
  750. package/dist/web/_app/immutable/chunks/DuxziNnw.js +1 -0
  751. package/dist/web/_app/immutable/chunks/FuiJnZG0.js +1 -0
  752. package/dist/web/_app/immutable/chunks/Izkulod7.js +1 -0
  753. package/dist/web/_app/immutable/chunks/LYL8znYR2.js +23 -0
  754. package/dist/web/_app/immutable/chunks/ON7Gta0d.js +1 -0
  755. package/dist/web/_app/immutable/chunks/PhN6tXuJ2.js +1 -0
  756. package/dist/web/_app/immutable/chunks/PyLyCpuL.js +1 -0
  757. package/dist/web/_app/immutable/chunks/RG7IUVLn2.js +2 -0
  758. package/dist/web/_app/immutable/chunks/RK4gCWN0.js +2 -0
  759. package/dist/web/_app/immutable/chunks/SnzlL4ZV.js +1 -0
  760. package/dist/web/_app/immutable/chunks/XcWejFm_.js +5 -0
  761. package/dist/web/_app/immutable/chunks/Xkp5hSA1.js +1 -0
  762. package/dist/web/_app/immutable/chunks/al_nidE9.js +1 -0
  763. package/dist/web/_app/immutable/chunks/e50-izZO2.js +1 -0
  764. package/dist/web/_app/immutable/chunks/golz20La2.js +2 -0
  765. package/dist/web/_app/immutable/chunks/hG-QCarB.js +1 -0
  766. package/dist/web/_app/immutable/chunks/kNaey6uv.js +1 -0
  767. package/dist/web/_app/immutable/chunks/nXReuy-5.js +3 -0
  768. package/dist/web/_app/immutable/chunks/o61aZZFZ2.js +66 -0
  769. package/dist/web/_app/immutable/chunks/qwr5boV8.js +1 -0
  770. package/dist/web/_app/immutable/chunks/rjjyuGhb.js +1 -0
  771. package/dist/web/_app/immutable/chunks/uBgoVlsx.js +3 -0
  772. package/dist/web/_app/immutable/chunks/xY0c-UfG.js +3 -0
  773. package/dist/web/_app/immutable/chunks/xeNvx4Bl2.js +1 -0
  774. package/dist/web/_app/immutable/chunks/xihTtKlq.js +1 -0
  775. package/dist/web/_app/immutable/entry/app.dqA31fjy.js +2 -0
  776. package/dist/web/_app/immutable/entry/start.BB1XrAea.js +1 -0
  777. package/dist/web/_app/immutable/nodes/0.dALEQAnu.js +2 -0
  778. package/dist/web/_app/immutable/nodes/1.aFU32Ukj.js +1 -0
  779. package/dist/web/_app/immutable/nodes/10.C2wB-OnW.js +1 -0
  780. package/dist/web/_app/immutable/nodes/11.CI3a8Rj5.js +1 -0
  781. package/dist/web/_app/immutable/nodes/12.CsTvsKzB.js +1 -0
  782. package/dist/web/_app/immutable/nodes/13.CYrHXCA8.js +1 -0
  783. package/dist/web/_app/immutable/nodes/14.B31HrQ26.js +1 -0
  784. package/dist/web/_app/immutable/nodes/15.DxgnZ61h.js +1 -0
  785. package/dist/web/_app/immutable/nodes/16.DAP8cwVb.js +1 -0
  786. package/dist/web/_app/immutable/nodes/17.CmwXtCDY.js +77 -0
  787. package/dist/web/_app/immutable/nodes/2.BuGXEIlN.js +122 -0
  788. package/dist/web/_app/immutable/nodes/3.CmhZJWHE.js +6 -0
  789. package/dist/web/_app/immutable/nodes/4.BRfoPTm-.js +11 -0
  790. package/dist/web/_app/immutable/nodes/5.C7gPuZM_.js +1 -0
  791. package/dist/web/_app/immutable/nodes/6.qKODVbya.js +6 -0
  792. package/dist/web/_app/immutable/nodes/7.BZO37zAJ.js +1 -0
  793. package/dist/web/_app/immutable/nodes/8.xF_Dd1BO.js +1 -0
  794. package/dist/web/_app/immutable/nodes/9.Bow4UyKV.js +1 -0
  795. package/dist/web/_app/version.json +1 -1
  796. package/dist/web/favicon-16.png +0 -0
  797. package/dist/web/favicon-180.png +0 -0
  798. package/dist/web/favicon-32.png +0 -0
  799. package/dist/web/favicon-48.png +0 -0
  800. package/dist/web/favicon-512.png +0 -0
  801. package/dist/web/favicon.ico +0 -0
  802. package/dist/web/favicon.svg +8 -0
  803. package/dist/web/index.html +56 -21
  804. package/dist/web/studiograph-logomark.svg +29 -0
  805. package/package.json +35 -14
  806. package/dist/agent/skills/enrich-entities.md +0 -136
  807. package/dist/agent/skills/sync-configuration.md +0 -119
  808. package/dist/agent/skills/sync-setup.md +0 -82
  809. package/dist/agent/tools/message-tools.d.ts +0 -42
  810. package/dist/agent/tools/message-tools.js +0 -106
  811. package/dist/agent/tools/message-tools.js.map +0 -1
  812. package/dist/cli/commands/app.d.ts +0 -7
  813. package/dist/cli/commands/app.js +0 -268
  814. package/dist/cli/commands/app.js.map +0 -1
  815. package/dist/cli/commands/clear.d.ts +0 -5
  816. package/dist/cli/commands/clear.js +0 -36
  817. package/dist/cli/commands/clear.js.map +0 -1
  818. package/dist/cli/commands/collection.d.ts +0 -10
  819. package/dist/cli/commands/collection.js.map +0 -1
  820. package/dist/cli/commands/join.d.ts +0 -9
  821. package/dist/cli/commands/join.js +0 -255
  822. package/dist/cli/commands/join.js.map +0 -1
  823. package/dist/cli/commands/start.d.ts +0 -7
  824. package/dist/cli/commands/start.js +0 -584
  825. package/dist/cli/commands/start.js.map +0 -1
  826. package/dist/cli/commands/update.d.ts +0 -8
  827. package/dist/cli/commands/update.js +0 -155
  828. package/dist/cli/commands/update.js.map +0 -1
  829. package/dist/cli/commands/user.d.ts +0 -7
  830. package/dist/cli/commands/user.js +0 -175
  831. package/dist/cli/commands/user.js.map +0 -1
  832. package/dist/cli/scaffolding.d.ts +0 -12
  833. package/dist/cli/scaffolding.js +0 -397
  834. package/dist/cli/scaffolding.js.map +0 -1
  835. package/dist/integrations/registry.d.ts +0 -8
  836. package/dist/integrations/registry.js +0 -7
  837. package/dist/integrations/registry.js.map +0 -1
  838. package/dist/integrations/types.d.ts +0 -43
  839. package/dist/integrations/types.js +0 -5
  840. package/dist/integrations/types.js.map +0 -1
  841. package/dist/lib/lib/utils.d.ts +0 -2
  842. package/dist/lib/lib/utils.js +0 -6
  843. package/dist/lib/lib/utils.js.map +0 -1
  844. package/dist/server/chrome/chrome.css +0 -691
  845. package/dist/server/chrome/chrome.js +0 -374
  846. package/dist/server/commit-scheduler.d.ts +0 -39
  847. package/dist/server/commit-scheduler.js +0 -113
  848. package/dist/server/commit-scheduler.js.map +0 -1
  849. package/dist/server/plugin-loader.d.ts +0 -53
  850. package/dist/server/plugin-loader.js +0 -155
  851. package/dist/server/plugin-loader.js.map +0 -1
  852. package/dist/server/routes/meeting-ingest-api.d.ts +0 -14
  853. package/dist/server/routes/meeting-ingest-api.js.map +0 -1
  854. package/dist/server/routes/messages-api.d.ts +0 -15
  855. package/dist/server/routes/messages-api.js +0 -385
  856. package/dist/server/routes/messages-api.js.map +0 -1
  857. package/dist/services/batch-processor.d.ts +0 -49
  858. package/dist/services/batch-processor.js +0 -166
  859. package/dist/services/batch-processor.js.map +0 -1
  860. package/dist/services/briefing.d.ts +0 -26
  861. package/dist/services/briefing.js +0 -230
  862. package/dist/services/briefing.js.map +0 -1
  863. package/dist/services/heartbeat.d.ts +0 -28
  864. package/dist/services/heartbeat.js +0 -183
  865. package/dist/services/heartbeat.js.map +0 -1
  866. package/dist/services/image-import-service.d.ts +0 -24
  867. package/dist/services/image-import-service.js +0 -108
  868. package/dist/services/image-import-service.js.map +0 -1
  869. package/dist/services/insights.d.ts +0 -38
  870. package/dist/services/insights.js +0 -269
  871. package/dist/services/insights.js.map +0 -1
  872. package/dist/services/meeting-processor.js.map +0 -1
  873. package/dist/services/message-service.d.ts +0 -68
  874. package/dist/services/message-service.js +0 -220
  875. package/dist/services/message-service.js.map +0 -1
  876. package/dist/utils/workspace-config.d.ts +0 -8
  877. package/dist/utils/workspace-config.js +0 -22
  878. package/dist/utils/workspace-config.js.map +0 -1
  879. package/dist/web/_app/immutable/assets/0.uPSqtsC5.css +0 -1
  880. package/dist/web/_app/immutable/assets/11.2jzI3cZY.css +0 -1
  881. package/dist/web/_app/immutable/assets/12.CT4xL4K3.css +0 -1
  882. package/dist/web/_app/immutable/assets/13.BUrHkYry.css +0 -1
  883. package/dist/web/_app/immutable/assets/2.DpQWr6q6.css +0 -1
  884. package/dist/web/_app/immutable/assets/3.BxdqT7zi.css +0 -1
  885. package/dist/web/_app/immutable/assets/4.DdNqjd0T.css +0 -1
  886. package/dist/web/_app/immutable/assets/5.DFeGxLYf.css +0 -1
  887. package/dist/web/_app/immutable/assets/6.DXZr_rI_.css +0 -1
  888. package/dist/web/_app/immutable/assets/GraphView.D9ePpZez.css +0 -1
  889. package/dist/web/_app/immutable/assets/Toaster.rN8r_Hzv.css +0 -1
  890. package/dist/web/_app/immutable/assets/ViewToolbar.BWE03S64.css +0 -1
  891. package/dist/web/_app/immutable/assets/WorkspaceView.CgGDi_Zb.css +0 -1
  892. package/dist/web/_app/immutable/assets/wikilinks.CzMBkUMB.css +0 -1
  893. package/dist/web/_app/immutable/chunks/-jG4Obyh.js +0 -4
  894. package/dist/web/_app/immutable/chunks/2nrc8f_O.js +0 -1
  895. package/dist/web/_app/immutable/chunks/7S2LGqoP.js +0 -2
  896. package/dist/web/_app/immutable/chunks/8Q3ZJIYu.js +0 -1
  897. package/dist/web/_app/immutable/chunks/B8ydT5xX.js +0 -2
  898. package/dist/web/_app/immutable/chunks/BB_5th5W.js +0 -3383
  899. package/dist/web/_app/immutable/chunks/BEn6N5c2.js +0 -1
  900. package/dist/web/_app/immutable/chunks/BFNNbCAM.js +0 -1
  901. package/dist/web/_app/immutable/chunks/BFZZEUd5.js +0 -1
  902. package/dist/web/_app/immutable/chunks/BGk8kfOE.js +0 -2
  903. package/dist/web/_app/immutable/chunks/BIBCr278.js +0 -1
  904. package/dist/web/_app/immutable/chunks/BPCkkwqe.js +0 -1
  905. package/dist/web/_app/immutable/chunks/BhlvzGQx.js +0 -1
  906. package/dist/web/_app/immutable/chunks/BlMknQeF.js +0 -1
  907. package/dist/web/_app/immutable/chunks/BpjqrlCg.js +0 -1
  908. package/dist/web/_app/immutable/chunks/BrebtJNG.js +0 -18
  909. package/dist/web/_app/immutable/chunks/ByBZ7JIT.js +0 -1
  910. package/dist/web/_app/immutable/chunks/Bz0ZjVQE.js +0 -2
  911. package/dist/web/_app/immutable/chunks/BzJTZOK2.js +0 -1
  912. package/dist/web/_app/immutable/chunks/C0LVZhvn.js +0 -1
  913. package/dist/web/_app/immutable/chunks/C3uBrOS5.js +0 -1
  914. package/dist/web/_app/immutable/chunks/C8R1sDpW.js +0 -1
  915. package/dist/web/_app/immutable/chunks/CDRHrs0g.js +0 -1
  916. package/dist/web/_app/immutable/chunks/CN5_py1I.js +0 -1
  917. package/dist/web/_app/immutable/chunks/CPne482a.js +0 -1
  918. package/dist/web/_app/immutable/chunks/CSVbGg_b.js +0 -5
  919. package/dist/web/_app/immutable/chunks/CWyU-seV.js +0 -1
  920. package/dist/web/_app/immutable/chunks/CX_61fY8.js +0 -5
  921. package/dist/web/_app/immutable/chunks/CYrVHOHA.js +0 -1
  922. package/dist/web/_app/immutable/chunks/ChsiIm-E.js +0 -1
  923. package/dist/web/_app/immutable/chunks/CojKppbh.js +0 -1
  924. package/dist/web/_app/immutable/chunks/CqkleIqs.js +0 -1
  925. package/dist/web/_app/immutable/chunks/CtYLtD7K.js +0 -1
  926. package/dist/web/_app/immutable/chunks/D-HDy5qS.js +0 -1
  927. package/dist/web/_app/immutable/chunks/D5aIYSkd.js +0 -1
  928. package/dist/web/_app/immutable/chunks/DBBXARVf.js +0 -1
  929. package/dist/web/_app/immutable/chunks/DFYOFE3o.js +0 -1
  930. package/dist/web/_app/immutable/chunks/DKaafS50.js +0 -1
  931. package/dist/web/_app/immutable/chunks/DUMOo1Pn.js +0 -1
  932. package/dist/web/_app/immutable/chunks/DWX9f6AF.js +0 -1
  933. package/dist/web/_app/immutable/chunks/DY8-EONP.js +0 -1
  934. package/dist/web/_app/immutable/chunks/DkoHPElM.js +0 -1
  935. package/dist/web/_app/immutable/chunks/DnL9f0lc.js +0 -7
  936. package/dist/web/_app/immutable/chunks/DsnmJJEf.js +0 -1
  937. package/dist/web/_app/immutable/chunks/DujahU3W.js +0 -1
  938. package/dist/web/_app/immutable/chunks/FBn-ES5k.js +0 -1
  939. package/dist/web/_app/immutable/chunks/HQpwSOb3.js +0 -1
  940. package/dist/web/_app/immutable/chunks/KyjzlWRN.js +0 -2
  941. package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +0 -1
  942. package/dist/web/_app/immutable/chunks/UwYfmrPx.js +0 -2
  943. package/dist/web/_app/immutable/chunks/W25ZVI8L.js +0 -2
  944. package/dist/web/_app/immutable/chunks/WSUKABI_.js +0 -1
  945. package/dist/web/_app/immutable/chunks/XjsuEnNE.js +0 -5
  946. package/dist/web/_app/immutable/chunks/ZD6ARAtb.js +0 -1
  947. package/dist/web/_app/immutable/chunks/pBTf4stg.js +0 -2
  948. package/dist/web/_app/immutable/chunks/rGIarcnp.js +0 -1
  949. package/dist/web/_app/immutable/chunks/vxEtkL8z.js +0 -1
  950. package/dist/web/_app/immutable/chunks/wDIGUaoU.js +0 -3
  951. package/dist/web/_app/immutable/entry/app.ZHiTM8WS.js +0 -2
  952. package/dist/web/_app/immutable/entry/start.C9-FfAVc.js +0 -1
  953. package/dist/web/_app/immutable/nodes/0.D92Orz8k.js +0 -2
  954. package/dist/web/_app/immutable/nodes/1.BMdyglM_.js +0 -1
  955. package/dist/web/_app/immutable/nodes/10.BilVDHSL.js +0 -1
  956. package/dist/web/_app/immutable/nodes/11.CS9E0Hic.js +0 -1
  957. package/dist/web/_app/immutable/nodes/12.D3BOxYzG.js +0 -1
  958. package/dist/web/_app/immutable/nodes/13.CClMKYtN.js +0 -1
  959. package/dist/web/_app/immutable/nodes/2.C8KKElPL.js +0 -267
  960. package/dist/web/_app/immutable/nodes/3.C5n5uiWU.js +0 -5
  961. package/dist/web/_app/immutable/nodes/4.DcGVvgiL.js +0 -11
  962. package/dist/web/_app/immutable/nodes/5.DxIjnFQO.js +0 -4
  963. package/dist/web/_app/immutable/nodes/6.lkh6kKLj.js +0 -1
  964. package/dist/web/_app/immutable/nodes/7.Bg7SbfhA.js +0 -1
  965. package/dist/web/_app/immutable/nodes/8.DcXWCNBE.js +0 -1
  966. package/dist/web/_app/immutable/nodes/9.Cefi8Jfm.js +0 -1
@@ -1 +0,0 @@
1
- import"./DsnmJJEf.js";import{i as V}from"./C8R1sDpW.js";import{p as $,l as n,s as c,d as p,g as i,a as A,c as m,n as H,r as _,b as U,m as u,t as k}from"./C3uBrOS5.js";import{a as v,s as B,f as b}from"./W25ZVI8L.js";import{i as C}from"./D5aIYSkd.js";import{a as N}from"./DkoHPElM.js";import{l as g,p as h}from"./FBn-ES5k.js";var P=b("<title> </title>"),R=b('<svg><!><path d="M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"></path><path d="M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"></path></svg>');function G(x,t){const e=g(t,["children","$$slots","$$events","$$legacy"]),w=g(e,["size","title"]);$(t,!1);const a=u(),d=u();let f=h(t,"size",8,16),s=h(t,"title",8,void 0);n(()=>(p(e),p(s())),()=>{c(a,e["aria-label"]||e["aria-labelledby"]||s())}),n(()=>(i(a),p(e)),()=>{c(d,{"aria-hidden":i(a)?void 0:!0,role:i(a)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),A(),V();var r=R();N(r,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:f(),height:f(),...i(d),...w}));var y=m(r);{var z=o=>{var l=P(),M=m(l,!0);_(l),k(()=>B(M,s())),v(o,l)};C(y,o=>{s()&&o(z)})}H(2),_(r),v(x,r),U()}export{G as U};
@@ -1,2 +0,0 @@
1
- const ct=1024;let Je=0;class H{constructor(e,t){this.from=e,this.to=t}}class A{constructor(e={}){this.id=Je++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=L.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}A.closedBy=new A({deserialize:l=>l.split(" ")});A.openedBy=new A({deserialize:l=>l.split(" ")});A.group=new A({deserialize:l=>l.split(" ")});A.isolate=new A({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});A.contextHash=new A({perNode:!0});A.lookAhead=new A({perNode:!0});A.mounted=new A({perNode:!0});class re{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[A.mounted.id]}}const Ke=Object.create(null);class L{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):Ke,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new L(e.name||"",t,e.id,r);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(A.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(A.group),n=-1;n<(i?i.length:0);n++){let s=t[n<0?r.name:i[n]];if(s)return s}}}}L.none=new L("",Object.create(null),0,8);class je{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let n of e){let s=n(r);if(s){i||(i=Object.assign({},r.props));let o=s[1],a=s[0];a.combine&&a.id in i&&(o=a.combine(i[a.id],o)),i[a.id]=o}}t.push(i?new L(r.name,i,r.id,r.flags):r)}return new je(t)}}const he=new WeakMap,Ne=new WeakMap;var v;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(v||(v={}));class R{constructor(e,t,r,i,n){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,n&&n.length){this.props=Object.create(null);for(let[s,o]of n)this.props[typeof s=="number"?s:s.id]=o}}toString(){let e=re.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new ge(this.topNode,e)}cursorAt(e,t=0,r=0){let i=he.get(this)||this.topNode,n=new ge(i);return n.moveTo(e,t),he.set(this,n._tree),n}get topNode(){return new T(this,0,0,null)}resolve(e,t=0){let r=se(he.get(this)||this.topNode,e,t,!1);return he.set(this,r),r}resolveInner(e,t=0){let r=se(Ne.get(this)||this.topNode,e,t,!0);return Ne.set(this,r),r}resolveStack(e,t=0){return Ge(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:n=this.length}=e,s=e.mode||0,o=(s&v.IncludeAnonymous)>0;for(let a=this.cursor(s|v.IncludeAnonymous);;){let h=!1;if(a.from<=n&&a.to>=i&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&r&&(o||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ae(L.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new R(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new R(L.none,t,r,i)))}static build(e){return Qe(e)}}R.empty=new R(L.none,[],[],0);class ke{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ke(this.buffer,this.index)}}class X{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return L.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],n=i.name;if(/\W/.test(n)&&!i.isError&&(n=JSON.stringify(n)),e+=4,r==e)return n;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return n+"("+s.join(",")+")"}findChild(e,t,r,i,n){let{buffer:s}=this,o=-1;for(let a=e;a!=t&&!(Fe(n,i,s[a+1],s[a+2])&&(o=a,r>0));a=s[a+3]);return o}slice(e,t,r){let i=this.buffer,n=new Uint16Array(t-e),s=0;for(let o=e,a=0;o<t;){n[a++]=i[o++],n[a++]=i[o++]-r;let h=n[a++]=i[o++]-r;n[a++]=i[o++]-e,s=Math.max(s,h)}return new X(n,s,this.set)}}function Fe(l,e,t,r){switch(l){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function se(l,e,t,r){for(var i;l.from==l.to||(t<1?l.from>=e:l.from>e)||(t>-1?l.to<=e:l.to<e);){let s=!r&&l instanceof T&&l.index<0?null:l.parent;if(!s)return l;l=s}let n=r?0:v.IgnoreOverlays;if(r)for(let s=l,o=s.parent;o;s=o,o=s.parent)s instanceof T&&s.index<0&&((i=o.enter(e,t,n))===null||i===void 0?void 0:i.from)!=s.from&&(l=o);for(;;){let s=l.enter(e,t,n);if(!s)return l;l=s}}class De{cursor(e=0){return new ge(this,e)}getChild(e,t=null,r=null){let i=_e(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return _e(this,e,t,r)}resolve(e,t=0){return se(this,e,t,!1)}resolveInner(e,t=0){return se(this,e,t,!0)}matchContext(e){return be(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class T extends De{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,n=0){for(let s=this;;){for(let{children:o,positions:a}=s._tree,h=t>0?o.length:-1;e!=h;e+=t){let u=o[e],p=a[e]+s.from,c;if(!(!(n&v.EnterBracketed&&u instanceof R&&(c=re.get(u))&&!c.overlay&&c.bracketed&&r>=p&&r<=p+u.length)&&!Fe(i,r,p,p+u.length))){if(u instanceof X){if(n&v.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,t,r-p,i);if(m>-1)return new K(new Ve(s,u,e,p),null,m)}else if(n&v.IncludeAnonymous||!u.type.isAnonymous||ve(u)){let m;if(!(n&v.IgnoreMounts)&&(m=re.get(u))&&!m.overlay)return new T(m.tree,p,e,s);let w=new T(u,p,e,s);return n&v.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(t<0?u.children.length-1:0,t,r,i,n)}}}if(n&v.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+t:e=t<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&v.IgnoreOverlays)&&(i=re.get(this._tree))&&i.overlay){let n=e-this.from,s=r&v.EnterBracketed&&i.bracketed;for(let{from:o,to:a}of i.overlay)if((t>0||s?o<=n:o<n)&&(t<0||s?a>=n:a>n))return new T(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function _e(l,e,t,r){let i=l.cursor(),n=[];if(!i.firstChild())return n;if(t!=null){for(let s=!1;!s;)if(s=i.type.is(t),!i.nextSibling())return n}for(;;){if(r!=null&&i.type.is(r))return n;if(i.type.is(e)&&n.push(i.node),!i.nextSibling())return r==null?n:[]}}function be(l,e,t=e.length-1){for(let r=l;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class Ve{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class K extends De{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,n=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return n<0?null:new K(this.context,this,n)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&v.ExcludeBuffers)return null;let{buffer:i}=this.context,n=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return n<0?null:new K(this.context,this,n)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new K(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new K(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,n=r.buffer[this.index+3];if(n>i){let s=r.buffer[this.index+1];e.push(r.slice(i,n,s)),t.push(0)}return new R(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function He(l){if(!l.length)return null;let e=0,t=l[0];for(let n=1;n<l.length;n++){let s=l[n];(s.from>t.from||s.to<t.to)&&(t=s,e=n)}let r=t instanceof T&&t.index<0?null:t.parent,i=l.slice();return r?i[e]=r:i.splice(e,1),new $e(i,t)}class $e{constructor(e,t){this.heads=e,this.node=t}get next(){return He(this.heads)}}function Ge(l,e,t){let r=l.resolveInner(e,t),i=null;for(let n=r instanceof T?r:r.context.parent;n;n=n.parent)if(n.index<0){let s=n.parent;(i||(i=[r])).push(s.resolve(e,t)),n=s}else{let s=re.get(n.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let o=new T(s.tree,s.overlay[0].from+n.from,-1,n);(i||(i=[r])).push(se(o,e,t,!1))}}return i?He(i):r}class ge{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~v.EnterBracketed,e instanceof T)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof T?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,n=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return n<0?!1:(this.stack.push(this.index),this.yieldBuf(n))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&v.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&v.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&v.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let n=0;n<this.index;n++)if(i.buffer.buffer[n+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let n=t+e,s=e<0?-1:r._tree.children.length;n!=s;n+=e){let o=r._tree.children[n];if(this.mode&v.IncludeAnonymous||o instanceof X||!o.type.isAnonymous||ve(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,n=this.stack.length;n>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,r=n+1;break e}i=this.stack[--n]}for(let i=r;i<this.stack.length;i++)t=new K(this.buffer,t,this.stack[i]);return this.bufferNode=new K(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return be(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,n=this.stack.length-1;i>=0;n--){if(n<0)return be(this._tree,e,i);let s=r[t.buffer[this.stack[n]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function ve(l){return l.children.some(e=>e instanceof X||!e.type.isAnonymous||ve(e))}function Qe(l){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=1024,reused:n=[],minRepeatType:s=r.types.length}=l,o=Array.isArray(t)?new ke(t,t.length):t,a=r.types,h=0,u=0;function p(x,N,d,B,k,I){let{id:b,start:g,end:S,size:_}=o,O=u,$=h;if(_<0)if(o.next(),_==-1){let V=n[b];d.push(V),B.push(g-x);return}else if(_==-3){h=b;return}else if(_==-4){u=b;return}else throw new RangeError(`Unrecognized record size: ${_}`);let ie=a[b],ae,Y,Ce=g-x;if(S-g<=i&&(Y=M(o.pos-N,k))){let V=new Uint16Array(Y.size-Y.skip),D=o.pos-Y.size,W=V.length;for(;o.pos>D;)W=E(Y.start,V,W);ae=new X(V,S-Y.start,r),Ce=Y.start-x}else{let V=o.pos-_;o.next();let D=[],W=[],Z=b>=s?b:-1,te=0,fe=S;for(;o.pos>V;)Z>=0&&o.id==Z&&o.size>=0?(o.end<=fe-i&&(w(D,W,g,te,o.end,fe,Z,O,$),te=D.length,fe=o.end),o.next()):I>2500?c(g,V,D,W):p(g,V,D,W,Z,I+1);if(Z>=0&&te>0&&te<D.length&&w(D,W,g,te,g,fe,Z,O,$),D.reverse(),W.reverse(),Z>-1&&te>0){let Se=m(ie,$);ae=Ae(ie,D,W,0,D.length,0,S-g,Se,Se)}else ae=P(ie,D,W,S-g,O-S,$)}d.push(ae),B.push(Ce)}function c(x,N,d,B){let k=[],I=0,b=-1;for(;o.pos>N;){let{id:g,start:S,end:_,size:O}=o;if(O>4)o.next();else{if(b>-1&&S<b)break;b<0&&(b=_-i),k.push(g,S,_),I++,o.next()}}if(I){let g=new Uint16Array(I*4),S=k[k.length-2];for(let _=k.length-3,O=0;_>=0;_-=3)g[O++]=k[_],g[O++]=k[_+1]-S,g[O++]=k[_+2]-S,g[O++]=O;d.push(new X(g,k[2]-S,r)),B.push(S-x)}}function m(x,N){return(d,B,k)=>{let I=0,b=d.length-1,g,S;if(b>=0&&(g=d[b])instanceof R){if(!b&&g.type==x&&g.length==k)return g;(S=g.prop(A.lookAhead))&&(I=B[b]+g.length+S)}return P(x,d,B,k,I,N)}}function w(x,N,d,B,k,I,b,g,S){let _=[],O=[];for(;x.length>B;)_.push(x.pop()),O.push(N.pop()+d-k);x.push(P(r.types[b],_,O,I-k,g-I,S)),N.push(k-d)}function P(x,N,d,B,k,I,b){if(I){let g=[A.contextHash,I];b=b?[g].concat(b):[g]}if(k>25){let g=[A.lookAhead,k];b=b?[g].concat(b):[g]}return new R(x,N,d,B,b)}function M(x,N){let d=o.fork(),B=0,k=0,I=0,b=d.end-i,g={size:0,start:0,skip:0};e:for(let S=d.pos-x;d.pos>S;){let _=d.size;if(d.id==N&&_>=0){g.size=B,g.start=k,g.skip=I,I+=4,B+=4,d.next();continue}let O=d.pos-_;if(_<0||O<S||d.start<b)break;let $=d.id>=s?4:0,ie=d.start;for(d.next();d.pos>O;){if(d.size<0)if(d.size==-3||d.size==-4)$+=4;else break e;else d.id>=s&&($+=4);d.next()}k=ie,B+=_,I+=$}return(N<0||B==x)&&(g.size=B,g.start=k,g.skip=I),g.size>4?g:void 0}function E(x,N,d){let{id:B,start:k,end:I,size:b}=o;if(o.next(),b>=0&&B<s){let g=d;if(b>4){let S=o.pos-(b-4);for(;o.pos>S;)d=E(x,N,d)}N[--d]=g,N[--d]=I-x,N[--d]=k-x,N[--d]=B}else b==-3?h=B:b==-4&&(u=B);return d}let z=[],C=[];for(;o.pos>0;)p(l.start||0,l.bufferStart||0,z,C,-1,0);let F=(e=l.length)!==null&&e!==void 0?e:z.length?C[0]+z[0].length:0;return new R(a[l.topID],z.reverse(),C.reverse(),F)}const Be=new WeakMap;function de(l,e){if(!l.isAnonymous||e instanceof X||e.type!=l)return 1;let t=Be.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=l||!(r instanceof R)){t=1;break}t+=de(l,r)}Be.set(e,t)}return t}function Ae(l,e,t,r,i,n,s,o,a){let h=0;for(let w=r;w<i;w++)h+=de(l,e[w]);let u=Math.ceil(h*1.5/8),p=[],c=[];function m(w,P,M,E,z){for(let C=M;C<E;){let F=C,x=P[C],N=de(l,w[C]);for(C++;C<E;C++){let d=de(l,w[C]);if(N+d>=u)break;N+=d}if(C==F+1){if(N>u){let d=w[F];m(d.children,d.positions,0,d.children.length,P[F]+z);continue}p.push(w[F])}else{let d=P[C-1]+w[C-1].length-x;p.push(Ae(l,w,P,F,C,x,d,null,a))}c.push(x+z-n)}}return m(e,t,r,i,0),(o||a)(p,c,s)}class dt{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof K?this.setBuffer(e.context.buffer,e.index,t):e instanceof T&&this.map.set(e.tree,t)}get(e){return e instanceof K?this.getBuffer(e.context.buffer,e.index):e instanceof T?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class le{constructor(e,t,r,i,n=!1,s=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(n?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new le(0,e.length,e,0,!1,r)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],n=1,s=e.length?e[0]:null;for(let o=0,a=0,h=0;;o++){let u=o<t.length?t[o]:null,p=u?u.fromA:1e9;if(p-a>=r)for(;s&&s.from<p;){let c=s;if(a>=c.from||p<=c.to||h){let m=Math.max(c.from,a)-h,w=Math.min(c.to,p)-h;c=m>=w?null:new le(m,w,c.tree,c.offset+h,o>0,!!u)}if(c&&i.push(c),s.to>p)break;s=n<e.length?e[n++]:null}if(!u)break;a=u.toA,h=u.toA-u.toB}return i}}class gt{startParse(e,t,r){return typeof e=="string"&&(e=new Xe(e)),r=r?r.length?r.map(i=>new H(i.from,i.to)):[new H(0,0)]:[new H(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let n=i.advance();if(n)return n}}}class Xe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function mt(l){return(e,t,r,i)=>new Ze(e,l,t,r,i)}class Ie{constructor(e,t,r,i,n,s){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=n,this.from=s}}function Pe(l){if(!l.length||l.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class Ye{constructor(e,t,r,i,n,s,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=n,this.bracketed=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const xe=new A({perNode:!0});class Ze{constructor(e,t,r,i,n){this.nest=t,this.input=r,this.fragments=i,this.ranges=n,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new R(r.type,r.children,r.positions,r.length,r.propValues.concat([[xe,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[A.mounted.id]=new re(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new rt(this.fragments),t=null,r=null,i=new ge(new T(this.baseTree,this.ranges[0].from,0,null),v.IncludeAnonymous|v.IgnoreMounts);e:for(let n,s;;){let o=!0,a;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let h=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(h)for(let u of h.mount.overlay){let p=u.from+h.pos,c=u.to+h.pos;p>=i.from&&c<=i.to&&!t.ranges.some(m=>m.from<c&&m.to>p)&&t.ranges.push({from:p,to:c})}}o=!1}else if(r&&(s=et(r.ranges,i.from,i.to)))o=s!=2;else if(!i.type.isAnonymous&&(n=this.nest(i,this.input))&&(i.from<i.to||!n.overlay)){i.tree||(tt(i),t&&t.depth++,r&&r.depth++);let h=e.findMounts(i.from,n.parser);if(typeof n.overlay=="function")t=new Ye(n.parser,n.overlay,h,this.inner.length,i.from,!!n.bracketed,i.tree,t);else{let u=Ee(this.ranges,n.overlay||(i.from<i.to?[new H(i.from,i.to)]:[]));u.length&&Pe(u),(u.length||!n.overlay)&&this.inner.push(new Ie(n.parser,u.length?n.parser.startParse(this.input,Oe(h,u),u):n.parser.startParse(""),n.overlay?n.overlay.map(p=>new H(p.from-i.from,p.to-i.from)):null,!!n.bracketed,i.tree,u.length?u[0].from:i.from)),n.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):o=!1}}else if(t&&(a=t.predicate(i))&&(a===!0&&(a=new H(i.from,i.to)),a.from<a.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(o&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let h=Ee(this.ranges,t.ranges);h.length&&(Pe(h),this.inner.splice(t.index,0,new Ie(t.parser,t.parser.startParse(this.input,Oe(t.mounts,h),h),t.ranges.map(u=>new H(u.from-t.start,u.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function et(l,e,t){for(let r of l){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function Me(l,e,t,r,i,n){if(e<t){let s=l.buffer[e+1];r.push(l.slice(e,t,s)),i.push(s-n)}}function tt(l){let{node:e}=l,t=[],r=e.context.buffer;do t.push(l.index),l.parent();while(!l.tree);let i=l.tree,n=i.children.indexOf(r),s=i.children[n],o=s.buffer,a=[n];function h(u,p,c,m,w,P){let M=t[P],E=[],z=[];Me(s,u,M,E,z,m);let C=o[M+1],F=o[M+2];a.push(E.length);let x=P?h(M+4,o[M+3],s.set.types[o[M]],C,F-C,P-1):e.toTree();return E.push(x),z.push(C-m),Me(s,o[M+3],p,E,z,m),new R(c,E,z,w)}i.children[n]=h(0,o.length,L.none,0,s.length,t.length-1);for(let u of a){let p=l.tree.children[u],c=l.tree.positions[u];l.yield(new T(p,c+l.from,u,l._tree))}}class ze{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(v.IncludeAnonymous|v.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,v.IgnoreOverlays|v.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof R)t=t.children[0];else break}return!1}}class rt{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(xe))!==null&&t!==void 0?t:r.to,this.inner=new ze(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(xe))!==null&&e!==void 0?e:t.to,this.inner=new ze(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let n=this.inner.cursor.node;n;n=n.parent){let s=(r=n.tree)===null||r===void 0?void 0:r.prop(A.mounted);if(s&&s.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let a=this.fragments[o];if(a.from>=n.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:n.from-a.offset,mount:s})}}}return i}}function Ee(l,e){let t=null,r=e;for(let i=1,n=0;i<l.length;i++){let s=l[i-1].to,o=l[i].from;for(;n<r.length;n++){let a=r[n];if(a.from>=o)break;a.to<=s||(t||(r=t=e.slice()),a.from<s?(t[n]=new H(a.from,s),a.to>o&&t.splice(n+1,0,new H(o,a.to))):a.to>o?t[n--]=new H(o,a.to):t.splice(n--,1))}}return r}function it(l,e,t,r){let i=0,n=0,s=!1,o=!1,a=-1e9,h=[];for(;;){let u=i==l.length?1e9:s?l[i].to:l[i].from,p=n==e.length?1e9:o?e[n].to:e[n].from;if(s!=o){let c=Math.max(a,t),m=Math.min(u,p,r);c<m&&h.push(new H(c,m))}if(a=Math.min(u,p),a==1e9)break;u==a&&(s?(s=!1,i++):s=!0),p==a&&(o?(o=!1,n++):o=!0)}return h}function Oe(l,e){let t=[];for(let{pos:r,mount:i,frag:n}of l){let s=r+(i.overlay?i.overlay[0].from:0),o=s+i.tree.length,a=Math.max(n.from,s),h=Math.min(n.to,o);if(i.overlay){let u=i.overlay.map(c=>new H(c.from+r,c.to+r)),p=it(e,u,a,h);for(let c=0,m=a;;c++){let w=c==p.length,P=w?h:p[c].from;if(P>m&&t.push(new le(m,P,i.tree,-s,n.from>=m||n.openStart,n.to<=P||n.openEnd)),w)break;m=p[c].to}}else t.push(new le(a,h,i.tree,-s,n.from>=s||n.openStart,n.to<=o||n.openEnd))}return t}let nt=0;class j{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=nt++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof j&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new j(r,[],null,[]);if(i.set.push(i),t)for(let n of t.set)i.set.push(n);return i}static defineModifier(e){let t=new me(e);return r=>r.modified.indexOf(t)>-1?r:me.get(r.base||r,r.modified.concat(t).sort((i,n)=>i.id-n.id))}}let st=0;class me{constructor(e){this.name=e,this.instances=[],this.id=st++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(o=>o.base==e&&lt(t,o.modified));if(r)return r;let i=[],n=new j(e.name,i,e,t);for(let o of t)o.instances.push(n);let s=ot(t);for(let o of e.set)if(!o.modified.length)for(let a of s)i.push(me.get(o,a));return n}}function lt(l,e){return l.length==e.length&&l.every((t,r)=>t==e[r])}function ot(l){let e=[[]];for(let t=0;t<l.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(l[t]));return e.sort((t,r)=>r.length-t.length)}function at(l){let e=Object.create(null);for(let t in l){let r=l[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let n=[],s=2,o=i;for(let p=0;;){if(o=="..."&&p>0&&p+3==i.length){s=1;break}let c=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!c)throw new RangeError("Invalid path: "+i);if(n.push(c[0]=="*"?"":c[0][0]=='"'?JSON.parse(c[0]):c[0]),p+=c[0].length,p==i.length)break;let m=i[p++];if(p==i.length&&m=="!"){s=0;break}if(m!="/")throw new RangeError("Invalid path: "+i);o=i.slice(p)}let a=n.length-1,h=n[a];if(!h)throw new RangeError("Invalid path: "+i);let u=new oe(r,s,a>0?n.slice(0,a):null);e[h]=u.sort(e[h])}}return Le.add(e)}const Le=new A({combine(l,e){let t,r,i;for(;l||e;){if(!l||e&&l.depth>=e.depth?(i=e,e=e.next):(i=l,l=l.next),t&&t.mode==i.mode&&!i.context&&!t.context)continue;let n=new oe(i.tags,i.mode,i.context);t?t.next=n:r=n,t=n}return r}});class oe{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}oe.empty=new oe([],2,null);function We(l,e){let t=Object.create(null);for(let n of l)if(!Array.isArray(n.tag))t[n.tag.id]=n.class;else for(let s of n.tag)t[s.id]=n.class;let{scope:r,all:i=null}=e||{};return{style:n=>{let s=i;for(let o of n)for(let a of o.set){let h=t[a.id];if(h){s=s?s+" "+h:h;break}}return s},scope:r}}function ft(l,e){let t=null;for(let r of l){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function Ue(l,e,t,r=0,i=l.length){let n=new ut(r,Array.isArray(e)?e:[e],t);n.highlightRange(l.cursor(),r,i,"",n.highlighters),n.flush(i)}function ht(l,e,t,r,i,n=0,s=l.length){let o=n;function a(h,u){if(!(h<=o)){for(let p=l.slice(o,h),c=0;;){let m=p.indexOf(`
2
- `,c),w=m<0?p.length:m;if(w>c&&r(p.slice(c,w),u),m<0)break;i(),c=m+1}o=h}}Ue(e,t,(h,u,p)=>{a(h,""),a(u,p)},n,s),a(s,"")}class ut{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,n){let{type:s,from:o,to:a}=e;if(o>=r||a<=t)return;s.isTop&&(n=this.highlighters.filter(m=>!m.scope||m.scope(s)));let h=i,u=qe(e)||oe.empty,p=ft(n,u.tags);if(p&&(h&&(h+=" "),h+=p,u.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(t,o),h),u.opaque)return;let c=e.tree&&e.tree.prop(A.mounted);if(c&&c.overlay){let m=e.node.enter(c.overlay[0].from+o,1),w=this.highlighters.filter(M=>!M.scope||M.scope(c.tree.type)),P=e.firstChild();for(let M=0,E=o;;M++){let z=M<c.overlay.length?c.overlay[M]:null,C=z?z.from+o:a,F=Math.max(t,E),x=Math.min(r,C);if(F<x&&P)for(;e.from<x&&(this.highlightRange(e,F,x,i,n),this.startSpan(Math.min(x,e.to),h),!(e.to>=C||!e.nextSibling())););if(!z||C>r)break;E=z.to+o,E>t&&(this.highlightRange(m.cursor(),Math.max(t,z.from+o),Math.min(r,E),"",w),this.startSpan(Math.min(r,E),h))}P&&e.parent()}else if(e.firstChild()){c&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,n),this.startSpan(Math.min(r,e.to),h)}while(e.nextSibling());e.parent()}}}function qe(l){let e=l.type.prop(Le);for(;e&&e.context&&!l.matchContext(e.context);)e=e.next;return e||null}const f=j.define,ue=f(),G=f(),Te=f(G),Re=f(G),Q=f(),pe=f(Q),ye=f(Q),J=f(),ee=f(J),U=f(),q=f(),we=f(),ne=f(we),ce=f(),y={comment:ue,lineComment:f(ue),blockComment:f(ue),docComment:f(ue),name:G,variableName:f(G),typeName:Te,tagName:f(Te),propertyName:Re,attributeName:f(Re),className:f(G),labelName:f(G),namespace:f(G),macroName:f(G),literal:Q,string:pe,docString:f(pe),character:f(pe),attributeValue:f(pe),number:ye,integer:f(ye),float:f(ye),bool:f(Q),regexp:f(Q),escape:f(Q),color:f(Q),url:f(Q),keyword:U,self:f(U),null:f(U),atom:f(U),unit:f(U),modifier:f(U),operatorKeyword:f(U),controlKeyword:f(U),definitionKeyword:f(U),moduleKeyword:f(U),operator:q,derefOperator:f(q),arithmeticOperator:f(q),logicOperator:f(q),bitwiseOperator:f(q),compareOperator:f(q),updateOperator:f(q),definitionOperator:f(q),typeOperator:f(q),controlOperator:f(q),punctuation:we,separator:f(we),bracket:ne,angleBracket:f(ne),squareBracket:f(ne),paren:f(ne),brace:f(ne),content:J,heading:ee,heading1:f(ee),heading2:f(ee),heading3:f(ee),heading4:f(ee),heading5:f(ee),heading6:f(ee),contentSeparator:f(J),list:f(J),quote:f(J),emphasis:f(J),strong:f(J),link:f(J),monospace:f(J),strikethrough:f(J),inserted:f(),deleted:f(),changed:f(),invalid:f(),meta:ce,documentMeta:f(ce),annotation:f(ce),processingInstruction:f(ce),definition:j.defineModifier("definition"),constant:j.defineModifier("constant"),function:j.defineModifier("function"),standard:j.defineModifier("standard"),local:j.defineModifier("local"),special:j.defineModifier("special")};for(let l in y){let e=y[l];e instanceof j&&(e.name=l)}const pt=We([{tag:y.link,class:"tok-link"},{tag:y.heading,class:"tok-heading"},{tag:y.emphasis,class:"tok-emphasis"},{tag:y.strong,class:"tok-strong"},{tag:y.keyword,class:"tok-keyword"},{tag:y.atom,class:"tok-atom"},{tag:y.bool,class:"tok-bool"},{tag:y.url,class:"tok-url"},{tag:y.labelName,class:"tok-labelName"},{tag:y.inserted,class:"tok-inserted"},{tag:y.deleted,class:"tok-deleted"},{tag:y.literal,class:"tok-literal"},{tag:y.string,class:"tok-string"},{tag:y.number,class:"tok-number"},{tag:[y.regexp,y.escape,y.special(y.string)],class:"tok-string2"},{tag:y.variableName,class:"tok-variableName"},{tag:y.local(y.variableName),class:"tok-variableName tok-local"},{tag:y.definition(y.variableName),class:"tok-variableName tok-definition"},{tag:y.special(y.variableName),class:"tok-variableName2"},{tag:y.definition(y.propertyName),class:"tok-propertyName tok-definition"},{tag:y.typeName,class:"tok-typeName"},{tag:y.namespace,class:"tok-namespace"},{tag:y.className,class:"tok-className"},{tag:y.macroName,class:"tok-macroName"},{tag:y.propertyName,class:"tok-propertyName"},{tag:y.operator,class:"tok-operator"},{tag:y.comment,class:"tok-comment"},{tag:y.meta,class:"tok-meta"},{tag:y.invalid,class:"tok-invalid"},{tag:y.punctuation,class:"tok-punctuation"}]),yt=Object.freeze(Object.defineProperty({__proto__:null,Tag:j,classHighlighter:pt,getStyleTags:qe,highlightCode:ht,highlightTree:Ue,styleTags:at,tagHighlighter:We,tags:y},Symbol.toStringTag,{value:"Module"}));export{ct as D,v as I,A as N,gt as P,R as T,le as a,y as b,L as c,je as d,j as e,dt as f,Ue as h,yt as i,mt as p,at as s,We as t};
@@ -1 +0,0 @@
1
- import{O as _,f as P,g as b,e as W,w as m,a as G,t as k,c as A,r as I,b as q,d as j,h as V,i as R,j as z,k as C,l as K,D as Q,p as X,m as Z}from"./CSVbGg_b.js";import{r as O}from"./UwYfmrPx.js";const T=3e4;class $ extends _{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=b();this.getLocalState()!==null&&T/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&T<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&Y(this,s,"timeout")},P(T/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:b()});const i=[],u=[],r=[],f=[];n===null?f.push(e):c==null?n!=null&&i.push(e):(u.push(e),W(c,n)||r.push(e)),(i.length>0||r.length>0||f.length>0)&&this.emit("change",[{added:i,updated:r,removed:f},"local"]),this.emit("update",[{added:i,updated:u,removed:f},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const Y=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const i=t.meta.get(c);t.meta.set(c,{clock:i.clock+1,lastUpdated:b()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},H=(t,n,e=t.states)=>{const s=n.length,a=A();m(a,s);for(let c=0;c<s;c++){const i=n[c],u=e.get(i)||null,r=t.meta.get(i).clock;m(a,i),m(a,r),G(a,JSON.stringify(u))}return k(a)},tt=(t,n,e)=>{const s=j(n),a=b(),c=[],i=[],u=[],r=[],f=I(s);for(let w=0;w<f;w++){const d=I(s);let y=I(s);const h=JSON.parse(q(s)),g=t.meta.get(d),U=t.states.get(d),S=g===void 0?0:g.clock;(S<y||S===y&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:y,lastUpdated:a}),g===void 0&&h!==null?c.push(d):g!==void 0&&h===null?r.push(d):h!==null&&(W(h,U)||u.push(d),i.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||i.length>0||r.length>0)&&t.emit("update",[{added:c,updated:i,removed:r},e])},B=0,M=1,N=2,et=(t,n)=>{m(t,B);const e=R(n);V(t,e)},nt=(t,n,e)=>{m(t,M),V(t,K(n,e))},st=(t,n,e)=>nt(n,e,C(t)),F=(t,n,e,s)=>{try{z(n,C(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},at=(t,n)=>{m(t,N),V(t,n)},ct=F,ot=(t,n,e,s,a)=>{const c=I(t);switch(c){case B:st(t,n,e);break;case M:F(t,e,s,a);break;case N:ct(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},L=0,x=1;function it(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function lt(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function ut(t,n){const e=new Q,s=e.getText("content"),a=new $(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,i=!1,u=!1;function r(){return O.ws??null}function f(o,p){const l=r();!l||l.readyState!==WebSocket.OPEN||l.send(it(t,o,p))}function w(){const o=A();et(o,e),f(L,k(o))}function d(o){const p=o??[e.clientID],l=H(a,p);f(x,l)}function y(o){if(i||typeof o.data=="string")return;const p=o.data instanceof ArrayBuffer?o.data:null;if(!p)return;const l=lt(p);if(!(!l||l.docName!==t))if(l.msgType===L){const v=j(l.payload),D=X(v),E=A();ot(v,E,e,"ws-server"),Z(E)>0&&f(L,k(E)),!u&&(D===M||D===N)&&(u=!0,S.synced=!0)}else l.msgType===x&&tt(a,l.payload,"ws-server")}function h(o,p){if(i||p==="ws-server")return;const l=A();at(l,o),f(L,k(l))}function g({added:o,updated:p,removed:l},v){if(i||v==="ws-server")return;const D=o.concat(p,l);d(D)}function U(){if(i)return;const o=r();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=y,o.addEventListener("message",c),w(),d())}const S={ydoc:e,ytext:s,awareness:a,synced:!1,destroy:J};e.on("update",h),a.on("update",g),U(),O.addConnectHandler(U);function J(){if(i)return;i=!0,Y(a,[e.clientID],"local"),d([e.clientID]);const o=r();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",h),a.off("update",g),a.destroy(),e.destroy()}return S}export{ut as createCollabSession};
@@ -1 +0,0 @@
1
- import{StateField as ze,Transaction as P,Facet as oe,combineConfig as He,EditorSelection as h,StateEffect as le,ChangeSet as qe,ChangeDesc as Ke,Annotation as ce,countColumn as $,Text as se,findClusterBreak as E}from"./CX_61fY8.js";import{E as x,D as $e}from"./DnL9f0lc.js";import{IndentContext as ie,getIndentation as ue,indentString as v,syntaxTree as W,matchBrackets as D,getIndentUnit as G,indentUnit as We}from"./wDIGUaoU.js";import{N as F}from"./Bz0ZjVQE.js";const Qe=e=>{let{state:t}=e,r=t.doc.lineAt(t.selection.main.from),n=X(e.state,r.from);return n.line?Xe(e):n.block?Ze(e):!1};function Q(e,t){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let l=e(t,r);return l?(n(r.update(l)),!0):!1}}const Xe=Q(we,0),Ye=Q(fe,0),Ze=Q((e,t)=>fe(e,t,_e(t)),0);function X(e,t){let r=e.languageDataAt("commentTokens",t,1);return r.length?r[0]:{}}const M=50;function je(e,{open:t,close:r},n,l){let o=e.sliceDoc(n-M,n),c=e.sliceDoc(l,l+M),s=/\s*$/.exec(o)[0].length,i=/^\s*/.exec(c)[0].length,f=o.length-s;if(o.slice(f-t.length,f)==t&&c.slice(i,i+r.length)==r)return{open:{pos:n-s,margin:s&&1},close:{pos:l+i,margin:i&&1}};let u,a;l-n<=2*M?u=a=e.sliceDoc(n,l):(u=e.sliceDoc(n,n+M),a=e.sliceDoc(l-M,l));let p=/^\s*/.exec(u)[0].length,T=/\s*$/.exec(a)[0].length,L=a.length-T-r.length;return u.slice(p,p+t.length)==t&&a.slice(L,L+r.length)==r?{open:{pos:n+p+t.length,margin:/\s/.test(u.charAt(p+t.length))?1:0},close:{pos:l-T-r.length,margin:/\s/.test(a.charAt(L-1))?1:0}}:null}function _e(e){let t=[];for(let r of e.selection.ranges){let n=e.doc.lineAt(r.from),l=r.to<=n.to?n:e.doc.lineAt(r.to);l.from>n.from&&l.from==r.to&&(l=r.to==n.to+1?n:e.doc.lineAt(r.to-1));let o=t.length-1;o>=0&&t[o].to>n.from?t[o].to=l.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:l.to})}return t}function fe(e,t,r=t.selection.ranges){let n=r.map(o=>X(t,o.from).block);if(!n.every(o=>o))return null;let l=r.map((o,c)=>je(t,n[c],o.from,o.to));if(e!=2&&!l.every(o=>o))return{changes:t.changes(r.map((o,c)=>l[c]?[]:[{from:o.from,insert:n[c].open+" "},{from:o.to,insert:" "+n[c].close}]))};if(e!=1&&l.some(o=>o)){let o=[];for(let c=0,s;c<l.length;c++)if(s=l[c]){let i=n[c],{open:f,close:u}=s;o.push({from:f.pos-i.open.length,to:f.pos+f.margin},{from:u.pos-u.margin,to:u.pos+i.close.length})}return{changes:o}}return null}function we(e,t,r=t.selection.ranges){let n=[],l=-1;e:for(let{from:o,to:c}of r){let s=n.length,i=1e9,f;for(let u=o;u<=c;){let a=t.doc.lineAt(u);if(f==null&&(f=X(t,a.from).line,!f))continue e;if(a.from>l&&(o==c||c>a.from)){l=a.from;let p=/^\s*/.exec(a.text)[0].length,T=p==a.length,L=a.text.slice(p,p+f.length)==f?p:-1;p<a.text.length&&p<i&&(i=p),n.push({line:a,comment:L,token:f,indent:p,empty:T,single:!1})}u=a.to+1}if(i<1e9)for(let u=s;u<n.length;u++)n[u].indent<n[u].line.text.length&&(n[u].indent=i);n.length==s+1&&(n[s].single=!0)}if(e!=2&&n.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:s,token:i,indent:f,empty:u,single:a}of n)(a||!u)&&o.push({from:s.from+f,insert:i+" "});let c=t.changes(o);return{changes:c,selection:t.selection.map(c,1)}}else if(e!=1&&n.some(o=>o.comment>=0)){let o=[];for(let{line:c,comment:s,token:i}of n)if(s>=0){let f=c.from+s,u=f+i.length;c.text[u-c.from]==" "&&u++,o.push({from:f,to:u})}return{changes:o}}return null}const z=ce.define(),et=ce.define(),tt=oe.define(),ae=oe.define({combine(e){return He(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,r)=>(n,l)=>t(n,l)||r(n,l)})}}),he=ze.define({create(){return B.empty},update(e,t){let r=t.state.facet(ae),n=t.annotation(z);if(n){let i=m.fromTransaction(t,n.selection),f=n.side,u=f==0?e.undone:e.done;return i?u=R(u,u.length,r.minDepth,i):u=pe(u,t.startState.selection),new B(f==0?n.rest:u,f==0?u:n.rest)}let l=t.annotation(et);if((l=="full"||l=="before")&&(e=e.isolate()),t.annotation(P.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=m.fromTransaction(t),c=t.annotation(P.time),s=t.annotation(P.userEvent);return o?e=e.addChanges(o,c,s,r,t):t.selection&&(e=e.addSelection(t.startState.selection,c,s,r.newGroupDelay)),(l=="full"||l=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new B(e.done.map(m.fromJSON),e.undone.map(m.fromJSON))}});function un(e={}){return[he,ae.of(e),x.domEventHandlers({beforeinput(t,r){let n=t.inputType=="historyUndo"?de:t.inputType=="historyRedo"?H:null;return n?(t.preventDefault(),n(r)):!1}})]}function I(e,t){return function({state:r,dispatch:n}){if(!t&&r.readOnly)return!1;let l=r.field(he,!1);if(!l)return!1;let o=l.pop(e,r,t);return o?(n(o),!0):!1}}const de=I(0,!1),H=I(1,!1),nt=I(0,!0),rt=I(1,!0);class m{constructor(t,r,n,l,o){this.changes=t,this.effects=r,this.mapped=n,this.startSelection=l,this.selectionsAfter=o}setSelAfter(t){return new m(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,r,n;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(l=>l.toJSON())}}static fromJSON(t){return new m(t.changes&&qe.fromJSON(t.changes),[],t.mapped&&Ke.fromJSON(t.mapped),t.startSelection&&h.fromJSON(t.startSelection),t.selectionsAfter.map(h.fromJSON))}static fromTransaction(t,r){let n=g;for(let l of t.startState.facet(tt)){let o=l(t);o.length&&(n=n.concat(o))}return!n.length&&t.changes.empty?null:new m(t.changes.invert(t.startState.doc),n,void 0,r||t.startState.selection,g)}static selection(t){return new m(void 0,g,void 0,void 0,t)}}function R(e,t,r,n){let l=t+1>r+20?t-r-1:0,o=e.slice(l,t);return o.push(n),o}function ot(e,t){let r=[],n=!1;return e.iterChangedRanges((l,o)=>r.push(l,o)),t.iterChangedRanges((l,o,c,s)=>{for(let i=0;i<r.length;){let f=r[i++],u=r[i++];s>=f&&c<=u&&(n=!0)}}),n}function lt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((r,n)=>r.empty!=t.ranges[n].empty).length===0}function me(e,t){return e.length?t.length?e.concat(t):e:t}const g=[],ct=200;function pe(e,t){if(e.length){let r=e[e.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-ct));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),R(e,e.length-1,1e9,r.setSelAfter(n)))}else return[m.selection([t])]}function st(e){let t=e[e.length-1],r=e.slice();return r[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),r}function J(e,t){if(!e.length)return e;let r=e.length,n=g;for(;r;){let l=it(e[r-1],t,n);if(l.changes&&!l.changes.empty||l.effects.length){let o=e.slice(0,r);return o[r-1]=l,o}else t=l.mapped,r--,n=l.selectionsAfter}return n.length?[m.selection(n)]:g}function it(e,t,r){let n=me(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):g,r);if(!e.changes)return m.selection(n);let l=e.changes.map(t),o=t.mapDesc(e.changes,!0),c=e.mapped?e.mapped.composeDesc(o):o;return new m(l,le.mapEffects(e.effects,t),c,e.startSelection.map(o),n)}const ut=/^(input\.type|delete)($|\.)/;class B{constructor(t,r,n=0,l=void 0){this.done=t,this.undone=r,this.prevTime=n,this.prevUserEvent=l}isolate(){return this.prevTime?new B(this.done,this.undone):this}addChanges(t,r,n,l,o){let c=this.done,s=c[c.length-1];return s&&s.changes&&!s.changes.empty&&t.changes&&(!n||ut.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime<l.newGroupDelay&&l.joinToEvent(o,ot(s.changes,t.changes))||n=="input.type.compose")?c=R(c,c.length-1,l.minDepth,new m(t.changes.compose(s.changes),me(le.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,g)):c=R(c,c.length,l.minDepth,t),new B(c,g,r,n)}addSelection(t,r,n,l){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:g;return o.length>0&&r-this.prevTime<l&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&lt(o[o.length-1],t)?this:new B(pe(this.done,t),this.undone,r,n)}addMapping(t){return new B(J(this.done,t),J(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,r,n){let l=t==0?this.done:this.undone;if(l.length==0)return null;let o=l[l.length-1],c=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):r.selection);if(n&&o.selectionsAfter.length)return r.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:z.of({side:t,rest:st(l),selection:c}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let s=l.length==1?g:l.slice(0,l.length-1);return o.mapped&&(s=J(s,o.mapped)),r.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:z.of({side:t,rest:s,selection:c}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}B.empty=new B(g,g);const fn=[{key:"Mod-z",run:de,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:H,preventDefault:!0},{linux:"Ctrl-Shift-z",run:H,preventDefault:!0},{key:"Mod-u",run:nt,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:rt,preventDefault:!0}];function C(e,t){return h.create(e.ranges.map(t),e.mainIndex)}function k(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function A({state:e,dispatch:t},r){let n=C(e.selection,r);return n.eq(e.selection,!0)?!1:(t(k(e,n)),!0)}function N(e,t){return h.cursor(t?e.to:e.from)}function ge(e,t){return A(e,r=>r.empty?e.moveByChar(r,t):N(r,t))}function d(e){return e.textDirectionAt(e.state.selection.main.head)==$e.LTR}const ye=e=>ge(e,!d(e)),ke=e=>ge(e,d(e));function Ae(e,t){return A(e,r=>r.empty?e.moveByGroup(r,t):N(r,t))}const ft=e=>Ae(e,!d(e)),at=e=>Ae(e,d(e));function ht(e,t,r){if(t.type.prop(r))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function U(e,t,r){let n=W(e).resolveInner(t.head),l=r?F.closedBy:F.openedBy;for(let i=t.head;;){let f=r?n.childAfter(i):n.childBefore(i);if(!f)break;ht(e,f,l)?n=f:i=r?f.to:f.from}let o=n.type.prop(l),c,s;return o&&(c=r?D(e,n.from,1):D(e,n.to,-1))&&c.matched?s=r?c.end.to:c.end.from:s=r?n.to:n.from,h.cursor(s,r?-1:1)}const dt=e=>A(e,t=>U(e.state,t,!d(e))),mt=e=>A(e,t=>U(e.state,t,d(e)));function Be(e,t){return A(e,r=>{if(!r.empty)return N(r,t);let n=e.moveVertically(r,t);return n.head!=r.head?n:e.moveToLineBoundary(r,t)})}const Se=e=>Be(e,!1),De=e=>Be(e,!0);function xe(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,n=0,l;if(t){for(let o of e.state.facet(x.scrollMargins)){let c=o(e);c?.top&&(r=Math.max(c?.top,r)),c?.bottom&&(n=Math.max(c?.bottom,n))}l=e.scrollDOM.clientHeight-r-n}else l=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:t,height:Math.max(e.defaultLineHeight,l-5)}}function Ce(e,t){let r=xe(e),{state:n}=e,l=C(n.selection,c=>c.empty?e.moveVertically(c,t,r.height):N(c,t));if(l.eq(n.selection))return!1;let o;if(r.selfScroll){let c=e.coordsAtPos(n.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),i=s.top+r.marginTop,f=s.bottom-r.marginBottom;c&&c.top>i&&c.bottom<f&&(o=x.scrollIntoView(l.main.head,{y:"start",yMargin:c.top-i}))}return e.dispatch(k(n,l),{effects:o}),!0}const Z=e=>Ce(e,!1),q=e=>Ce(e,!0);function S(e,t,r){let n=e.lineBlockAt(t.head),l=e.moveToLineBoundary(t,r);if(l.head==t.head&&l.head!=(r?n.to:n.from)&&(l=e.moveToLineBoundary(t,r,!1)),!r&&l.head==n.from&&n.length){let o=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;o&&t.head!=n.from+o&&(l=h.cursor(n.from+o))}return l}const pt=e=>A(e,t=>S(e,t,!0)),gt=e=>A(e,t=>S(e,t,!1)),yt=e=>A(e,t=>S(e,t,!d(e))),kt=e=>A(e,t=>S(e,t,d(e))),At=e=>A(e,t=>h.cursor(e.lineBlockAt(t.head).from,1)),Bt=e=>A(e,t=>h.cursor(e.lineBlockAt(t.head).to,-1));function St(e,t,r){let n=!1,l=C(e.selection,o=>{let c=D(e,o.head,-1)||D(e,o.head,1)||o.head>0&&D(e,o.head-1,1)||o.head<e.doc.length&&D(e,o.head+1,-1);if(!c||!c.end)return o;n=!0;let s=c.start.from==o.head?c.end.to:c.end.from;return h.cursor(s)});return n?(t(k(e,l)),!0):!1}const Dt=({state:e,dispatch:t})=>St(e,t);function y(e,t){let r=C(e.state.selection,n=>{let l=t(n);return h.range(n.anchor,l.head,l.goalColumn,l.bidiLevel||void 0,l.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(k(e.state,r)),!0)}function Le(e,t){return y(e,r=>e.moveByChar(r,t))}const Me=e=>Le(e,!d(e)),Ee=e=>Le(e,d(e));function Oe(e,t){return y(e,r=>e.moveByGroup(r,t))}const xt=e=>Oe(e,!d(e)),Ct=e=>Oe(e,d(e)),Lt=e=>y(e,t=>U(e.state,t,!d(e))),Mt=e=>y(e,t=>U(e.state,t,d(e)));function Te(e,t){return y(e,r=>e.moveVertically(r,t))}const be=e=>Te(e,!1),ve=e=>Te(e,!0);function Re(e,t){return y(e,r=>e.moveVertically(r,t,xe(e).height))}const j=e=>Re(e,!1),_=e=>Re(e,!0),Et=e=>y(e,t=>S(e,t,!0)),Ot=e=>y(e,t=>S(e,t,!1)),Tt=e=>y(e,t=>S(e,t,!d(e))),bt=e=>y(e,t=>S(e,t,d(e))),vt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).from)),Rt=e=>y(e,t=>h.cursor(e.lineBlockAt(t.head).to)),w=({state:e,dispatch:t})=>(t(k(e,{anchor:0})),!0),ee=({state:e,dispatch:t})=>(t(k(e,{anchor:e.doc.length})),!0),te=({state:e,dispatch:t})=>(t(k(e,{anchor:e.selection.main.anchor,head:0})),!0),ne=({state:e,dispatch:t})=>(t(k(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),It=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Nt=({state:e,dispatch:t})=>{let r=V(e).map(({from:n,to:l})=>h.range(n,Math.min(l+1,e.doc.length)));return t(e.update({selection:h.create(r),userEvent:"select"})),!0},Ut=({state:e,dispatch:t})=>{let r=C(e.selection,n=>{let l=W(e),o=l.resolveStack(n.from,1);if(n.empty){let c=l.resolveStack(n.from,-1);c.node.from>=o.node.from&&c.node.to<=o.node.to&&(o=c)}for(let c=o;c;c=c.next){let{node:s}=c;if((s.from<n.from&&s.to>=n.to||s.to>n.to&&s.from<=n.from)&&c.next)return h.range(s.to,s.from)}return n});return r.eq(e.selection)?!1:(t(k(e,r)),!0)};function Ie(e,t){let{state:r}=e,n=r.selection,l=r.selection.ranges.slice();for(let o of r.selection.ranges){let c=r.doc.lineAt(o.head);if(t?c.to<e.state.doc.length:c.from>0)for(let s=o;;){let i=e.moveVertically(s,t);if(i.head<c.from||i.head>c.to){l.some(f=>f.head==i.head)||l.push(i);break}else{if(i.head==s.head)break;s=i}}}return l.length==n.ranges.length?!1:(e.dispatch(k(r,h.create(l,l.length-1))),!0)}const Vt=e=>Ie(e,!1),Pt=e=>Ie(e,!0),Jt=({state:e,dispatch:t})=>{let r=e.selection,n=null;return r.ranges.length>1?n=h.create([r.main]):r.main.empty||(n=h.create([h.cursor(r.main.head)])),n?(t(k(e,n)),!0):!1};function O(e,t){if(e.state.readOnly)return!1;let r="delete.selection",{state:n}=e,l=n.changeByRange(o=>{let{from:c,to:s}=o;if(c==s){let i=t(o);i<c?(r="delete.backward",i=b(e,i,!1)):i>c&&(r="delete.forward",i=b(e,i,!0)),c=Math.min(c,i),s=Math.max(s,i)}else c=b(e,c,!1),s=b(e,s,!0);return c==s?{range:o}:{changes:{from:c,to:s},range:h.cursor(c,c<o.head?-1:1)}});return l.changes.empty?!1:(e.dispatch(n.update(l,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?x.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function b(e,t,r){if(e instanceof x)for(let n of e.state.facet(x.atomicRanges).map(l=>l(e)))n.between(t,t,(l,o)=>{l<t&&o>t&&(t=r?o:l)});return t}const Ne=(e,t,r)=>O(e,n=>{let l=n.from,{state:o}=e,c=o.doc.lineAt(l),s,i;if(r&&!t&&l>c.from&&l<c.from+200&&!/[^ \t]/.test(s=c.text.slice(0,l-c.from))){if(s[s.length-1]==" ")return l-1;let f=$(s,o.tabSize),u=f%G(o)||G(o);for(let a=0;a<u&&s[s.length-1-a]==" ";a++)l--;i=l}else i=E(c.text,l-c.from,t,t)+c.from,i==l&&c.number!=(t?o.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(c.text.slice(i-c.from,l-c.from))&&(i=E(c.text,i-c.from,!1,!1)+c.from);return i}),K=e=>Ne(e,!1,!0),Ue=e=>Ne(e,!0,!1),Ve=(e,t)=>O(e,r=>{let n=r.head,{state:l}=e,o=l.doc.lineAt(n),c=l.charCategorizer(n);for(let s=null;;){if(n==(t?o.to:o.from)){n==r.head&&o.number!=(t?l.doc.lines:1)&&(n+=t?1:-1);break}let i=E(o.text,n-o.from,t)+o.from,f=o.text.slice(Math.min(n,i)-o.from,Math.max(n,i)-o.from),u=c(f);if(s!=null&&u!=s)break;(f!=" "||n!=r.head)&&(s=u),n=i}return n}),Pe=e=>Ve(e,!1),Gt=e=>Ve(e,!0),Ft=e=>O(e,t=>{let r=e.lineBlockAt(t.head).to;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),zt=e=>O(e,t=>{let r=e.moveToLineBoundary(t,!1).head;return t.head>r?r:Math.max(0,t.head-1)}),Ht=e=>O(e,t=>{let r=e.moveToLineBoundary(t,!0).head;return t.head<r?r:Math.min(e.state.doc.length,t.head+1)}),qt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:se.of(["",""])},range:h.cursor(n.from)}));return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Kt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(n=>{if(!n.empty||n.from==0||n.from==e.doc.length)return{range:n};let l=n.from,o=e.doc.lineAt(l),c=l==o.from?l-1:E(o.text,l-o.from,!1)+o.from,s=l==o.to?l+1:E(o.text,l-o.from,!0)+o.from;return{changes:{from:c,to:s,insert:e.doc.slice(l,s).append(e.doc.slice(c,l))},range:h.cursor(s)}});return r.changes.empty?!1:(t(e.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function V(e){let t=[],r=-1;for(let n of e.selection.ranges){let l=e.doc.lineAt(n.from),o=e.doc.lineAt(n.to);if(!n.empty&&n.to==o.from&&(o=e.doc.lineAt(n.to-1)),r>=l.number){let c=t[t.length-1];c.to=o.to,c.ranges.push(n)}else t.push({from:l.from,to:o.to,ranges:[n]});r=o.number+1}return t}function Je(e,t,r){if(e.readOnly)return!1;let n=[],l=[];for(let o of V(e)){if(r?o.to==e.doc.length:o.from==0)continue;let c=e.doc.lineAt(r?o.to+1:o.from-1),s=c.length+1;if(r){n.push({from:o.to,to:c.to},{from:o.from,insert:c.text+e.lineBreak});for(let i of o.ranges)l.push(h.range(Math.min(e.doc.length,i.anchor+s),Math.min(e.doc.length,i.head+s)))}else{n.push({from:c.from,to:o.from},{from:o.to,insert:e.lineBreak+c.text});for(let i of o.ranges)l.push(h.range(i.anchor-s,i.head-s))}}return n.length?(t(e.update({changes:n,scrollIntoView:!0,selection:h.create(l,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const $t=({state:e,dispatch:t})=>Je(e,t,!1),Wt=({state:e,dispatch:t})=>Je(e,t,!0);function Ge(e,t,r){if(e.readOnly)return!1;let n=[];for(let o of V(e))r?n.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):n.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let l=e.changes(n);return t(e.update({changes:l,selection:e.selection.map(l,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Qt=({state:e,dispatch:t})=>Ge(e,t,!1),Xt=({state:e,dispatch:t})=>Ge(e,t,!0),Yt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,r=t.changes(V(t).map(({from:l,to:o})=>(l>0?l--:o<t.doc.length&&o++,{from:l,to:o}))),n=C(t.selection,l=>{let o;if(e.lineWrapping){let c=e.lineBlockAt(l.head),s=e.coordsAtPos(l.head,l.assoc||1);s&&(o=c.bottom+e.documentTop-s.bottom+e.defaultLineHeight/2)}return e.moveVertically(l,!0,o)}).map(r);return e.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Zt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let r=W(e).resolveInner(t),n=r.childBefore(t),l=r.childAfter(t),o;return n&&l&&n.to<=t&&l.from>=t&&(o=n.type.prop(F.closedBy))&&o.indexOf(l.name)>-1&&e.doc.lineAt(n.to).from==e.doc.lineAt(l.from).from&&!/\S/.test(e.sliceDoc(n.to,l.from))?{from:n.to,to:l.from}:null}const re=Fe(!1),jt=Fe(!0);function Fe(e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let n=t.changeByRange(l=>{let{from:o,to:c}=l,s=t.doc.lineAt(o),i=!e&&o==c&&Zt(t,o);e&&(o=c=(c<=s.to?s:t.doc.lineAt(c)).to);let f=new ie(t,{simulateBreak:o,simulateDoubleBreak:!!i}),u=ue(f,o);for(u==null&&(u=$(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));c<s.to&&/\s/.test(s.text[c-s.from]);)c++;i?{from:o,to:c}=i:o>s.from&&o<s.from+100&&!/\S/.test(s.text.slice(0,o))&&(o=s.from);let a=["",v(t,u)];return i&&a.push(v(t,f.lineIndent(s.from,-1))),{changes:{from:o,to:c,insert:se.of(a)},range:h.cursor(o+1+a[1].length)}});return r(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Y(e,t){let r=-1;return e.changeByRange(n=>{let l=[];for(let c=n.from;c<=n.to;){let s=e.doc.lineAt(c);s.number>r&&(n.empty||n.to>s.from)&&(t(s,l,n),r=s.number),c=s.to+1}let o=e.changes(l);return{changes:l,range:h.range(o.mapPos(n.anchor,1),o.mapPos(n.head,1))}})}const _t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=Object.create(null),n=new ie(e,{overrideIndentation:o=>{let c=r[o];return c??-1}}),l=Y(e,(o,c,s)=>{let i=ue(n,o.from);if(i==null)return;/\S/.test(o.text)||(i=0);let f=/^\s*/.exec(o.text)[0],u=v(e,i);(f!=u||s.from<o.from+f.length)&&(r[o.from]=i,c.push({from:o.from,to:o.from+f.length,insert:u}))});return l.changes.empty||t(e.update(l,{userEvent:"indent"})),!0},wt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Y(e,(r,n)=>{n.push({from:r.from,insert:e.facet(We)})}),{userEvent:"input.indent"})),!0),en=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Y(e,(r,n)=>{let l=/^\s*/.exec(r.text)[0];if(!l)return;let o=$(l,e.tabSize),c=0,s=v(e,Math.max(0,o-G(e)));for(;c<l.length&&c<s.length&&l.charCodeAt(c)==s.charCodeAt(c);)c++;n.push({from:r.from+c,to:r.from+l.length,insert:s.slice(c)})}),{userEvent:"delete.dedent"})),!0),tn=e=>(e.setTabFocusMode(),!0),nn=[{key:"Ctrl-b",run:ye,shift:Me,preventDefault:!0},{key:"Ctrl-f",run:ke,shift:Ee},{key:"Ctrl-p",run:Se,shift:be},{key:"Ctrl-n",run:De,shift:ve},{key:"Ctrl-a",run:At,shift:vt},{key:"Ctrl-e",run:Bt,shift:Rt},{key:"Ctrl-d",run:Ue},{key:"Ctrl-h",run:K},{key:"Ctrl-k",run:Ft},{key:"Ctrl-Alt-h",run:Pe},{key:"Ctrl-o",run:qt},{key:"Ctrl-t",run:Kt},{key:"Ctrl-v",run:q}],rn=[{key:"ArrowLeft",run:ye,shift:Me,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ft,shift:xt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:yt,shift:Tt,preventDefault:!0},{key:"ArrowRight",run:ke,shift:Ee,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:at,shift:Ct,preventDefault:!0},{mac:"Cmd-ArrowRight",run:kt,shift:bt,preventDefault:!0},{key:"ArrowUp",run:Se,shift:be,preventDefault:!0},{mac:"Cmd-ArrowUp",run:w,shift:te},{mac:"Ctrl-ArrowUp",run:Z,shift:j},{key:"ArrowDown",run:De,shift:ve,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ee,shift:ne},{mac:"Ctrl-ArrowDown",run:q,shift:_},{key:"PageUp",run:Z,shift:j},{key:"PageDown",run:q,shift:_},{key:"Home",run:gt,shift:Ot,preventDefault:!0},{key:"Mod-Home",run:w,shift:te},{key:"End",run:pt,shift:Et,preventDefault:!0},{key:"Mod-End",run:ee,shift:ne},{key:"Enter",run:re,shift:re},{key:"Mod-a",run:It},{key:"Backspace",run:K,shift:K,preventDefault:!0},{key:"Delete",run:Ue,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Pe,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Gt,preventDefault:!0},{mac:"Mod-Backspace",run:zt,preventDefault:!0},{mac:"Mod-Delete",run:Ht,preventDefault:!0}].concat(nn.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),an=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:dt,shift:Lt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:mt,shift:Mt},{key:"Alt-ArrowUp",run:$t},{key:"Shift-Alt-ArrowUp",run:Qt},{key:"Alt-ArrowDown",run:Wt},{key:"Shift-Alt-ArrowDown",run:Xt},{key:"Mod-Alt-ArrowUp",run:Vt},{key:"Mod-Alt-ArrowDown",run:Pt},{key:"Escape",run:Jt},{key:"Mod-Enter",run:jt},{key:"Alt-l",mac:"Ctrl-l",run:Nt},{key:"Mod-i",run:Ut,preventDefault:!0},{key:"Mod-[",run:en},{key:"Mod-]",run:wt},{key:"Mod-Alt-\\",run:_t},{key:"Shift-Mod-k",run:Yt},{key:"Shift-Mod-\\",run:Dt},{key:"Mod-/",run:Qe},{key:"Alt-A",run:Ye},{key:"Ctrl-m",mac:"Shift-Alt-m",run:tn}].concat(rn);export{Vt as addCursorAbove,Pt as addCursorBelow,Xt as copyLineDown,Qt as copyLineUp,ye as cursorCharLeft,ke as cursorCharRight,ee as cursorDocEnd,w as cursorDocStart,ft as cursorGroupLeft,at as cursorGroupRight,gt as cursorLineBoundaryBackward,pt as cursorLineBoundaryForward,yt as cursorLineBoundaryLeft,kt as cursorLineBoundaryRight,De as cursorLineDown,Bt as cursorLineEnd,At as cursorLineStart,Se as cursorLineUp,Dt as cursorMatchingBracket,q as cursorPageDown,Z as cursorPageUp,dt as cursorSyntaxLeft,mt as cursorSyntaxRight,an as defaultKeymap,K as deleteCharBackward,Ue as deleteCharForward,Pe as deleteGroupBackward,Gt as deleteGroupForward,Yt as deleteLine,zt as deleteLineBoundaryBackward,Ht as deleteLineBoundaryForward,Ft as deleteToLineEnd,nn as emacsStyleKeymap,un as history,fn as historyKeymap,en as indentLess,wt as indentMore,_t as indentSelection,jt as insertBlankLine,re as insertNewlineAndIndent,tt as invertedEffects,et as isolateHistory,Wt as moveLineDown,$t as moveLineUp,H as redo,rt as redoSelection,It as selectAll,Me as selectCharLeft,Ee as selectCharRight,ne as selectDocEnd,te as selectDocStart,xt as selectGroupLeft,Ct as selectGroupRight,Nt as selectLine,Ot as selectLineBoundaryBackward,Et as selectLineBoundaryForward,Tt as selectLineBoundaryLeft,bt as selectLineBoundaryRight,ve as selectLineDown,Rt as selectLineEnd,vt as selectLineStart,be as selectLineUp,_ as selectPageDown,j as selectPageUp,Ut as selectParentSyntax,Lt as selectSyntaxLeft,Mt as selectSyntaxRight,Jt as simplifySelection,qt as splitLine,rn as standardKeymap,Ye as toggleBlockComment,Ze as toggleBlockCommentByLine,Qe as toggleComment,Xe as toggleLineComment,tn as toggleTabFocusMode,Kt as transposeChars,de as undo,nt as undoSelection};
@@ -1 +0,0 @@
1
- var Kt=Array.isArray,Xt=Array.prototype.indexOf,oe=Array.prototype.includes,zn=Array.from,Gn=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Zt=Object.getOwnPropertyDescriptors,Wt=Object.prototype,Jt=Array.prototype,_t=Object.getPrototypeOf,rt=Object.isExtensible;function $n(e){return typeof e=="function"}const ye=()=>{};function Kn(e){return e()}function Qt(e){for(var t=0;t<e.length;t++)e[t]()}function vt(){var e,t,n=new Promise((r,s)=>{e=r,t=s});return{promise:n,resolve:e,reject:t}}function Xn(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const E=2,ie=4,ue=8,Be=1<<24,K=16,L=32,X=64,en=128,O=512,y=1024,T=2048,M=4096,F=8192,V=16384,de=32768,Se=65536,st=1<<17,tn=1<<18,he=1<<19,dt=1<<20,Zn=1<<25,re=65536,Le=1<<21,Ue=1<<22,B=1<<23,te=Symbol("$state"),Wn=Symbol("legacy props"),Jn=Symbol(""),W=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},er=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Ce=3,ht=8;function ze(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function nn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function tr(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function rn(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function fn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function an(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function nr(){throw new Error("https://svelte.dev/e/hydration_failed")}function rr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function ln(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function on(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function un(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function sr(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const fr=1,ir=2,ar=4,lr=8,or=16,ur=1,cr=2,_r=4,vr=8,dr=16,hr=1,pr=2,cn="[",_n="[!",br="[?",vn="]",Ge={},g=Symbol(),dn="http://www.w3.org/1999/xhtml",wr="http://www.w3.org/2000/svg",yr="http://www.w3.org/1998/Math/MathML",gr="@attach";function $e(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Er(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function mr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let z=!1;function Tr(e){z=e}let S;function ce(e){if(e===null)throw $e(),Ge;return S=e}function Ar(){return ce(Z(S))}function xr(e){if(z){if(Z(S)!==null)throw $e(),Ge;S=e}}function Sr(e=1){if(z){for(var t=e,n=S;t--;)n=Z(n);S=n}}function Rr(e=!0){for(var t=0,n=S;;){if(n.nodeType===ht){var r=n.data;if(r===vn){if(t===0)return n;t-=1}else(r===cn||r===_n||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=Z(n);e&&n.remove(),n=s}}function Nr(e){if(!e||e.nodeType!==ht)throw $e(),Ge;return e.data}function pt(e){return e===this.v}function bt(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function wt(e){return!bt(e,this.v)}let me=!1;function kr(){me=!0}let h=null;function Re(e){h=e}function Or(e){return De().get(e)}function Cr(e,t){return De().set(e,t),t}function Dr(e){return De().has(e)}function Ir(){return De()}function Pr(e,t=!1,n){h={p:h,i:!1,c:null,e:null,s:e,x:null,l:me&&!t?{s:null,u:null,$:[]}:null}}function Mr(e){var t=h,n=t.e;if(n!==null){t.e=null;for(var r of n)Mt(r)}return e!==void 0&&(t.x=e),t.i=!0,h=t.p,e??{}}function Te(){return!me||h!==null&&h.l===null}function De(e){return h===null&&ze(),h.c??=new Map(hn(h)||void 0)}function hn(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}let J=[];function yt(){var e=J;J=[],Qt(e)}function je(e){if(J.length===0&&!ge){var t=J;queueMicrotask(()=>{t===J&&yt()})}J.push(e)}function pn(){for(;J.length>0;)yt()}function bn(e){var t=d;if(t===null)return v.f|=B,e;if((t.f&de)===0&&(t.f&ie)===0)throw e;Ne(e,t)}function Ne(e,t){for(;t!==null;){if((t.f&en)!==0){if((t.f&de)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const wn=-7169;function w(e,t){e.f=e.f&wn|t}function Ke(e){(e.f&O)!==0||e.deps===null?w(e,y):w(e,M)}function gt(e){if(e!==null)for(const t of e)(t.f&E)===0||(t.f&re)===0||(t.f^=re,gt(t.deps))}function yn(e,t,n){(e.f&T)!==0?t.add(e):(e.f&M)!==0&&n.add(e),gt(e.deps),w(e,y)}const Ae=new Set;let b=null,ft=null,I=null,A=[],Ie=null,ge=!1,_e=null;class ae{current=new Map;previous=new Map;#t=new Set;#s=new Set;#r=0;#f=0;#i=null;#a=new Set;#n=new Set;#e=new Map;is_fork=!1;#l=!1;#o(){return this.is_fork||this.#f>0}skip_effect(t){this.#e.has(t)||this.#e.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#e.get(t);if(n){this.#e.delete(t);for(var r of n.d)w(r,T),Y(r);for(r of n.m)w(r,M),Y(r)}}process(t){A=[],this.apply();var n=_e=[],r=[];for(const s of t)this.#u(s,n,r);if(_e=null,this.#o()){this.#c(r),this.#c(n);for(const[s,f]of this.#e)At(s,f)}else{ft=this,b=null;for(const s of this.#t)s(this);this.#t.clear(),this.#r===0&&this.#_(),it(r),it(n),this.#a.clear(),this.#n.clear(),ft=null,this.#i?.resolve()}I=null}#u(t,n,r){t.f^=y;for(var s=t.first;s!==null;){var f=s.f,o=(f&(L|X))!==0,l=o&&(f&y)!==0,i=l||(f&F)!==0||this.#e.has(s);if(!i&&s.fn!==null){o?s.f^=y:(f&ie)!==0?n.push(s):pe(s)&&((f&K)!==0&&this.#n.add(s),fe(s));var a=s.first;if(a!==null){s=a;continue}}for(;s!==null;){var u=s.next;if(u!==null){s=u;break}s=s.parent}}}#c(t){for(var n=0;n<t.length;n+=1)yn(t[n],this.#a,this.#n)}capture(t,n){n!==g&&!this.previous.has(t)&&this.previous.set(t,n),(t.f&B)===0&&(this.current.set(t,t.v),I?.set(t,t.v))}activate(){b=this,this.apply()}deactivate(){b===this&&(b=null,I=null)}flush(){if(A.length>0)b=this,Et();else if(this.#r===0&&!this.is_fork){for(const t of this.#t)t(this);this.#t.clear(),this.#_(),this.#i?.resolve()}this.deactivate()}discard(){for(const t of this.#s)t(this);this.#s.clear()}#_(){if(Ae.size>1){this.previous.clear();var t=b,n=I,r=!0;for(const f of Ae){if(f===this){r=!1;continue}const o=[];for(const[i,a]of this.current){if(f.current.has(i))if(r&&a!==f.current.get(i))f.current.set(i,a);else continue;o.push(i)}if(o.length===0)continue;const l=[...f.current.keys()].filter(i=>!this.current.has(i));if(l.length>0){var s=A;A=[];const i=new Set,a=new Map;for(const u of o)mt(u,l,i,a);if(A.length>0){b=f,f.apply();for(const u of A)f.#u(u,[],[]);f.deactivate()}A=s}}b=t,I=n}this.#e.clear(),Ae.delete(this)}increment(t){this.#r+=1,t&&(this.#f+=1)}decrement(t){this.#r-=1,t&&(this.#f-=1),!this.#l&&(this.#l=!0,je(()=>{this.#l=!1,this.#o()?A.length>0&&this.flush():this.revive()}))}revive(){for(const t of this.#a)this.#n.delete(t),w(t,T),Y(t);for(const t of this.#n)w(t,M),Y(t);this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#s.add(t)}settled(){return(this.#i??=vt()).promise}static ensure(){if(b===null){const t=b=new ae;Ae.add(b),ge||je(()=>{b===t&&t.flush()})}return b}apply(){}}function gn(e){var t=ge;ge=!0;try{for(var n;;){if(pn(),A.length===0&&(b?.flush(),A.length===0))return Ie=null,n;Et()}}finally{ge=t}}function Et(){var e=null;try{for(var t=0;A.length>0;){var n=ae.ensure();if(t++>1e3){var r,s;En()}n.process(A),U.clear()}}finally{A=[],Ie=null,_e=null}}function En(){try{an()}catch(e){Ne(e,Ie)}}let j=null;function it(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(V|F))===0&&pe(r)&&(j=new Set,fe(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&jt(r),j?.size>0)){U.clear();for(const s of j){if((s.f&(V|F))!==0)continue;const f=[s];let o=s.parent;for(;o!==null;)j.has(o)&&(j.delete(o),f.push(o)),o=o.parent;for(let l=f.length-1;l>=0;l--){const i=f[l];(i.f&(V|F))===0&&fe(i)}}j.clear()}}j=null}}function mt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const f=s.f;(f&E)!==0?mt(s,t,n,r):(f&(Ue|K))!==0&&(f&T)===0&&Tt(s,t,r)&&(w(s,T),Y(s))}}function Tt(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(oe.call(t,s))return!0;if((s.f&E)!==0&&Tt(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function Y(e){var t=Ie=e,n=t.b;if(n?.is_pending&&(e.f&(ie|ue|Be))!==0&&(e.f&de)===0){n.defer_effect(e);return}for(;t.parent!==null;){t=t.parent;var r=t.f;if(_e!==null&&t===d&&(e.f&ue)===0)return;if((r&(X|L))!==0){if((r&y)===0)return;t.f^=y}}A.push(t)}function At(e,t){if(!((e.f&L)!==0&&(e.f&y)!==0)){(e.f&T)!==0?t.d.push(e):(e.f&M)!==0&&t.m.push(e),w(e,y);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function xt(e,t,n,r){const s=Te()?Xe:An;var f=e.filter(c=>!c.settled);if(n.length===0&&f.length===0){r(t.map(s));return}var o=d,l=mn(),i=f.length===1?f[0].promise:f.length>1?Promise.all(f.map(c=>c.promise)):null;function a(c){l();try{r(c)}catch(_){(o.f&V)===0&&Ne(_,o)}Ye()}if(n.length===0){i.then(()=>a(t.map(s)));return}function u(){l(),Promise.all(n.map(c=>Tn(c))).then(c=>a([...t.map(s),...c])).catch(c=>Ne(c,o))}i?i.then(u):u()}function mn(){var e=d,t=v,n=h,r=b;return function(f=!0){ve(e),$(t),Re(n),f&&r?.activate()}}function Ye(e=!0){ve(null),$(null),Re(null),e&&b?.deactivate()}function St(){var e=d.b,t=b,n=e.is_rendered();return e.update_pending_count(1),t.increment(n),()=>{e.update_pending_count(-1),t.decrement(n)}}function Xe(e){var t=E|T,n=v!==null&&(v.f&E)!==0?v:null;return d!==null&&(d.f|=he),{ctx:h,deps:null,effects:null,equals:pt,f:t,fn:e,reactions:null,rv:0,v:g,wv:0,parent:n??d,ac:null}}function Tn(e,t,n){d===null&&nn();var s=void 0,f=We(g),o=!v,l=new Map;return Fn(()=>{var i=vt();s=i.promise;try{Promise.resolve(e()).then(i.resolve,i.reject).finally(Ye)}catch(_){i.reject(_),Ye()}var a=b;if(o){var u=St();l.get(a)?.reject(W),l.delete(a),l.set(a,i)}const c=(_,m=void 0)=>{if(a.activate(),m)m!==W&&(f.f|=B,He(f,m));else{(f.f&B)!==0&&(f.f^=B),He(f,_);for(const[p,D]of l){if(l.delete(p),p===a)break;D.reject(W)}}u&&u()};i.promise.then(c,_=>c(null,_||"unknown"))}),Pn(()=>{for(const i of l.values())i.reject(W)}),new Promise(i=>{function a(u){function c(){u===s?i(f):a(s)}u.then(c,c)}a(s)})}function Fr(e){const t=Xe(e);return Ht(t),t}function An(e){const t=Xe(e);return t.equals=wt,t}function xn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)G(t[n])}}function Sn(e){for(var t=e.parent;t!==null;){if((t.f&E)===0)return(t.f&V)===0?t:null;t=t.parent}return null}function Ze(e){var t,n=d;ve(Sn(e));try{e.f&=~re,xn(e),t=zt(e)}finally{ve(n)}return t}function Rt(e){var t=Ze(e);if(!e.equals(t)&&(e.wv=Bt(),(!b?.is_fork||e.deps===null)&&(e.v=t,e.deps===null))){w(e,y);return}se||(I!==null?(Pt()||b?.is_fork)&&I.set(e,t):Ke(e))}function Rn(e){if(e.effects!==null)for(const t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(W),t.teardown=ye,t.ac=null,Ee(t,0),et(t))}function Nt(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&fe(t)}let qe=new Set;const U=new Map;let kt=!1;function We(e,t){var n={f:0,v:e,reactions:null,equals:pt,rv:0,wv:0};return n}function q(e,t){const n=We(e);return Ht(n),n}function Lr(e,t=!1,n=!0){const r=We(e);return t||(r.equals=wt),me&&n&&h!==null&&h.l!==null&&(h.l.s??=[]).push(r),r}function H(e,t,n=!1){v!==null&&(!P||(v.f&st)!==0)&&Te()&&(v.f&(E|K|Ue|st))!==0&&(C===null||!oe.call(C,e))&&un();let r=n?be(t):t;return He(e,r)}function He(e,t){if(!e.equals(t)){var n=e.v;se?U.set(e,t):U.set(e,n),e.v=t;var r=ae.ensure();if(r.capture(e,n),(e.f&E)!==0){const s=e;(e.f&T)!==0&&Ze(s),Ke(s)}e.wv=Bt(),Ot(e,T),Te()&&d!==null&&(d.f&y)!==0&&(d.f&(L|X))===0&&(k===null?qn([e]):k.push(e)),!r.is_fork&&qe.size>0&&!kt&&Nn()}return t}function Nn(){kt=!1;for(const e of qe)(e.f&y)!==0&&w(e,M),pe(e)&&fe(e);qe.clear()}function jr(e,t=1){var n=ee(e),r=t===1?n++:n--;return H(e,n),r}function Fe(e){H(e,e.v+1)}function Ot(e,t){var n=e.reactions;if(n!==null)for(var r=Te(),s=n.length,f=0;f<s;f++){var o=n[f],l=o.f;if(!(!r&&o===d)){var i=(l&T)===0;if(i&&w(o,t),(l&E)!==0){var a=o;I?.delete(a),(l&re)===0&&(l&O&&(o.f|=re),Ot(a,M))}else i&&((l&K)!==0&&j!==null&&j.add(o),Y(o))}}}function be(e){if(typeof e!="object"||e===null||te in e)return e;const t=_t(e);if(t!==Wt&&t!==Jt)return e;var n=new Map,r=Kt(e),s=q(0),f=ne,o=l=>{if(ne===f)return l();var i=v,a=ne;$(null),ct(f);var u=l();return $(i),ct(a),u};return r&&n.set("length",q(e.length)),new Proxy(e,{defineProperty(l,i,a){(!("value"in a)||a.configurable===!1||a.enumerable===!1||a.writable===!1)&&ln();var u=n.get(i);return u===void 0?o(()=>{var c=q(a.value);return n.set(i,c),c}):H(u,a.value,!0),!0},deleteProperty(l,i){var a=n.get(i);if(a===void 0){if(i in l){const u=o(()=>q(g));n.set(i,u),Fe(s)}}else H(a,g),Fe(s);return!0},get(l,i,a){if(i===te)return e;var u=n.get(i),c=i in l;if(u===void 0&&(!c||we(l,i)?.writable)&&(u=o(()=>{var m=be(c?l[i]:g),p=q(m);return p}),n.set(i,u)),u!==void 0){var _=ee(u);return _===g?void 0:_}return Reflect.get(l,i,a)},getOwnPropertyDescriptor(l,i){var a=Reflect.getOwnPropertyDescriptor(l,i);if(a&&"value"in a){var u=n.get(i);u&&(a.value=ee(u))}else if(a===void 0){var c=n.get(i),_=c?.v;if(c!==void 0&&_!==g)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return a},has(l,i){if(i===te)return!0;var a=n.get(i),u=a!==void 0&&a.v!==g||Reflect.has(l,i);if(a!==void 0||d!==null&&(!u||we(l,i)?.writable)){a===void 0&&(a=o(()=>{var _=u?be(l[i]):g,m=q(_);return m}),n.set(i,a));var c=ee(a);if(c===g)return!1}return u},set(l,i,a,u){var c=n.get(i),_=i in l;if(r&&i==="length")for(var m=a;m<c.v;m+=1){var p=n.get(m+"");p!==void 0?H(p,g):m in l&&(p=o(()=>q(g)),n.set(m+"",p))}if(c===void 0)(!_||we(l,i)?.writable)&&(c=o(()=>q(void 0)),H(c,be(a)),n.set(i,c));else{_=c.v!==g;var D=o(()=>be(a));H(c,D)}var tt=Reflect.getOwnPropertyDescriptor(l,i);if(tt?.set&&tt.set.call(u,a),!_){if(r&&typeof i=="string"){var nt=n.get("length"),Me=Number(i);Number.isInteger(Me)&&Me>=nt.v&&H(nt,Me+1)}Fe(s)}return!0},ownKeys(l){ee(s);var i=Reflect.ownKeys(l).filter(c=>{var _=n.get(c);return _===void 0||_.v!==g});for(var[a,u]of n)u.v!==g&&!(a in l)&&i.push(a);return i},setPrototypeOf(){on()}})}function at(e){try{if(e!==null&&typeof e=="object"&&te in e)return e[te]}catch{}return e}function Yr(e,t){return Object.is(at(e),at(t))}var lt,kn,On,Ct,Dt;function qr(){if(lt===void 0){lt=window,kn=document,On=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Ct=we(t,"firstChild").get,Dt=we(t,"nextSibling").get,rt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),rt(n)&&(n.__t=void 0)}}function ke(e=""){return document.createTextNode(e)}function Oe(e){return Ct.call(e)}function Z(e){return Dt.call(e)}function Hr(e,t){if(!z)return Oe(e);var n=Oe(S);if(n===null)n=S.appendChild(ke());else if(t&&n.nodeType!==Ce){var r=ke();return n?.before(r),ce(r),r}return t&&Je(n),ce(n),n}function Vr(e,t=!1){if(!z){var n=Oe(e);return n instanceof Comment&&n.data===""?Z(n):n}if(t){if(S?.nodeType!==Ce){var r=ke();return S?.before(r),ce(r),r}Je(S)}return S}function Br(e,t=1,n=!1){let r=z?S:e;for(var s;t--;)s=r,r=Z(r);if(!z)return r;if(n){if(r?.nodeType!==Ce){var f=ke();return r===null?s?.after(f):r.before(f),ce(f),f}Je(r)}return ce(r),r}function Cn(e){e.textContent=""}function Ur(){return!1}function zr(e,t,n){return document.createElementNS(t??dn,e,void 0)}function Je(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ce;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Gr(e,t){if(t){const n=document.body;e.autofocus=!0,je(()=>{document.activeElement===n&&e.focus()})}}function $r(e){z&&Oe(e)!==null&&Cn(e)}let ot=!1;function Dn(){ot||(ot=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function Qe(e){var t=v,n=d;$(null),ve(null);try{return e()}finally{$(t),ve(n)}}function Kr(e,t,n,r=n){e.addEventListener(t,()=>Qe(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),Dn()}function It(e){d===null&&(v===null&&fn(),sn()),se&&rn()}function In(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function N(e,t){var n=d;n!==null&&(n.f&F)!==0&&(e|=F);var r={ctx:h,deps:null,nodes:null,f:e|T|O,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},s=r;if((e&ie)!==0)_e!==null?_e.push(r):Y(r);else if(t!==null){try{fe(r)}catch(o){throw G(r),o}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&he)===0&&(s=s.first,(e&K)!==0&&(e&Se)!==0&&s!==null&&(s.f|=Se))}if(s!==null&&(s.parent=n,n!==null&&In(s,n),v!==null&&(v.f&E)!==0&&(e&X)===0)){var f=v;(f.effects??=[]).push(s)}return r}function Pt(){return v!==null&&!P}function Pn(e){const t=N(ue,null);return w(t,y),t.teardown=e,t}function Mn(e){It();var t=d.f,n=!v&&(t&L)!==0&&(t&de)===0;if(n){var r=h;(r.e??=[]).push(e)}else return Mt(e)}function Mt(e){return N(ie|dt,e)}function Xr(e){return It(),N(ue|dt,e)}function Zr(e){ae.ensure();const t=N(X|he,e);return()=>{G(t)}}function Wr(e){ae.ensure();const t=N(X|he,e);return(n={})=>new Promise(r=>{n.outro?Yn(t,()=>{G(t),r(void 0)}):(G(t),r(void 0))})}function Jr(e){return N(ie,e)}function Qr(e,t){var n=h,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Ft(()=>{e(),!r.ran&&(r.ran=!0,Pe(t))})}function es(){var e=h;Ft(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&y)!==0&&n.deps!==null&&w(n,M),pe(n)&&fe(n),t.ran=!1}})}function Fn(e){return N(Ue|he,e)}function Ft(e,t=0){return N(ue|t,e)}function ts(e,t=[],n=[],r=[]){xt(r,t,n,s=>{N(ue,()=>e(...s.map(ee)))})}function ns(e,t=[],n=[],r=[]){if(n.length>0||r.length>0)var s=St();xt(r,t,n,f=>{N(ie,()=>e(...f.map(ee))),s&&s()})}function rs(e,t=0){var n=N(K|t,e);return n}function ss(e,t=0){var n=N(Be|t,e);return n}function fs(e){return N(L|he,e)}function Lt(e){var t=e.teardown;if(t!==null){const n=se,r=v;ut(!0),$(null);try{t.call(null)}finally{ut(n),$(r)}}}function et(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Qe(()=>{s.abort(W)});var r=n.next;(n.f&X)!==0?n.parent=null:G(n,t),n=r}}function Ln(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&L)===0&&G(t),t=n}}function G(e,t=!0){var n=!1;(t||(e.f&tn)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(jn(e.nodes.start,e.nodes.end),n=!0),et(e,t&&!n),Ee(e,0),w(e,V);var r=e.nodes&&e.nodes.t;if(r!==null)for(const f of r)f.stop();Lt(e);var s=e.parent;s!==null&&s.first!==null&&jt(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function jn(e,t){for(;e!==null;){var n=e===t?null:Z(e);e.remove(),e=n}}function jt(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Yn(e,t,n=!0){var r=[];Yt(e,r,!0);var s=()=>{n&&G(e),t&&t()},f=r.length;if(f>0){var o=()=>--f||s();for(var l of r)l.out(o)}else s()}function Yt(e,t,n){if((e.f&F)===0){e.f^=F;var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)(l.is_global||n)&&t.push(l);for(var s=e.first;s!==null;){var f=s.next,o=(s.f&Se)!==0||(s.f&L)!==0&&(e.f&K)!==0;Yt(s,t,o?n:!1),s=f}}}function is(e){qt(e,!0)}function qt(e,t){if((e.f&F)!==0){e.f^=F,(e.f&y)===0&&(w(e,T),Y(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Se)!==0||(n.f&L)!==0;qt(n,s?t:!1),n=r}var f=e.nodes&&e.nodes.t;if(f!==null)for(const o of f)(o.is_global||t)&&o.in()}}function as(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:Z(n);t.append(n),n=s}}let xe=!1,se=!1;function ut(e){se=e}let v=null,P=!1;function $(e){v=e}let d=null;function ve(e){d=e}let C=null;function Ht(e){v!==null&&(C===null?C=[e]:C.push(e))}let x=null,R=0,k=null;function qn(e){k=e}let Vt=1,Q=0,ne=Q;function ct(e){ne=e}function Bt(){return++Vt}function pe(e){var t=e.f;if((t&T)!==0)return!0;if(t&E&&(e.f&=~re),(t&M)!==0){for(var n=e.deps,r=n.length,s=0;s<r;s++){var f=n[s];if(pe(f)&&Rt(f),f.wv>e.wv)return!0}(t&O)!==0&&I===null&&w(e,y)}return!1}function Ut(e,t,n=!0){var r=e.reactions;if(r!==null&&!(C!==null&&oe.call(C,e)))for(var s=0;s<r.length;s++){var f=r[s];(f.f&E)!==0?Ut(f,t,!1):t===f&&(n?w(f,T):(f.f&y)!==0&&w(f,M),Y(f))}}function zt(e){var t=x,n=R,r=k,s=v,f=C,o=h,l=P,i=ne,a=e.f;x=null,R=0,k=null,v=(a&(L|X))===0?e:null,C=null,Re(e.ctx),P=!1,ne=++Q,e.ac!==null&&(Qe(()=>{e.ac.abort(W)}),e.ac=null);try{e.f|=Le;var u=e.fn,c=u();e.f|=de;var _=e.deps,m=b?.is_fork;if(x!==null){var p;if(m||Ee(e,R),_!==null&&R>0)for(_.length=R+x.length,p=0;p<x.length;p++)_[R+p]=x[p];else e.deps=_=x;if(Pt()&&(e.f&O)!==0)for(p=R;p<_.length;p++)(_[p].reactions??=[]).push(e)}else!m&&_!==null&&R<_.length&&(Ee(e,R),_.length=R);if(Te()&&k!==null&&!P&&_!==null&&(e.f&(E|M|T))===0)for(p=0;p<k.length;p++)Ut(k[p],e);if(s!==null&&s!==e){if(Q++,s.deps!==null)for(let D=0;D<n;D+=1)s.deps[D].rv=Q;if(t!==null)for(const D of t)D.rv=Q;k!==null&&(r===null?r=k:r.push(...k))}return(e.f&B)!==0&&(e.f^=B),c}catch(D){return bn(D)}finally{e.f^=Le,x=t,R=n,k=r,v=s,C=f,Re(o),P=l,ne=i}}function Hn(e,t){let n=t.reactions;if(n!==null){var r=Xt.call(n,e);if(r!==-1){var s=n.length-1;s===0?n=t.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(t.f&E)!==0&&(x===null||!oe.call(x,t))){var f=t;(f.f&O)!==0&&(f.f^=O,f.f&=~re),Ke(f),Rn(f),Ee(f,0)}}function Ee(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Hn(e,n[r])}function fe(e){var t=e.f;if((t&V)===0){w(e,y);var n=d,r=xe;d=e,xe=!0;try{(t&(K|Be))!==0?Ln(e):et(e),Lt(e);var s=zt(e);e.teardown=typeof s=="function"?s:null,e.wv=Vt;var f}finally{xe=r,d=n}}}async function ls(){await Promise.resolve(),gn()}function os(){return ae.ensure().settled()}function ee(e){var t=e.f,n=(t&E)!==0;if(v!==null&&!P){var r=d!==null&&(d.f&V)!==0;if(!r&&(C===null||!oe.call(C,e))){var s=v.deps;if((v.f&Le)!==0)e.rv<Q&&(e.rv=Q,x===null&&s!==null&&s[R]===e?R++:x===null?x=[e]:x.push(e));else{(v.deps??=[]).push(e);var f=e.reactions;f===null?e.reactions=[v]:oe.call(f,v)||f.push(v)}}}if(se&&U.has(e))return U.get(e);if(n){var o=e;if(se){var l=o.v;return((o.f&y)===0&&o.reactions!==null||$t(o))&&(l=Ze(o)),U.set(o,l),l}var i=(o.f&O)===0&&!P&&v!==null&&(xe||(v.f&O)!==0),a=(o.f&de)===0;pe(o)&&(i&&(o.f|=O),Rt(o)),i&&!a&&(Nt(o),Gt(o))}if(I?.has(e))return I.get(e);if((e.f&B)!==0)throw e.v;return e.v}function Gt(e){if(e.f|=O,e.deps!==null)for(const t of e.deps)(t.reactions??=[]).push(e),(t.f&E)!==0&&(t.f&O)===0&&(Nt(t),Gt(t))}function $t(e){if(e.v===g)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(U.has(t)||(t.f&E)!==0&&$t(t))return!0;return!1}function Pe(e){var t=P;try{return P=!0,e()}finally{P=t}}function us(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(te in e)Ve(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&te in n&&Ve(n)}}}function Ve(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{Ve(e[r],t)}catch{}const n=_t(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Zt(n);for(let s in r){const f=r[s].get;if(f)try{f.call(e)}catch{}}}}}function Vn(e,t,n){if(e==null)return t(void 0),ye;const r=Pe(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const le=[];function cs(e,t=ye){let n=null;const r=new Set;function s(l){if(bt(e,l)&&(e=l,n)){const i=!le.length;for(const a of r)a[1](),le.push(a,e);if(i){for(let a=0;a<le.length;a+=2)le[a][0](le[a+1]);le.length=0}}}function f(l){s(l(e))}function o(l,i=ye){const a=[l,i];return r.add(a),r.size===1&&(n=t(s,f)||ye),l(e),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:s,update:f,subscribe:o}}function _s(e){let t;return Vn(e,n=>t=n)(),t}function Bn(e){h===null&&ze(),me&&h.l!==null?Un(h).m.push(e):Mn(()=>{const t=Pe(e);if(typeof t=="function")return t})}function vs(e){h===null&&ze(),Bn(()=>()=>Pe(e))}function Un(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{_s as $,Z as A,Oe as B,ht as C,we as D,Se as E,rr as F,be as G,cn as H,se as I,d as J,V as K,vr as L,Pe as M,me as N,cr as O,_r as P,ur as Q,Xe as R,An as S,$n as T,te as U,Wn as V,dr as W,We as X,ve as Y,ye as Z,Vn as _,es as a,ae as a$,Pn as a0,Gn as a1,Vr as a2,Br as a3,Fr as a4,h as a5,Xr as a6,Kn as a7,Qt as a8,kr as a9,Ft as aA,gn as aB,Bn as aC,ls as aD,vs as aE,Xn as aF,Or as aG,lt as aH,Kr as aI,ft as aJ,ss as aK,Er as aL,Yr as aM,xt as aN,dn as aO,_t as aP,Jn as aQ,gr as aR,Zt as aS,er as aT,Gr as aU,g as aV,Dn as aW,Pt as aX,Fe as aY,en as aZ,br as a_,ns as aa,kn as ab,_n as ac,vn as ad,He as ae,b as af,Zn as ag,fs as ah,tr as ai,Ur as aj,Kt as ak,zn as al,fr as am,or as an,ir as ao,is as ap,Yn as aq,F as ar,L as as,Cn as at,G as au,je as av,ar as aw,lr as ax,as as ay,Jr as az,Mr as b,w as b0,T as b1,Y as b2,M as b3,yn as b4,$ as b5,Re as b6,bn as b7,v as b8,Ne as b9,cs as bA,os as bB,sr as ba,mr as bb,Qe as bc,zr as bd,On as be,hr as bf,pr as bg,Ce as bh,Je as bi,de as bj,qr as bk,Ge as bl,nr as bm,Wr as bn,$e as bo,Dr as bp,Cr as bq,$r as br,Te as bs,Ir as bt,Wt as bu,ne as bv,Zr as bw,jn as bx,wr as by,yr as bz,Hr as c,us as d,rs as e,Ar as f,ee as g,z as h,Nr as i,Rr as j,ce as k,Qr as l,Lr as m,Sr as n,Tr as o,Pr as p,S as q,xr as r,H as s,ts as t,Mn as u,jr as v,q as w,ke as x,tn as y,he as z};
@@ -1 +0,0 @@
1
- import{a5 as d,a6 as g,u as c,M as m,a7 as b,a8 as i,g as p,d as v,R as h,a9 as k}from"./C3uBrOS5.js";function x(a=!1){const s=d,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(a){let n=0,t={};const _=h(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==t[o]&&(t[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&g(()=>{u(s,f),i(e.b)}),c(()=>{const n=m(()=>e.m.map(b));return()=>{for(const t of n)typeof t=="function"&&t()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(a,s){if(a.l.s)for(const e of a.l.s)p(e);s()}k();export{x as i};
@@ -1 +0,0 @@
1
- import{E as C,V as S,a as o,W as g}from"./DnL9f0lc.js";import{r as y}from"./CWyU-seV.js";import{syntaxTree as E}from"./wDIGUaoU.js";class W extends g{toDOM(){const e=document.createElement("span");return e.className="cm-bullet-widget",e.textContent="•",e}}class L extends g{constructor(e){super(),this.num=e}eq(e){return this.num===e.num}toDOM(){const e=document.createElement("span");return e.className="cm-ordered-widget",e.textContent=this.num+" ",e}}class M extends g{toDOM(){const e=document.createElement("div");return e.className="cm-hr-widget",e}}class T extends g{toDOM(){const e=document.createElement("span");return e.textContent="—",e}}class D extends g{constructor(e){super(),this.char=e}eq(e){return this.char===e.char}toDOM(){const e=document.createElement("span");return e.textContent=this.char,e}}class O extends g{constructor(e,l){super(),this.alt=e,this.url=l}eq(e){return this.alt===e.alt&&this.url===e.url}toDOM(){const e=document.createElement("div");e.className="cm-image-widget";const l=document.createElement("img");return l.src=this.url,l.alt=this.alt,l.loading="lazy",l.onerror=()=>{e.textContent=`[Image not found: ${this.alt||this.url}]`,e.className="cm-image-error"},e.appendChild(l),e}ignoreEvent(e){return e.type==="mousedown"}}class F extends g{constructor(e,l,s){super(),this.text=e,this.className=l,this.entityId=s}eq(e){return this.text===e.text&&this.className===e.className&&this.entityId===e.entityId}toDOM(){const e=document.createElement("span");return e.className=this.className,e.textContent=this.text,e.dataset.entityId=this.entityId,e.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.dispatchEvent(new CustomEvent("wikilink-click",{bubbles:!0,detail:this.entityId}))}),e}ignoreEvent(e){return e.type==="mousedown"}}function I(r){return r.doc.lineAt(r.selection.main.head).number}function u(r,e,l){const s=r.selection.main.head;return s>=e&&s<=l}function x(r,e,l,s,d=!0){const t=r.from>0?e.doc.sliceString(r.from-1,r.from):"",f=r.to<e.doc.length?e.doc.sliceString(r.to,r.to+1):"";if(t!=="["||f!=="]")return!1;const i=r.from-1,n=r.to+1,a=e.doc.sliceString(r.from+1,r.to-1),m=y(a),c=m?"cm-live-wikilink cm-wikilink-active":"cm-live-wikilink cm-wikilink-inactive",h=s?`${c} ${s}`:c;if(!d||!u(e,i,n)){const p=m?m.title:a.replace(/-/g," ").replace(/\b\w/g,k=>k.toUpperCase());l.push(o.replace({widget:new F(p,h,a)}).range(i,n))}else l.push(o.mark({class:h}).range(i,n));return!0}function b(r){const e=r.state,l=r.hasFocus?I(e):-1,s=[];E(e).iterate({enter(t){const f=e.doc.lineAt(t.from).number;if(t.name.startsWith("ATXHeading")){const n=`cm-live-heading cm-live-heading-${parseInt(t.name.replace("ATXHeading",""),10)||1}`;if(s.push(o.mark({class:n}).range(t.from,t.to)),f!==l){let a=t.node.firstChild;for(;a;){if(a.name==="HeaderMark"){const m=Math.min(a.to+1,t.to);s.push(o.replace({}).range(a.from,m))}else a.name==="Link"&&x(a,e,s,n,r.hasFocus);a=a.nextSibling}}return!1}if(t.name==="HorizontalRule"&&f!==l&&s.push(o.replace({widget:new M}).range(t.from,t.to)),t.name==="ListMark"&&f!==l){const i=Math.min(t.to+1,e.doc.lineAt(t.from).to);if(t.node.parent?.parent?.name==="OrderedList"){const m=e.doc.sliceString(t.from,t.to);s.push(o.replace({widget:new L(m)}).range(t.from,i))}else s.push(o.replace({widget:new W}).range(t.from,i));const a=e.doc.lineAt(t.from);s.push(o.line({class:"cm-list-line"}).range(a.from))}if(t.name==="StrongEmphasis"){if(!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild,n=!1;for(;i;)i.name==="Link"&&(n=x(i,e,s,"cm-live-strong",r.hasFocus)),i=i.nextSibling;for(n||s.push(o.mark({class:"cm-live-strong"}).range(t.from,t.to)),i=t.node.firstChild;i;)i.name==="EmphasisMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}else s.push(o.mark({class:"cm-live-strong"}).range(t.from,t.to));return!1}if(t.name==="Emphasis"){if(!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild,n=!1;for(;i;)i.name==="Link"&&(n=x(i,e,s,"cm-live-em",r.hasFocus)),i=i.nextSibling;for(n||s.push(o.mark({class:"cm-live-em"}).range(t.from,t.to)),i=t.node.firstChild;i;)i.name==="EmphasisMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}else s.push(o.mark({class:"cm-live-em"}).range(t.from,t.to));return!1}if(t.name==="InlineCode"){if(s.push(o.mark({class:"cm-live-code"}).range(t.from,t.to)),!r.hasFocus||!u(e,t.from,t.to)){let i=t.node.firstChild;for(;i;)i.name==="CodeMark"&&s.push(o.replace({}).range(i.from,i.to)),i=i.nextSibling}return!1}if(t.name==="Link"){const i=e.doc.sliceString(t.from,t.to);if(x(t,e,s,void 0,r.hasFocus))return!1;if(i.includes("](")){let n=t.node.firstChild;const a=[];let m=null;for(;n;)n.name==="LinkMark"&&a.push({from:n.from,to:n.to}),n.name==="URL"&&(m={from:n.from,to:n.to}),n=n.nextSibling;const c=m?e.doc.sliceString(m.from,m.to):"";return s.push(o.mark({class:"cm-live-link",attributes:c?{"data-href":c}:{}}).range(t.from,t.to)),(!r.hasFocus||!u(e,t.from,t.to))&&a.length>=2&&m&&(s.push(o.replace({}).range(a[0].from,a[0].to)),s.push(o.replace({}).range(a[1].from,t.to))),!1}}if(t.name==="Image"){if(!r.hasFocus||!u(e,t.from,t.to)){const n=e.doc.sliceString(t.from,t.to).match(/!\[([^\]]*)\]/),a=n?n[1]:"";let m="",c=t.node.firstChild;for(;c;)c.name==="URL"&&(m=e.doc.sliceString(c.from,c.to)),c=c.nextSibling;m&&s.push(o.replace({widget:new O(a,m)}).range(t.from,t.to))}else s.push(o.mark({class:"cm-image-raw"}).range(t.from,t.to));return!1}}});const d=e.doc;for(let t=1;t<=d.lines;t++){if(t===l)continue;const f=d.line(t),i=f.text,n=i.trim(),a=/^-{3,}$/.test(n)||/^\*{3,}$/.test(n)||/^_{3,}$/.test(n);let m=0;for(;!a&&(m=i.indexOf("--",m))!==-1;){const c=f.from+m,h=c+2;u(e,c,h)||s.push(o.replace({widget:new T}).range(c,h)),m+=2}for(let c=0;c<i.length;c++){const h=i[c];if(h!=='"'&&h!=="'")continue;const p=f.from+c;if(u(e,p,p+1))continue;const k=c>0?i[c-1]:"",v=!k||/[\s([\-—]/.test(k);let w;h==='"'?w=v?"“":"”":w=v?"‘":"’",s.push(o.replace({widget:new D(w)}).range(p,p+1))}}return o.set(s,!0)}const $=S.fromClass(class{decorations;constructor(r){this.decorations=b(r)}update(r){(r.docChanged||r.selectionSet||r.viewportChanged||r.focusChanged)&&(this.decorations=b(r.view))}},{decorations:r=>r.decorations}),A=C.baseTheme({".cm-live-heading":{fontWeight:"600"},".cm-live-heading-1":{fontSize:"1.5em"},".cm-live-heading-2":{fontSize:"1.2em"},".cm-live-heading-3":{fontSize:"1.05em"},".cm-live-strong":{fontWeight:"600"},".cm-live-em":{fontStyle:"italic"},".cm-live-code":{fontFamily:"monospace",fontSize:"0.9em",padding:"1px 4px",borderRadius:"3px",backgroundColor:"rgba(128,128,128,0.12)"},".cm-live-wikilink":{borderRadius:"3px"},".cm-wikilink-active":{color:"var(--color-accent, #e05050)",cursor:"pointer",textDecoration:"none"},".cm-wikilink-active:hover":{textDecoration:"underline"},".cm-wikilink-inactive":{color:"var(--color-text-tertiary)"},".cm-live-link":{color:"var(--color-link, #e07070)",textDecoration:"none",cursor:"pointer"},".cm-live-link:hover":{textDecoration:"underline"},".cm-bullet-widget":{color:"var(--color-text-tertiary)",display:"inline-block",width:"16px",marginLeft:"-16px"},".cm-ordered-widget":{color:"var(--color-text-tertiary)",display:"inline-block",width:"20px",marginLeft:"-20px"},".cm-list-line":{paddingLeft:"20px"},".cm-hr-widget":{borderTop:"1px solid var(--color-border, #333)",margin:"8px 0"},".cm-image-widget":{display:"block",lineHeight:"0"},".cm-image-widget img":{maxWidth:"100%",borderRadius:"4px"},".cm-image-error":{color:"var(--color-text-tertiary)",fontSize:"13px",fontStyle:"italic"},".cm-image-raw":{color:"var(--color-text-tertiary)"}});export{$ as livePreviewPlugin,A as livePreviewTheme};
@@ -1 +0,0 @@
1
- import{s as n,g as e,v as M,w as i}from"./C3uBrOS5.js";import{g as $}from"./BEn6N5c2.js";import{c as v}from"./BhlvzGQx.js";import{apiFetch as I}from"./DFYOFE3o.js";let o=i("idle"),g=i(!1),u=i(null),d=i(null),c=i(null),s=i(""),f=i(null),m=i(0),p=null;const q={get state(){return e(o)},get isElectron(){return e(g)},get activeEntityId(){return e(u)},get activeRepo(){return e(d)},get meetingTitle(){return e(s)},get platform(){return e(f)},get elapsedSeconds(){return e(m)},get recordingStartTime(){return e(c)},handleElectronReady(){n(g,!0),console.log("[Meeting] Electron detected")},async handleRecordingStarted(t){if(e(o)!=="idle")return;const r=t.repo||await R();if(!r){console.error("[Meeting] No collection configured for meetings");return}n(s,t.meetingTitle||"",!0),n(f,t.platform||null,!0),n(d,r,!0),n(c,new Date,!0),n(o,"recording"),n(m,0),p=setInterval(()=>{M(m)},1e3);const l=T(e(s)||"Meeting",e(c));try{await v(r,"meeting",l,{name:e(s)||`Meeting ${h(e(c))}`,date:e(c).toISOString().slice(0,10),attendees:(t.attendees||[]).filter(a=>!a.isSelf).map(a=>`[[${S(a.name)}]]`),tags:["auto-transcribed",t.platform].filter(Boolean)},""),n(u,l,!0),$(`/${r}/meeting/${l}`),window.postMessage({type:"sg:entity-created",repo:r,entityType:"meeting",entityId:l},"*"),console.log(`[Meeting] Created entity ${l}, navigating`)}catch(a){console.error("[Meeting] Failed to create entity:",a),n(o,"idle"),y()}},async handleRecordingStopped(t){if(e(o)!=="recording")return;n(o,"stopping"),y();const r=E();window.postMessage({type:"sg:stop-ack",entityId:e(u),repo:e(d),memo:r},"*"),n(o,"processing"),console.log(`[Meeting] Stop acknowledged, memo length: ${r.length}`)},startRecording(){e(g)&&window.postMessage({type:"sg:start-recording"},"*")},stopRecording(){!e(g)||e(o)!=="recording"||window.postMessage({type:"sg:stop-recording"},"*")},reset(){n(o,"idle"),n(u,null),n(d,null),n(c,null),n(s,""),n(f,null),n(m,0),y()}};function y(){p&&(clearInterval(p),p=null)}function S(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function T(t,r){const l=r.toISOString().slice(0,10),a=r.toTimeString().slice(0,5).replace(":",""),w=S(t);return`${l}-${w}-${a}`}function h(t){return t.toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function E(){const t=document.querySelector(".cm-content");if(t)return t.textContent||"";const r=document.querySelector(".entity-editor textarea");return r?r.value:""}async function R(){try{const t=await I("/api/preferences/settings");if(t.default_meeting_collection)return t.default_meeting_collection}catch{}return null}export{q as m};
@@ -1 +0,0 @@
1
- import{w as S,G as y,s as f,g as e,p as k,l as _,d as c,a as B,c as g,n as D,r as v,b as F,m as h,t as G}from"./C3uBrOS5.js";import{apiFetch as H}from"./DFYOFE3o.js";import{r as N}from"./UwYfmrPx.js";import"./DsnmJJEf.js";import{i as P}from"./C8R1sDpW.js";import{a as b,s as R,f as z}from"./W25ZVI8L.js";import{i as Y}from"./D5aIYSkd.js";import{a as j}from"./DkoHPElM.js";import{l as w,p as x}from"./FBn-ES5k.js";let p=S(y({}));async function d(){try{const{colors:a}=await H("/api/auth/colors");f(p,a,!0)}catch{}}function q(a){return e(p)[String(a)]??null}d();N.addConnectHandler(()=>d());const X={getColor:q,load:d,get colors(){return e(p)}},Z=y({count:null});var E=z("<title> </title>"),I=z('<svg><!><path d="M24.59 16.59 17 24.17 17 4 15 4 15 24.17 7.41 16.59 6 18 16 28 26 18 24.59 16.59z"></path></svg>');function tt(a,r){const t=w(r,["children","$$slots","$$events","$$legacy"]),C=w(t,["size","title"]);k(r,!1);const s=h(),u=h();let m=x(r,"size",8,16),o=x(r,"title",8,void 0);_(()=>(c(t),c(o())),()=>{f(s,t["aria-label"]||t["aria-labelledby"]||o())}),_(()=>(e(s),c(t)),()=>{f(u,{"aria-hidden":e(s)?void 0:!0,role:e(s)?"img":void 0,focusable:Number(t.tabindex)===0?!0:void 0})}),B(),P();var i=I();j(i,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:m(),height:m(),...e(u),...C}));var $=g(i);{var A=l=>{var n=E(),M=g(n,!0);v(n),G(()=>R(M,o())),b(l,n)};Y($,l=>{o()&&l(A)})}D(),v(i),b(a,i),F()}export{tt as A,Z as f,X as u};
@@ -1,5 +0,0 @@
1
- const T=()=>new Map,en=e=>{const t=T();return e.forEach((n,s)=>{t.set(s,n)}),t},R=(e,t,n)=>{let s=e.get(t);return s===void 0&&e.set(t,s=n()),s},Pr=(e,t)=>{const n=[];for(const[s,r]of e)n.push(t(r,s));return n},Zr=(e,t)=>{for(const[n,s]of e)if(t(s,n))return!0;return!1},Et=()=>new Set,He=e=>e[e.length-1],Qr=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},st=Array.from,fn=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},gn=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},ti=(e,t)=>{const n=new Array(e);for(let s=0;s<e;s++)n[s]=t(s,n);return n},Mt=Array.isArray;class pn{constructor(){this._observers=T()}on(t,n){return R(this._observers,t,Et).add(n),n}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return st((this._observers.get(t)||T()).values()).forEach(s=>s(...n))}destroy(){this._observers=T()}}class Ol{constructor(){this._observers=T()}on(t,n){R(this._observers,t,Et).add(n)}once(t,n){const s=(...r)=>{this.off(t,s),n(...r)};this.on(t,s)}off(t,n){const s=this._observers.get(t);s!==void 0&&(s.delete(n),s.size===0&&this._observers.delete(t))}emit(t,n){return st((this._observers.get(t)||T()).values()).forEach(s=>s(...n))}destroy(){this._observers=T()}}const q=Math.floor,ge=Math.abs,ks=(e,t)=>e<t?e:t,Tt=(e,t)=>e>t?e:t,ys=e=>e!==0?e<0:1/e<0,Jn=1,Hn=2,Ye=4,Xe=8,Ht=32,et=64,B=128,Ie=31,nn=63,kt=127,ei=2147483647,ye=Number.MAX_SAFE_INTEGER,Yn=Number.MIN_SAFE_INTEGER,ni=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&q(e)===e),si=String.fromCharCode,ri=e=>e.toLowerCase(),ii=/^\s*/g,oi=e=>e.replace(ii,""),ci=/([A-Z])/g,Xn=(e,t)=>oi(e.replace(ci,n=>`${t}${ri(n)}`)),li=e=>{const t=unescape(encodeURIComponent(e)),n=t.length,s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=t.codePointAt(r);return s},Yt=typeof TextEncoder<"u"?new TextEncoder:null,hi=e=>Yt.encode(e),ai=Yt?hi:li;let Jt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Jt&&Jt.decode(new Uint8Array).length===1&&(Jt=null);const _s=(e,t)=>ti(t,()=>e).join("");class oe{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Bt=()=>new oe,ui=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},z=e=>{const t=new Uint8Array(ui(e));let n=0;for(let s=0;s<e.bufs.length;s++){const r=e.bufs[s];t.set(r,n),n+=r.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},di=(e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(Tt(n,t)*2),e.cpos=0)},I=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},Xt=I,p=(e,t)=>{for(;t>kt;)I(e,B|kt&t),t=q(t/128);I(e,kt&t)},Te=(e,t)=>{const n=ys(t);for(n&&(t=-t),I(e,(t>nn?B:0)|(n?et:0)|nn&t),t=q(t/64);t>0;)I(e,(t>kt?B:0)|kt&t),t=q(t/128)},sn=new Uint8Array(3e4),fi=sn.length/3,gi=(e,t)=>{if(t.length<fi){const n=Yt.encodeInto(t,sn).written||0;p(e,n);for(let s=0;s<n;s++)I(e,sn[s])}else V(e,ai(t))},pi=(e,t)=>{const n=unescape(encodeURIComponent(t)),s=n.length;p(e,s);for(let r=0;r<s;r++)I(e,n.codePointAt(r))},yt=Yt&&Yt.encodeInto?gi:pi,wi=(e,t)=>ce(e,z(t)),ce=(e,t)=>{const n=e.cbuf.length,s=e.cpos,r=ks(n-s,t.length),i=t.length-r;e.cbuf.set(t.subarray(0,r),s),e.cpos+=r,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(Tt(n*2,i)),e.cbuf.set(t.subarray(r)),e.cpos=i)},V=(e,t)=>{p(e,t.byteLength),ce(e,t)},wn=(e,t)=>{di(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},mi=(e,t)=>wn(e,4).setFloat32(0,t,!1),ki=(e,t)=>wn(e,8).setFloat64(0,t,!1),yi=(e,t)=>wn(e,8).setBigInt64(0,t,!1),Kn=new DataView(new ArrayBuffer(4)),_i=e=>(Kn.setFloat32(0,e),Kn.getFloat32(0)===e),Kt=(e,t)=>{switch(typeof t){case"string":I(e,119),yt(e,t);break;case"number":ni(t)&&ge(t)<=ei?(I(e,125),Te(e,t)):_i(t)?(I(e,124),mi(e,t)):(I(e,123),ki(e,t));break;case"bigint":I(e,122),yi(e,t);break;case"object":if(t===null)I(e,126);else if(Mt(t)){I(e,117),p(e,t.length);for(let n=0;n<t.length;n++)Kt(e,t[n])}else if(t instanceof Uint8Array)I(e,116),V(e,t);else{I(e,118);const n=Object.keys(t);p(e,n.length);for(let s=0;s<n.length;s++){const r=n[s];yt(e,r),Kt(e,t[r])}}break;case"boolean":I(e,t?120:121);break;default:I(e,127)}};class Wn extends oe{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&p(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const qn=e=>{e.count>0&&(Te(e.encoder,e.count===1?e.s:-e.s),e.count>1&&p(e.encoder,e.count-2))};class pe{constructor(){this.encoder=new oe,this.s=0,this.count=0}write(t){this.s===t?this.count++:(qn(this),this.count=1,this.s=t)}toUint8Array(){return qn(this),z(this.encoder)}}const Pn=e=>{if(e.count>0){const t=e.diff*2+(e.count===1?0:1);Te(e.encoder,t),e.count>1&&p(e.encoder,e.count-2)}};class Ke{constructor(){this.encoder=new oe,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Pn(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Pn(this),z(this.encoder)}}class bi{constructor(){this.sarr=[],this.s="",this.lensE=new pe}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new oe;return this.sarr.push(this.s),this.s="",yt(t,this.sarr.join("")),ce(t,this.lensE.toUint8Array()),z(t)}}const P=e=>new Error(e),X=()=>{throw P("Method unimplemented")},v=()=>{throw P("Unexpected case")},bs=P("Unexpected end of array"),Ss=P("Integer out of Range");class xe{constructor(t){this.arr=t,this.pos=0}}const L=e=>new xe(e),Es=e=>e.pos!==e.arr.length,Si=(e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},F=e=>Si(e,m(e)),Nt=e=>e.arr[e.pos++],m=e=>{let t=0,n=1;const s=e.arr.length;for(;e.pos<s;){const r=e.arr[e.pos++];if(t=t+(r&kt)*n,n*=128,r<B)return t;if(t>ye)throw Ss}throw bs},Oe=e=>{let t=e.arr[e.pos++],n=t&nn,s=64;const r=(t&et)>0?-1:1;if((t&B)===0)return r*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n=n+(t&kt)*s,s*=128,t<B)return r*n;if(n>ye)throw Ss}throw bs},Ul=e=>{const t=e.pos,n=m(e);return e.pos=t,n},Ei=e=>{let t=m(e);if(t===0)return"";{let n=String.fromCodePoint(Nt(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(Nt(e));else for(;t>0;){const s=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+s);e.pos+=s,n+=String.fromCodePoint.apply(null,r),t-=s}return decodeURIComponent(escape(n))}},Ci=e=>Jt.decode(F(e)),_t=Jt?Ci:Ei,mn=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},Di=e=>mn(e,4).getFloat32(0,!1),Ai=e=>mn(e,8).getFloat64(0,!1),Ii=e=>mn(e,8).getBigInt64(0,!1),Ti=[e=>{},e=>null,Oe,Di,Ai,Ii,e=>!1,e=>!0,_t,e=>{const t=m(e),n={};for(let s=0;s<t;s++){const r=_t(e);n[r]=Wt(e)}return n},e=>{const t=m(e),n=[];for(let s=0;s<t;s++)n.push(Wt(e));return n},F],Wt=e=>Ti[127-Nt(e)](e);class Zn extends xe{constructor(t,n){super(t),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Es(this)?this.count=m(this)+1:this.count=-1),this.count--,this.s}}class we extends xe{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=Oe(this);const t=ys(this.s);this.count=1,t&&(this.s=-this.s,this.count=m(this)+2)}return this.count--,this.s}}class We extends xe{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=Oe(this),n=t&1;this.diff=q(t/2),this.count=1,n&&(this.count=m(this)+2)}return this.s+=this.diff,this.count--,this.s}}class xi{constructor(t){this.decoder=new we(t),this.str=_t(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),n=this.str.slice(this.spos,t);return this.spos=t,n}}const Oi=crypto.getRandomValues.bind(crypto),Cs=()=>Oi(new Uint32Array(1))[0],Ui="10000000-1000-4000-8000"+-1e11,vi=()=>Ui.replace(/[018]/g,e=>(e^Cs()&15>>e/4).toString(16)),Li=Date.now,Qn=e=>new Promise(e);Promise.all.bind(Promise);const ts=e=>e===void 0?null:e;class Mi{constructor(){this.map=new Map}setItem(t,n){this.map.set(t,n)}getItem(t){return this.map.get(t)}}let Ds=new Mi,Ni=!0;try{typeof localStorage<"u"&&localStorage&&(Ds=localStorage,Ni=!1)}catch{}const Ri=Ds,qt=Symbol("Equality"),As=(e,t)=>e===t||!!e?.[qt]?.(t)||!1,$i=e=>typeof e=="object",Vi=Object.assign,Fi=Object.keys,Bi=(e,t)=>{for(const n in e)t(e[n],n)},_e=e=>Fi(e).length,ji=e=>{for(const t in e)return!1;return!0},le=(e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0},kn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),zi=(e,t)=>e===t||_e(e)===_e(t)&&le(e,(n,s)=>(n!==void 0||kn(t,s))&&As(t[s],n)),Gi=Object.freeze,Is=e=>{for(const t in e){const n=e[t];(typeof n=="object"||typeof n=="function")&&Is(e[t])}return Gi(e)},yn=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&yn(e,t,n+1)}},Ts=e=>e,me=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[qt]!=null)return e[qt](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break}case Set:{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break}case Map:{if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!me(e.get(n),t.get(n)))return!1;break}case void 0:case Object:if(_e(e)!==_e(t))return!1;for(const n in e)if(!kn(e,n)||!me(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!me(e[n],t[n]))return!1;break;default:return!1}return!0},Ji=(e,t)=>t.includes(e);var xs={};const Pt=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let W;const Hi=()=>{if(W===void 0)if(Pt){W=T();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const s=e[n];s[0]==="-"?(t!==null&&W.set(t,""),t=s):t!==null&&(W.set(t,s),t=null)}t!==null&&W.set(t,"")}else typeof location=="object"?(W=T(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){const[t,n]=e.split("=");W.set(`--${Xn(t,"-")}`,n),W.set(`-${Xn(t,"-")}`,n)}})):W=T();return W},rn=e=>Hi().has(e),be=e=>ts(Pt?xs[e.toUpperCase().replaceAll("-","_")]:Ri.getItem(e)),Os=e=>rn("--"+e)||be(e)!==null,Yi=Os("production"),Xi=Pt&&Ji(xs.FORCE_COLOR,["true","1","2"]),Ki=Xi||!rn("--no-colors")&&!Os("no-color")&&(!Pt||process.stdout.isTTY)&&(!Pt||rn("--color")||be("COLORTERM")!==null||(be("TERM")||"").includes("color")),Wi=e=>new Uint8Array(e),qi=e=>{const t=Wi(e.byteLength);return t.set(e),t};class Pi{constructor(t,n){this.left=t,this.right=n}}const tt=(e,t)=>new Pi(e,t),Zi=(e,t)=>e.forEach(n=>t(n.left,n.right)),es=e=>e.next()>=.5,qe=(e,t,n)=>q(e.next()*(n+1-t)+t),Us=(e,t,n)=>q(e.next()*(n+1-t)+t),_n=(e,t,n)=>Us(e,t,n),Qi=e=>si(_n(e,97,122)),to=(e,t=0,n=20)=>{const s=_n(e,t,n);let r="";for(let i=0;i<s;i++)r+=Qi(e);return r},Pe=(e,t)=>t[_n(e,0,t.length-1)],eo=Symbol("0schema");class no{constructor(){this._rerrs=[]}extend(t,n,s,r=null){this._rerrs.push({path:t,expected:n,has:s,message:r})}toString(){const t=[];for(let n=this._rerrs.length-1;n>0;n--){const s=this._rerrs[n];t.push(_s(" ",(this._rerrs.length-n)*2)+`${s.path!=null?`[${s.path}] `:""}${s.has} doesn't match ${s.expected}. ${s.message}`)}return t.join(`
2
- `)}}const on=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[qt]?As(e,t):Mt(e)?fn(e,n=>gn(t,s=>on(n,s))):$i(e)?le(e,(n,s)=>on(n,t[s])):!1;class N{static _dilutes=!1;extends(t){let[n,s]=[this.shape,t.shape];return this.constructor._dilutes&&([s,n]=[n,s]),on(n,s)}equals(t){return this.constructor===t.constructor&&me(this.shape,t.shape)}[eo](){return!0}[qt](t){return this.equals(t)}validate(t){return this.check(t)}check(t,n){X()}get nullable(){return jt(this,Ne)}get optional(){return new Ms(this)}cast(t){return ns(t,this),t}expect(t){return ns(t,this),t}}class bn extends N{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n=void 0){const s=t?.constructor===this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),s}}const D=(e,t=null)=>new bn(e,t);D(bn);class Sn extends N{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape(t);return!s&&n?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),s}}const x=e=>new Sn(e);D(Sn);class Ue extends N{constructor(t){super(),this.shape=t}check(t,n){const s=this.shape.some(r=>r===t);return!s&&n?.extend(null,this.shape.join(" | "),t.toString()),s}}const ve=(...e)=>new Ue(e),vs=D(Ue),so=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),Ls=e=>{if(Rt.check(e))return[so(e)];if(vs.check(e))return e.shape.map(t=>t+"");if(Gs.check(e))return["[+-]?\\d+.?\\d*"];if(Js.check(e))return[".*"];if(Se.check(e))return e.shape.map(Ls).flat(1);v()};class ro extends N{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(Ls).map(n=>`(${n.join("|")})`).join("")+"$")}check(t,n){const s=this._r.exec(t)!=null;return!s&&n?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),s}}D(ro);const io=Symbol("optional");class Ms extends N{constructor(t){super(),this.shape=t}check(t,n){const s=t===void 0||this.shape.check(t);return!s&&n?.extend(null,"undefined (optional)","()"),s}get[io](){return!0}}const oo=D(Ms);class co extends N{check(t,n){return n?.extend(null,"never",typeof t),!1}}D(co);class Le extends N{constructor(t,n=!1){super(),this.shape=t,this._isPartial=n}static _dilutes=!0;get partial(){return new Le(this.shape,!0)}check(t,n){return t==null?(n?.extend(null,"object","null"),!1):le(this.shape,(s,r)=>{const i=this._isPartial&&!kn(t,r)||s.check(t[r],n);return!i&&n?.extend(r.toString(),s.toString(),typeof t[r],"Object property does not match"),i})}}const lo=e=>new Le(e),ho=D(Le),ao=x(e=>e!=null&&(e.constructor===Object||e.constructor==null));class Ns extends N{constructor(t,n){super(),this.shape={keys:t,values:n}}check(t,n){return t!=null&&le(t,(s,r)=>{const i=this.shape.keys.check(r,n);return!i&&n?.extend(r+"","Record",typeof t,i?"Key doesn't match schema":"Value doesn't match value"),i&&this.shape.values.check(s,n)})}}const Rs=(e,t)=>new Ns(e,t),uo=D(Ns);class $s extends N{constructor(t){super(),this.shape=t}check(t,n){return t!=null&&le(this.shape,(s,r)=>{const i=s.check(t[r],n);return!i&&n?.extend(r.toString(),"Tuple",typeof s),i})}}const fo=(...e)=>new $s(e);D($s);class Vs extends N{constructor(t){super(),this.shape=t.length===1?t[0]:new En(t)}check(t,n){const s=Mt(t)&&fn(t,r=>this.shape.check(r));return!s&&n?.extend(null,"Array",""),s}}const Fs=(...e)=>new Vs(e),go=D(Vs),po=x(e=>Mt(e));class Bs extends N{constructor(t,n){super(),this.shape=t,this._c=n}check(t,n){const s=t instanceof this.shape&&(this._c==null||this._c(t));return!s&&n?.extend(null,this.shape.name,t?.constructor.name),s}}const wo=(e,t=null)=>new Bs(e,t);D(Bs);const mo=wo(N);class ko extends N{constructor(t){super(),this.len=t.length-1,this.args=fo(...t.slice(-1)),this.res=t[this.len]}check(t,n){const s=t.constructor===Function&&t.length<=this.len;return!s&&n?.extend(null,"function",typeof t),s}}const yo=D(ko),_o=x(e=>typeof e=="function");class bo extends N{constructor(t){super(),this.shape=t}check(t,n){const s=fn(this.shape,r=>r.check(t,n));return!s&&n?.extend(null,"Intersectinon",typeof t),s}}D(bo,e=>e.shape.length>0);class En extends N{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,n){const s=gn(this.shape,r=>r.check(t,n));return n?.extend(null,"Union",typeof t),s}}const jt=(...e)=>e.findIndex(t=>Se.check(t))>=0?jt(...e.map(t=>Zt(t)).map(t=>Se.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new En(e),Se=D(En),js=()=>!0,Ee=x(js),So=D(Sn,e=>e.shape===js),Cn=x(e=>typeof e=="bigint"),Eo=x(e=>e===Cn),zs=x(e=>typeof e=="symbol");x(e=>e===zs);const Lt=x(e=>typeof e=="number"),Gs=x(e=>e===Lt),Rt=x(e=>typeof e=="string"),Js=x(e=>e===Rt),Me=x(e=>typeof e=="boolean"),Co=x(e=>e===Me),Hs=ve(void 0);D(Ue,e=>e.shape.length===1&&e.shape[0]===void 0);ve(void 0);const Ne=ve(null),Do=D(Ue,e=>e.shape.length===1&&e.shape[0]===null);D(Uint8Array);D(bn,e=>e.shape===Uint8Array);const Ao=jt(Lt,Rt,Ne,Hs,Cn,Me,zs);(()=>{const e=Fs(Ee),t=Rs(Rt,Ee),n=jt(Lt,Rt,Ne,Me,e,t);return e.shape=n,t.shape.values=n,n})();const Zt=e=>{if(mo.check(e))return e;if(ao.check(e)){const t={};for(const n in e)t[n]=Zt(e[n]);return lo(t)}else{if(po.check(e))return jt(...e.map(Zt));if(Ao.check(e))return ve(e);if(_o.check(e))return D(e)}v()},ns=Yi?()=>{}:(e,t)=>{const n=new no;if(!t.check(e,n))throw P(`Expected value to be of type ${t.constructor.name}.
3
- ${n.toString()}`)};class Io{constructor(t){this.patterns=[],this.$state=t}if(t,n){return this.patterns.push({if:Zt(t),h:n}),this}else(t){return this.if(Ee,t)}done(){return(t,n)=>{for(let s=0;s<this.patterns.length;s++){const r=this.patterns[s];if(r.if.check(t))return r.h(t,n)}throw P("Unhandled pattern")}}}const To=e=>new Io(e),Ys=To(Ee).if(Gs,(e,t)=>qe(t,Yn,ye)).if(Js,(e,t)=>to(t)).if(Co,(e,t)=>es(t)).if(Eo,(e,t)=>BigInt(qe(t,Yn,ye))).if(Se,(e,t)=>vt(t,Pe(t,e.shape))).if(ho,(e,t)=>{const n={};for(const s in e.shape){let r=e.shape[s];if(oo.check(r)){if(es(t))continue;r=r.shape}n[s]=Ys(r,t)}return n}).if(go,(e,t)=>{const n=[],s=Us(t,0,42);for(let r=0;r<s;r++)n.push(vt(t,e.shape));return n}).if(vs,(e,t)=>Pe(t,e.shape)).if(Do,(e,t)=>null).if(yo,(e,t)=>{const n=vt(t,e.res);return()=>n}).if(So,(e,t)=>vt(t,Pe(t,[Lt,Rt,Ne,Hs,Cn,Me,Fs(Lt),Rs(jt("a","b","c"),Lt)]))).if(uo,(e,t)=>{const n={},s=qe(t,0,3);for(let r=0;r<s;r++){const i=vt(t,e.shape.keys),o=vt(t,e.shape.values);n[i]=o}return n}).done(),vt=(e,t)=>Ys(Zt(t),e),Q=typeof document<"u"?document:{},xo=e=>Q.createElement(e),Oo=()=>Q.createDocumentFragment();x(e=>e.nodeType===Fo);const Uo=e=>Q.createTextNode(e);typeof DOMParser<"u"&&new DOMParser;const vo=(e,t)=>(Zi(t,(n,s)=>{s===!1?e.removeAttribute(n):s===!0?e.setAttribute(n,""):e.setAttribute(n,s)}),e),Lo=e=>{const t=Oo();for(let n=0;n<e.length;n++)Xs(t,e[n]);return t},Mo=(e,t)=>(Xs(e,Lo(t)),e),vl=(e,t=[],n=[])=>Mo(vo(xo(e),t),n);x(e=>e.nodeType===Ro);const Ll=Uo;x(e=>e.nodeType===$o);const No=e=>Pr(e,(t,n)=>`${n}:${t};`).join(""),Xs=(e,t)=>e.appendChild(t),Ro=Q.ELEMENT_NODE,$o=Q.TEXT_NODE;Q.CDATA_SECTION_NODE;Q.COMMENT_NODE;const Vo=Q.DOCUMENT_NODE;Q.DOCUMENT_TYPE_NODE;const Fo=Q.DOCUMENT_FRAGMENT_NODE;x(e=>e.nodeType===Vo);const ot=Symbol,Ks=ot(),Ws=ot(),Bo=ot(),jo=ot(),zo=ot(),qs=ot(),Go=ot(),Dn=ot(),Jo=ot(),Ho=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let s=0;for(;s<e.length;s++){const r=e[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)t.push(r);else if(r.constructor===Object)break}for(s>0&&n.push(t.join(""));s<e.length;s++){const r=e[s];r instanceof Symbol||n.push(r)}return n},Yo={[Ks]:tt("font-weight","bold"),[Ws]:tt("font-weight","normal"),[Bo]:tt("color","blue"),[zo]:tt("color","green"),[jo]:tt("color","grey"),[qs]:tt("color","red"),[Go]:tt("color","purple"),[Dn]:tt("color","orange"),[Jo]:tt("color","black")},Xo=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],s=T();let r=[],i=0;for(;i<e.length;i++){const o=e[i],c=Yo[o];if(c!==void 0)s.set(c.left,c.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const l=No(s);i>0||l.length>0?(t.push("%c"+o),n.push(l)):t.push(o)}else break}}for(i>0&&(r=n,r.unshift(t.join("")));i<e.length;i++){const o=e[i];o instanceof Symbol||r.push(o)}return r},Ps=Ki?Xo:Ho,cn=(...e)=>{console.log(...Ps(e)),Qs.forEach(t=>t.print(e))},Zs=(...e)=>{console.warn(...Ps(e)),e.unshift(Dn),Qs.forEach(t=>t.print(e))},Qs=Et(),tr=e=>({[Symbol.iterator](){return this},next:e}),Ko=(e,t)=>tr(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Ze=(e,t)=>tr(()=>{const{done:n,value:s}=e.next();return{done:n,value:n?void 0:t(s)}});class Wo extends pn{constructor(t,n){super(),this.doc=t,this.awareness=n}}class Re{constructor(t,n){this.clock=t,this.len=n}}class zt{constructor(){this.clients=new Map}}const Ct=(e,t,n)=>t.clients.forEach((s,r)=>{const i=e.doc.store.clients.get(r);if(i!=null){const o=i[i.length-1],c=o.id.clock+o.length;for(let l=0,a=s[l];l<s.length&&a.clock<c;a=s[++l])dr(e,i,a.clock,a.len,n)}}),qo=(e,t)=>{let n=0,s=e.length-1;for(;n<=s;){const r=q((n+s)/2),i=e[r],o=i.clock;if(o<=t){if(t<o+i.len)return r;n=r+1}else s=r-1}return null},xt=(e,t)=>{const n=e.clients.get(t.client);return n!==void 0&&qo(n,t.clock)!==null},An=e=>{e.clients.forEach(t=>{t.sort((r,i)=>r.clock-i.clock);let n,s;for(n=1,s=1;n<t.length;n++){const r=t[s-1],i=t[n];r.clock+r.len>=i.clock?t[s-1]=new Re(r.clock,Tt(r.len,i.clock+i.len-r.clock)):(s<n&&(t[s]=i),s++)}t.length=s})},Dt=e=>{const t=new zt;for(let n=0;n<e.length;n++)e[n].clients.forEach((s,r)=>{if(!t.clients.has(r)){const i=s.slice();for(let o=n+1;o<e.length;o++)Qr(i,e[o].clients.get(r)||[]);t.clients.set(r,i)}});return An(t),t},Qt=(e,t,n,s)=>{R(e.clients,t,()=>[]).push(new Re(n,s))},$e=()=>new zt,In=e=>{const t=$e();return e.clients.forEach((n,s)=>{const r=[];for(let i=0;i<n.length;i++){const o=n[i];if(o.deleted){const c=o.id.clock;let l=o.length;if(i+1<n.length)for(let a=n[i+1];i+1<n.length&&a.deleted;a=n[++i+1])l+=a.length;r.push(new Re(c,l))}}r.length>0&&t.clients.set(s,r)}),t},Z=(e,t)=>{p(e.restEncoder,t.clients.size),st(t.clients.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{e.resetDsCurVal(),p(e.restEncoder,n);const r=s.length;p(e.restEncoder,r);for(let i=0;i<r;i++){const o=s[i];e.writeDsClock(o.clock),e.writeDsLen(o.len)}})},rt=e=>{const t=new zt,n=m(e.restDecoder);for(let s=0;s<n;s++){e.resetDsCurVal();const r=m(e.restDecoder),i=m(e.restDecoder);if(i>0){const o=R(t.clients,r,()=>[]);for(let c=0;c<i;c++)o.push(new Re(e.readDsClock(),e.readDsLen()))}}return t},ss=(e,t,n)=>{const s=new zt,r=m(e.restDecoder);for(let i=0;i<r;i++){e.resetDsCurVal();const o=m(e.restDecoder),c=m(e.restDecoder),l=n.clients.get(o)||[],a=E(n,o);for(let h=0;h<c;h++){const u=e.readDsClock(),d=u+e.readDsLen();if(u<a){a<d&&Qt(s,o,a,d-a);let f=G(l,u),g=l[f];for(!g.deleted&&g.id.clock<u&&(l.splice(f+1,0,Ae(t,g,u-g.id.clock)),f++);f<l.length&&(g=l[f++],g.id.clock<d);)g.deleted||(d<g.id.clock+g.length&&l.splice(f,0,Ae(t,g,d-g.id.clock)),g.delete(t))}else Qt(s,o,u,d-u)}}if(s.clients.size>0){const i=new K;return p(i.restEncoder,0),Z(i,s),i.toUint8Array()}return null},er=(e,t)=>{if(e.clients.size!==t.clients.size)return!1;for(const[n,s]of e.clients.entries()){const r=t.clients.get(n);if(r===void 0||s.length!==r.length)return!1;for(let i=0;i<s.length;i++){const o=s[i],c=r[i];if(o.clock!==c.clock||o.len!==c.len)return!1}}return!0},nr=Cs;class gt extends pn{constructor({guid:t=vi(),collectionid:n=null,gc:s=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=nr(),this.guid=t,this.collectionid=n,this.share=new Map,this.store=new ar,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Qn(a=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});const l=()=>Qn(a=>{const h=u=>{(u===void 0||u===!0)&&(this.off("sync",h),a())};this.on("sync",h)});this.on("sync",a=>{a===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=a===void 0||a===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const t=this._item;t!==null&&!this.shouldLoad&&_(t.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(st(this.subdocs).map(t=>t.guid))}transact(t,n=null){return _(this,t,n)}get(t,n=A){const s=R(this.share,t,()=>{const i=new n;return i._integrate(this,null),i}),r=s.constructor;if(n!==A&&r!==n)if(r===A){const i=new n;i._map=s._map,s._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=s._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=s._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return s}getArray(t=""){return this.get(t,nt)}getText(t=""){return this.get(t,At)}getMap(t=""){return this.get(t,ut)}getXmlElement(t=""){return this.get(t,ft)}getXmlFragment(t=""){return this.get(t,dt)}toJSON(){const t={};return this.share.forEach((n,s)=>{t[s]=n.toJSON()}),t}destroy(){this.isDestroyed=!0,st(this.subdocs).forEach(n=>n.destroy());const t=this._item;if(t!==null){this._item=null;const n=t.content;n.doc=new gt({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,_(t.parent.doc,s=>{const r=n.doc;t.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class te{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return m(this.restDecoder)}readDsLen(){return m(this.restDecoder)}}class H extends te{readLeftID(){return w(m(this.restDecoder),m(this.restDecoder))}readRightID(){return w(m(this.restDecoder),m(this.restDecoder))}readClient(){return m(this.restDecoder)}readInfo(){return Nt(this.restDecoder)}readString(){return _t(this.restDecoder)}readParentInfo(){return m(this.restDecoder)===1}readTypeRef(){return m(this.restDecoder)}readLen(){return m(this.restDecoder)}readAny(){return Wt(this.restDecoder)}readBuf(){return qi(F(this.restDecoder))}readJSON(){return JSON.parse(_t(this.restDecoder))}readKey(){return _t(this.restDecoder)}}class sr{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=m(this.restDecoder),this.dsCurrVal}readDsLen(){const t=m(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class j extends sr{constructor(t){super(t),this.keys=[],m(t),this.keyClockDecoder=new We(F(t)),this.clientDecoder=new we(F(t)),this.leftClockDecoder=new We(F(t)),this.rightClockDecoder=new We(F(t)),this.infoDecoder=new Zn(F(t),Nt),this.stringDecoder=new xi(F(t)),this.parentInfoDecoder=new Zn(F(t),Nt),this.typeRefDecoder=new we(F(t)),this.lenDecoder=new we(F(t))}readLeftID(){return new bt(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new bt(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Wt(this.restDecoder)}readBuf(){return F(this.restDecoder)}readJSON(){return Wt(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class $t{constructor(){this.restEncoder=Bt()}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){p(this.restEncoder,t)}writeDsLen(t){p(this.restEncoder,t)}}class pt extends $t{writeLeftID(t){p(this.restEncoder,t.client),p(this.restEncoder,t.clock)}writeRightID(t){p(this.restEncoder,t.client),p(this.restEncoder,t.clock)}writeClient(t){p(this.restEncoder,t)}writeInfo(t){Xt(this.restEncoder,t)}writeString(t){yt(this.restEncoder,t)}writeParentInfo(t){p(this.restEncoder,t?1:0)}writeTypeRef(t){p(this.restEncoder,t)}writeLen(t){p(this.restEncoder,t)}writeAny(t){Kt(this.restEncoder,t)}writeBuf(t){V(this.restEncoder,t)}writeJSON(t){yt(this.restEncoder,JSON.stringify(t))}writeKey(t){yt(this.restEncoder,t)}}class Ve{constructor(){this.restEncoder=Bt(),this.dsCurrVal=0}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const n=t-this.dsCurrVal;this.dsCurrVal=t,p(this.restEncoder,n)}writeDsLen(t){t===0&&v(),p(this.restEncoder,t-1),this.dsCurrVal+=t}}class K extends Ve{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ke,this.clientEncoder=new pe,this.leftClockEncoder=new Ke,this.rightClockEncoder=new Ke,this.infoEncoder=new Wn(Xt),this.stringEncoder=new bi,this.parentInfoEncoder=new Wn(Xt),this.typeRefEncoder=new pe,this.lenEncoder=new pe}toUint8Array(){const t=Bt();return p(t,0),V(t,this.keyClockEncoder.toUint8Array()),V(t,this.clientEncoder.toUint8Array()),V(t,this.leftClockEncoder.toUint8Array()),V(t,this.rightClockEncoder.toUint8Array()),V(t,z(this.infoEncoder)),V(t,this.stringEncoder.toUint8Array()),V(t,z(this.parentInfoEncoder)),V(t,this.typeRefEncoder.toUint8Array()),V(t,this.lenEncoder.toUint8Array()),ce(t,z(this.restEncoder)),z(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){Kt(this.restEncoder,t)}writeBuf(t){V(this.restEncoder,t)}writeJSON(t){Kt(this.restEncoder,t)}writeKey(t){const n=this.keyMap.get(t);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(n)}}const Po=(e,t,n,s)=>{s=Tt(s,t[0].id.clock);const r=G(t,s);p(e.restEncoder,t.length-r),e.writeClient(n),p(e.restEncoder,s);const i=t[r];i.write(e,s-i.id.clock);for(let o=r+1;o<t.length;o++)t[o].write(e,0)},Tn=(e,t,n)=>{const s=new Map;n.forEach((r,i)=>{E(t,i)>r&&s.set(i,r)}),he(t).forEach((r,i)=>{n.has(i)||s.set(i,0)}),p(e.restEncoder,s.size),st(s.entries()).sort((r,i)=>i[0]-r[0]).forEach(([r,i])=>{Po(e,t.clients.get(r),r,i)})},Zo=(e,t)=>{const n=T(),s=m(e.restDecoder);for(let r=0;r<s;r++){const i=m(e.restDecoder),o=new Array(i),c=e.readClient();let l=m(e.restDecoder);n.set(c,{i:0,refs:o});for(let a=0;a<i;a++){const h=e.readInfo();switch(Ie&h){case 0:{const u=e.readLen();o[a]=new $(w(c,l),u),l+=u;break}case 10:{const u=m(e.restDecoder);o[a]=new M(w(c,l),u),l+=u;break}default:{const u=(h&(et|B))===0,d=new y(w(c,l),null,(h&B)===B?e.readLeftID():null,null,(h&et)===et?e.readRightID():null,u?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,u&&(h&Ht)===Ht?e.readString():null,Kr(e,h));o[a]=d,l+=d.length}}}}return n},Qo=(e,t,n)=>{const s=[];let r=st(n.keys()).sort((f,g)=>f-g);if(r.length===0)return null;const i=()=>{if(r.length===0)return null;let f=n.get(r[r.length-1]);for(;f.refs.length===f.i;)if(r.pop(),r.length>0)f=n.get(r[r.length-1]);else return null;return f};let o=i();if(o===null)return null;const c=new ar,l=new Map,a=(f,g)=>{const k=l.get(f);(k==null||k>g)&&l.set(f,g)};let h=o.refs[o.i++];const u=new Map,d=()=>{for(const f of s){const g=f.id.client,k=n.get(g);k?(k.i--,c.clients.set(g,k.refs.slice(k.i)),n.delete(g),k.i=0,k.refs=[]):c.clients.set(g,[f]),r=r.filter(b=>b!==g)}s.length=0};for(;;){if(h.constructor!==M){const g=R(u,h.id.client,()=>E(t,h.id.client))-h.id.clock;if(g<0)s.push(h),a(h.id.client,h.id.clock-1),d();else{const k=h.getMissing(e,t);if(k!==null){s.push(h);const b=n.get(k)||{refs:[],i:0};if(b.refs.length===b.i)a(k,E(t,k)),d();else{h=b.refs[b.i++];continue}}else(g===0||g<h.length)&&(h.integrate(e,g),u.set(h.id.client,h.id.clock+h.length))}}if(s.length>0)h=s.pop();else if(o!==null&&o.i<o.refs.length)h=o.refs[o.i++];else{if(o=i(),o===null)break;h=o.refs[o.i++]}}if(c.clients.size>0){const f=new K;return Tn(f,c,new Map),p(f.restEncoder,0),{missing:l,update:f.toUint8Array()}}return null},tc=(e,t)=>Tn(e,t.doc.store,t.beforeState),xn=(e,t,n,s=new j(e))=>_(t,r=>{r.local=!1;let i=!1;const o=r.doc,c=o.store,l=Zo(s,o),a=Qo(r,c,l),h=c.pendingStructs;if(h){for(const[d,f]of h.missing)if(f<E(c,d)){i=!0;break}if(a){for(const[d,f]of a.missing){const g=h.missing.get(d);(g==null||g>f)&&h.missing.set(d,f)}h.update=ne([h.update,a.update])}}else c.pendingStructs=a;const u=ss(s,r,c);if(c.pendingDs){const d=new j(L(c.pendingDs));m(d.restDecoder);const f=ss(d,r,c);u&&f?c.pendingDs=ne([u,f]):c.pendingDs=u||f}else c.pendingDs=u;if(i){const d=c.pendingStructs.update;c.pendingStructs=null,Fe(r.doc,d)}},n,!1),ec=(e,t,n)=>xn(e,t,n,new H(e)),Fe=(e,t,n,s=j)=>{const r=L(t);xn(r,e,n,new s(r))},nc=(e,t,n)=>Fe(e,t,n,H),sc=(e,t,n=new Map)=>{Tn(e,t.store,n),Z(e,In(t.store))},rr=(e,t=new Uint8Array([0]),n=new K)=>{const s=On(t);sc(n,e,s);const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(Rn(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===pt)return yr(r.map((i,o)=>o===0?i:Cr(i)));if(n.constructor===K)return ne(r)}return r[0]},rc=(e,t)=>rr(e,t,new pt),ir=e=>{const t=new Map,n=m(e.restDecoder);for(let s=0;s<n;s++){const r=m(e.restDecoder),i=m(e.restDecoder);t.set(r,i)}return t},On=e=>ir(new te(L(e))),Un=(e,t)=>(p(e.restEncoder,t.size),st(t.entries()).sort((n,s)=>s[0]-n[0]).forEach(([n,s])=>{p(e.restEncoder,n),p(e.restEncoder,s)}),e),ic=(e,t)=>Un(e,he(t.store)),oc=(e,t=new Ve)=>(e instanceof Map?Un(t,e):ic(t,e),t.toUint8Array()),cc=e=>oc(e,new $t);class lc{constructor(){this.l=[]}}const rs=()=>new lc,is=(e,t)=>e.l.push(t),os=(e,t)=>{const n=e.l,s=n.length;e.l=n.filter(r=>t!==r),s===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},or=(e,t,n)=>yn(e.l,[t,n]);class bt{constructor(t,n){this.client=t,this.clock=n}}const mt=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,w=(e,t)=>new bt(e,t),cs=(e,t)=>{p(e,t.client),p(e,t.clock)},ls=e=>w(m(e),m(e)),vn=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw v()},ee=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},hc=e=>{const t=[];let n=e._start;for(;n;)t.push(n),n=n.right;console.log("Children: ",t),console.log("Children content: ",t.filter(s=>!s.deleted).map(s=>s.content))};class ac{constructor(t,n=t.getMap("users")){const s=new Map;this.yusers=n,this.doc=t,this.clients=new Map,this.dss=s;const r=(i,o)=>{const c=i.get("ds"),l=i.get("ids"),a=h=>this.clients.set(h,o);c.observe(h=>{h.changes.added.forEach(u=>{u.content.getContent().forEach(d=>{d instanceof Uint8Array&&this.dss.set(o,Dt([this.dss.get(o)||$e(),rt(new te(L(d)))]))})})}),this.dss.set(o,Dt(c.map(h=>rt(new te(L(h)))))),l.observe(h=>h.changes.added.forEach(u=>u.content.getContent().forEach(a))),l.forEach(a)};n.observe(i=>{i.keysChanged.forEach(o=>r(n.get(o),o))}),n.forEach(r)}setUserMapping(t,n,s,{filter:r=()=>!0}={}){const i=this.yusers;let o=i.get(s);o||(o=new ut,o.set("ids",new nt),o.set("ds",new nt),i.set(s,o)),o.get("ids").push([n]),i.observe(c=>{setTimeout(()=>{const l=i.get(s);if(l!==o){o=l,this.clients.forEach((u,d)=>{s===u&&o.get("ids").push([d])});const a=new $t,h=this.dss.get(s);h&&(Z(a,h),o.get("ds").push([a.toUint8Array()]))}},0)}),t.on("afterTransaction",c=>{setTimeout(()=>{const l=o.get("ds"),a=c.deleteSet;if(c.local&&a.clients.size>0&&r(c,a)){const h=new $t;Z(h,a),l.push([h.toUint8Array()])}})})}getUserByClientId(t){return this.clients.get(t)||null}getUserByDeletedId(t){for(const[n,s]of this.dss.entries())if(xt(s,t))return n;return null}}class Be{constructor(t,n,s,r=0){this.type=t,this.tname=n,this.item=s,this.assoc=r}}const uc=e=>{const t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},dc=e=>new Be(e.type==null?null:w(e.type.client,e.type.clock),e.tname??null,e.item==null?null:w(e.item.client,e.item.clock),e.assoc==null?0:e.assoc);class cr{constructor(t,n,s=0){this.type=t,this.index=n,this.assoc=s}}const fc=(e,t,n=0)=>new cr(e,t,n),ue=(e,t,n)=>{let s=null,r=null;return e._item===null?r=vn(e):s=w(e._item.id.client,e._item.id.clock),new Be(s,r,t,n)},gc=(e,t,n=0)=>{let s=e._start;if(n<0){if(t===0)return ue(e,null,n);t--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>t)return ue(e,w(s.id.client,s.id.clock+t),n);t-=s.length}if(s.right===null&&n<0)return ue(e,s.lastId,n);s=s.right}return ue(e,null,n)},pc=(e,t)=>{const{type:n,tname:s,item:r,assoc:i}=t;if(r!==null)p(e,0),cs(e,r);else if(s!==null)Xt(e,1),yt(e,s);else if(n!==null)Xt(e,2),cs(e,n);else throw v();return Te(e,i),e},wc=e=>{const t=Bt();return pc(t,e),z(t)},mc=e=>{let t=null,n=null,s=null;switch(m(e)){case 0:s=ls(e);break;case 1:n=_t(e);break;case 2:t=ls(e)}const r=Es(e)?Oe(e):0;return new Be(t,n,s,r)},kc=e=>mc(L(e)),yc=(e,t)=>{const n=St(e,t),s=t.clock-n.id.clock;return{item:n,diff:s}},_c=(e,t,n=!0)=>{const s=t.store,r=e.item,i=e.type,o=e.tname,c=e.assoc;let l=null,a=0;if(r!==null){if(E(s,r.client)<=r.clock)return null;const h=n?dn(s,r):yc(s,r),u=h.item;if(!(u instanceof y))return null;if(l=u.parent,l._item===null||!l._item.deleted){a=u.deleted||!u.countable?0:h.diff+(c>=0?0:1);let d=u.left;for(;d!==null;)!d.deleted&&d.countable&&(a+=d.length),d=d.left}}else{if(o!==null)l=t.get(o);else if(i!==null){if(E(s,i.client)<=i.clock)return null;const{item:h}=n?dn(s,i):{item:St(s,i)};if(h instanceof y&&h.content instanceof Y)l=h.content.type;else return null}else throw v();c>=0?a=l._length:a=0}return fc(l,a,e.assoc)},bc=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&mt(e.item,t.item)&&mt(e.type,t.type)&&e.assoc===t.assoc;class Ln{constructor(t,n){this.ds=t,this.sv=n}}const Sc=(e,t)=>{const n=e.ds.clients,s=t.ds.clients,r=e.sv,i=t.sv;if(r.size!==i.size||n.size!==s.size)return!1;for(const[o,c]of r.entries())if(i.get(o)!==c)return!1;for(const[o,c]of n.entries()){const l=s.get(o)||[];if(c.length!==l.length)return!1;for(let a=0;a<c.length;a++){const h=c[a],u=l[a];if(h.clock!==u.clock||h.len!==u.len)return!1}}return!0},lr=(e,t=new Ve)=>(Z(t,e.ds),Un(t,e.sv),t.toUint8Array()),Ec=e=>lr(e,new $t),hr=(e,t=new sr(L(e)))=>new Ln(rt(t),ir(t)),Cc=e=>hr(e,new te(L(e))),Mn=(e,t)=>new Ln(e,t),Dc=Mn($e(),new Map),Ac=e=>Mn(In(e.store),he(e.store)),lt=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!xt(t.ds,e.id),ln=(e,t)=>{const n=R(e.meta,ln,Et),s=e.doc.store;n.has(t)||(t.sv.forEach((r,i)=>{r<E(s,i)&&U(e,w(i,r))}),Ct(e,t.ds,r=>{}),n.add(t))},Ic=(e,t,n=new gt)=>{if(e.gc)throw new Error("Garbage-collection must be disabled in `originDoc`!");const{sv:s,ds:r}=t,i=new K;return e.transact(o=>{let c=0;s.forEach(l=>{l>0&&c++}),p(i.restEncoder,c);for(const[l,a]of s){if(a===0)continue;a<E(e.store,l)&&U(o,w(l,a));const h=e.store.clients.get(l)||[],u=G(h,a-1);p(i.restEncoder,u+1),i.writeClient(l),p(i.restEncoder,0);for(let d=0;d<=u;d++)h[d].write(i,0)}Z(i,r)}),Fe(n,i.toUint8Array(),"snapshot"),n},Tc=(e,t,n=j)=>{const s=new n(L(t)),r=new wt(s,!1);for(let o=r.curr;o!==null;o=r.next())if((e.sv.get(o.id.client)||0)<o.id.clock+o.length)return!1;const i=Dt([e.ds,rt(s)]);return er(e.ds,i)},xc=(e,t)=>Tc(e,t,H);class ar{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const he=e=>{const t=new Map;return e.clients.forEach((n,s)=>{const r=n[n.length-1];t.set(s,r.id.clock+r.length)}),t},E=(e,t)=>{const n=e.clients.get(t);if(n===void 0)return 0;const s=n[n.length-1];return s.id.clock+s.length},ur=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{const s=n[n.length-1];if(s.id.clock+s.length!==t.id.clock)throw v()}n.push(t)},G=(e,t)=>{let n=0,s=e.length-1,r=e[s],i=r.id.clock;if(i===t)return s;let o=q(t/(i+r.length-1)*s);for(;n<=s;){if(r=e[o],i=r.id.clock,i<=t){if(t<i+r.length)return o;n=o+1}else s=o-1;o=q((n+s)/2)}throw v()},Oc=(e,t)=>{const n=e.clients.get(t.client);return n[G(n,t.clock)]},St=Oc,hn=(e,t,n)=>{const s=G(t,n),r=t[s];return r.id.clock<n&&r instanceof y?(t.splice(s+1,0,Ae(e,r,n-r.id.clock)),s+1):s},U=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[hn(e,n,t.clock)]},an=(e,t,n)=>{const s=t.clients.get(n.client),r=G(s,n.clock),i=s[r];return n.clock!==i.id.clock+i.length-1&&i.constructor!==$&&s.splice(r+1,0,Ae(e,i,n.clock-i.id.clock+1)),i},Uc=(e,t,n)=>{const s=e.clients.get(t.id.client);s[G(s,t.id.clock)]=n},dr=(e,t,n,s,r)=>{if(s===0)return;const i=n+s;let o=hn(e,t,n),c;do c=t[o++],i<c.id.clock+c.length&&hn(e,t,i),r(c);while(o<t.length&&t[o].id.clock<i)};class fr{constructor(t,n,s){this.doc=t,this.deleteSet=new zt,this.beforeState=he(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const hs=(e,t)=>t.deleteSet.clients.size===0&&!Zr(t.afterState,(n,s)=>t.beforeState.get(s)!==n)?!1:(An(t.deleteSet),tc(e,t),Z(e,t.deleteSet),!0),as=(e,t,n)=>{const s=t._item;(s===null||s.id.clock<(e.beforeState.get(s.id.client)||0)&&!s.deleted)&&R(e.changed,t,Et).add(n)},ke=(e,t)=>{let n=e[t],s=e[t-1],r=t;for(;r>0;n=s,s=e[--r-1]){if(s.deleted===n.deleted&&s.constructor===n.constructor&&s.mergeWith(n)){n instanceof y&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,s);continue}break}const i=t-r;return i&&e.splice(t+1-i,i),i},gr=(e,t,n)=>{for(const[s,r]of e.clients.entries()){const i=t.clients.get(s);for(let o=r.length-1;o>=0;o--){const c=r[o],l=c.clock+c.len;for(let a=G(i,c.clock),h=i[a];a<i.length&&h.id.clock<l;h=i[++a]){const u=i[a];if(c.clock+c.len<=u.id.clock)break;u instanceof y&&u.deleted&&!u.keep&&n(u)&&u.gc(t,!1)}}}},pr=(e,t)=>{e.clients.forEach((n,s)=>{const r=t.clients.get(s);for(let i=n.length-1;i>=0;i--){const o=n[i],c=ks(r.length-1,1+G(r,o.clock+o.len-1));for(let l=c,a=r[l];l>0&&a.id.clock>=o.clock;a=r[l])l-=1+ke(r,l)}})},vc=(e,t,n)=>{gr(e,t,n),pr(e,t)},wr=(e,t)=>{if(t<e.length){const n=e[t],s=n.doc,r=s.store,i=n.deleteSet,o=n._mergeStructs;try{An(i),n.afterState=he(n.doc.store),s.emit("beforeObserverCalls",[n,s]);const c=[];n.changed.forEach((l,a)=>c.push(()=>{(a._item===null||!a._item.deleted)&&a._callObserver(n,l)})),c.push(()=>{n.changedParentTypes.forEach((l,a)=>{a._dEH.l.length>0&&(a._item===null||!a._item.deleted)&&(l=l.filter(h=>h.target._item===null||!h.target._item.deleted),l.forEach(h=>{h.currentTarget=a,h._path=null}),l.sort((h,u)=>h.path.length-u.path.length),c.push(()=>{or(a._dEH,l,n)}))}),c.push(()=>s.emit("afterTransaction",[n,s])),c.push(()=>{n._needFormattingCleanup&&sl(n)})}),yn(c,[])}finally{s.gc&&gr(i,r,s.gcFilter),pr(i,r),n.afterState.forEach((h,u)=>{const d=n.beforeState.get(u)||0;if(d!==h){const f=r.clients.get(u),g=Tt(G(f,d),1);for(let k=f.length-1;k>=g;)k-=1+ke(f,k)}});for(let h=o.length-1;h>=0;h--){const{client:u,clock:d}=o[h].id,f=r.clients.get(u),g=G(f,d);g+1<f.length&&ke(f,g+1)>1||g>0&&ke(f,g)}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)&&(cn(Dn,Ks,"[yjs] ",Ws,qs,"Changed the client-id because another client seems to be using it."),s.clientID=nr()),s.emit("afterTransactionCleanup",[n,s]),s._observers.has("update")){const h=new pt;hs(h,n)&&s.emit("update",[h.toUint8Array(),n.origin,s,n])}if(s._observers.has("updateV2")){const h=new K;hs(h,n)&&s.emit("updateV2",[h.toUint8Array(),n.origin,s,n])}const{subdocsAdded:c,subdocsLoaded:l,subdocsRemoved:a}=n;(c.size>0||a.size>0||l.size>0)&&(c.forEach(h=>{h.clientID=s.clientID,h.collectionid==null&&(h.collectionid=s.collectionid),s.subdocs.add(h)}),a.forEach(h=>s.subdocs.delete(h)),s.emit("subdocs",[{loaded:l,added:c,removed:a},s,n]),a.forEach(h=>h.destroy())),e.length<=t+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,e])):wr(e,t+1)}}},_=(e,t,n=null,s=!0)=>{const r=e._transactionCleanups;let i=!1,o=null;e._transaction===null&&(i=!0,e._transaction=new fr(e,n,s),r.push(e._transaction),r.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(i){const c=e._transaction===r[0];e._transaction=null,c&&wr(r,0)}}return o};class Lc{constructor(t,n){this.insertions=n,this.deletions=t,this.meta=new Map}}const us=(e,t,n)=>{Ct(e,n.deletions,s=>{s instanceof y&&t.scope.some(r=>r===e.doc||ee(r,s))&&jn(s,!1)})},ds=(e,t,n)=>{let s=null;const r=e.doc,i=e.scope;_(r,c=>{for(;t.length>0&&e.currStackItem===null;){const l=r.store,a=t.pop(),h=new Set,u=[];let d=!1;Ct(c,a.insertions,f=>{if(f instanceof y){if(f.redone!==null){let{item:g,diff:k}=dn(l,f.id);k>0&&(g=U(c,w(g.id.client,g.id.clock+k))),f=g}!f.deleted&&i.some(g=>g===c.doc||ee(g,f))&&u.push(f)}}),Ct(c,a.deletions,f=>{f instanceof y&&i.some(g=>g===c.doc||ee(g,f))&&!xt(a.insertions,f.id)&&h.add(f)}),h.forEach(f=>{d=Xr(c,f,h,a.insertions,e.ignoreRemoteMapChanges,e)!==null||d});for(let f=u.length-1;f>=0;f--){const g=u[f];e.deleteFilter(g)&&(g.delete(c),d=!0)}e.currStackItem=d?a:null}c.changed.forEach((l,a)=>{l.has(null)&&a._searchMarker&&(a._searchMarker.length=0)}),s=c},e);const o=e.currStackItem;if(o!=null){const c=s.changedParentTypes;e.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:c,origin:e},e]),e.currStackItem=null}return o};class Mc extends pn{constructor(t,{captureTimeout:n=500,captureTransaction:s=l=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Mt(t)?t[0].doc:t instanceof gt?t:t.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(t),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(b=>l.changedParentTypes.has(b)||b===this.doc)||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const a=this.undoing,h=this.redoing,u=a?this.redoStack:this.undoStack;a?this.stopCapturing():h||this.clear(!1,!0);const d=new zt;l.afterState.forEach((b,S)=>{const zn=l.beforeState.get(S)||0,Gn=b-zn;Gn>0&&Qt(d,S,zn,Gn)});const f=Li();let g=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&u.length>0&&!a&&!h){const b=u[u.length-1];b.deletions=Dt([b.deletions,l.deleteSet]),b.insertions=Dt([b.insertions,d])}else u.push(new Lc(l.deleteSet,d)),g=!0;!a&&!h&&(this.lastChange=f),Ct(l,l.deleteSet,b=>{b instanceof y&&this.scope.some(S=>S===l.doc||ee(S,b))&&jn(b,!0)});const k=[{stackItem:u[u.length-1],origin:l.origin,type:a?"redo":"undo",changedParentTypes:l.changedParentTypes},this];g?this.emit("stack-item-added",k):this.emit("stack-item-updated",k)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const n=new Set(this.scope);t=Mt(t)?t:[t],t.forEach(s=>{n.has(s)||(n.add(s),(s instanceof A?s.doc!==this.doc:s!==this.doc)&&Zs("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,n=!0){(t&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(s=>{t&&(this.undoStack.forEach(r=>us(s,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>us(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=ds(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=ds(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*Nc(e){const t=m(e.restDecoder);for(let n=0;n<t;n++){const s=m(e.restDecoder),r=e.readClient();let i=m(e.restDecoder);for(let o=0;o<s;o++){const c=e.readInfo();if(c===10){const l=m(e.restDecoder);yield new M(w(r,i),l),i+=l}else if((Ie&c)!==0){const l=(c&(et|B))===0,a=new y(w(r,i),null,(c&B)===B?e.readLeftID():null,null,(c&et)===et?e.readRightID():null,l?e.readParentInfo()?e.readString():e.readLeftID():null,l&&(c&Ht)===Ht?e.readString():null,Kr(e,c));yield a,i+=a.length}else{const l=e.readLen();yield new $(w(r,i),l),i+=l}}}}class wt{constructor(t,n){this.gen=Nc(t),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===M);return this.curr}}const Rc=e=>mr(e,H),mr=(e,t=j)=>{const n=[],s=new t(L(e)),r=new wt(s,!1);for(let o=r.curr;o!==null;o=r.next())n.push(o);cn("Structs: ",n);const i=rt(s);cn("DeleteSet: ",i)},$c=e=>kr(e,H),kr=(e,t=j)=>{const n=[],s=new t(L(e)),r=new wt(s,!1);for(let i=r.curr;i!==null;i=r.next())n.push(i);return{structs:n,ds:rt(s)}};class Nn{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const yr=e=>ne(e,H,pt),_r=(e,t=Ve,n=j)=>{const s=new t,r=new wt(new n(L(e)),!1);let i=r.curr;if(i!==null){let o=0,c=i.id.client,l=i.id.clock!==0,a=l?0:i.id.clock+i.length;for(;i!==null;i=r.next())c!==i.id.client&&(a!==0&&(o++,p(s.restEncoder,c),p(s.restEncoder,a)),c=i.id.client,a=0,l=i.id.clock!==0),i.constructor===M&&(l=!0),l||(a=i.id.clock+i.length);a!==0&&(o++,p(s.restEncoder,c),p(s.restEncoder,a));const h=Bt();return p(h,o),wi(h,s.restEncoder),s.restEncoder=h,s.toUint8Array()}else return p(s.restEncoder,0),s.toUint8Array()},Vc=e=>_r(e,$t,H),br=(e,t=j)=>{const n=new Map,s=new Map,r=new wt(new t(L(e)),!1);let i=r.curr;if(i!==null){let o=i.id.client,c=i.id.clock;for(n.set(o,c);i!==null;i=r.next())o!==i.id.client&&(s.set(o,c),n.set(i.id.client,i.id.clock),o=i.id.client),c=i.id.clock+i.length;s.set(o,c)}return{from:n,to:s}},Fc=e=>br(e,H),Bc=(e,t)=>{if(e.constructor===$){const{client:n,clock:s}=e.id;return new $(w(n,s+t),e.length-t)}else if(e.constructor===M){const{client:n,clock:s}=e.id;return new M(w(n,s+t),e.length-t)}else{const n=e,{client:s,clock:r}=n.id;return new y(w(s,r+t),null,w(s,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},ne=(e,t=j,n=K)=>{if(e.length===1)return e[0];const s=e.map(h=>new t(L(h)));let r=s.map(h=>new wt(h,!0)),i=null;const o=new n,c=new Nn(o);for(;r=r.filter(d=>d.curr!==null),r.sort((d,f)=>{if(d.curr.id.client===f.curr.id.client){const g=d.curr.id.clock-f.curr.id.clock;return g===0?d.curr.constructor===f.curr.constructor?0:d.curr.constructor===M?1:-1:g}else return f.curr.id.client-d.curr.id.client}),r.length!==0;){const h=r[0],u=h.curr.id.client;if(i!==null){let d=h.curr,f=!1;for(;d!==null&&d.id.clock+d.length<=i.struct.id.clock+i.struct.length&&d.id.client>=i.struct.id.client;)d=h.next(),f=!0;if(d===null||d.id.client!==u||f&&d.id.clock>i.struct.id.clock+i.struct.length)continue;if(u!==i.struct.id.client)ht(c,i.struct,i.offset),i={struct:d,offset:0},h.next();else if(i.struct.id.clock+i.struct.length<d.id.clock)if(i.struct.constructor===M)i.struct.length=d.id.clock+d.length-i.struct.id.clock;else{ht(c,i.struct,i.offset);const g=d.id.clock-i.struct.id.clock-i.struct.length;i={struct:new M(w(u,i.struct.id.clock+i.struct.length),g),offset:0}}else{const g=i.struct.id.clock+i.struct.length-d.id.clock;g>0&&(i.struct.constructor===M?i.struct.length-=g:d=Bc(d,g)),i.struct.mergeWith(d)||(ht(c,i.struct,i.offset),i={struct:d,offset:0},h.next())}}else i={struct:h.curr,offset:0},h.next();for(let d=h.curr;d!==null&&d.id.client===u&&d.id.clock===i.struct.id.clock+i.struct.length&&d.constructor!==M;d=h.next())ht(c,i.struct,i.offset),i={struct:d,offset:0}}i!==null&&(ht(c,i.struct,i.offset),i=null),$n(c);const l=s.map(h=>rt(h)),a=Dt(l);return Z(o,a),o.toUint8Array()},Rn=(e,t,n=j,s=K)=>{const r=On(t),i=new s,o=new Nn(i),c=new n(L(e)),l=new wt(c,!1);for(;l.curr;){const h=l.curr,u=h.id.client,d=r.get(u)||0;if(l.curr.constructor===M){l.next();continue}if(h.id.clock+h.length>d)for(ht(o,h,Tt(d-h.id.clock,0)),l.next();l.curr&&l.curr.id.client===u;)ht(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===u&&l.curr.id.clock+l.curr.length<=d;)l.next()}$n(o);const a=rt(c);return Z(i,a),i.toUint8Array()},jc=(e,t)=>Rn(e,t,H,pt),Sr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:z(e.encoder.restEncoder)}),e.encoder.restEncoder=Bt(),e.written=0)},ht=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Sr(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),p(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},$n=e=>{Sr(e);const t=e.encoder.restEncoder;p(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const s=e.clientStructs[n];p(t,s.written),ce(t,s.restEncoder)}},je=(e,t,n,s)=>{const r=new n(L(e)),i=new wt(r,!1),o=new s,c=new Nn(o);for(let a=i.curr;a!==null;a=i.next())ht(c,t(a),0);$n(c);const l=rt(r);return Z(o,l),o.toUint8Array()},Er=({formatting:e=!0,subdocs:t=!0,yxml:n=!0}={})=>{let s=0;const r=T(),i=T(),o=T(),c=T();return c.set(null,null),l=>{switch(l.constructor){case $:case M:return l;case y:{const a=l,h=a.content;switch(h.constructor){case It:break;case Y:{if(n){const u=h.type;u instanceof ft&&(u.nodeName=R(i,u.nodeName,()=>"node-"+s)),u instanceof Vt&&(u.hookName=R(i,u.hookName,()=>"hook-"+s))}break}case it:{const u=h;u.arr=u.arr.map(()=>s);break}case Ot:{const u=h;u.content=new Uint8Array([s]);break}case Ut:{const u=h;t&&(u.opts={},u.doc.guid=s+"");break}case ct:{const u=h;u.embed={};break}case C:{const u=h;e&&(u.key=R(o,u.key,()=>s+""),u.value=R(c,u.value,()=>({i:s})));break}case Ft:{const u=h;u.arr=u.arr.map(()=>s);break}case J:{const u=h;u.str=_s(s%10+"",u.str.length);break}default:v()}return a.parentSub&&(a.parentSub=R(r,a.parentSub,()=>s+"")),s++,l}default:v()}}},zc=(e,t)=>je(e,Er(t),H,pt),Gc=(e,t)=>je(e,Er(t),j,K),Jc=e=>je(e,Ts,H,K),Cr=e=>je(e,Ts,j,pt),fs="You must not compute changes after the event-handler fired.";class ae{constructor(t,n){this.target=t,this.currentTarget=t,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Hc(this.currentTarget,this.target))}deletes(t){return xt(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw P(fs);const t=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const i=n._map.get(r);let o,c;if(this.adds(i)){let l=i.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))o="delete",c=He(l.content.getContent());else return;else l!==null&&this.deletes(l)?(o="update",c=He(l.content.getContent())):(o="add",c=void 0)}else if(this.deletes(i))o="delete",c=He(i.content.getContent());else return;t.set(r,{action:o,oldValue:c})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw P(fs);const n=this.target,s=Et(),r=Et(),i=[];if(t={added:s,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const l=()=>{c&&i.push(c)};for(let a=n._start;a!==null;a=a.right)a.deleted?this.deletes(a)&&!this.adds(a)&&((c===null||c.delete===void 0)&&(l(),c={delete:0}),c.delete+=a.length,r.add(a)):this.adds(a)?((c===null||c.insert===void 0)&&(l(),c={insert:[]}),c.insert=c.insert.concat(a.content.getContent()),s.add(a)):((c===null||c.retain===void 0)&&(l(),c={retain:0}),c.retain+=a.length);c!==null&&c.retain===void 0&&l()}this._changes=t}return t}}const Hc=(e,t)=>{const n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let s=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;n.unshift(s)}t=t._item.parent}return n},O=()=>{Zs("Invalid access: Add Yjs type to a document before reading data.")},Dr=80;let Vn=0;class Yc{constructor(t,n){t.marker=!0,this.p=t,this.index=n,this.timestamp=Vn++}}const Xc=e=>{e.timestamp=Vn++},Ar=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Vn++},Kc=(e,t,n)=>{if(e.length>=Dr){const s=e.reduce((r,i)=>r.timestamp<i.timestamp?r:i);return Ar(s,t,n),s}else{const s=new Yc(t,n);return e.push(s),s}},ze=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;const n=e._searchMarker.length===0?null:e._searchMarker.reduce((i,o)=>ge(t-i.index)<ge(t-o.index)?i:o);let s=e._start,r=0;for(n!==null&&(s=n.p,r=n.index,Xc(n));s.right!==null&&r<t;){if(!s.deleted&&s.countable){if(t<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>t;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return n!==null&&ge(n.index-r)<s.parent.length/Dr?(Ar(n,s,r),n):Kc(e._searchMarker,s,r)},se=(e,t,n)=>{for(let s=e.length-1;s>=0;s--){const r=e[s];if(n>0){let i=r.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(r.index-=i.length);if(i===null||i.marker===!0){e.splice(s,1);continue}r.p=i,i.marker=!0}(t<r.index||n>0&&t===r.index)&&(r.index=Tt(t,r.index+n))}},Wc=e=>{e.doc??O();let t=e._start;const n=[];for(;t;)n.push(t),t=t.right;return n},Ge=(e,t,n)=>{const s=e,r=t.changedParentTypes;for(;R(r,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;or(s._eH,n,t)};class A{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=rs(),this._dEH=rs(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,n){this.doc=t,this._item=n}_copy(){throw X()}clone(){throw X()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,n){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){is(this._eH,t)}observeDeep(t){is(this._dEH,t)}unobserve(t){os(this._eH,t)}unobserveDeep(t){os(this._dEH,t)}toJSON(){}}const Ir=(e,t,n)=>{e.doc??O(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let s=n-t;const r=[];let i=e._start;for(;i!==null&&s>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let c=t;c<o.length&&s>0;c++)r.push(o[c]),s--;t=0}}i=i.right}return r},Tr=e=>{e.doc??O();const t=[];let n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){const s=n.content.getContent();for(let r=0;r<s.length;r++)t.push(s[r])}n=n.right}return t},qc=(e,t)=>{const n=[];let s=e._start;for(;s!==null;){if(s.countable&&lt(s,t)){const r=s.content.getContent();for(let i=0;i<r.length;i++)n.push(r[i])}s=s.right}return n},re=(e,t)=>{let n=0,s=e._start;for(e.doc??O();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let i=0;i<r.length;i++)t(r[i],n++,e)}s=s.right}},xr=(e,t)=>{const n=[];return re(e,(s,r)=>{n.push(t(s,r,e))}),n},Pc=e=>{let t=e._start,n=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),s=0,t=t.right}const r=n[s++];return n.length<=s&&(n=null),{done:!1,value:r}}}},Or=(e,t)=>{e.doc??O();const n=ze(e,t);let s=e._start;for(n!==null&&(s=n.p,t-=n.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(t<s.length)return s.content.getContent()[t];t-=s.length}},Ce=(e,t,n,s)=>{let r=n;const i=e.doc,o=i.clientID,c=i.store,l=n===null?t._start:n.right;let a=[];const h=()=>{a.length>0&&(r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new it(a)),r.integrate(e,0),a=[])};s.forEach(u=>{if(u===null)a.push(u);else switch(u.constructor){case Number:case Object:case Boolean:case Array:case String:a.push(u);break;default:switch(h(),u.constructor){case Uint8Array:case ArrayBuffer:r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ot(new Uint8Array(u))),r.integrate(e,0);break;case gt:r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Ut(u)),r.integrate(e,0);break;default:if(u instanceof A)r=new y(w(o,E(c,o)),r,r&&r.lastId,l,l&&l.id,t,null,new Y(u)),r.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},Ur=()=>P("Length exceeded!"),vr=(e,t,n,s)=>{if(n>t._length)throw Ur();if(n===0)return t._searchMarker&&se(t._searchMarker,n,s.length),Ce(e,t,null,s);const r=n,i=ze(t,n);let o=t._start;for(i!==null&&(o=i.p,n-=i.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&U(e,w(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&se(t._searchMarker,r,s.length),Ce(e,t,o,s)},Zc=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return Ce(e,t,r,n)},Lr=(e,t,n,s)=>{if(s===0)return;const r=n,i=s,o=ze(t,n);let c=t._start;for(o!==null&&(c=o.p,n-=o.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&U(e,w(c.id.client,c.id.clock+n)),n-=c.length);for(;s>0&&c!==null;)c.deleted||(s<c.length&&U(e,w(c.id.client,c.id.clock+s)),c.delete(e),s-=c.length),c=c.right;if(s>0)throw Ur();t._searchMarker&&se(t._searchMarker,r,-i+s)},De=(e,t,n)=>{const s=t._map.get(n);s!==void 0&&s.delete(e)},Fn=(e,t,n,s)=>{const r=t._map.get(n)||null,i=e.doc,o=i.clientID;let c;if(s==null)c=new it([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new it([s]);break;case Uint8Array:c=new Ot(s);break;case gt:c=new Ut(s);break;default:if(s instanceof A)c=new Y(s);else throw new Error("Unexpected content type")}new y(w(o,E(i.store,o)),r,r&&r.lastId,null,null,t,n,c).integrate(e,0)},Bn=(e,t)=>{e.doc??O();const n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},Mr=e=>{const t={};return e.doc??O(),e._map.forEach((n,s)=>{n.deleted||(t[s]=n.content.getContent()[n.length-1])}),t},Nr=(e,t)=>{e.doc??O();const n=e._map.get(t);return n!==void 0&&!n.deleted},Qc=(e,t,n)=>{let s=e._map.get(t)||null;for(;s!==null&&(!n.sv.has(s.id.client)||s.id.clock>=(n.sv.get(s.id.client)||0));)s=s.left;return s!==null&&lt(s,n)?s.content.getContent()[s.length-1]:void 0},Rr=(e,t)=>{const n={};return e._map.forEach((s,r)=>{let i=s;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&lt(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},de=e=>(e.doc??O(),Ko(e._map.entries(),t=>!t[1].deleted));class $r extends ae{}class nt extends A{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const n=new nt;return n.push(t),n}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new nt}clone(){const t=new nt;return t.insert(0,this.toArray().map(n=>n instanceof A?n.clone():n)),t}get length(){return this.doc??O(),this._length}_callObserver(t,n){super._callObserver(t,n),Ge(this,t,new $r(this,t))}insert(t,n){this.doc!==null?_(this.doc,s=>{vr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}push(t){this.doc!==null?_(this.doc,n=>{Zc(n,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,n=1){this.doc!==null?_(this.doc,s=>{Lr(s,this,t,n)}):this._prelimContent.splice(t,n)}get(t){return Or(this,t)}toArray(){return Tr(this)}slice(t=0,n=this.length){return Ir(this,t,n)}toJSON(){return this.map(t=>t instanceof A?t.toJSON():t)}map(t){return xr(this,t)}forEach(t){re(this,t)}[Symbol.iterator](){return Pc(this)}_write(t){t.writeTypeRef(_l)}}const tl=e=>new nt;class Vr extends ae{constructor(t,n,s){super(t,n),this.keysChanged=s}}class ut extends A{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,n){super._integrate(t,n),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new ut}clone(){const t=new ut;return this.forEach((n,s)=>{t.set(s,n instanceof A?n.clone():n)}),t}_callObserver(t,n){Ge(this,t,new Vr(this,t,n))}toJSON(){this.doc??O();const t={};return this._map.forEach((n,s)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];t[s]=r instanceof A?r.toJSON():r}}),t}get size(){return[...de(this)].length}keys(){return Ze(de(this),t=>t[0])}values(){return Ze(de(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Ze(de(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??O(),this._map.forEach((n,s)=>{n.deleted||t(n.content.getContent()[n.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._prelimContent.delete(t)}set(t,n){return this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._prelimContent.set(t,n),n}get(t){return Bn(this,t)}has(t){return Nr(this,t)}clear(){this.doc!==null?_(this.doc,t=>{this.forEach(function(n,s,r){De(t,r,s)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(bl)}}const el=e=>new ut,at=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&zi(e,t);class un{constructor(t,n,s,r){this.left=t,this.right=n,this.index=s,this.currentAttributes=r}forward(){this.right===null&&v(),this.right.content.constructor===C?this.right.deleted||Gt(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const gs=(e,t,n)=>{for(;t.right!==null&&n>0;)t.right.content.constructor===C?t.right.deleted||Gt(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&U(e,w(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},fe=(e,t,n,s)=>{const r=new Map,i=s?ze(t,n):null;if(i){const o=new un(i.p.left,i.p,i.index,r);return gs(e,o,n-i.index)}else{const o=new un(null,t._start,0,r);return gs(e,o,n)}},Fr=(e,t,n,s)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===C&&at(s.get(n.right.content.key),n.right.content.value));)n.right.deleted||s.delete(n.right.content.key),n.forward();const r=e.doc,i=r.clientID;s.forEach((o,c)=>{const l=n.left,a=n.right,h=new y(w(i,E(r.store,i)),l,l&&l.lastId,a,a&&a.id,t,null,new C(c,o));h.integrate(e,0),n.right=h,n.forward()})},Gt=(e,t)=>{const{key:n,value:s}=t;s===null?e.delete(n):e.set(n,s)},Br=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===C&&at(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},jr=(e,t,n,s)=>{const r=e.doc,i=r.clientID,o=new Map;for(const c in s){const l=s[c],a=n.currentAttributes.get(c)??null;if(!at(a,l)){o.set(c,a);const{left:h,right:u}=n;n.right=new y(w(i,E(r.store,i)),h,h&&h.lastId,u,u&&u.id,t,null,new C(c,l)),n.right.integrate(e,0),n.forward()}}return o},Qe=(e,t,n,s,r)=>{n.currentAttributes.forEach((d,f)=>{r[f]===void 0&&(r[f]=null)});const i=e.doc,o=i.clientID;Br(n,r);const c=jr(e,t,n,r),l=s.constructor===String?new J(s):s instanceof A?new Y(s):new ct(s);let{left:a,right:h,index:u}=n;t._searchMarker&&se(t._searchMarker,n.index,l.getLength()),h=new y(w(o,E(i.store,o)),a,a&&a.lastId,h,h&&h.id,t,null,l),h.integrate(e,0),n.right=h,n.index=u,n.forward(),Fr(e,t,n,c)},ps=(e,t,n,s,r)=>{const i=e.doc,o=i.clientID;Br(n,r);const c=jr(e,t,n,r);t:for(;n.right!==null&&(s>0||c.size>0&&(n.right.deleted||n.right.content.constructor===C));){if(!n.right.deleted)switch(n.right.content.constructor){case C:{const{key:l,value:a}=n.right.content,h=r[l];if(h!==void 0){if(at(h,a))c.delete(l);else{if(s===0)break t;c.set(l,a)}n.right.delete(e)}else n.currentAttributes.set(l,a);break}default:s<n.right.length&&U(e,w(n.right.id.client,n.right.id.clock+s)),s-=n.right.length;break}n.forward()}if(s>0){let l="";for(;s>0;s--)l+=`
4
- `;n.right=new y(w(o,E(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new J(l)),n.right.integrate(e,0),n.forward()}Fr(e,t,n,c)},zr=(e,t,n,s,r)=>{let i=t;const o=T();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===C){const a=i.content;o.set(a.key,a)}i=i.right}let c=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const a=t.content;if(a.constructor===C){const{key:h,value:u}=a,d=s.get(h)??null;(o.get(h)!==a||d===u)&&(t.delete(e),c++,!l&&(r.get(h)??null)===u&&d!==u&&(d===null?r.delete(h):r.set(h,d))),!l&&!t.deleted&&Gt(r,a)}}t=t.right}return c},nl=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===C){const s=t.content.key;n.has(s)?t.delete(e):n.add(s)}t=t.left}},Gr=e=>{let t=0;return _(e.doc,n=>{let s=e._start,r=e._start,i=T();const o=en(i);for(;r;)r.deleted===!1&&(r.content.constructor===C?Gt(o,r.content):(t+=zr(n,s,r,i,o),i=en(o),s=r)),r=r.right}),t},sl=e=>{const t=new Set,n=e.doc;for(const[s,r]of e.afterState.entries()){const i=e.beforeState.get(s)||0;r!==i&&dr(e,n.store.clients.get(s),i,r,o=>{!o.deleted&&o.content.constructor===C&&o.constructor!==$&&t.add(o.parent)})}_(n,s=>{Ct(e,e.deleteSet,r=>{if(r instanceof $||!r.parent._hasFormatting||t.has(r.parent))return;const i=r.parent;r.content.constructor===C?t.add(i):nl(s,r)});for(const r of t)Gr(r)})},ws=(e,t,n)=>{const s=n,r=en(t.currentAttributes),i=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Y:case ct:case J:n<t.right.length&&U(e,w(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}i&&zr(e,i,t.right,r,t.currentAttributes);const o=(t.left||t.right).parent;return o._searchMarker&&se(o._searchMarker,t.index,-s+n),t};class Jr extends ae{constructor(t,n,s){super(t,n),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,n=[];_(t,s=>{const r=new Map,i=new Map;let o=this.target._start,c=null;const l={};let a="",h=0,u=0;const d=()=>{if(c!==null){let f=null;switch(c){case"delete":u>0&&(f={delete:u}),u=0;break;case"insert":(typeof a=="object"||a.length>0)&&(f={insert:a},r.size>0&&(f.attributes={},r.forEach((g,k)=>{g!==null&&(f.attributes[k]=g)}))),a="";break;case"retain":h>0&&(f={retain:h},ji(l)||(f.attributes=Vi({},l))),h=0;break}f&&n.push(f),c=null}};for(;o!==null;){switch(o.content.constructor){case Y:case ct:this.adds(o)?this.deletes(o)||(d(),c="insert",a=o.content.getContent()[0],d()):this.deletes(o)?(c!=="delete"&&(d(),c="delete"),u+=1):o.deleted||(c!=="retain"&&(d(),c="retain"),h+=1);break;case J:this.adds(o)?this.deletes(o)||(c!=="insert"&&(d(),c="insert"),a+=o.content.str):this.deletes(o)?(c!=="delete"&&(d(),c="delete"),u+=o.length):o.deleted||(c!=="retain"&&(d(),c="retain"),h+=o.length);break;case C:{const{key:f,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const k=r.get(f)??null;at(k,g)?g!==null&&o.delete(s):(c==="retain"&&d(),at(g,i.get(f)??null)?delete l[f]:l[f]=g)}}else if(this.deletes(o)){i.set(f,g);const k=r.get(f)??null;at(k,g)||(c==="retain"&&d(),l[f]=k)}else if(!o.deleted){i.set(f,g);const k=l[f];k!==void 0&&(at(k,g)?k!==null&&o.delete(s):(c==="retain"&&d(),g===null?delete l[f]:l[f]=g))}o.deleted||(c==="insert"&&d(),Gt(r,o.content));break}}o=o.right}for(d();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class At extends A{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??O(),this._length}_integrate(t,n){super._integrate(t,n);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new At}clone(){const t=new At;return t.applyDelta(this.toDelta()),t}_callObserver(t,n){super._callObserver(t,n);const s=new Jr(this,t,n);Ge(this,t,s),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??O();let t="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===J&&(t+=n.content.str),n=n.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:n=!0}={}){this.doc!==null?_(this.doc,s=>{const r=new un(null,this._start,0,new Map);for(let i=0;i<t.length;i++){const o=t[i];if(o.insert!==void 0){const c=!n&&typeof o.insert=="string"&&i===t.length-1&&r.right===null&&o.insert.slice(-1)===`
5
- `?o.insert.slice(0,-1):o.insert;(typeof c!="string"||c.length>0)&&Qe(s,this,r,c,o.attributes||{})}else o.retain!==void 0?ps(s,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&ws(s,r,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,n,s){this.doc??O();const r=[],i=new Map,o=this.doc;let c="",l=this._start;function a(){if(c.length>0){const u={};let d=!1;i.forEach((g,k)=>{d=!0,u[k]=g});const f={insert:c};d&&(f.attributes=u),r.push(f),c=""}}const h=()=>{for(;l!==null;){if(lt(l,t)||n!==void 0&&lt(l,n))switch(l.content.constructor){case J:{const u=i.get("ychange");t!==void 0&&!lt(l,t)?(u===void 0||u.user!==l.id.client||u.type!=="removed")&&(a(),i.set("ychange",s?s("removed",l.id):{type:"removed"})):n!==void 0&&!lt(l,n)?(u===void 0||u.user!==l.id.client||u.type!=="added")&&(a(),i.set("ychange",s?s("added",l.id):{type:"added"})):u!==void 0&&(a(),i.delete("ychange")),c+=l.content.str;break}case Y:case ct:{a();const u={insert:l.content.getContent()[0]};if(i.size>0){const d={};u.attributes=d,i.forEach((f,g)=>{d[g]=f})}r.push(u);break}case C:lt(l,t)&&(a(),Gt(i,l.content));break}l=l.right}a()};return t||n?_(o,u=>{t&&ln(u,t),n&&ln(u,n),h()},"cleanup"):h(),r}insert(t,n,s){if(n.length<=0)return;const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!s);s||(s={},o.currentAttributes.forEach((c,l)=>{s[l]=c})),Qe(i,this,o,n,s)}):this._pending.push(()=>this.insert(t,n,s))}insertEmbed(t,n,s){const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!s);Qe(i,this,o,n,s||{})}):this._pending.push(()=>this.insertEmbed(t,n,s||{}))}delete(t,n){if(n===0)return;const s=this.doc;s!==null?_(s,r=>{ws(r,fe(r,this,t,!0),n)}):this._pending.push(()=>this.delete(t,n))}format(t,n,s){if(n===0)return;const r=this.doc;r!==null?_(r,i=>{const o=fe(i,this,t,!1);o.right!==null&&ps(i,this,o,n,s)}):this._pending.push(()=>this.format(t,n,s))}removeAttribute(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,n){this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._pending.push(()=>this.setAttribute(t,n))}getAttribute(t){return Bn(this,t)}getAttributes(){return Mr(this)}_write(t){t.writeTypeRef(Sl)}}const rl=e=>new At;class tn{constructor(t,n=()=>!0){this._filter=n,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??O()}[Symbol.iterator](){return this}next(){let t=this._currentNode,n=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(n)))do if(n=t.content.type,!t.deleted&&(n.constructor===ft||n.constructor===dt)&&n._start!==null)t=n._start;else for(;t!==null;){const s=t.next;if(s!==null){t=s;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class dt extends A{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,n){super._integrate(t,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new dt}clone(){const t=new dt;return t.insert(0,this.toArray().map(n=>n instanceof A?n.clone():n)),t}get length(){return this.doc??O(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new tn(this,t)}querySelector(t){t=t.toUpperCase();const s=new tn(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return s.done?null:s.value}querySelectorAll(t){return t=t.toUpperCase(),st(new tn(this,n=>n.nodeName&&n.nodeName.toUpperCase()===t))}_callObserver(t,n){Ge(this,t,new Hr(this,n,t))}toString(){return xr(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,n={},s){const r=t.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),re(this,i=>{r.insertBefore(i.toDOM(t,n,s),null)}),r}insert(t,n){this.doc!==null?_(this.doc,s=>{vr(s,this,t,n)}):this._prelimContent.splice(t,0,...n)}insertAfter(t,n){if(this.doc!==null)_(this.doc,s=>{const r=t&&t instanceof A?t._item:t;Ce(s,this,r,n)});else{const s=this._prelimContent,r=t===null?0:s.findIndex(i=>i===t)+1;if(r===0&&t!==null)throw P("Reference item not found");s.splice(r,0,...n)}}delete(t,n=1){this.doc!==null?_(this.doc,s=>{Lr(s,this,t,n)}):this._prelimContent.splice(t,n)}toArray(){return Tr(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return Or(this,t)}slice(t=0,n=this.length){return Ir(this,t,n)}forEach(t){re(this,t)}_write(t){t.writeTypeRef(Cl)}}const il=e=>new dt;class ft extends dt{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,n){super._integrate(t,n),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new ft(this.nodeName)}clone(){const t=new ft(this.nodeName),n=this.getAttributes();return Bi(n,(s,r)=>{t.setAttribute(r,s)}),t.insert(0,this.toArray().map(s=>s instanceof A?s.clone():s)),t}toString(){const t=this.getAttributes(),n=[],s=[];for(const c in t)s.push(c);s.sort();const r=s.length;for(let c=0;c<r;c++){const l=s[c];n.push(l+'="'+t[l]+'"')}const i=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?_(this.doc,n=>{De(n,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,n){this.doc!==null?_(this.doc,s=>{Fn(s,this,t,n)}):this._prelimAttrs.set(t,n)}getAttribute(t){return Bn(this,t)}hasAttribute(t){return Nr(this,t)}getAttributes(t){return t?Rr(this,t):Mr(this)}toDOM(t=document,n={},s){const r=t.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const c=i[o];typeof c=="string"&&r.setAttribute(o,c)}return re(this,o=>{r.appendChild(o.toDOM(t,n,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(t){t.writeTypeRef(El),t.writeKey(this.nodeName)}}const ol=e=>new ft(e.readKey());class Hr extends ae{constructor(t,n,s){super(t,s),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class Vt extends ut{constructor(t){super(),this.hookName=t}_copy(){return new Vt(this.hookName)}clone(){const t=new Vt(this.hookName);return this.forEach((n,s)=>{t.set(s,n)}),t}toDOM(t=document,n={},s){const r=n[this.hookName];let i;return r!==void 0?i=r.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(i,this),i}_write(t){t.writeTypeRef(Dl),t.writeKey(this.hookName)}}const cl=e=>new Vt(e.readKey());class ie extends At{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new ie}clone(){const t=new ie;return t.applyDelta(this.toDelta()),t}toDOM(t=document,n,s){const r=t.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const n=[];for(const r in t.attributes){const i=[];for(const o in t.attributes[r])i.push({key:o,value:t.attributes[r][o]});i.sort((o,c)=>o.key<c.key?-1:1),n.push({nodeName:r,attrs:i})}n.sort((r,i)=>r.nodeName<i.nodeName?-1:1);let s="";for(let r=0;r<n.length;r++){const i=n[r];s+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){const c=i.attrs[o];s+=` ${c.key}="${c.value}"`}s+=">"}s+=t.insert;for(let r=n.length-1;r>=0;r--)s+=`</${n[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Al)}}const ll=e=>new ie;class Je{constructor(t,n){this.id=t,this.length=n}get deleted(){throw X()}mergeWith(t){return!1}write(t,n,s){throw X()}integrate(t,n){throw X()}}const hl=0;class $ extends Je{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){n>0&&(this.id.clock+=n,this.length-=n),ur(t.doc.store,this)}write(t,n){t.writeInfo(hl),t.writeLen(this.length-n)}getMissing(t,n){return null}}class Ot{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Ot(this.content)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeBuf(this.content)}getRef(){return 3}}const al=e=>new Ot(e.readBuf());class It{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new It(this.len)}splice(t){const n=new It(this.len-t);return this.len=t,n}mergeWith(t){return this.len+=t.len,!0}integrate(t,n){Qt(t.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(t){}gc(t){}write(t,n){t.writeLen(this.len-n)}getRef(){return 1}}const ul=e=>new It(e.readLen()),Yr=(e,t)=>new gt({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ut{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const n={};this.opts=n,t.gc||(n.gc=!1),t.autoLoad&&(n.autoLoad=!0),t.meta!==null&&(n.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ut(Yr(this.doc.guid,this.opts))}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){this.doc._item=n,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,n){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const dl=e=>new Ut(Yr(e.readString(),e.readAny()));class ct{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ct(this.embed)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeJSON(this.embed)}getRef(){return 5}}const fl=e=>new ct(e.readJSON());class C{constructor(t,n){this.key=t,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new C(this.key,this.value)}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){const s=n.parent;s._searchMarker=null,s._hasFormatting=!0}delete(t){}gc(t){}write(t,n){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const gl=e=>new C(e.readKey(),e.readJSON());class Ft{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ft(this.arr)}splice(t){const n=new Ft(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}const pl=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++){const r=e.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new Ft(n)},wl=be("node_env")==="development";class it{constructor(t){this.arr=t,wl&&Is(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new it(this.arr)}splice(t){const n=new it(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){const s=this.arr.length;t.writeLen(s-n);for(let r=n;r<s;r++){const i=this.arr[r];t.writeAny(i)}}getRef(){return 8}}const ml=e=>{const t=e.readLen(),n=[];for(let s=0;s<t;s++)n.push(e.readAny());return new it(n)};class J{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new J(this.str)}splice(t){const n=new J(this.str.slice(t));this.str=this.str.slice(0,t);const s=this.str.charCodeAt(t-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,t-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(t){return this.str+=t.str,!0}integrate(t,n){}delete(t){}gc(t){}write(t,n){t.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const kl=e=>new J(e.readString()),yl=[tl,el,rl,ol,il,cl,ll],_l=0,bl=1,Sl=2,El=3,Cl=4,Dl=5,Al=6;class Y{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Y(this.type._copy())}splice(t){throw X()}mergeWith(t){return!1}integrate(t,n){this.type._integrate(t.doc,n)}delete(t){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t),n=n.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(t.beforeState.get(s.id.client)||0)&&t._mergeStructs.push(s):s.delete(t)}),t.changed.delete(this.type)}gc(t){let n=this.type._start;for(;n!==null;)n.gc(t,!0),n=n.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(t,!0),s=s.left}),this.type._map=new Map}write(t,n){this.type._write(t)}getRef(){return 7}}const Il=e=>new Y(yl[e.readTypeRef()](e)),dn=(e,t)=>{let n=t,s=0,r;do s>0&&(n=w(n.client,n.clock+s)),r=St(e,n),s=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof y);return{item:r,diff:s}},jn=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},Ae=(e,t,n)=>{const{client:s,clock:r}=t.id,i=new y(w(s,r+n),t,w(s,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=w(t.redone.client,t.redone.clock+n)),t.right=i,i.right!==null&&(i.right.left=i),e._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=n,i},ms=(e,t)=>gn(e,n=>xt(n.deletions,t)),Xr=(e,t,n,s,r,i)=>{const o=e.doc,c=o.store,l=o.clientID,a=t.redone;if(a!==null)return U(e,a);let h=t.parent._item,u=null,d;if(h!==null&&h.deleted===!0){if(h.redone===null&&(!n.has(h)||Xr(e,h,n,s,r,i)===null))return null;for(;h.redone!==null;)h=U(e,h.redone)}const f=h===null?t.parent:h.content.type;if(t.parentSub===null){for(u=t.left,d=t;u!==null;){let S=u;for(;S!==null&&S.parent._item!==h;)S=S.redone===null?null:U(e,S.redone);if(S!==null&&S.parent._item===h){u=S;break}u=u.left}for(;d!==null;){let S=d;for(;S!==null&&S.parent._item!==h;)S=S.redone===null?null:U(e,S.redone);if(S!==null&&S.parent._item===h){d=S;break}d=d.right}}else if(d=null,t.right&&!r){for(u=t;u!==null&&u.right!==null&&(u.right.redone||xt(s,u.right.id)||ms(i.undoStack,u.right.id)||ms(i.redoStack,u.right.id));)for(u=u.right;u.redone;)u=U(e,u.redone);if(u&&u.right!==null)return null}else u=f._map.get(t.parentSub)||null;const g=E(c,l),k=w(l,g),b=new y(k,u,u&&u.lastId,d,d&&d.id,f,t.parentSub,t.content.copy());return t.redone=k,jn(b,!0),b.integrate(e,0),b};class y extends Je{constructor(t,n,s,r,i,o,c,l){super(t,l.getLength()),this.origin=s,this.left=n,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=c,this.redone=null,this.content=l,this.info=this.content.isCountable()?Hn:0}set marker(t){(this.info&Xe)>0!==t&&(this.info^=Xe)}get marker(){return(this.info&Xe)>0}get keep(){return(this.info&Jn)>0}set keep(t){this.keep!==t&&(this.info^=Jn)}get countable(){return(this.info&Hn)>0}get deleted(){return(this.info&Ye)>0}set deleted(t){this.deleted!==t&&(this.info^=Ye)}markDeleted(){this.info|=Ye}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=E(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=E(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===bt&&this.id.client!==this.parent.client&&this.parent.clock>=E(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=an(t,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=U(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===$||this.right&&this.right.constructor===$)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===y?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===y&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===bt){const s=St(n,this.parent);s.constructor===$?this.parent=null:this.parent=s.content.type}return null}integrate(t,n){if(n>0&&(this.id.clock+=n,this.left=an(t,t.doc.store,w(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const i=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),i.add(r),mt(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,i.clear();else if(mt(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(St(t.doc.store,r.origin)))i.has(St(t.doc.store,r.origin))||(s=r,i.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),ur(t.doc.store,this),this.content.integrate(t,this),as(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new $(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:w(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&mt(t.origin,this.lastId)&&this.right===t&&mt(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const n=this.parent._searchMarker;return n&&n.forEach(s=>{s.p===t&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Qt(t.deleteSet,this.id.client,this.id.clock,this.length),as(t,n,this.parentSub),this.content.delete(t)}}gc(t,n){if(!this.deleted)throw v();this.content.gc(t),n?Uc(t,this,new $(this.id,this.length)):this.content=new It(this.length)}write(t,n){const s=n>0?w(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Ie|(s===null?0:B)|(r===null?0:et)|(i===null?0:Ht);if(t.writeInfo(o),s!==null&&t.writeLeftID(s),r!==null&&t.writeRightID(r),s===null&&r===null){const c=this.parent;if(c._item!==void 0){const l=c._item;if(l===null){const a=vn(c);t.writeParentInfo(!0),t.writeString(a)}else t.writeParentInfo(!1),t.writeLeftID(l.id)}else c.constructor===String?(t.writeParentInfo(!0),t.writeString(c)):c.constructor===bt?(t.writeParentInfo(!1),t.writeLeftID(c)):v();i!==null&&t.writeString(i)}this.content.write(t,n)}}const Kr=(e,t)=>Tl[t&Ie](e),Tl=[()=>{v()},ul,pl,al,kl,fl,gl,Il,ml,dl,()=>{v()}],xl=10;class M extends Je{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,n){v()}write(t,n){t.writeInfo(xl),p(t.restEncoder,this.length-n)}getMissing(t,n){return null}}const Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},qr="__ $YJS$ __";Wr[qr]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Wr[qr]=!0;const Ml=Object.freeze(Object.defineProperty({__proto__:null,AbsolutePosition:cr,AbstractConnector:Wo,AbstractStruct:Je,AbstractType:A,Array:nt,ContentAny:it,ContentBinary:Ot,ContentDeleted:It,ContentDoc:Ut,ContentEmbed:ct,ContentFormat:C,ContentJSON:Ft,ContentString:J,ContentType:Y,Doc:gt,GC:$,ID:bt,Item:y,Map:ut,PermanentUserData:ac,RelativePosition:Be,Skip:M,Snapshot:Ln,Text:At,Transaction:fr,UndoManager:Mc,UpdateDecoderV1:H,UpdateDecoderV2:j,UpdateEncoderV1:pt,UpdateEncoderV2:K,XmlElement:ft,XmlFragment:dt,XmlHook:Vt,XmlText:ie,YArrayEvent:$r,YEvent:ae,YMapEvent:Vr,YTextEvent:Jr,YXmlEvent:Hr,applyUpdate:nc,applyUpdateV2:Fe,cleanupYTextFormatting:Gr,compareIDs:mt,compareRelativePositions:bc,convertUpdateFormatV1ToV2:Jc,convertUpdateFormatV2ToV1:Cr,createAbsolutePositionFromRelativePosition:_c,createDeleteSet:$e,createDeleteSetFromStructStore:In,createDocFromSnapshot:Ic,createID:w,createRelativePositionFromJSON:dc,createRelativePositionFromTypeIndex:gc,createSnapshot:Mn,decodeRelativePosition:kc,decodeSnapshot:Cc,decodeSnapshotV2:hr,decodeStateVector:On,decodeUpdate:$c,decodeUpdateV2:kr,diffUpdate:jc,diffUpdateV2:Rn,emptySnapshot:Dc,encodeRelativePosition:wc,encodeSnapshot:Ec,encodeSnapshotV2:lr,encodeStateAsUpdate:rc,encodeStateAsUpdateV2:rr,encodeStateVector:cc,encodeStateVectorFromUpdate:Vc,encodeStateVectorFromUpdateV2:_r,equalDeleteSets:er,equalSnapshots:Sc,findIndexSS:G,findRootTypeKey:vn,getItem:St,getItemCleanEnd:an,getItemCleanStart:U,getState:E,getTypeChildren:Wc,isDeleted:xt,isParentOf:ee,iterateDeletedStructs:Ct,logType:hc,logUpdate:Rc,logUpdateV2:mr,mergeDeleteSets:Dt,mergeUpdates:yr,mergeUpdatesV2:ne,obfuscateUpdate:zc,obfuscateUpdateV2:Gc,parseUpdateMeta:Fc,parseUpdateMetaV2:br,readUpdate:ec,readUpdateV2:xn,relativePositionToJSON:uc,snapshot:Ac,snapshotContainsUpdate:xc,transact:_,tryGc:vc,typeListToArraySnapshot:qc,typeMapGetAllSnapshot:Rr,typeMapGetSnapshot:Qc},Symbol.toStringTag,{value:"Module"}));export{tt as A,Ml as B,gt as D,Ol as O,Mc as U,yt as a,_t as b,Bt as c,L as d,me as e,q as f,Li as g,V as h,cc as i,nc as j,F as k,rc as l,ui as m,uc as n,dc as o,Ul as p,gc as q,m as r,_c as s,z as t,bc as u,ks as v,p as w,Tt as x,vl as y,Ll as z};