studiograph 1.3.47 → 1.3.48-beta.1

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 (1067) hide show
  1. package/README.md +26 -16
  2. package/dist/agent/agent-pool.d.ts +117 -0
  3. package/dist/agent/agent-pool.js +287 -0
  4. package/dist/agent/agent-pool.js.map +1 -0
  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 +113 -22
  9. package/dist/agent/orchestrator.js +573 -181
  10. package/dist/agent/orchestrator.js.map +1 -1
  11. package/dist/agent/prompts/entity-types-section.d.ts +36 -0
  12. package/dist/agent/prompts/entity-types-section.js +90 -0
  13. package/dist/agent/prompts/entity-types-section.js.map +1 -0
  14. package/dist/agent/prompts/system.md +148 -69
  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/entity-schema.md +77 -433
  19. package/dist/agent/skills/interview/entity-templates.md +193 -0
  20. package/dist/agent/skills/interview/question-domains.md +391 -0
  21. package/dist/agent/skills/interview/skill.md +204 -0
  22. package/dist/agent/skills/schema-rules.md +54 -0
  23. package/dist/agent/tools/capture-tools.d.ts +31 -0
  24. package/dist/agent/tools/capture-tools.js +40 -0
  25. package/dist/agent/tools/capture-tools.js.map +1 -0
  26. package/dist/agent/tools/folder-tools.d.ts +47 -0
  27. package/dist/agent/tools/folder-tools.js +249 -0
  28. package/dist/agent/tools/folder-tools.js.map +1 -0
  29. package/dist/agent/tools/fs-tools.d.ts +7 -6
  30. package/dist/agent/tools/fs-tools.js +5 -4
  31. package/dist/agent/tools/fs-tools.js.map +1 -1
  32. package/dist/agent/tools/graph-tools.d.ts +21 -58
  33. package/dist/agent/tools/graph-tools.js +635 -332
  34. package/dist/agent/tools/graph-tools.js.map +1 -1
  35. package/dist/agent/tools/history-tools.d.ts +95 -0
  36. package/dist/agent/tools/history-tools.js +461 -0
  37. package/dist/agent/tools/history-tools.js.map +1 -0
  38. package/dist/agent/tools/load-skill.d.ts +6 -5
  39. package/dist/agent/tools/load-skill.js +3 -3
  40. package/dist/agent/tools/load-skill.js.map +1 -1
  41. package/dist/agent/tools/ops-tools.d.ts +5 -4
  42. package/dist/agent/tools/ops-tools.js +130 -236
  43. package/dist/agent/tools/ops-tools.js.map +1 -1
  44. package/dist/agent/tools/permission-tools.d.ts +87 -17
  45. package/dist/agent/tools/permission-tools.js +233 -38
  46. package/dist/agent/tools/permission-tools.js.map +1 -1
  47. package/dist/agent/tools/tool-loader.js +5 -4
  48. package/dist/agent/tools/tool-loader.js.map +1 -1
  49. package/dist/agent/tools/web-tools.d.ts +18 -0
  50. package/dist/agent/tools/web-tools.js +283 -0
  51. package/dist/agent/tools/web-tools.js.map +1 -0
  52. package/dist/cli/commands/about.d.ts +1 -0
  53. package/dist/cli/commands/about.js +55 -3
  54. package/dist/cli/commands/about.js.map +1 -1
  55. package/dist/cli/commands/admin/audit-workspace.d.ts +23 -0
  56. package/dist/cli/commands/admin/audit-workspace.js +133 -0
  57. package/dist/cli/commands/admin/audit-workspace.js.map +1 -0
  58. package/dist/cli/commands/admin/audit.d.ts +21 -0
  59. package/dist/cli/commands/admin/audit.js +174 -0
  60. package/dist/cli/commands/admin/audit.js.map +1 -0
  61. package/dist/cli/commands/admin/backup.d.ts +54 -0
  62. package/dist/cli/commands/admin/backup.js +207 -0
  63. package/dist/cli/commands/admin/backup.js.map +1 -0
  64. package/dist/cli/commands/admin/folder.d.ts +11 -0
  65. package/dist/cli/commands/admin/folder.js +186 -0
  66. package/dist/cli/commands/admin/folder.js.map +1 -0
  67. package/dist/cli/commands/admin/index.d.ts +16 -0
  68. package/dist/cli/commands/admin/index.js +46 -0
  69. package/dist/cli/commands/admin/index.js.map +1 -0
  70. package/dist/cli/commands/admin/migrate-assets.d.ts +53 -0
  71. package/dist/cli/commands/admin/migrate-assets.js +184 -0
  72. package/dist/cli/commands/admin/migrate-assets.js.map +1 -0
  73. package/dist/cli/commands/admin/migrate.d.ts +56 -0
  74. package/dist/cli/commands/admin/migrate.js +263 -0
  75. package/dist/cli/commands/admin/migrate.js.map +1 -0
  76. package/dist/cli/commands/admin/restore.d.ts +24 -0
  77. package/dist/cli/commands/admin/restore.js +228 -0
  78. package/dist/cli/commands/admin/restore.js.map +1 -0
  79. package/dist/cli/commands/admin/secrets.d.ts +23 -0
  80. package/dist/cli/commands/admin/secrets.js +256 -0
  81. package/dist/cli/commands/admin/secrets.js.map +1 -0
  82. package/dist/cli/commands/admin/settings.d.ts +28 -0
  83. package/dist/cli/commands/admin/settings.js +284 -0
  84. package/dist/cli/commands/admin/settings.js.map +1 -0
  85. package/dist/cli/commands/admin/token.d.ts +42 -0
  86. package/dist/cli/commands/admin/token.js +126 -0
  87. package/dist/cli/commands/admin/token.js.map +1 -0
  88. package/dist/cli/commands/admin/transfer-ownership.d.ts +15 -0
  89. package/dist/cli/commands/admin/transfer-ownership.js +106 -0
  90. package/dist/cli/commands/admin/transfer-ownership.js.map +1 -0
  91. package/dist/cli/commands/admin/user.d.ts +11 -0
  92. package/dist/cli/commands/admin/user.js +187 -0
  93. package/dist/cli/commands/admin/user.js.map +1 -0
  94. package/dist/cli/commands/clone.d.ts +25 -3
  95. package/dist/cli/commands/clone.js +142 -36
  96. package/dist/cli/commands/clone.js.map +1 -1
  97. package/dist/cli/commands/commit.d.ts +1 -1
  98. package/dist/cli/commands/commit.js +24 -11
  99. package/dist/cli/commands/commit.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 +2 -2
  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 +12 -4
  113. package/dist/cli/commands/mcp.js.map +1 -1
  114. package/dist/cli/commands/orphans.js +14 -30
  115. package/dist/cli/commands/orphans.js.map +1 -1
  116. package/dist/cli/commands/r2.d.ts +3 -0
  117. package/dist/cli/commands/r2.js +223 -204
  118. package/dist/cli/commands/r2.js.map +1 -1
  119. package/dist/cli/commands/redeploy.js +65 -12
  120. package/dist/cli/commands/redeploy.js.map +1 -1
  121. package/dist/cli/commands/reset.d.ts +22 -6
  122. package/dist/cli/commands/reset.js +142 -63
  123. package/dist/cli/commands/reset.js.map +1 -1
  124. package/dist/cli/commands/serve.js +209 -24
  125. package/dist/cli/commands/serve.js.map +1 -1
  126. package/dist/cli/commands/sync.d.ts +1 -1
  127. package/dist/cli/commands/sync.js +372 -202
  128. package/dist/cli/commands/sync.js.map +1 -1
  129. package/dist/cli/crypto-bundle.d.ts +39 -0
  130. package/dist/cli/crypto-bundle.js +94 -0
  131. package/dist/cli/crypto-bundle.js.map +1 -0
  132. package/dist/cli/index.js +24 -35
  133. package/dist/cli/index.js.map +1 -1
  134. package/dist/cli/railway-pin.d.ts +68 -0
  135. package/dist/cli/railway-pin.js +96 -0
  136. package/dist/cli/railway-pin.js.map +1 -0
  137. package/dist/cli/railway-provisioning.d.ts +53 -0
  138. package/dist/cli/railway-provisioning.js +85 -0
  139. package/dist/cli/railway-provisioning.js.map +1 -0
  140. package/dist/cli/setup-wizard.d.ts +33 -52
  141. package/dist/cli/setup-wizard.js +43 -68
  142. package/dist/cli/setup-wizard.js.map +1 -1
  143. package/dist/core/accent-palette.d.ts +22 -0
  144. package/dist/core/accent-palette.js +47 -0
  145. package/dist/core/accent-palette.js.map +1 -0
  146. package/dist/core/cell-anchor.d.ts +29 -0
  147. package/dist/core/cell-anchor.js +53 -0
  148. package/dist/core/cell-anchor.js.map +1 -0
  149. package/dist/core/comment-anchor.d.ts +41 -0
  150. package/dist/core/comment-anchor.js +147 -0
  151. package/dist/core/comment-anchor.js.map +1 -0
  152. package/dist/core/commit-messages.d.ts +57 -0
  153. package/dist/core/commit-messages.js +85 -0
  154. package/dist/core/commit-messages.js.map +1 -0
  155. package/dist/core/embeds.d.ts +56 -0
  156. package/dist/core/embeds.js +103 -0
  157. package/dist/core/embeds.js.map +1 -0
  158. package/dist/core/entity-body-templates.d.ts +21 -0
  159. package/dist/core/entity-body-templates.js +53 -0
  160. package/dist/core/entity-body-templates.js.map +1 -0
  161. package/dist/core/entity-types-catalog.d.ts +65 -0
  162. package/dist/core/entity-types-catalog.js +140 -0
  163. package/dist/core/entity-types-catalog.js.map +1 -0
  164. package/dist/core/folder-paths.d.ts +41 -0
  165. package/dist/core/folder-paths.js +95 -0
  166. package/dist/core/folder-paths.js.map +1 -0
  167. package/dist/core/folder-sidecar.d.ts +36 -0
  168. package/dist/core/folder-sidecar.js +91 -0
  169. package/dist/core/folder-sidecar.js.map +1 -0
  170. package/dist/core/graph.d.ts +675 -14
  171. package/dist/core/graph.js +2118 -314
  172. package/dist/core/graph.js.map +1 -1
  173. package/dist/core/history-diff.d.ts +35 -0
  174. package/dist/core/history-diff.js +114 -0
  175. package/dist/core/history-diff.js.map +1 -0
  176. package/dist/core/schema-registry.d.ts +59 -0
  177. package/dist/core/schema-registry.js +198 -0
  178. package/dist/core/schema-registry.js.map +1 -1
  179. package/dist/core/schemas/connector.d.ts +67 -0
  180. package/dist/core/schemas/connector.js +100 -0
  181. package/dist/core/schemas/connector.js.map +1 -0
  182. package/dist/core/schemas/workspace.d.ts +122 -0
  183. package/dist/core/schemas/workspace.js +211 -0
  184. package/dist/core/schemas/workspace.js.map +1 -0
  185. package/dist/core/secrets/SecretStore.d.ts +77 -0
  186. package/dist/core/secrets/SecretStore.js +13 -0
  187. package/dist/core/secrets/SecretStore.js.map +1 -0
  188. package/dist/core/secrets/SettingsResolver.d.ts +54 -0
  189. package/dist/core/secrets/SettingsResolver.js +80 -0
  190. package/dist/core/secrets/SettingsResolver.js.map +1 -0
  191. package/dist/core/secrets/SettingsStore.d.ts +30 -0
  192. package/dist/core/secrets/SettingsStore.js +9 -0
  193. package/dist/core/secrets/SettingsStore.js.map +1 -0
  194. package/dist/core/secrets/SqliteEncryptedStore.d.ts +90 -0
  195. package/dist/core/secrets/SqliteEncryptedStore.js +598 -0
  196. package/dist/core/secrets/SqliteEncryptedStore.js.map +1 -0
  197. package/dist/core/secrets/audit.d.ts +36 -0
  198. package/dist/core/secrets/audit.js +60 -0
  199. package/dist/core/secrets/audit.js.map +1 -0
  200. package/dist/core/secrets/auth-db-migration.d.ts +129 -0
  201. package/dist/core/secrets/auth-db-migration.js +653 -0
  202. package/dist/core/secrets/auth-db-migration.js.map +1 -0
  203. package/dist/core/secrets/bundle.d.ts +141 -0
  204. package/dist/core/secrets/bundle.js +435 -0
  205. package/dist/core/secrets/bundle.js.map +1 -0
  206. package/dist/core/secrets/dual-write.d.ts +81 -0
  207. package/dist/core/secrets/dual-write.js +247 -0
  208. package/dist/core/secrets/dual-write.js.map +1 -0
  209. package/dist/core/secrets/encryption.d.ts +44 -0
  210. package/dist/core/secrets/encryption.js +97 -0
  211. package/dist/core/secrets/encryption.js.map +1 -0
  212. package/dist/core/secrets/index.d.ts +49 -0
  213. package/dist/core/secrets/index.js +74 -0
  214. package/dist/core/secrets/index.js.map +1 -0
  215. package/dist/core/secrets/master-key.d.ts +38 -0
  216. package/dist/core/secrets/master-key.js +122 -0
  217. package/dist/core/secrets/master-key.js.map +1 -0
  218. package/dist/core/secrets/probes/anthropic.d.ts +98 -0
  219. package/dist/core/secrets/probes/anthropic.js +300 -0
  220. package/dist/core/secrets/probes/anthropic.js.map +1 -0
  221. package/dist/core/secrets/probes/brave.d.ts +9 -0
  222. package/dist/core/secrets/probes/brave.js +15 -0
  223. package/dist/core/secrets/probes/brave.js.map +1 -0
  224. package/dist/core/secrets/probes/r2.d.ts +15 -0
  225. package/dist/core/secrets/probes/r2.js +14 -0
  226. package/dist/core/secrets/probes/r2.js.map +1 -0
  227. package/dist/core/secrets/probes/voyage.d.ts +13 -0
  228. package/dist/core/secrets/probes/voyage.js +52 -0
  229. package/dist/core/secrets/probes/voyage.js.map +1 -0
  230. package/dist/core/secrets/r2-structural-migration.d.ts +39 -0
  231. package/dist/core/secrets/r2-structural-migration.js +109 -0
  232. package/dist/core/secrets/r2-structural-migration.js.map +1 -0
  233. package/dist/core/secrets/read-flip.d.ts +59 -0
  234. package/dist/core/secrets/read-flip.js +87 -0
  235. package/dist/core/secrets/read-flip.js.map +1 -0
  236. package/dist/core/secrets/registry.d.ts +188 -0
  237. package/dist/core/secrets/registry.js +598 -0
  238. package/dist/core/secrets/registry.js.map +1 -0
  239. package/dist/core/types.d.ts +77 -455
  240. package/dist/core/types.js +17 -3
  241. package/dist/core/types.js.map +1 -1
  242. package/dist/core/user-config.d.ts +75 -7
  243. package/dist/core/user-config.js +155 -7
  244. package/dist/core/user-config.js.map +1 -1
  245. package/dist/core/validation.d.ts +717 -1791
  246. package/dist/core/validation.js +357 -228
  247. package/dist/core/validation.js.map +1 -1
  248. package/dist/core/workspace-manager.d.ts +79 -12
  249. package/dist/core/workspace-manager.js +213 -73
  250. package/dist/core/workspace-manager.js.map +1 -1
  251. package/dist/core/workspace.d.ts +19 -5
  252. package/dist/core/workspace.js +69 -35
  253. package/dist/core/workspace.js.map +1 -1
  254. package/dist/mcp/comment-virtual-entity.d.ts +36 -0
  255. package/dist/mcp/comment-virtual-entity.js +71 -0
  256. package/dist/mcp/comment-virtual-entity.js.map +1 -0
  257. package/dist/mcp/connector-manager.d.ts +94 -13
  258. package/dist/mcp/connector-manager.js +283 -62
  259. package/dist/mcp/connector-manager.js.map +1 -1
  260. package/dist/mcp/oauth-provider.d.ts +27 -33
  261. package/dist/mcp/oauth-provider.js +65 -134
  262. package/dist/mcp/oauth-provider.js.map +1 -1
  263. package/dist/mcp/oauth-registry.d.ts +62 -0
  264. package/dist/mcp/oauth-registry.js +85 -0
  265. package/dist/mcp/oauth-registry.js.map +1 -0
  266. package/dist/mcp/server.d.ts +11 -3
  267. package/dist/mcp/server.js +30 -5
  268. package/dist/mcp/server.js.map +1 -1
  269. package/dist/mcp/state-signer.d.ts +41 -0
  270. package/dist/mcp/state-signer.js +120 -0
  271. package/dist/mcp/state-signer.js.map +1 -0
  272. package/dist/mcp/tools.d.ts +35 -2
  273. package/dist/mcp/tools.js +1051 -117
  274. package/dist/mcp/tools.js.map +1 -1
  275. package/dist/server/__tests__/helpers/graph-api.d.ts +18 -0
  276. package/dist/server/__tests__/helpers/graph-api.js +16 -0
  277. package/dist/server/__tests__/helpers/graph-api.js.map +1 -0
  278. package/dist/server/body-write-coordinator.d.ts +151 -0
  279. package/dist/server/body-write-coordinator.js +161 -0
  280. package/dist/server/body-write-coordinator.js.map +1 -0
  281. package/dist/server/cloud-billing-flow.d.ts +32 -0
  282. package/dist/server/cloud-billing-flow.js +75 -0
  283. package/dist/server/cloud-billing-flow.js.map +1 -0
  284. package/dist/server/commit-audit.d.ts +26 -0
  285. package/dist/server/commit-audit.js +30 -0
  286. package/dist/server/commit-audit.js.map +1 -0
  287. package/dist/server/index.d.ts +14 -3
  288. package/dist/server/index.js +451 -193
  289. package/dist/server/index.js.map +1 -1
  290. package/dist/server/middleware/sanitize.d.ts +46 -0
  291. package/dist/server/middleware/sanitize.js +171 -0
  292. package/dist/server/middleware/sanitize.js.map +1 -0
  293. package/dist/server/routes/asset-api.d.ts +10 -0
  294. package/dist/server/routes/asset-api.js +294 -0
  295. package/dist/server/routes/asset-api.js.map +1 -0
  296. package/dist/server/routes/audit-api.d.ts +24 -0
  297. package/dist/server/routes/audit-api.js +117 -0
  298. package/dist/server/routes/audit-api.js.map +1 -0
  299. package/dist/server/routes/auth-api.d.ts +3 -2
  300. package/dist/server/routes/auth-api.js +519 -38
  301. package/dist/server/routes/auth-api.js.map +1 -1
  302. package/dist/server/routes/capture-api.d.ts +18 -0
  303. package/dist/server/routes/capture-api.js +257 -0
  304. package/dist/server/routes/capture-api.js.map +1 -0
  305. package/dist/server/routes/chat.d.ts +4 -1
  306. package/dist/server/routes/chat.js +298 -88
  307. package/dist/server/routes/chat.js.map +1 -1
  308. package/dist/server/routes/comments-api.d.ts +15 -0
  309. package/dist/server/routes/comments-api.js +444 -0
  310. package/dist/server/routes/comments-api.js.map +1 -0
  311. package/dist/server/routes/config-api.d.ts +21 -0
  312. package/dist/server/routes/config-api.js +256 -0
  313. package/dist/server/routes/config-api.js.map +1 -0
  314. package/dist/server/routes/connectors-api.d.ts +17 -0
  315. package/dist/server/routes/connectors-api.js +410 -0
  316. package/dist/server/routes/connectors-api.js.map +1 -0
  317. package/dist/server/routes/event-ingest-api.d.ts +15 -0
  318. package/dist/server/routes/event-ingest-api.js +125 -0
  319. package/dist/server/routes/event-ingest-api.js.map +1 -0
  320. package/dist/server/routes/git-http.d.ts +3 -3
  321. package/dist/server/routes/git-http.js +86 -38
  322. package/dist/server/routes/git-http.js.map +1 -1
  323. package/dist/server/routes/graph-api-access.d.ts +35 -0
  324. package/dist/server/routes/graph-api-access.js +105 -0
  325. package/dist/server/routes/graph-api-access.js.map +1 -0
  326. package/dist/server/routes/graph-api.d.ts +3 -2
  327. package/dist/server/routes/graph-api.js +1321 -263
  328. package/dist/server/routes/graph-api.js.map +1 -1
  329. package/dist/server/routes/health.d.ts +18 -0
  330. package/dist/server/routes/health.js +74 -0
  331. package/dist/server/routes/health.js.map +1 -0
  332. package/dist/server/routes/insights-api.d.ts +1 -2
  333. package/dist/server/routes/insights-api.js +149 -41
  334. package/dist/server/routes/insights-api.js.map +1 -1
  335. package/dist/server/routes/mcp.d.ts +7 -3
  336. package/dist/server/routes/mcp.js +22 -6
  337. package/dist/server/routes/mcp.js.map +1 -1
  338. package/dist/server/routes/permissions-api.d.ts +9 -2
  339. package/dist/server/routes/permissions-api.js +87 -30
  340. package/dist/server/routes/permissions-api.js.map +1 -1
  341. package/dist/server/routes/r2-api.d.ts +25 -0
  342. package/dist/server/routes/r2-api.js +276 -0
  343. package/dist/server/routes/r2-api.js.map +1 -0
  344. package/dist/server/routes/secrets-api.d.ts +36 -0
  345. package/dist/server/routes/secrets-api.js +308 -0
  346. package/dist/server/routes/secrets-api.js.map +1 -0
  347. package/dist/server/routes/settings-api.d.ts +29 -0
  348. package/dist/server/routes/settings-api.js +180 -0
  349. package/dist/server/routes/settings-api.js.map +1 -0
  350. package/dist/server/routes/url-api.d.ts +7 -0
  351. package/dist/server/routes/url-api.js +74 -0
  352. package/dist/server/routes/url-api.js.map +1 -0
  353. package/dist/server/routes/views-api.js +81 -7
  354. package/dist/server/routes/views-api.js.map +1 -1
  355. package/dist/server/routes/workspace-api.d.ts +2 -1
  356. package/dist/server/routes/workspace-api.js +124 -35
  357. package/dist/server/routes/workspace-api.js.map +1 -1
  358. package/dist/server/routes/ws.d.ts +2 -1
  359. package/dist/server/routes/ws.js +64 -16
  360. package/dist/server/routes/ws.js.map +1 -1
  361. package/dist/server/session-manager.d.ts +48 -5
  362. package/dist/server/session-manager.js +182 -15
  363. package/dist/server/session-manager.js.map +1 -1
  364. package/dist/server/ws-hub.d.ts +138 -14
  365. package/dist/server/ws-hub.js +0 -0
  366. package/dist/server/ws-hub.js.map +1 -1
  367. package/dist/server/yjs-manager.d.ts +285 -7
  368. package/dist/server/yjs-manager.js +907 -36
  369. package/dist/server/yjs-manager.js.map +1 -1
  370. package/dist/server/yjs-persistence.d.ts +165 -0
  371. package/dist/server/yjs-persistence.js +557 -0
  372. package/dist/server/yjs-persistence.js.map +1 -0
  373. package/dist/server/yjs-text-diff.d.ts +32 -0
  374. package/dist/server/yjs-text-diff.js +61 -0
  375. package/dist/server/yjs-text-diff.js.map +1 -0
  376. package/dist/services/access-control.d.ts +73 -0
  377. package/dist/services/access-control.js +146 -0
  378. package/dist/services/access-control.js.map +1 -0
  379. package/dist/services/asset-listing.d.ts +39 -0
  380. package/dist/services/asset-listing.js +125 -0
  381. package/dist/services/asset-listing.js.map +1 -0
  382. package/dist/services/asset-upload-service.d.ts +53 -0
  383. package/dist/services/asset-upload-service.js +201 -0
  384. package/dist/services/asset-upload-service.js.map +1 -0
  385. package/dist/services/assets/asset-index-service.d.ts +82 -0
  386. package/dist/services/assets/asset-index-service.js +167 -0
  387. package/dist/services/assets/asset-index-service.js.map +1 -0
  388. package/dist/services/assets/base.d.ts +44 -0
  389. package/dist/services/assets/base.js +55 -0
  390. package/dist/services/assets/base.js.map +1 -1
  391. package/dist/services/assets/index.d.ts +69 -1
  392. package/dist/services/assets/index.js +125 -0
  393. package/dist/services/assets/index.js.map +1 -1
  394. package/dist/services/assets/local.d.ts +12 -1
  395. package/dist/services/assets/local.js +100 -1
  396. package/dist/services/assets/local.js.map +1 -1
  397. package/dist/services/assets/r2-sync.d.ts +88 -0
  398. package/dist/services/assets/r2-sync.js +412 -0
  399. package/dist/services/assets/r2-sync.js.map +1 -0
  400. package/dist/services/assets/r2.d.ts +34 -1
  401. package/dist/services/assets/r2.js +93 -1
  402. package/dist/services/assets/r2.js.map +1 -1
  403. package/dist/services/auth-service.d.ts +314 -36
  404. package/dist/services/auth-service.js +1126 -139
  405. package/dist/services/auth-service.js.map +1 -1
  406. package/dist/services/bookmark-import-service.d.ts +49 -0
  407. package/dist/services/bookmark-import-service.js +250 -0
  408. package/dist/services/bookmark-import-service.js.map +1 -0
  409. package/dist/services/cloud-inference-billing.d.ts +64 -0
  410. package/dist/services/cloud-inference-billing.js +313 -0
  411. package/dist/services/cloud-inference-billing.js.map +1 -0
  412. package/dist/services/comment-service.d.ts +97 -0
  413. package/dist/services/comment-service.js +341 -0
  414. package/dist/services/comment-service.js.map +1 -0
  415. package/dist/services/csv-service.d.ts +22 -17
  416. package/dist/services/csv-service.js +55 -92
  417. package/dist/services/csv-service.js.map +1 -1
  418. package/dist/services/entity-mutations.d.ts +161 -0
  419. package/dist/services/entity-mutations.js +296 -0
  420. package/dist/services/entity-mutations.js.map +1 -0
  421. package/dist/services/event-processor.d.ts +104 -0
  422. package/dist/services/event-processor.js +441 -0
  423. package/dist/services/event-processor.js.map +1 -0
  424. package/dist/services/folder-creation.d.ts +33 -0
  425. package/dist/services/folder-creation.js +103 -0
  426. package/dist/services/folder-creation.js.map +1 -0
  427. package/dist/services/git.d.ts +54 -0
  428. package/dist/services/git.js +188 -54
  429. package/dist/services/git.js.map +1 -1
  430. package/dist/services/graph-maintenance.d.ts +42 -0
  431. package/dist/services/graph-maintenance.js +143 -0
  432. package/dist/services/graph-maintenance.js.map +1 -0
  433. package/dist/services/import-service.d.ts +45 -2
  434. package/dist/services/import-service.js +304 -100
  435. package/dist/services/import-service.js.map +1 -1
  436. package/dist/services/lint-service.js +9 -16
  437. package/dist/services/lint-service.js.map +1 -1
  438. package/dist/services/markdown.d.ts +12 -1
  439. package/dist/services/markdown.js +71 -6
  440. package/dist/services/markdown.js.map +1 -1
  441. package/dist/services/memory-service.d.ts +22 -14
  442. package/dist/services/memory-service.js +53 -35
  443. package/dist/services/memory-service.js.map +1 -1
  444. package/dist/services/mention-detector.d.ts +23 -0
  445. package/dist/services/mention-detector.js +47 -0
  446. package/dist/services/mention-detector.js.map +1 -0
  447. package/dist/services/notification-broadcast.d.ts +32 -0
  448. package/dist/services/notification-broadcast.js +38 -0
  449. package/dist/services/notification-broadcast.js.map +1 -0
  450. package/dist/services/notification-service.d.ts +41 -0
  451. package/dist/services/notification-service.js +100 -0
  452. package/dist/services/notification-service.js.map +1 -0
  453. package/dist/services/personal-folder.d.ts +40 -0
  454. package/dist/services/personal-folder.js +101 -0
  455. package/dist/services/personal-folder.js.map +1 -0
  456. package/dist/services/user-person-bridge.d.ts +118 -0
  457. package/dist/services/user-person-bridge.js +306 -0
  458. package/dist/services/user-person-bridge.js.map +1 -0
  459. package/dist/services/vector-service.d.ts +146 -6
  460. package/dist/services/vector-service.js +276 -13
  461. package/dist/services/vector-service.js.map +1 -1
  462. package/dist/services/workspace-access.d.ts +106 -0
  463. package/dist/services/workspace-access.js +149 -0
  464. package/dist/services/workspace-access.js.map +1 -0
  465. package/dist/utils/git.d.ts +17 -2
  466. package/dist/utils/git.js +23 -7
  467. package/dist/utils/git.js.map +1 -1
  468. package/dist/utils/log.d.ts +42 -0
  469. package/dist/utils/log.js +137 -0
  470. package/dist/utils/log.js.map +1 -0
  471. package/dist/utils/preflight.js +2 -2
  472. package/dist/utils/preflight.js.map +1 -1
  473. package/dist/utils/version-checker.d.ts +12 -19
  474. package/dist/utils/version-checker.js +14 -104
  475. package/dist/utils/version-checker.js.map +1 -1
  476. package/dist/web/_app/immutable/assets/0.DOumm94J.css +2 -0
  477. package/dist/web/_app/immutable/assets/13.DlIf1mKh.css +1 -0
  478. package/dist/web/_app/immutable/assets/14.7d-Q37wc.css +1 -0
  479. package/dist/web/_app/immutable/assets/15.CmLrbzZp.css +1 -0
  480. package/dist/web/_app/immutable/assets/2.BftNiAA4.css +1 -0
  481. package/dist/web/_app/immutable/assets/3.CV0abekd.css +1 -0
  482. package/dist/web/_app/immutable/assets/4.BgXzUTTk.css +1 -0
  483. package/dist/web/_app/immutable/assets/9.gsF-Ne6_.css +1 -0
  484. package/dist/web/_app/immutable/assets/AgentOverlay.CpvH9rhf.css +1 -0
  485. package/dist/web/_app/immutable/assets/AssetManagerModal.BKJfPAPk.css +1 -0
  486. package/dist/web/_app/immutable/assets/CalendarView.bNewSxkH.css +1 -0
  487. package/dist/web/_app/immutable/assets/ChevronDown.Bz0FjM7b.css +1 -0
  488. package/dist/web/_app/immutable/assets/FolderMembersPanel.DX1oBeF_.css +1 -0
  489. package/dist/web/_app/immutable/assets/FolderMutationDialogs.BMRF6Z3z.css +1 -0
  490. package/dist/web/_app/immutable/assets/FolderPicker.B5KdvRYl.css +1 -0
  491. package/dist/web/_app/immutable/assets/GalleryView.DgvSjS0I.css +1 -0
  492. package/dist/web/_app/immutable/assets/GraphView.BJtGL9py.css +1 -0
  493. package/dist/web/_app/immutable/assets/KanbanView.D0QbZFd6.css +1 -0
  494. package/dist/web/_app/immutable/assets/SettingsDialog.DYWYMFSO.css +1 -0
  495. package/dist/web/_app/immutable/assets/Spinner.UBfl0pab.css +1 -0
  496. package/dist/web/_app/immutable/assets/StopFilledAlt.CkPrHdPD.css +1 -0
  497. package/dist/web/_app/immutable/assets/TimelineView.DA-H6dvv.css +1 -0
  498. package/dist/web/_app/immutable/assets/WorkspaceView.BS1ildu7.css +1 -0
  499. package/dist/web/_app/immutable/assets/button.BlLm4Dg1.css +1 -0
  500. package/dist/web/_app/immutable/assets/formatting.vV0ne105.css +1 -0
  501. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.CvHOgSBP.woff +0 -0
  502. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.DMJ8VG8y.woff2 +0 -0
  503. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.CB9ihrfo.woff +0 -0
  504. package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.DSY6xOcd.woff2 +0 -0
  505. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CZTNEAuW.woff2 +0 -0
  506. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CsGl1sm0.woff +0 -0
  507. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CDDApCn2.woff2 +0 -0
  508. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CYLoc0-x.woff +0 -0
  509. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.BNK2_mGO.woff2 +0 -0
  510. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.DpEwFAQM.woff +0 -0
  511. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.6ng42L7E.woff2 +0 -0
  512. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.BgVn5rGT.woff +0 -0
  513. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.Cu4Hd6ag.woff +0 -0
  514. package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.CuJfVYMP.woff2 +0 -0
  515. package/dist/web/_app/immutable/assets/inline-list.cqga56xT.css +1 -0
  516. package/dist/web/_app/immutable/assets/list-columns.BrRrAiZ7.css +1 -0
  517. package/dist/web/_app/immutable/assets/realtime.DDCWxn3B.css +1 -0
  518. package/dist/web/_app/immutable/assets/sheet.DJPuqnTg.css +1 -0
  519. package/dist/web/_app/immutable/assets/speech-dictation.C5CYFhS1.css +1 -0
  520. package/dist/web/_app/immutable/chunks/0edH8sO82.js +1 -0
  521. package/dist/web/_app/immutable/chunks/0iDDDyaZ.js +1 -0
  522. package/dist/web/_app/immutable/chunks/7-y0CE1z.js +1 -0
  523. package/dist/web/_app/immutable/chunks/7Bu427my2.js +184 -0
  524. package/dist/web/_app/immutable/chunks/B-V5eMSw2.js +1 -0
  525. package/dist/web/_app/immutable/chunks/B-i9_YVM.js +1 -0
  526. package/dist/web/_app/immutable/chunks/B15-kvCe.js +1 -0
  527. package/dist/web/_app/immutable/chunks/B4cFqqUS.js +3 -0
  528. package/dist/web/_app/immutable/chunks/B6Lt-qaJ.js +1 -0
  529. package/dist/web/_app/immutable/chunks/B7hznOQp.js +1 -0
  530. package/dist/web/_app/immutable/chunks/B7tbGyiU2.js +1 -0
  531. package/dist/web/_app/immutable/chunks/B8-Lm86o2.js +1 -0
  532. package/dist/web/_app/immutable/chunks/BBxt8lpa.js +1 -0
  533. package/dist/web/_app/immutable/chunks/BCaRi2AF.js +1 -0
  534. package/dist/web/_app/immutable/chunks/BJReLGMs.js +1 -0
  535. package/dist/web/_app/immutable/chunks/BKzV82vD2.js +83 -0
  536. package/dist/web/_app/immutable/chunks/BLHrJvbG.js +1 -0
  537. package/dist/web/_app/immutable/chunks/BQULA6er.js +4 -0
  538. package/dist/web/_app/immutable/chunks/BQW-EDgP2.js +224 -0
  539. package/dist/web/_app/immutable/chunks/BR6jMpLB.js +1 -0
  540. package/dist/web/_app/immutable/chunks/BUBMGU8t2.js +2 -0
  541. package/dist/web/_app/immutable/chunks/BVnuLlVg.js +1 -0
  542. package/dist/web/_app/immutable/chunks/BYokDzwE.js +1 -0
  543. package/dist/web/_app/immutable/chunks/B_Avv9jQ2.js +1 -0
  544. package/dist/web/_app/immutable/chunks/Bbp76jaT2.js +1 -0
  545. package/dist/web/_app/immutable/chunks/BddNmQ8j.js +1 -0
  546. package/dist/web/_app/immutable/chunks/BiJjH5mJ.js +2 -0
  547. package/dist/web/_app/immutable/chunks/BlyFGPFV.js +22 -0
  548. package/dist/web/_app/immutable/chunks/Bt88HrRx.js +1 -0
  549. package/dist/web/_app/immutable/chunks/Bu2iU6hh.js +67 -0
  550. package/dist/web/_app/immutable/chunks/Buih1pxI.js +1 -0
  551. package/dist/web/_app/immutable/chunks/BwwLJVvR.js +1 -0
  552. package/dist/web/_app/immutable/chunks/C0RpyyYZ.js +7 -0
  553. package/dist/web/_app/immutable/chunks/C2l-EXsT2.js +1 -0
  554. package/dist/web/_app/immutable/chunks/C35TIzaB.js +1 -0
  555. package/dist/web/_app/immutable/chunks/C3OdK8z_2.js +1 -0
  556. package/dist/web/_app/immutable/chunks/C6Nx0jpM.js +1 -0
  557. package/dist/web/_app/immutable/chunks/CA7O0J_u2.js +1 -0
  558. package/dist/web/_app/immutable/chunks/CAwjrHdk.js +23 -0
  559. package/dist/web/_app/immutable/chunks/CCLR-AJL2.js +185 -0
  560. package/dist/web/_app/immutable/chunks/CD0X7XPW.js +6 -0
  561. package/dist/web/_app/immutable/chunks/CDTjuBSm2.js +1 -0
  562. package/dist/web/_app/immutable/chunks/CSUrYOis.js +1 -0
  563. package/dist/web/_app/immutable/chunks/CUPSJObs.js +1 -0
  564. package/dist/web/_app/immutable/chunks/CUoGvuxK2.js +2 -0
  565. package/dist/web/_app/immutable/chunks/CWh8aehb.js +1 -0
  566. package/dist/web/_app/immutable/chunks/CY4XVBP0.js +1 -0
  567. package/dist/web/_app/immutable/chunks/CYTTTma0.js +3 -0
  568. package/dist/web/_app/immutable/chunks/CaoriuNq.js +1 -0
  569. package/dist/web/_app/immutable/chunks/CcsSt9AW2.js +1 -0
  570. package/dist/web/_app/immutable/chunks/Cd4VfAZC.js +2 -0
  571. package/dist/web/_app/immutable/chunks/CePZ1985.js +1 -0
  572. package/dist/web/_app/immutable/chunks/Cei8CKT4.js +1 -0
  573. package/dist/web/_app/immutable/chunks/CheXrbDk.js +1 -0
  574. package/dist/web/_app/immutable/chunks/CkLfUXwy.js +1 -0
  575. package/dist/web/_app/immutable/chunks/Cl-W0JYt.js +2 -0
  576. package/dist/web/_app/immutable/chunks/Cna7tYp-.js +1 -0
  577. package/dist/web/_app/immutable/chunks/Czwe4sGU2.js +3 -0
  578. package/dist/web/_app/immutable/chunks/D41CbXmM.js +1 -0
  579. package/dist/web/_app/immutable/chunks/D83_Ss42.js +1 -0
  580. package/dist/web/_app/immutable/chunks/D9NgbGbO2.js +9 -0
  581. package/dist/web/_app/immutable/chunks/DA-BuZei.js +2 -0
  582. package/dist/web/_app/immutable/chunks/DAXW5iLp.js +1 -0
  583. package/dist/web/_app/immutable/chunks/DCNJWlho2.js +1 -0
  584. package/dist/web/_app/immutable/chunks/DCtgLRl52.js +1 -0
  585. package/dist/web/_app/immutable/chunks/DH0epITQ2.js +1 -0
  586. package/dist/web/_app/immutable/chunks/DIb5rAPU2.js +1 -0
  587. package/dist/web/_app/immutable/chunks/DOmH4G9o2.js +14 -0
  588. package/dist/web/_app/immutable/chunks/DQMWa2t7.js +1 -0
  589. package/dist/web/_app/immutable/chunks/DQ_Xokap2.js +1 -0
  590. package/dist/web/_app/immutable/chunks/DR1K6PIm.js +1 -0
  591. package/dist/web/_app/immutable/chunks/DTCHhxD5.js +1 -0
  592. package/dist/web/_app/immutable/chunks/DU7XA-cL2.js +1 -0
  593. package/dist/web/_app/immutable/chunks/DVcy5Pp82.js +1 -0
  594. package/dist/web/_app/immutable/chunks/DWygwzcO2.js +1 -0
  595. package/dist/web/_app/immutable/chunks/DYXDRmoo2.js +1 -0
  596. package/dist/web/_app/immutable/chunks/DZEmjBTb.js +5 -0
  597. package/dist/web/_app/immutable/chunks/DaoOQFPb.js +1 -0
  598. package/dist/web/_app/immutable/chunks/DdfvtDOY.js +1 -0
  599. package/dist/web/_app/immutable/chunks/DevZTY1l.js +1 -0
  600. package/dist/web/_app/immutable/chunks/DiMQob8p.js +1 -0
  601. package/dist/web/_app/immutable/chunks/DiQJ9DLy.js +1 -0
  602. package/dist/web/_app/immutable/chunks/Dj5oP_ik.js +2 -0
  603. package/dist/web/_app/immutable/chunks/DjTJ4D_0.js +3 -0
  604. package/dist/web/_app/immutable/chunks/Dk4TeNwu.js +1 -0
  605. package/dist/web/_app/immutable/chunks/Dng3OcRd2.js +1 -0
  606. package/dist/web/_app/immutable/chunks/Do1OCNEG.js +1 -0
  607. package/dist/web/_app/immutable/chunks/Do6qOOng.js +1 -0
  608. package/dist/web/_app/immutable/chunks/DoQwt-f9.js +1 -0
  609. package/dist/web/_app/immutable/chunks/Dqg3k9HI2.js +1 -0
  610. package/dist/web/_app/immutable/chunks/DsnqOT222.js +1 -0
  611. package/dist/web/_app/immutable/chunks/DvJSCDuZ2.js +1 -0
  612. package/dist/web/_app/immutable/chunks/DvPuaTCl.js +5 -0
  613. package/dist/web/_app/immutable/chunks/DvYQu1SV.js +1 -0
  614. package/dist/web/_app/immutable/chunks/HdjeJPly2.js +1 -0
  615. package/dist/web/_app/immutable/chunks/JDw4tOUY.js +1 -0
  616. package/dist/web/_app/immutable/chunks/KBbDg4lS2.js +1 -0
  617. package/dist/web/_app/immutable/chunks/KQXQLJf32.js +1 -0
  618. package/dist/web/_app/immutable/chunks/LGnNalpn2.js +2 -0
  619. package/dist/web/_app/immutable/chunks/SH5Fg0Xu.js +1 -0
  620. package/dist/web/_app/immutable/chunks/Shyla9c12.js +2 -0
  621. package/dist/web/_app/immutable/chunks/VQbAelHN.js +1 -0
  622. package/dist/web/_app/immutable/chunks/apNT0aug2.js +1 -0
  623. package/dist/web/_app/immutable/chunks/e0ySQvQ6.js +1 -0
  624. package/dist/web/_app/immutable/chunks/eNB_sIHC2.js +1 -0
  625. package/dist/web/_app/immutable/chunks/g09ZrevW2.js +1 -0
  626. package/dist/web/_app/immutable/chunks/h4WWBpcD2.js +2692 -0
  627. package/dist/web/_app/immutable/chunks/kLub81jO.js +1 -0
  628. package/dist/web/_app/immutable/chunks/kW0z_eo62.js +1 -0
  629. package/dist/web/_app/immutable/chunks/oBQOivfH.js +1 -0
  630. package/dist/web/_app/immutable/chunks/ss8hcwTT.js +1 -0
  631. package/dist/web/_app/immutable/chunks/sub7ikQV.js +2 -0
  632. package/dist/web/_app/immutable/chunks/uuFM-ygL.js +1 -0
  633. package/dist/web/_app/immutable/chunks/v7me-ydg.js +2 -0
  634. package/dist/web/_app/immutable/chunks/xihTtKlq.js +1 -0
  635. package/dist/web/_app/immutable/chunks/yWi6xIp8.js +1 -0
  636. package/dist/web/_app/immutable/chunks/zl16E4yc2.js +1 -0
  637. package/dist/web/_app/immutable/entry/app.Bgniax9U.js +2 -0
  638. package/dist/web/_app/immutable/entry/start.DeD3x0AC.js +1 -0
  639. package/dist/web/_app/immutable/nodes/0.D7f7eDDY.js +2 -0
  640. package/dist/web/_app/immutable/nodes/1.nDAGsQWA.js +1 -0
  641. package/dist/web/_app/immutable/nodes/10.DFbhcPKT.js +1 -0
  642. package/dist/web/_app/immutable/nodes/11.CDErrkBt.js +1 -0
  643. package/dist/web/_app/immutable/nodes/12.QmphOXE2.js +1 -0
  644. package/dist/web/_app/immutable/nodes/13.Bq5rDhPs.js +1 -0
  645. package/dist/web/_app/immutable/nodes/14.BlcHqgr6.js +1 -0
  646. package/dist/web/_app/immutable/nodes/15.COK_-D-x.js +1 -0
  647. package/dist/web/_app/immutable/nodes/2.DOsCYNHa.js +109 -0
  648. package/dist/web/_app/immutable/nodes/3.BgE1sIyr.js +2 -0
  649. package/dist/web/_app/immutable/nodes/4.DvgaHeI4.js +11 -0
  650. package/dist/web/_app/immutable/nodes/5.CrjeBZES.js +1 -0
  651. package/dist/web/_app/immutable/nodes/6.DoHxsiEE.js +1 -0
  652. package/dist/web/_app/immutable/nodes/7.04fnxKIo.js +1 -0
  653. package/dist/web/_app/immutable/nodes/8.D35_cY6C.js +1 -0
  654. package/dist/web/_app/immutable/nodes/9.BRionwW6.js +1 -0
  655. package/dist/web/_app/version.json +1 -1
  656. package/dist/web/favicon-16.png +0 -0
  657. package/dist/web/favicon-180.png +0 -0
  658. package/dist/web/favicon-32.png +0 -0
  659. package/dist/web/favicon-48.png +0 -0
  660. package/dist/web/favicon-512.png +0 -0
  661. package/dist/web/favicon.ico +0 -0
  662. package/dist/web/favicon.svg +8 -0
  663. package/dist/web/index.html +56 -19
  664. package/dist/web/studiograph-logomark.svg +29 -0
  665. package/package.json +34 -14
  666. package/dist/agent/skills/enrich-entities.md +0 -136
  667. package/dist/agent/skills/obsidian-source-setup.md +0 -246
  668. package/dist/agent/skills/skill-loader.d.ts +0 -48
  669. package/dist/agent/skills/skill-loader.js +0 -166
  670. package/dist/agent/skills/skill-loader.js.map +0 -1
  671. package/dist/agent/skills/sync-configuration.md +0 -119
  672. package/dist/agent/skills/sync-setup.md +0 -82
  673. package/dist/agent/tools/sync-tools.d.ts +0 -35
  674. package/dist/agent/tools/sync-tools.js +0 -992
  675. package/dist/agent/tools/sync-tools.js.map +0 -1
  676. package/dist/auth/github.d.ts +0 -56
  677. package/dist/auth/github.js +0 -169
  678. package/dist/auth/github.js.map +0 -1
  679. package/dist/cli/commands/access.d.ts +0 -11
  680. package/dist/cli/commands/access.js +0 -156
  681. package/dist/cli/commands/access.js.map +0 -1
  682. package/dist/cli/commands/app.d.ts +0 -7
  683. package/dist/cli/commands/app.js +0 -268
  684. package/dist/cli/commands/app.js.map +0 -1
  685. package/dist/cli/commands/auth.d.ts +0 -10
  686. package/dist/cli/commands/auth.js +0 -79
  687. package/dist/cli/commands/auth.js.map +0 -1
  688. package/dist/cli/commands/clear.d.ts +0 -5
  689. package/dist/cli/commands/clear.js +0 -36
  690. package/dist/cli/commands/clear.js.map +0 -1
  691. package/dist/cli/commands/collection.d.ts +0 -10
  692. package/dist/cli/commands/collection.js +0 -187
  693. package/dist/cli/commands/collection.js.map +0 -1
  694. package/dist/cli/commands/enrich.d.ts +0 -11
  695. package/dist/cli/commands/enrich.js +0 -135
  696. package/dist/cli/commands/enrich.js.map +0 -1
  697. package/dist/cli/commands/graphrag.d.ts +0 -12
  698. package/dist/cli/commands/graphrag.js +0 -122
  699. package/dist/cli/commands/graphrag.js.map +0 -1
  700. package/dist/cli/commands/join.d.ts +0 -9
  701. package/dist/cli/commands/join.js +0 -255
  702. package/dist/cli/commands/join.js.map +0 -1
  703. package/dist/cli/commands/members.d.ts +0 -11
  704. package/dist/cli/commands/members.js +0 -230
  705. package/dist/cli/commands/members.js.map +0 -1
  706. package/dist/cli/commands/org.d.ts +0 -10
  707. package/dist/cli/commands/org.js +0 -132
  708. package/dist/cli/commands/org.js.map +0 -1
  709. package/dist/cli/commands/provision.d.ts +0 -8
  710. package/dist/cli/commands/provision.js +0 -116
  711. package/dist/cli/commands/provision.js.map +0 -1
  712. package/dist/cli/commands/resolve.d.ts +0 -8
  713. package/dist/cli/commands/resolve.js +0 -85
  714. package/dist/cli/commands/resolve.js.map +0 -1
  715. package/dist/cli/commands/review.d.ts +0 -19
  716. package/dist/cli/commands/review.js +0 -128
  717. package/dist/cli/commands/review.js.map +0 -1
  718. package/dist/cli/commands/source.d.ts +0 -16
  719. package/dist/cli/commands/source.js +0 -159
  720. package/dist/cli/commands/source.js.map +0 -1
  721. package/dist/cli/commands/start.d.ts +0 -7
  722. package/dist/cli/commands/start.js +0 -589
  723. package/dist/cli/commands/start.js.map +0 -1
  724. package/dist/cli/commands/sync-collection.d.ts +0 -14
  725. package/dist/cli/commands/sync-collection.js +0 -355
  726. package/dist/cli/commands/sync-collection.js.map +0 -1
  727. package/dist/cli/commands/sync-entities.d.ts +0 -13
  728. package/dist/cli/commands/sync-entities.js +0 -242
  729. package/dist/cli/commands/sync-entities.js.map +0 -1
  730. package/dist/cli/commands/team.d.ts +0 -12
  731. package/dist/cli/commands/team.js +0 -185
  732. package/dist/cli/commands/team.js.map +0 -1
  733. package/dist/cli/commands/update.d.ts +0 -8
  734. package/dist/cli/commands/update.js +0 -155
  735. package/dist/cli/commands/update.js.map +0 -1
  736. package/dist/cli/commands/user.d.ts +0 -7
  737. package/dist/cli/commands/user.js +0 -153
  738. package/dist/cli/commands/user.js.map +0 -1
  739. package/dist/cli/scaffolding.d.ts +0 -12
  740. package/dist/cli/scaffolding.js +0 -397
  741. package/dist/cli/scaffolding.js.map +0 -1
  742. package/dist/cli/sync-review-interactive.d.ts +0 -31
  743. package/dist/cli/sync-review-interactive.js +0 -393
  744. package/dist/cli/sync-review-interactive.js.map +0 -1
  745. package/dist/core/migration-runner.d.ts +0 -42
  746. package/dist/core/migration-runner.js +0 -232
  747. package/dist/core/migration-runner.js.map +0 -1
  748. package/dist/core/migration-types.d.ts +0 -101
  749. package/dist/core/migration-types.js +0 -21
  750. package/dist/core/migration-types.js.map +0 -1
  751. package/dist/core/migrations/20260219-formalize-memory-location.d.ts +0 -2
  752. package/dist/core/migrations/20260219-formalize-memory-location.js +0 -35
  753. package/dist/core/migrations/20260219-formalize-memory-location.js.map +0 -1
  754. package/dist/core/migrations/20260220-add-workspace-metadata.d.ts +0 -12
  755. package/dist/core/migrations/20260220-add-workspace-metadata.js +0 -65
  756. package/dist/core/migrations/20260220-add-workspace-metadata.js.map +0 -1
  757. package/dist/core/migrations/20260220-add-workspace-readme.d.ts +0 -11
  758. package/dist/core/migrations/20260220-add-workspace-readme.js +0 -82
  759. package/dist/core/migrations/20260220-add-workspace-readme.js.map +0 -1
  760. package/dist/core/migrations/20260220-migrate-yaml-to-json.d.ts +0 -9
  761. package/dist/core/migrations/20260220-migrate-yaml-to-json.js +0 -64
  762. package/dist/core/migrations/20260220-migrate-yaml-to-json.js.map +0 -1
  763. package/dist/core/migrations/index.d.ts +0 -11
  764. package/dist/core/migrations/index.js +0 -23
  765. package/dist/core/migrations/index.js.map +0 -1
  766. package/dist/integrations/asana.d.ts +0 -26
  767. package/dist/integrations/asana.js +0 -78
  768. package/dist/integrations/asana.js.map +0 -1
  769. package/dist/integrations/figma-local.d.ts +0 -16
  770. package/dist/integrations/figma-local.js +0 -10
  771. package/dist/integrations/figma-local.js.map +0 -1
  772. package/dist/integrations/figma.d.ts +0 -17
  773. package/dist/integrations/figma.js +0 -17
  774. package/dist/integrations/figma.js.map +0 -1
  775. package/dist/integrations/granola.d.ts +0 -24
  776. package/dist/integrations/granola.js +0 -60
  777. package/dist/integrations/granola.js.map +0 -1
  778. package/dist/integrations/linear.d.ts +0 -14
  779. package/dist/integrations/linear.js +0 -80
  780. package/dist/integrations/linear.js.map +0 -1
  781. package/dist/integrations/paper-local.d.ts +0 -14
  782. package/dist/integrations/paper-local.js +0 -10
  783. package/dist/integrations/paper-local.js.map +0 -1
  784. package/dist/integrations/paper.d.ts +0 -2
  785. package/dist/integrations/paper.js +0 -10
  786. package/dist/integrations/paper.js.map +0 -1
  787. package/dist/integrations/pipedrive.d.ts +0 -26
  788. package/dist/integrations/pipedrive.js +0 -97
  789. package/dist/integrations/pipedrive.js.map +0 -1
  790. package/dist/integrations/registry.d.ts +0 -15
  791. package/dist/integrations/registry.js +0 -27
  792. package/dist/integrations/registry.js.map +0 -1
  793. package/dist/integrations/types.d.ts +0 -38
  794. package/dist/integrations/types.js +0 -9
  795. package/dist/integrations/types.js.map +0 -1
  796. package/dist/lib/lib/utils.d.ts +0 -2
  797. package/dist/lib/lib/utils.js +0 -6
  798. package/dist/lib/lib/utils.js.map +0 -1
  799. package/dist/mcp/connectors/asana.d.ts +0 -2
  800. package/dist/mcp/connectors/asana.js +0 -20
  801. package/dist/mcp/connectors/asana.js.map +0 -1
  802. package/dist/mcp/connectors/definitions.d.ts +0 -45
  803. package/dist/mcp/connectors/definitions.js +0 -32
  804. package/dist/mcp/connectors/definitions.js.map +0 -1
  805. package/dist/mcp/connectors/figma.d.ts +0 -5
  806. package/dist/mcp/connectors/figma.js +0 -21
  807. package/dist/mcp/connectors/figma.js.map +0 -1
  808. package/dist/mcp/connectors/gdrive.d.ts +0 -2
  809. package/dist/mcp/connectors/gdrive.js +0 -20
  810. package/dist/mcp/connectors/gdrive.js.map +0 -1
  811. package/dist/mcp/connectors/granola.d.ts +0 -2
  812. package/dist/mcp/connectors/granola.js +0 -12
  813. package/dist/mcp/connectors/granola.js.map +0 -1
  814. package/dist/mcp/connectors/linear.d.ts +0 -2
  815. package/dist/mcp/connectors/linear.js +0 -19
  816. package/dist/mcp/connectors/linear.js.map +0 -1
  817. package/dist/mcp/connectors/obsidian.d.ts +0 -2
  818. package/dist/mcp/connectors/obsidian.js +0 -19
  819. package/dist/mcp/connectors/obsidian.js.map +0 -1
  820. package/dist/mcp/connectors/pipedrive.d.ts +0 -2
  821. package/dist/mcp/connectors/pipedrive.js +0 -20
  822. package/dist/mcp/connectors/pipedrive.js.map +0 -1
  823. package/dist/mcp/connectors/slack.d.ts +0 -2
  824. package/dist/mcp/connectors/slack.js +0 -21
  825. package/dist/mcp/connectors/slack.js.map +0 -1
  826. package/dist/mcp/server-oauth-provider.d.ts +0 -56
  827. package/dist/mcp/server-oauth-provider.js +0 -142
  828. package/dist/mcp/server-oauth-provider.js.map +0 -1
  829. package/dist/server/chrome/chrome.css +0 -691
  830. package/dist/server/chrome/chrome.js +0 -374
  831. package/dist/server/collab-authority.d.ts +0 -70
  832. package/dist/server/collab-authority.js +0 -218
  833. package/dist/server/collab-authority.js.map +0 -1
  834. package/dist/server/collab.d.ts +0 -29
  835. package/dist/server/collab.js +0 -195
  836. package/dist/server/collab.js.map +0 -1
  837. package/dist/server/commit-scheduler.d.ts +0 -39
  838. package/dist/server/commit-scheduler.js +0 -113
  839. package/dist/server/commit-scheduler.js.map +0 -1
  840. package/dist/server/plugin-loader.d.ts +0 -53
  841. package/dist/server/plugin-loader.js +0 -155
  842. package/dist/server/plugin-loader.js.map +0 -1
  843. package/dist/server/routes/collab.d.ts +0 -6
  844. package/dist/server/routes/collab.js +0 -10
  845. package/dist/server/routes/collab.js.map +0 -1
  846. package/dist/server/routes/git-api.d.ts +0 -9
  847. package/dist/server/routes/git-api.js +0 -82
  848. package/dist/server/routes/git-api.js.map +0 -1
  849. package/dist/server/routes/meeting-ingest-api.d.ts +0 -15
  850. package/dist/server/routes/meeting-ingest-api.js +0 -323
  851. package/dist/server/routes/meeting-ingest-api.js.map +0 -1
  852. package/dist/server/routes/sync-api.d.ts +0 -26
  853. package/dist/server/routes/sync-api.js +0 -814
  854. package/dist/server/routes/sync-api.js.map +0 -1
  855. package/dist/server/routes/webhook.d.ts +0 -14
  856. package/dist/server/routes/webhook.js +0 -102
  857. package/dist/server/routes/webhook.js.map +0 -1
  858. package/dist/services/github-provisioner.d.ts +0 -36
  859. package/dist/services/github-provisioner.js +0 -126
  860. package/dist/services/github-provisioner.js.map +0 -1
  861. package/dist/services/github-service.d.ts +0 -99
  862. package/dist/services/github-service.js +0 -310
  863. package/dist/services/github-service.js.map +0 -1
  864. package/dist/services/insights.d.ts +0 -38
  865. package/dist/services/insights.js +0 -246
  866. package/dist/services/insights.js.map +0 -1
  867. package/dist/services/sync/collection-sync.d.ts +0 -60
  868. package/dist/services/sync/collection-sync.js +0 -509
  869. package/dist/services/sync/collection-sync.js.map +0 -1
  870. package/dist/services/sync/commit.d.ts +0 -60
  871. package/dist/services/sync/commit.js +0 -354
  872. package/dist/services/sync/commit.js.map +0 -1
  873. package/dist/services/sync/context-index.d.ts +0 -69
  874. package/dist/services/sync/context-index.js +0 -280
  875. package/dist/services/sync/context-index.js.map +0 -1
  876. package/dist/services/sync/data-fetcher.d.ts +0 -31
  877. package/dist/services/sync/data-fetcher.js +0 -12
  878. package/dist/services/sync/data-fetcher.js.map +0 -1
  879. package/dist/services/sync/derive.d.ts +0 -34
  880. package/dist/services/sync/derive.js +0 -164
  881. package/dist/services/sync/derive.js.map +0 -1
  882. package/dist/services/sync/enrichment-state.d.ts +0 -31
  883. package/dist/services/sync/enrichment-state.js +0 -63
  884. package/dist/services/sync/enrichment-state.js.map +0 -1
  885. package/dist/services/sync/enrichment.d.ts +0 -25
  886. package/dist/services/sync/enrichment.js +0 -121
  887. package/dist/services/sync/enrichment.js.map +0 -1
  888. package/dist/services/sync/entity-refresh.d.ts +0 -30
  889. package/dist/services/sync/entity-refresh.js +0 -275
  890. package/dist/services/sync/entity-refresh.js.map +0 -1
  891. package/dist/services/sync/frontmatter-extractor.d.ts +0 -40
  892. package/dist/services/sync/frontmatter-extractor.js +0 -279
  893. package/dist/services/sync/frontmatter-extractor.js.map +0 -1
  894. package/dist/services/sync/graph-match-state.d.ts +0 -33
  895. package/dist/services/sync/graph-match-state.js +0 -61
  896. package/dist/services/sync/graph-match-state.js.map +0 -1
  897. package/dist/services/sync/graph-match.d.ts +0 -53
  898. package/dist/services/sync/graph-match.js +0 -316
  899. package/dist/services/sync/graph-match.js.map +0 -1
  900. package/dist/services/sync/graphrag-client.d.ts +0 -43
  901. package/dist/services/sync/graphrag-client.js +0 -94
  902. package/dist/services/sync/graphrag-client.js.map +0 -1
  903. package/dist/services/sync/graphrag-config.d.ts +0 -16
  904. package/dist/services/sync/graphrag-config.js +0 -39
  905. package/dist/services/sync/graphrag-config.js.map +0 -1
  906. package/dist/services/sync/graphrag-context.d.ts +0 -14
  907. package/dist/services/sync/graphrag-context.js +0 -109
  908. package/dist/services/sync/graphrag-context.js.map +0 -1
  909. package/dist/services/sync/graphrag-indexer.d.ts +0 -30
  910. package/dist/services/sync/graphrag-indexer.js +0 -358
  911. package/dist/services/sync/graphrag-indexer.js.map +0 -1
  912. package/dist/services/sync/llm.d.ts +0 -32
  913. package/dist/services/sync/llm.js +0 -115
  914. package/dist/services/sync/llm.js.map +0 -1
  915. package/dist/services/sync/mcp-client.d.ts +0 -71
  916. package/dist/services/sync/mcp-client.js +0 -299
  917. package/dist/services/sync/mcp-client.js.map +0 -1
  918. package/dist/services/sync/model-factory.d.ts +0 -13
  919. package/dist/services/sync/model-factory.js +0 -38
  920. package/dist/services/sync/model-factory.js.map +0 -1
  921. package/dist/services/sync/name-quality.d.ts +0 -31
  922. package/dist/services/sync/name-quality.js +0 -60
  923. package/dist/services/sync/name-quality.js.map +0 -1
  924. package/dist/services/sync/output-schemas.d.ts +0 -92
  925. package/dist/services/sync/output-schemas.js +0 -43
  926. package/dist/services/sync/output-schemas.js.map +0 -1
  927. package/dist/services/sync/prompts.d.ts +0 -19
  928. package/dist/services/sync/prompts.js +0 -128
  929. package/dist/services/sync/prompts.js.map +0 -1
  930. package/dist/services/sync/reconciler.d.ts +0 -48
  931. package/dist/services/sync/reconciler.js +0 -294
  932. package/dist/services/sync/reconciler.js.map +0 -1
  933. package/dist/services/sync/rest-client.d.ts +0 -40
  934. package/dist/services/sync/rest-client.js +0 -100
  935. package/dist/services/sync/rest-client.js.map +0 -1
  936. package/dist/services/sync/source-config.d.ts +0 -67
  937. package/dist/services/sync/source-config.js +0 -304
  938. package/dist/services/sync/source-config.js.map +0 -1
  939. package/dist/services/sync/source-definitions/asana.d.ts +0 -14
  940. package/dist/services/sync/source-definitions/asana.js +0 -42
  941. package/dist/services/sync/source-definitions/asana.js.map +0 -1
  942. package/dist/services/sync/source-definitions/definitions.d.ts +0 -8
  943. package/dist/services/sync/source-definitions/definitions.js +0 -8
  944. package/dist/services/sync/source-definitions/definitions.js.map +0 -1
  945. package/dist/services/sync/source-definitions/gdrive.d.ts +0 -16
  946. package/dist/services/sync/source-definitions/gdrive.js +0 -68
  947. package/dist/services/sync/source-definitions/gdrive.js.map +0 -1
  948. package/dist/services/sync/source-definitions/granola.d.ts +0 -2
  949. package/dist/services/sync/source-definitions/granola.js +0 -21
  950. package/dist/services/sync/source-definitions/granola.js.map +0 -1
  951. package/dist/services/sync/source-definitions/linear.d.ts +0 -2
  952. package/dist/services/sync/source-definitions/linear.js +0 -62
  953. package/dist/services/sync/source-definitions/linear.js.map +0 -1
  954. package/dist/services/sync/source-definitions/obsidian.d.ts +0 -2
  955. package/dist/services/sync/source-definitions/obsidian.js +0 -55
  956. package/dist/services/sync/source-definitions/obsidian.js.map +0 -1
  957. package/dist/services/sync/source-definitions/pipedrive.d.ts +0 -2
  958. package/dist/services/sync/source-definitions/pipedrive.js +0 -43
  959. package/dist/services/sync/source-definitions/pipedrive.js.map +0 -1
  960. package/dist/services/sync/staging.d.ts +0 -53
  961. package/dist/services/sync/staging.js +0 -130
  962. package/dist/services/sync/staging.js.map +0 -1
  963. package/dist/services/sync/structured-extractor.d.ts +0 -57
  964. package/dist/services/sync/structured-extractor.js +0 -584
  965. package/dist/services/sync/structured-extractor.js.map +0 -1
  966. package/dist/services/sync/sync-runner.d.ts +0 -32
  967. package/dist/services/sync/sync-runner.js +0 -195
  968. package/dist/services/sync/sync-runner.js.map +0 -1
  969. package/dist/services/sync/sync-state.d.ts +0 -43
  970. package/dist/services/sync/sync-state.js +0 -154
  971. package/dist/services/sync/sync-state.js.map +0 -1
  972. package/dist/services/sync/types.d.ts +0 -381
  973. package/dist/services/sync/types.js +0 -8
  974. package/dist/services/sync/types.js.map +0 -1
  975. package/dist/services/sync/unstructured-extractor.d.ts +0 -27
  976. package/dist/services/sync/unstructured-extractor.js +0 -185
  977. package/dist/services/sync/unstructured-extractor.js.map +0 -1
  978. package/dist/utils/merge-resolver.d.ts +0 -59
  979. package/dist/utils/merge-resolver.js +0 -303
  980. package/dist/utils/merge-resolver.js.map +0 -1
  981. package/dist/utils/workspace-config.d.ts +0 -8
  982. package/dist/utils/workspace-config.js +0 -22
  983. package/dist/utils/workspace-config.js.map +0 -1
  984. package/dist/web/_app/immutable/assets/0.DdizXOKi.css +0 -1
  985. package/dist/web/_app/immutable/assets/10.BUrHkYry.css +0 -1
  986. package/dist/web/_app/immutable/assets/2.n7-yW_Fs.css +0 -1
  987. package/dist/web/_app/immutable/assets/3.BtaZagnv.css +0 -1
  988. package/dist/web/_app/immutable/assets/4.DT7X0x5S.css +0 -1
  989. package/dist/web/_app/immutable/assets/5.DFeGxLYf.css +0 -1
  990. package/dist/web/_app/immutable/assets/6.CquhUpOu.css +0 -1
  991. package/dist/web/_app/immutable/assets/7.CjbDRbuG.css +0 -1
  992. package/dist/web/_app/immutable/assets/8.S1QdUGNM.css +0 -1
  993. package/dist/web/_app/immutable/assets/9.CT4xL4K3.css +0 -1
  994. package/dist/web/_app/immutable/assets/Copy.FS8bdfxr.css +0 -1
  995. package/dist/web/_app/immutable/assets/Toaster.rN8r_Hzv.css +0 -1
  996. package/dist/web/_app/immutable/assets/ViewToolbar.D-QW2oKe.css +0 -1
  997. package/dist/web/_app/immutable/assets/index.D6tMDJWk.css +0 -1
  998. package/dist/web/_app/immutable/chunks/37NdyH6G.js +0 -32
  999. package/dist/web/_app/immutable/chunks/4Hhzb6pv.js +0 -1
  1000. package/dist/web/_app/immutable/chunks/72bZS3G9.js +0 -1
  1001. package/dist/web/_app/immutable/chunks/7S2LGqoP.js +0 -2
  1002. package/dist/web/_app/immutable/chunks/B-7hHz7B.js +0 -1
  1003. package/dist/web/_app/immutable/chunks/B340SUKR.js +0 -1
  1004. package/dist/web/_app/immutable/chunks/BB_5th5W.js +0 -3383
  1005. package/dist/web/_app/immutable/chunks/BDoWDZaG.js +0 -1
  1006. package/dist/web/_app/immutable/chunks/BFyl1ZHO.js +0 -1
  1007. package/dist/web/_app/immutable/chunks/BS2rFAVq.js +0 -1
  1008. package/dist/web/_app/immutable/chunks/BSsDC_p4.js +0 -1
  1009. package/dist/web/_app/immutable/chunks/BTX2Jr8_.js +0 -1
  1010. package/dist/web/_app/immutable/chunks/BWNY8zw6.js +0 -2
  1011. package/dist/web/_app/immutable/chunks/BdPUVvAi.js +0 -1
  1012. package/dist/web/_app/immutable/chunks/BmsJVLyy.js +0 -1
  1013. package/dist/web/_app/immutable/chunks/BoAosqzE.js +0 -1
  1014. package/dist/web/_app/immutable/chunks/Bs-tL5OR.js +0 -1
  1015. package/dist/web/_app/immutable/chunks/Bsacq2UX.js +0 -1
  1016. package/dist/web/_app/immutable/chunks/BuewkNdS.js +0 -4
  1017. package/dist/web/_app/immutable/chunks/ByunV8un.js +0 -1
  1018. package/dist/web/_app/immutable/chunks/C7VoTosa.js +0 -2
  1019. package/dist/web/_app/immutable/chunks/CDV5Q7RN.js +0 -1
  1020. package/dist/web/_app/immutable/chunks/CJ8__CWt.js +0 -1
  1021. package/dist/web/_app/immutable/chunks/CJUKmosC.js +0 -5
  1022. package/dist/web/_app/immutable/chunks/CSVbGg_b.js +0 -5
  1023. package/dist/web/_app/immutable/chunks/CT6oIU-C.js +0 -1
  1024. package/dist/web/_app/immutable/chunks/CTRxNfZk.js +0 -1
  1025. package/dist/web/_app/immutable/chunks/CWQRQXxy.js +0 -1
  1026. package/dist/web/_app/immutable/chunks/CXH6iFbA.js +0 -1
  1027. package/dist/web/_app/immutable/chunks/CX_61fY8.js +0 -5
  1028. package/dist/web/_app/immutable/chunks/CYrVHOHA.js +0 -1
  1029. package/dist/web/_app/immutable/chunks/CdeYcEuU.js +0 -1
  1030. package/dist/web/_app/immutable/chunks/CmCtpZ1Y.js +0 -1
  1031. package/dist/web/_app/immutable/chunks/CqkleIqs.js +0 -1
  1032. package/dist/web/_app/immutable/chunks/CrdV0ttd.js +0 -1
  1033. package/dist/web/_app/immutable/chunks/CscoF-YL.js +0 -18
  1034. package/dist/web/_app/immutable/chunks/Cx4YdFMk.js +0 -1
  1035. package/dist/web/_app/immutable/chunks/D7ZqAKi9.js +0 -3
  1036. package/dist/web/_app/immutable/chunks/DGbA7IXh.js +0 -2
  1037. package/dist/web/_app/immutable/chunks/DbbB6Up5.js +0 -1
  1038. package/dist/web/_app/immutable/chunks/DnL9f0lc.js +0 -7
  1039. package/dist/web/_app/immutable/chunks/DtM5cEDu.js +0 -1
  1040. package/dist/web/_app/immutable/chunks/Eqahi7_S.js +0 -2
  1041. package/dist/web/_app/immutable/chunks/FFlLQIiS.js +0 -1
  1042. package/dist/web/_app/immutable/chunks/O9Eb9k00.js +0 -1
  1043. package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +0 -1
  1044. package/dist/web/_app/immutable/chunks/QF8MAmnc.js +0 -1
  1045. package/dist/web/_app/immutable/chunks/UjzxCpxn.js +0 -1
  1046. package/dist/web/_app/immutable/chunks/WSUKABI_.js +0 -1
  1047. package/dist/web/_app/immutable/chunks/Y90OgS-9.js +0 -1
  1048. package/dist/web/_app/immutable/chunks/cLyZlkXv.js +0 -1
  1049. package/dist/web/_app/immutable/chunks/iDtAARVW.js +0 -2
  1050. package/dist/web/_app/immutable/chunks/oC_W7W7p.js +0 -1
  1051. package/dist/web/_app/immutable/chunks/rJdWIgh-.js +0 -1
  1052. package/dist/web/_app/immutable/chunks/tvOsokaa.js +0 -1
  1053. package/dist/web/_app/immutable/chunks/uLEXaPwE.js +0 -1
  1054. package/dist/web/_app/immutable/chunks/vSaooFHB.js +0 -1
  1055. package/dist/web/_app/immutable/entry/app.DAR-mtfg.js +0 -2
  1056. package/dist/web/_app/immutable/entry/start.xDnyRaR1.js +0 -1
  1057. package/dist/web/_app/immutable/nodes/0.D0aV-Zro.js +0 -2
  1058. package/dist/web/_app/immutable/nodes/1.C7QoM8qD.js +0 -1
  1059. package/dist/web/_app/immutable/nodes/10.DrDOAjOD.js +0 -1
  1060. package/dist/web/_app/immutable/nodes/2.B0OgNuKW.js +0 -168
  1061. package/dist/web/_app/immutable/nodes/3.BZ4qHGZi.js +0 -1
  1062. package/dist/web/_app/immutable/nodes/4.hm-mxuuj.js +0 -12
  1063. package/dist/web/_app/immutable/nodes/5.Bdbt4fjx.js +0 -4
  1064. package/dist/web/_app/immutable/nodes/6.BXrCI40c.js +0 -2
  1065. package/dist/web/_app/immutable/nodes/7.Chd4i9bm.js +0 -2
  1066. package/dist/web/_app/immutable/nodes/8.B8SF-aNs.js +0 -1
  1067. package/dist/web/_app/immutable/nodes/9.YDeu-RnO.js +0 -1
@@ -1,5 +0,0 @@
1
- import{l as Yn,o as j,c as F,a as C,p as Vt,b as ct,m as eo,u as no}from"./iDtAARVW.js";import{aO as ro,o as oo,w as io,bx as so,k as ao,e as M,by as Sn,Q as co,g as u,s as y,a_ as Yt,u as x,f as _t,aY as lo,aC as An,aX as uo,a4 as fo,a5 as Z,a6 as _e,aF as ho,p as R,h as T,b as N,ad as K,c as At,r as Ot,bz as go,bA as qn,i as de,aE as po}from"./CT6oIU-C.js";import{b as k,a as Ct}from"./CmCtpZ1Y.js";import{p as v,r as V,s as Q}from"./cLyZlkXv.js";import{B as mo,i as rt,b as Zn}from"./72bZS3G9.js";import{c as Et}from"./CXH6iFbA.js";import{c as Pt,a as Qn}from"./BS2rFAVq.js";import{b as Re}from"./DGbA7IXh.js";function vo(){return Symbol(ro)}const yo=Symbol("NaN");function bo(e,t,n){oo&&io();var r=new mo(e),o=!so();ao(()=>{var s=t();s!==s&&(s=yo),o&&s!==null&&typeof s=="object"&&(s={}),r.ensure(s,n)})}class wo extends Map{#t=new Map;#e=M(0);#n=M(0);#r=Sn||-1;constructor(t){if(super(),t){for(var[n,r]of t)super.set(n,r);this.#n.v=super.size}}#o(t){return Sn===this.#r?M(t):co(t)}has(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#o(0),n.set(t,r);else return u(this.#e),!1;return u(r),!0}forEach(t,n){this.#i(),super.forEach(t,n)}get(t){var n=this.#t,r=n.get(t);if(r===void 0)if(super.has(t))r=this.#o(0),n.set(t,r);else{u(this.#e);return}return u(r),super.get(t)}set(t,n){var r=this.#t,o=r.get(t),s=super.get(t),i=super.set(t,n),a=this.#e;if(o===void 0)o=this.#o(0),r.set(t,o),y(this.#n,super.size),Yt(a);else if(s!==n){Yt(o);var c=a.reactions===null?null:new Set(a.reactions),l=c===null||!o.reactions?.every(h=>c.has(h));l&&Yt(a)}return i}delete(t){var n=this.#t,r=n.get(t),o=super.delete(t);return r!==void 0&&(n.delete(t),y(r,-1)),o&&(y(this.#n,super.size),Yt(this.#e)),o}clear(){if(super.size!==0){super.clear();var t=this.#t;y(this.#n,0);for(var n of t.values())y(n,-1);Yt(this.#e),t.clear()}}#i(){u(this.#e);var t=this.#t;if(this.#n.v!==t.size){for(var n of super.keys())if(!t.has(n)){var r=this.#o(0);t.set(n,r)}}for([,r]of this.#t)u(r)}keys(){return u(this.#e),super.keys()}values(){return this.#i(),super.values()}entries(){return this.#i(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(this.#n),super.size}}function xo(e){return typeof e=="function"}function ne(e){return e!==null&&typeof e=="object"}const So=["string","number","bigint","boolean"];function Be(e){return e==null||So.includes(typeof e)?!0:Array.isArray(e)?e.every(t=>Be(t)):typeof e=="object"?Object.getPrototypeOf(e)===Object.prototype:!1}const Lt=Symbol("box"),Ce=Symbol("is-writable");function w(e,t){const n=x(e);return t?{[Lt]:!0,[Ce]:!0,get current(){return u(n)},set current(r){t(r)}}:{[Lt]:!0,get current(){return e()}}}function re(e){return ne(e)&&Lt in e}function Ue(e){return re(e)&&Ce in e}function Jn(e){return re(e)?e:xo(e)?w(e):ut(e)}function Ao(e){return Object.entries(e).reduce((t,[n,r])=>re(r)?(Ue(r)?Object.defineProperty(t,n,{get(){return r.current},set(o){r.current=o}}):Object.defineProperty(t,n,{get(){return r.current}}),t):Object.assign(t,{[n]:r}),{})}function Oo(e){return Ue(e)?{[Lt]:!0,get current(){return e.current}}:e}function ut(e){let t=M(_t(e));return{[Lt]:!0,[Ce]:!0,get current(){return u(t)},set current(n){y(t,n,!0)}}}function Dt(e){let t=M(_t(e));return{[Lt]:!0,[Ce]:!0,get current(){return u(t)},set current(n){y(t,n,!0)}}}Dt.from=Jn;Dt.with=w;Dt.flatten=Ao;Dt.readonly=Oo;Dt.isBox=re;Dt.isWritableBox=Ue;function $n(...e){return function(t){for(const n of e)if(n){if(t.defaultPrevented)return;typeof n=="function"?n.call(this,t):n.current?.call(this,t)}}}var On=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Co=/\n/g,Eo=/^\s*/,Po=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,To=/^:\s*/,Mo=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Fo=/^[;\s]*/,Io=/^\s+|\s+$/g,Ro=`
2
- `,Cn="/",En="*",It="",No="comment",ko="declaration";function Do(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(g){var p=g.match(Co);p&&(n+=p.length);var b=g.lastIndexOf(Ro);r=~b?g.length-b:r+g.length}function s(){var g={line:n,column:r};return function(p){return p.position=new i(g),l(),p}}function i(g){this.start=g,this.end={line:n,column:r},this.source=t.source}i.prototype.content=e;function a(g){var p=new Error(t.source+":"+n+":"+r+": "+g);if(p.reason=g,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function c(g){var p=g.exec(e);if(p){var b=p[0];return o(b),e=e.slice(b.length),p}}function l(){c(Eo)}function h(g){var p;for(g=g||[];p=d();)p!==!1&&g.push(p);return g}function d(){var g=s();if(!(Cn!=e.charAt(0)||En!=e.charAt(1))){for(var p=2;It!=e.charAt(p)&&(En!=e.charAt(p)||Cn!=e.charAt(p+1));)++p;if(p+=2,It===e.charAt(p-1))return a("End of comment missing");var b=e.slice(2,p-2);return r+=2,o(b),e=e.slice(p),r+=2,g({type:No,comment:b})}}function m(){var g=s(),p=c(Po);if(p){if(d(),!c(To))return a("property missing ':'");var b=c(Mo),S=g({type:ko,property:Pn(p[0].replace(On,It)),value:b?Pn(b[0].replace(On,It)):It});return c(Fo),S}}function f(){var g=[];h(g);for(var p;p=m();)p!==!1&&(g.push(p),h(g));return g}return l(),f()}function Pn(e){return e?e.replace(Io,It):It}function _o(e,t){let n=null;if(!e||typeof e!="string")return n;const r=Do(e),o=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:i,value:a}=s;o?t(i,a,s):a&&(n=n||{},n[i]=a)}),n}const Bo=/\d/,Lo=["-","_","/","."];function Wo(e=""){if(!Bo.test(e))return e!==e.toLowerCase()}function Ko(e){const t=[];let n="",r,o;for(const s of e){const i=Lo.includes(s);if(i===!0){t.push(n),n="",r=void 0;continue}const a=Wo(s);if(o===!1){if(r===!1&&a===!0){t.push(n),n=s,r=a;continue}if(r===!0&&a===!1&&n.length>1){const c=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=c+s,r=a;continue}}n+=s,r=a,o=i}return t.push(n),t}function tr(e){return e?Ko(e).map(t=>zo(t)).join(""):""}function Vo(e){return Ho(tr(e||""))}function zo(e){return e?e[0].toUpperCase()+e.slice(1):""}function Ho(e){return e?e[0].toLowerCase()+e.slice(1):""}function Jt(e){if(!e)return{};const t={};function n(r,o){if(r.startsWith("-moz-")||r.startsWith("-webkit-")||r.startsWith("-ms-")||r.startsWith("-o-")){t[tr(r)]=o;return}if(r.startsWith("--")){t[r]=o;return}t[Vo(r)]=o}return _o(e,n),t}function Rt(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}function jo(e,t){const n=RegExp(e,"g");return r=>{if(typeof r!="string")throw new TypeError(`expected an argument of type string, but got ${typeof r}`);return r.match(n)?r.replace(n,t):r}}const Uo=jo(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Go(e){if(!e||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Uo(t)}: ${e[t]};`).join(`
3
- `)}function er(e={}){return Go(e).replace(`
4
- `," ")}const Xo=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],Yo=new Set(Xo);function qo(e){return Yo.has(e)}function ot(...e){const t={...e[0]};for(let n=1;n<e.length;n++){const r=e[n];if(r){for(const o of Object.keys(r)){const s=t[o],i=r[o],a=typeof s=="function",c=typeof i=="function";if(a&&qo(o)){const l=s,h=i;t[o]=$n(l,h)}else if(a&&c)t[o]=Rt(s,i);else if(o==="class"){const l=Be(s),h=Be(i);l&&h?t[o]=Re(s,i):l?t[o]=Re(s):h&&(t[o]=Re(i))}else if(o==="style"){const l=typeof s=="object",h=typeof i=="object",d=typeof s=="string",m=typeof i=="string";if(l&&h)t[o]={...s,...i};else if(l&&m){const f=Jt(i);t[o]={...s,...f}}else if(d&&h){const f=Jt(s);t[o]={...f,...i}}else if(d&&m){const f=Jt(s),g=Jt(i);t[o]={...f,...g}}else l?t[o]=s:h?t[o]=i:d?t[o]=s:m&&(t[o]=i)}else t[o]=i!==void 0?i:s}for(const o of Object.getOwnPropertySymbols(r)){const s=t[o],i=r[o];t[o]=i!==void 0?i:s}}}return typeof t.style=="object"&&(t.style=er(t.style).replaceAll(`
5
- `," ")),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}const nr=typeof window<"u"?window:void 0;function Zo(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Qo{#t;#e;constructor(t={}){const{window:n=nr,document:r=n?.document}=t;n!==void 0&&(this.#t=r,this.#e=Yn(o=>{const s=j(n,"focusin",o),i=j(n,"focusout",o);return()=>{s(),i()}}))}get current(){return this.#e?.(),this.#t?Zo(this.#t):null}}new Qo;function Jo(e){return typeof e=="function"}class Tt{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return lo(this.#e)}get(){const t=An(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=An(this.#e);return n===void 0?t:n}set(t){return uo(this.#e,t)}}function $o(e,t){switch(e){case"post":Z(t);break;case"pre":fo(t);break}}function rr(e,t,n,r={}){const{lazy:o=!1}=r;let s=!o,i=Array.isArray(e)?[]:void 0;$o(t,()=>{const a=Array.isArray(e)?e.map(l=>l()):e();if(!s){s=!0,i=a;return}const c=_e(()=>n(a,i));return i=a,c})}function G(e,t,n){rr(e,"post",t,n)}function ti(e,t,n){rr(e,"pre",t,n)}G.pre=ti;function Tn(e){return Jo(e)?e():e}class ei{#t={width:0,height:0};#e=!1;#n;#r;#o;#i=x(()=>(u(this.#s)?.(),this.getSize().width));#a=x(()=>(u(this.#s)?.(),this.getSize().height));#s=x(()=>{const t=Tn(this.#r);if(t)return Yn(n=>{if(!this.#o)return;const r=new this.#o.ResizeObserver(o=>{this.#e=!0;for(const s of o){const i=this.#n.box==="content-box"?s.contentBoxSize:s.borderBoxSize,a=Array.isArray(i)?i:[i];this.#t.width=a.reduce((c,l)=>Math.max(c,l.inlineSize),0),this.#t.height=a.reduce((c,l)=>Math.max(c,l.blockSize),0)}n()});return r.observe(t),()=>{this.#e=!1,r.disconnect()}})});constructor(t,n={box:"border-box"}){this.#o=n.window??nr,this.#n=n,this.#r=t,this.#t={width:0,height:0}}calculateSize(){const t=Tn(this.#r);if(!t||!this.#o)return;const n=t.offsetWidth,r=t.offsetHeight;if(this.#n.box==="border-box")return{width:n,height:r};const o=this.#o.getComputedStyle(t),s=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),i=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),a=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),c=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),l=n-s-a,h=r-i-c;return{width:l,height:h}}getSize(){return this.#e?this.#t:this.calculateSize()??this.#t}get current(){return u(this.#s)?.(),this.getSize()}get width(){return u(this.#i)}get height(){return u(this.#a)}}function zt(e){Z(()=>()=>{e()})}function or(e,t){return setTimeout(t,e)}function lt(e){ho().then(e)}const ni=1,ri=9,oi=11;function Le(e){return ne(e)&&e.nodeType===ni&&typeof e.nodeName=="string"}function ir(e){return ne(e)&&e.nodeType===ri}function ii(e){return ne(e)&&e.constructor?.name==="VisualViewport"}function si(e){return ne(e)&&e.nodeType!==void 0}function sr(e){return si(e)&&e.nodeType===oi&&"host"in e}function ai(e,t){if(!e||!t||!Le(e)||!Le(t))return!1;const n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&sr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function oe(e){return ir(e)?e:ii(e)?e.document:e?.ownerDocument??document}function Ge(e){return sr(e)?Ge(e.host):ir(e)?e.defaultView??window:Le(e)?e.ownerDocument?.defaultView??window:window}function ci(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class Xe{element;#t=x(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return u(this.#t)}set root(t){y(this.#t,t)}constructor(t){typeof t=="function"?this.element=w(t):this.element=t}getDocument=()=>oe(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>ci(this.root);isActiveElement=t=>t===this.getActiveElement();getElementById(t){return this.root.getElementById(t)}querySelector=t=>this.root?this.root.querySelector(t):null;querySelectorAll=t=>this.root?this.root.querySelectorAll(t):[];setTimeout=(t,n)=>this.getWindow().setTimeout(t,n);clearTimeout=t=>this.getWindow().clearTimeout(t)}function tt(e,t){return{[vo()]:n=>re(e)?(e.current=n,_e(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e.current=null,t?.(null))}):(e(n),_e(()=>t?.(n)),()=>{"isConnected"in n&&n.isConnected||(e(null),t?.(null))})}}function ar(e){return e?"true":"false"}function Wt(e){return e?"":void 0}function uc(e){return e?!0:void 0}function Ye(e){return e?"open":"closed"}function dc(e,t){return t?"mixed":e?"true":"false"}class li{#t;#e;attrs;constructor(t){this.#t=t.getVariant?t.getVariant():null,this.#e=this.#t?`data-${this.#t}-`:`data-${t.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(t.parts.map(n=>[n,this.getAttr(n)]))}getAttr(t,n){return n?`data-${n}-${t}`:`${this.#e}${t}`}selector(t,n){return`[${this.getAttr(t,n)}]`}}function cr(e){const t=new li(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}const te="ArrowDown",qe="ArrowLeft",Ze="ArrowRight",fe="ArrowUp",lr="End",Ee="Enter",ui="Escape",ur="Home",di="PageDown",fi="PageUp",ie=" ",hi="Tab";function gi(e){return window.getComputedStyle(e).getPropertyValue("direction")}function pi(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?qe:Ze,vertical:te}[t]}function mi(e="ltr",t="horizontal"){return{horizontal:e==="rtl"?Ze:qe,vertical:fe}[t]}function vi(e="ltr",t="horizontal"){return["ltr","rtl"].includes(e)||(e="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:pi(e,t),prevKey:mi(e,t)}}const dr=typeof document<"u",Mn=yi();function yi(){return dr&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function mt(e){return e instanceof HTMLElement}function We(e){return e instanceof Element}function fr(e){return e instanceof Element||e instanceof SVGElement}function fc(e){return e.pointerType==="touch"}function bi(e){return e!==null}function wi(e){return e instanceof HTMLInputElement&&"select"in e}class xi{#t;#e=Dt(null);constructor(t){this.#t=t}getCandidateNodes(){return this.#t.rootNode.current?this.#t.candidateSelector?Array.from(this.#t.rootNode.current.querySelectorAll(this.#t.candidateSelector)):this.#t.candidateAttr?Array.from(this.#t.rootNode.current.querySelectorAll(`[${this.#t.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){const t=this.getCandidateNodes();t.length&&t[0]?.focus()}handleKeydown(t,n,r=!1){const o=this.#t.rootNode.current;if(!o||!t)return;const s=this.getCandidateNodes();if(!s.length)return;const i=s.indexOf(t),a=gi(o),{nextKey:c,prevKey:l}=vi(a,this.#t.orientation.current),h=this.#t.loop.current,d={[c]:i+1,[l]:i-1,[ur]:0,[lr]:s.length-1};if(r){const g=c===te?Ze:te,p=l===fe?qe:fe;d[g]=i+1,d[p]=i-1}let m=d[n.key];if(m===void 0)return;n.preventDefault(),m<0&&h?m=s.length-1:m===s.length&&h&&(m=0);const f=s[m];if(f)return f.focus(),this.#e.current=f.id,this.#t.onCandidateFocus?.(f),f}getTabIndex(t){const n=this.getCandidateNodes(),r=this.#e.current!==null;return t&&!r&&n[0]===t?(this.#e.current=t.id,0):t?.id===this.#e.current?0:-1}setCurrentTabStopId(t){this.#e.current=t}focusCurrentTabStop(){const t=this.#e.current;if(!t)return;const n=this.#t.rootNode.current?.querySelector(`#${t}`);!n||!mt(n)||n.focus()}}class Si{#t;#e=null;constructor(t){this.#t=t,zt(()=>this.#n())}#n(){this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null)}run(t){this.#n();const n=this.#t.ref.current;if(n){if(typeof n.getAnimations!="function"){this.#r(t);return}this.#e=window.requestAnimationFrame(()=>{const r=n.getAnimations();if(r.length===0){this.#r(t);return}Promise.allSettled(r.map(o=>o.finished)).then(()=>{this.#r(t)})})}}#r(t){const n=()=>{t()};this.#t.afterTick?lt(n):n()}}class Ke{#t;#e;#n;#r=M(!1);constructor(t){this.#t=t,y(this.#r,t.open.current,!0),this.#e=t.enabled??!0,this.#n=new Si({ref:this.#t.ref,afterTick:this.#t.open}),G(()=>this.#t.open.current,n=>{n&&y(this.#r,!0),this.#e&&this.#n.run(()=>{n===this.#t.open.current&&(this.#t.open.current||y(this.#r,!1),this.#t.onComplete?.())})})}get shouldRender(){return u(this.#r)}}function W(){}function Ht(e,t){return`bits-${e}`}const Ai=cr({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),vt=new Tt("Dialog.Root | AlertDialog.Root");class Qe{static create(t){const n=vt.getOr(null);return vt.set(new Qe(t,n))}opts;#t=M(null);get triggerNode(){return u(this.#t)}set triggerNode(t){y(this.#t,t,!0)}#e=M(null);get contentNode(){return u(this.#e)}set contentNode(t){y(this.#e,t,!0)}#n=M(null);get overlayNode(){return u(this.#n)}set overlayNode(t){y(this.#n,t,!0)}#r=M(null);get descriptionNode(){return u(this.#r)}set descriptionNode(t){y(this.#r,t,!0)}#o=M(void 0);get contentId(){return u(this.#o)}set contentId(t){y(this.#o,t,!0)}#i=M(void 0);get titleId(){return u(this.#i)}set titleId(t){y(this.#i,t,!0)}#a=M(void 0);get triggerId(){return u(this.#a)}set triggerId(t){y(this.#a,t,!0)}#s=M(void 0);get descriptionId(){return u(this.#s)}set descriptionId(t){y(this.#s,t,!0)}#c=M(null);get cancelNode(){return u(this.#c)}set cancelNode(t){y(this.#c,t,!0)}#u=M(0);get nestedOpenCount(){return u(this.#u)}set nestedOpenCount(t){y(this.#u,t,!0)}depth;parent;contentPresence;overlayPresence;constructor(t,n){this.opts=t,this.parent=n,this.depth=n?n.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new Ke({ref:w(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new Ke({ref:w(()=>this.overlayNode),open:this.opts.open,enabled:!0}),G(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),zt(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=t=>Ai.getAttr(t,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#l=x(()=>({"data-state":Ye(this.opts.open.current)}));get sharedProps(){return u(this.#l)}set sharedProps(t){y(this.#l,t)}}class hr{static create(t){return new hr(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===ie||t.key===Ee)&&(t.preventDefault(),this.root.handleClose())}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}class Je{static create(t){return new Je(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref)}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("action")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}class $e{static create(t){return new $e(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.root.titleId=this.opts.id.current,this.attachment=tt(this.opts.ref),G.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}#t=x(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}class tn{static create(t){return new tn(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.root.descriptionId=this.opts.id.current,this.attachment=tt(this.opts.ref,r=>{this.root.descriptionNode=r}),G.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}class en{static create(t){return new en(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r?.id})}#t=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){y(this.#t,t)}#e=x(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Wt(this.root.nestedOpenCount>0),"data-nested":Wt(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){y(this.#e,t)}get shouldRender(){return this.root.contentPresence.shouldRender}}class nn{static create(t){return new nn(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref,r=>this.root.overlayNode=r)}#t=x(()=>({open:this.root.opts.open.current}));get snippetProps(){return u(this.#t)}set snippetProps(t){y(this.#t,t)}#e=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Wt(this.root.nestedOpenCount>0),"data-nested":Wt(this.root.parent!==null),...this.root.sharedProps,...this.attachment}));get props(){return u(this.#e)}set props(t){y(this.#e,t)}get shouldRender(){return this.root.overlayPresence.shouldRender}}class rn{static create(t){return new rn(t,vt.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref,r=>this.root.cancelNode=r),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===ie||t.key===Ee)&&(t.preventDefault(),this.root.handleClose())}#t=x(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}function Oi(e,t){R(t,!0);let n=v(t,"open",15,!1),r=v(t,"onOpenChange",3,W),o=v(t,"onOpenChangeComplete",3,W);Qe.create({variant:w(()=>"alert-dialog"),open:w(()=>n(),a=>{n(a),r()(a)}),onOpenChangeComplete:w(()=>o())});var s=F(),i=T(s);k(i,()=>t.children??K),C(e,s),N()}var Ci=ct("<div><!></div>");function Ei(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"ref",15,null),s=v(t,"level",3,2),i=V(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const a=$e.create({id:w(()=>r()),level:w(()=>s()),ref:w(()=>o(),f=>o(f))}),c=x(()=>ot(i,a.props));var l=F(),h=T(l);{var d=f=>{var g=F(),p=T(g);k(p,()=>t.child,()=>({props:u(c)})),C(f,g)},m=f=>{var g=Ci();Ct(g,()=>({...u(c)}));var p=At(g);k(p,()=>t.children??K),Ot(g),C(f,g)};rt(h,f=>{t.child?f(d):f(m,!1)})}C(e,l),N()}var Pi=ct("<button><!></button>");function Ti(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"ref",15,null),s=V(t,["$$slots","$$events","$$legacy","children","child","id","ref"]);const i=Je.create({id:w(()=>r()),ref:w(()=>o(),m=>o(m))}),a=x(()=>ot(s,i.props));var c=F(),l=T(c);{var h=m=>{var f=F(),g=T(f);k(g,()=>t.child,()=>({props:u(a)})),C(m,f)},d=m=>{var f=Pi();Ct(f,()=>({...u(a)}));var g=At(f);k(g,()=>t.children??K),Ot(f),C(m,f)};rt(l,m=>{t.child?m(h):m(d,!1)})}C(e,c),N()}var Mi=ct("<button><!></button>");function Fi(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"ref",15,null),s=v(t,"disabled",3,!1),i=V(t,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const a=rn.create({id:w(()=>r()),ref:w(()=>o(),f=>o(f)),disabled:w(()=>!!s())}),c=x(()=>ot(i,a.props));var l=F(),h=T(l);{var d=f=>{var g=F(),p=T(g);k(p,()=>t.child,()=>({props:u(c)})),C(f,g)},m=f=>{var g=Mi();Ct(g,()=>({...u(c)}));var p=At(g);k(p,()=>t.children??K),Ot(g),C(f,g)};rt(h,f=>{t.child?f(d):f(m,!1)})}C(e,l),N()}function Ii(e,t){var n=F(),r=T(n);bo(r,()=>t.children,o=>{var s=F(),i=T(s);k(i,()=>t.children??K),C(o,s)}),C(e,n)}const Ri=new Tt("BitsConfig");function Ni(){const e=new ki(null,{});return Ri.getOr(e).opts}class ki{opts;constructor(t,n){const r=Di(t,n);this.opts={defaultPortalTo:r(o=>o.defaultPortalTo),defaultLocale:r(o=>o.defaultLocale)}}}function Di(e,t){return n=>w(()=>{const o=n(t)?.current;if(o!==void 0)return o;if(e!==null)return n(e.opts)?.current})}function _i(e,t){return n=>{const r=Ni();return w(()=>{const o=n();if(o!==void 0)return o;const s=e(r).current;return s!==void 0?s:t})}}const Bi=_i(e=>e.defaultPortalTo,"body");function Li(e,t){R(t,!0);const n=Bi(()=>t.to),r=go();let o=x(s);function s(){if(!dr||t.disabled)return null;let d=null;return typeof n.current=="string"?d=document.querySelector(n.current):d=n.current,d}let i;function a(){i&&(no(i),i=null)}G([()=>u(o),()=>t.disabled],([d,m])=>{if(!d||m){a();return}return i=eo(Ii,{target:d,props:{children:t.children},context:r}),()=>{a()}});var c=F(),l=T(c);{var h=d=>{var m=F(),f=T(m);k(f,()=>t.children??K),C(d,m)};rt(l,d=>{t.disabled&&d(h)})}C(e,c),N()}class Wi{eventName;options;constructor(t,n={bubbles:!0,cancelable:!0}){this.eventName=t,this.options=n}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,n){const r=this.createEvent(n);return t.dispatchEvent(r),r}listen(t,n,r){const o=s=>{n(s)};return j(t,this.eventName,o,r)}}function Fn(e,t=500){let n=null;const r=(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function gr(e,t){return e===t||e.contains(t)}function pr(e){return e?.ownerDocument??document}function Ki(e,t){const{clientX:n,clientY:r}=e,o=t.getBoundingClientRect();return n<o.left||n>o.right||r<o.top||r>o.bottom}const Vi=[Ee,ie],zi=[te,fi,ur],mr=[fe,di,lr],Hi=[...zi,...mr];function In(e){return e.pointerType==="mouse"}function ji(e,{select:t=!1}={}){if(!e||!e.focus)return;const n=oe(e);if(n.activeElement===e)return;const r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&wi(e)&&t&&e.select()}function Ui(e,{select:t=!1}={},n){const r=n();for(const o of e)if(ji(o,{select:t}),n()!==r)return!0}let qt=M(!1);class wt{static _refs=0;static _cleanup;constructor(){Z(()=>(wt._refs===0&&(wt._cleanup=qn(()=>{const t=[],n=o=>{y(qt,!1)},r=o=>{y(qt,!0)};return t.push(j(document,"pointerdown",n,{capture:!0}),j(document,"pointermove",n,{capture:!0}),j(document,"keydown",r,{capture:!0})),Rt(...t)})),wt._refs++,()=>{wt._refs--,wt._refs===0&&(y(qt,!1),wt._cleanup?.())}))}get current(){return u(qt)}set current(t){y(qt,t,!0)}}var vr=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],he=vr.join(","),yr=typeof Element>"u",Nt=yr?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ge=!yr&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},pe=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):pe(t.parentNode));return i},Gi=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},br=function(t,n,r){if(pe(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(he));return n&&Nt.call(t,he)&&o.unshift(t),o=o.filter(r),o},me=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!pe(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),c=a.length?a:i.children,l=me(c,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:i,candidates:l})}else{var h=Nt.call(i,he);h&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),m=!pe(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&m){var f=me(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},wr=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},xr=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Gi(t))&&!wr(t)?0:t.tabIndex},Xi=function(t,n){var r=xr(t);return r<0&&n&&!wr(t)?0:r},Yi=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sr=function(t){return t.tagName==="INPUT"},qi=function(t){return Sr(t)&&t.type==="hidden"},Zi=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Qi=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Ji=function(t){if(!t.name)return!0;var n=t.form||ge(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Qi(o,t.form);return!s||s===t},$i=function(t){return Sr(t)&&t.type==="radio"},ts=function(t){return $i(t)&&!Ji(t)},es=function(t){var n,r=t&&ge(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,c;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&o;){var l,h,d;r=ge(o),o=(l=r)===null||l===void 0?void 0:l.host,s=!!((h=o)!==null&&h!==void 0&&(d=h.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Rn=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},ns=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Nt.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Nt.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var c=t;t;){var l=t.parentElement,h=ge(t);if(l&&!l.shadowRoot&&o(l)===!0)return Rn(t);t.assignedSlot?t=t.assignedSlot:!l&&h!==t.ownerDocument?t=h.host:t=l}t=c}if(es(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Rn(t);return!1},rs=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Nt.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ve=function(t,n){return!(n.disabled||qi(n)||ns(n,t)||Zi(n)||rs(n))},Ve=function(t,n){return!(ts(n)||xr(n)<0||!ve(t,n))},os=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ar=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,c=Xi(a,i),l=i?Ar(o.candidates):a;c===0?i?n.push.apply(n,l):n.push(a):r.push({documentOrder:s,tabIndex:c,item:o,isScope:i,content:l})}),r.sort(Yi).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Or=function(t,n){n=n||{};var r;return n.getShadowRoot?r=me([t],n.includeContainer,{filter:Ve.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:os}):r=br(t,n.includeContainer,Ve.bind(null,n)),Ar(r)},Cr=function(t,n){n=n||{};var r;return n.getShadowRoot?r=me([t],n.includeContainer,{filter:ve.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=br(t,n.includeContainer,ve.bind(null,n)),r},on=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Nt.call(t,he)===!1?!1:Ve(n,t)},is=vr.concat("iframe:not([inert]):not([inert] *)").join(","),Er=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Nt.call(t,is)===!1?!1:ve(n,t)};function $t(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function ss(e,t){if(!on(e,$t()))return as(e,t);const n=oe(e),r=Or(n.body,$t());t==="prev"&&r.reverse();const o=r.indexOf(e);return o===-1?n.body:r.slice(o+1)[0]}function as(e,t){const n=oe(e);if(!Er(e,$t()))return n.body;const r=Cr(n.body,$t());t==="prev"&&r.reverse();const o=r.indexOf(e);return o===-1?n.body:r.slice(o+1).find(i=>on(i,$t()))??n.body}function cs(e,t){return e.length!==t.length?!1:e.every((n,r)=>Pr(n,t[r]))}function Pr(e,t){return Number.isNaN(e)&&Number.isNaN(t)?!0:Array.isArray(e)&&Array.isArray(t)?cs(e,t):typeof e=="object"&&typeof t=="object"?ls(e,t):Object.is(e,t)}function ls(e,t){if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!Pr(e[o],t[o]))return!1;return!0}function hc(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===e.length-1?n?e[0]:void 0:e[t+1]}function gc(e,t,n=!0){if(!(e.length===0||t<0||t>=e.length))return e.length===1&&t===0?e[0]:t===0?n?e[e.length-1]:void 0:e[t-1]}function pc(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let o=t+n;return r?o=(o%e.length+e.length)%e.length:o=Math.max(0,Math.min(o,e.length-1)),e[o]}function mc(e,t,n,r=!0){if(e.length===0||t<0||t>=e.length)return;let o=t-n;return r?o=(o%e.length+e.length)%e.length:o=Math.max(0,Math.min(o,e.length-1)),e[o]}function Tr(e,t,n){const r=t.toLowerCase();if(r.endsWith(" ")){const d=r.slice(0,-1);if(e.filter(p=>p.toLowerCase().startsWith(d)).length<=1)return Tr(e,d,n);const f=n?.toLowerCase();if(f&&f.startsWith(d)&&f.charAt(d.length)===" "&&t.trim()===d)return n;const g=e.filter(p=>p.toLowerCase().startsWith(r));if(g.length>0){const p=n?e.indexOf(n):-1;return Nn(g,Math.max(p,0)).find(A=>A!==n)||n}}const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=s.toLowerCase(),a=n?e.indexOf(n):-1;let c=Nn(e,Math.max(a,0));s.length===1&&(c=c.filter(d=>d!==n));const h=c.find(d=>d?.toLowerCase().startsWith(i));return h!==n?h:void 0}function Nn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const us={afterMs:1e4,onChange:W};function Mr(e,t){const{afterMs:n,onChange:r,getWindow:o}={...us,...t};let s=null,i=M(_t(e));function a(){return o().setTimeout(()=>{y(i,e,!0),r?.(e)},n)}return Z(()=>()=>{s&&o().clearTimeout(s)}),w(()=>u(i),c=>{y(i,c,!0),r?.(c),s&&o().clearTimeout(s),s=a()})}class ds{#t;#e;#n=x(()=>this.#t.onMatch?this.#t.onMatch:t=>t.focus());#r=x(()=>this.#t.getCurrentItem?this.#t.getCurrentItem:this.#t.getActiveElement);constructor(t){this.#t=t,this.#e=Mr("",{afterMs:1e3,getWindow:t.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,n){if(!n.length)return;this.#e.current=this.#e.current+t;const r=u(this.#r)(),o=n.find(c=>c===r)?.textContent?.trim()??"",s=n.map(c=>c.textContent?.trim()??""),i=Tr(s,this.#e.current,o),a=n.find(c=>c.textContent?.trim()===i);return a&&u(this.#n)(a),a}resetTypeahead(){this.#e.current=""}get search(){return this.#e.current}}class fs{#t;#e;#n;#r=M(null);constructor(t){this.#t=t,this.#e=x(()=>this.#t.enabled()),this.#n=Mr(!1,{afterMs:t.transitTimeout??300,onChange:n=>{u(this.#e)&&this.#t.setIsPointerInTransit?.(n)},getWindow:()=>Ge(this.#t.triggerNode())}),G([t.triggerNode,t.contentNode,t.enabled],([n,r,o])=>{if(!n||!r||!o)return;const s=a=>{this.#i(a,r)},i=a=>{this.#i(a,n)};return Rt(j(n,"pointerleave",s),j(r,"pointerleave",i))}),G(()=>u(this.#r),()=>{const n=o=>{if(!u(this.#r))return;const s=o.target;if(!We(s))return;const i={x:o.clientX,y:o.clientY},a=t.triggerNode()?.contains(s)||t.contentNode()?.contains(s),c=!ms(i,u(this.#r));a?this.#o():c&&(this.#o(),t.onPointerExit())},r=oe(t.triggerNode()??t.contentNode());if(r)return j(r,"pointermove",n)})}#o(){y(this.#r,null),this.#n.current=!1}#i(t,n){const r=t.currentTarget;if(!mt(r))return;const o={x:t.clientX,y:t.clientY},s=hs(o,r.getBoundingClientRect()),i=gs(o,s),a=ps(n.getBoundingClientRect()),c=vs([...i,...a]);y(this.#r,c,!0),this.#n.current=!0}}function hs(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function gs(e,t,n=5){const r=n*1.5;switch(t){case"top":return[{x:e.x-n,y:e.y+n},{x:e.x,y:e.y-r},{x:e.x+n,y:e.y+n}];case"bottom":return[{x:e.x-n,y:e.y-n},{x:e.x,y:e.y+r},{x:e.x+n,y:e.y-n}];case"left":return[{x:e.x+n,y:e.y-n},{x:e.x-r,y:e.y},{x:e.x+n,y:e.y+n}];case"right":return[{x:e.x-n,y:e.y-n},{x:e.x+r,y:e.y},{x:e.x-n,y:e.y+n}]}}function ps(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ms(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s].x,c=t[s].y,l=t[i].x,h=t[i].y;c>r!=h>r&&n<(l-a)*(r-c)/(h-c)+a&&(o=!o)}return o}function vs(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ys(t)}function ys(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const bs="data-context-menu-trigger",ws="data-context-menu-content",Fr=new Tt("Menu.Root"),sn=new Tt("Menu.Root | Menu.Sub"),Ir=new Tt("Menu.Content"),xs=new Wi("bitsmenuopen",{bubbles:!1,cancelable:!0}),Ss=cr({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});class Rr{static create(t){const n=new Rr(t);return Fr.set(n)}opts;isUsingKeyboard=new wt;#t=M(!1);get ignoreCloseAutoFocus(){return u(this.#t)}set ignoreCloseAutoFocus(t){y(this.#t,t,!0)}#e=M(!1);get isPointerInTransit(){return u(this.#e)}set isPointerInTransit(t){y(this.#e,t,!0)}constructor(t){this.opts=t}getBitsAttr=t=>Ss.getAttr(t,this.opts.variant.current)}class Nr{static create(t,n){return sn.set(new Nr(t,n,null))}opts;root;parentMenu;contentId=w(()=>"");#t=M(null);get contentNode(){return u(this.#t)}set contentNode(t){y(this.#t,t,!0)}contentPresence;#e=M(null);get triggerNode(){return u(this.#e)}set triggerNode(t){y(this.#e,t,!0)}constructor(t,n,r){this.opts=t,this.root=n,this.parentMenu=r,this.contentPresence=new Ke({ref:w(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&G(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}}class kr{static create(t){return Ir.set(new kr(t,sn.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#t=M("");get search(){return u(this.#t)}set search(t){y(this.#t,t,!0)}#e=0;#n;#r=M(!1);get mounted(){return u(this.#r)}set mounted(t){y(this.#r,t,!0)}#o;constructor(t,n){this.opts=t,this.parentMenu=n,this.domContext=new Xe(t.ref),this.attachment=tt(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),n.contentId=t.id,this.#o=t.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new fs({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")),onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),this.#n=new ds({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new xi({rootNode:w(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:w(()=>"vertical")}),G(()=>this.parentMenu.contentNode,r=>{if(!r)return;const o=()=>{lt(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return xs.listen(r,o)}),Z(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#e)})}#i(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]}#a(){return this.parentMenu.root.isPointerInTransit}onCloseAutoFocus=t=>{if(this.opts.onCloseAutoFocus.current?.(t),!(t.defaultPrevented||this.#o)){if(this.parentMenu.root.ignoreCloseAutoFocus){t.preventDefault();return}this.parentMenu.triggerNode&&on(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(t){let n=this.parentMenu;for(;n.parentMenu!==null;)n=n.parentMenu;if(!n.triggerNode)return;t.preventDefault();const r=ss(n.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,n.onClose(),lt(()=>{r.focus(),lt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){if(t.defaultPrevented)return;if(t.key===hi){this.handleTabKeyDown(t);return}const n=t.target,r=t.currentTarget;if(!mt(n)||!mt(r))return;const o=n.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`)?.id===this.parentMenu.contentId.current,s=t.ctrlKey||t.altKey||t.metaKey,i=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(n,t)||t.code==="Space")return;const c=this.#i();o&&!s&&i&&this.#n(t.key,c),t.target?.id===this.parentMenu.contentId.current&&Hi.includes(t.key)&&(t.preventDefault(),mr.includes(t.key)&&c.reverse(),Ui(c,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){We(t.currentTarget)&&We(t.target)&&(t.currentTarget.contains?.(t.target)||(this.domContext.getWindow().clearTimeout(this.#e),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&lt(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#a()}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||this.#a()||this.parentMenu.root.isUsingKeyboard.current)return;this.parentMenu.contentNode?.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!this.#a()}handleInteractOutside(t){if(!fr(t.target))return;const n=this.parentMenu.triggerNode?.id;if(t.target.id===n){t.preventDefault();return}if(t.target.closest(`#${n}`)){t.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,lt(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#s=x(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return u(this.#s)}set snippetProps(t){y(this.#s,t)}#c=x(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Ye(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment}));get props(){return u(this.#c)}set props(t){y(this.#c,t)}popperProps={onCloseAutoFocus:t=>this.onCloseAutoFocus(t)}}class As{opts;content;attachment;#t=M(!1);constructor(t,n){this.opts=t,this.content=n,this.attachment=tt(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&In(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!mt(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||In(t)&&this.content.onItemLeave(t)}onfocus(t){lt(()=>{t.defaultPrevented||this.opts.disabled.current||y(this.#t,!0)})}onblur(t){lt(()=>{t.defaultPrevented||y(this.#t,!1)})}#e=x(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":ar(this.opts.disabled.current),"data-disabled":Wt(this.opts.disabled.current),"data-highlighted":u(this.#t)?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return u(this.#e)}set props(t){y(this.#e,t)}}class Dr{static create(t){const n=new As(t,Ir.get());return new Dr(t,n)}opts;item;root;#t=!1;constructor(t,n){this.opts=t,this.item=n,this.root=n.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#e(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(t){const n=this.item.content.search!=="";if(!(this.item.opts.disabled.current||n&&t.key===ie)&&Vi.includes(t.key)){if(!mt(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||this.#e()}onpointerup(t){if(!t.defaultPrevented&&!this.#t){if(!mt(t.currentTarget))return;t.currentTarget?.click()}}onpointerdown(t){this.#t=!0}#n=x(()=>ot(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return u(this.#n)}set props(t){y(this.#n,t)}}class _r{static create(t){return new _r(t,Fr.get())}opts;root;attachment;constructor(t,n){this.opts=t,this.root=n,this.attachment=tt(this.opts.ref)}#t=x(()=>({id:this.opts.id.current,role:"group",[this.root.getBitsAttr("separator")]:"",...this.attachment}));get props(){return u(this.#t)}set props(t){y(this.#t,t)}}class Br{static create(t){return new Br(t,sn.get())}opts;parentMenu;attachment;constructor(t,n){this.opts=t,this.parentMenu=n,this.attachment=tt(this.opts.ref,r=>this.parentMenu.triggerNode=r)}onclick=t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())};onpointerdown=t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}};onpointerup=t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=t=>{if(!this.opts.disabled.current){if(t.key===ie||t.key===Ee){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===te&&(this.parentMenu.onOpen(),t.preventDefault())}};#t=x(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#e=x(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":ar(this.parentMenu.opts.open.current),"aria-controls":u(this.#t),"data-disabled":Wt(this.opts.disabled.current),"data-state":Ye(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return u(this.#e)}set props(t){y(this.#e,t)}}globalThis.bitsDismissableLayers??=new Map;class an{static create(t){return new an(t)}opts;#t;#e;#n={pointerdown:!1};#r=!1;#o=!1;#i=void 0;#a;#s=W;constructor(t){this.opts=t,this.#e=t.interactOutsideBehavior,this.#t=t.onInteractOutside,this.#a=t.onFocusOutside,Z(()=>{this.#i=pr(this.opts.ref.current)});let n=W;const r=()=>{this.#f(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),n()};G([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return or(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#e),n(),n=this.#u())}),r}),zt(()=>{this.#f.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),n()})}#c=t=>{t.defaultPrevented||this.opts.ref.current&&lt(()=>{!this.opts.ref.current||this.#m(t.target)||t.target&&!this.#o&&this.#a.current?.(t)})};#u(){return Rt(j(this.#i,"pointerdown",Rt(this.#h,this.#p),{capture:!0}),j(this.#i,"pointerdown",Rt(this.#g,this.#d)),j(this.#i,"focusin",this.#c))}#l=t=>{let n=t;n.defaultPrevented&&(n=kn(t)),this.#t.current(t)};#d=Fn(t=>{if(!this.opts.ref.current){this.#s();return}const n=this.opts.isValidEvent.current(t,this.opts.ref.current)||Es(t,this.opts.ref.current);if(!this.#r||this.#v()||!n){this.#s();return}let r=t;if(r.defaultPrevented&&(r=kn(r)),this.#e.current!=="close"&&this.#e.current!=="defer-otherwise-close"){this.#s();return}t.pointerType==="touch"?(this.#s(),this.#s=j(this.#i,"click",this.#l,{once:!0})):this.#t.current(r)},10);#h=t=>{this.#n[t.type]=!0};#g=t=>{this.#n[t.type]=!1};#p=()=>{this.opts.ref.current&&(this.#r=Cs(this.opts.ref.current))};#m=t=>this.opts.ref.current?gr(this.opts.ref.current,t):!1;#f=Fn(()=>{for(const t in this.#n)this.#n[t]=!1;this.#r=!1},20);#v(){return Object.values(this.#n).some(Boolean)}#y=()=>{this.#o=!0};#b=()=>{this.#o=!1};props={onfocuscapture:this.#y,onblurcapture:this.#b}}function Os(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([t,{current:n}])=>n==="close"||n==="ignore")}function Cs(e){const t=[...globalThis.bitsDismissableLayers],n=Os(t);if(n)return n[0].opts.ref.current===e;const[r]=t[0];return r.opts.ref.current===e}function Es(e,t){const n=e.target;if(!fr(n))return!1;const r=!!n.closest(`[${bs}]`);if("button"in e&&e.button>0&&!r)return!1;if("button"in e&&e.button===0&&r)return!0;const o=!!t.closest(`[${ws}]`);return r&&o?!1:pr(n).documentElement.contains(n)&&!gr(t,n)&&Ki(e,t)}function kn(e){const t=e.currentTarget,n=e.target;let r;e instanceof PointerEvent?r=new PointerEvent(e.type,e):r=new PointerEvent("pointerdown",e);let o=!1;return new Proxy(r,{get:(i,a)=>a==="currentTarget"?t:a==="target"?n:a==="preventDefault"?()=>{o=!0,typeof i.preventDefault=="function"&&i.preventDefault()}:a==="defaultPrevented"?o:a in i?i[a]:e[a]})}function Lr(e,t){R(t,!0);let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"onInteractOutside",3,W),o=v(t,"onFocusOutside",3,W),s=v(t,"isValidEvent",3,()=>!1);const i=an.create({id:w(()=>t.id),interactOutsideBehavior:w(()=>n()),onInteractOutside:w(()=>r()),enabled:w(()=>t.enabled),onFocusOutside:w(()=>o()),isValidEvent:w(()=>s()),ref:t.ref});var a=F(),c=T(a);k(c,()=>t.children??K,()=>({props:i.props})),C(e,a),N()}globalThis.bitsEscapeLayers??=new Map;class cn{static create(t){return new cn(t)}opts;domContext;constructor(t){this.opts=t,this.domContext=new Xe(this.opts.ref);let n=W;G(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),n=this.#t()),()=>{n(),globalThis.bitsEscapeLayers.delete(this)}))}#t=()=>j(this.domContext.getDocument(),"keydown",this.#e,{passive:!1});#e=t=>{if(t.key!==ui||!Ps(this))return;const n=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(n)}}function Ps(e){const t=[...globalThis.bitsEscapeLayers],n=t.findLast(([o,{current:s}])=>s==="close"||s==="ignore");if(n)return n[0]===e;const[r]=t[0];return r===e}function Wr(e,t){R(t,!0);let n=v(t,"escapeKeydownBehavior",3,"close"),r=v(t,"onEscapeKeydown",3,W);cn.create({escapeKeydownBehavior:w(()=>n()),onEscapeKeydown:w(()=>r()),enabled:w(()=>t.enabled),ref:t.ref});var o=F(),s=T(o);k(s,()=>t.children??K),C(e,o),N()}class ln{static instance;#t=ut([]);#e=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||(this.instance=new ln),this.instance}register(t){const n=this.getActive();n&&n!==t&&n.pause();const r=document.activeElement;r&&r!==document.body&&this.#n.set(t,r),this.#t.current=this.#t.current.filter(o=>o!==t),this.#t.current.unshift(t)}unregister(t){this.#t.current=this.#t.current.filter(r=>r!==t);const n=this.getActive();n&&n.resume()}getActive(){return this.#t.current[0]}setFocusMemory(t,n){this.#e.set(t,n)}getFocusMemory(t){return this.#e.get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,n){this.#n.set(t,n)}getPreFocusMemory(t){return this.#n.get(t)}clearPreFocusMemory(t){this.#n.delete(t)}}class un{#t=!1;#e=null;#n=ln.getInstance();#r=[];#o;constructor(t){this.#o=t}get paused(){return this.#t}pause(){this.#t=!0}resume(){this.#t=!1}#i(){for(const t of this.#r)t();this.#r=[]}mount(t){this.#e&&this.unmount(),this.#e=t,this.#n.register(this),this.#c(),this.#a()}unmount(){this.#e&&(this.#i(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),this.#e=null)}#a(){if(!this.#e)return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});this.#o.onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!this.#e)return;const n=this.#l();n?(n.focus(),this.#n.setFocusMemory(this,n)):this.#e.focus()})}#s(){const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if(this.#o.onCloseAutoFocus.current?.(t),!t.defaultPrevented){const n=this.#n.getPreFocusMemory(this);if(n&&document.contains(n))try{n.focus()}catch{document.body.focus()}}}#c(){if(!this.#e||!this.#o.trap.current)return;const t=this.#e,n=t.ownerDocument,r=i=>{if(this.#t||!this.#n.isActiveScope(this))return;const a=i.target;if(!a)return;if(t.contains(a))this.#n.setFocusMemory(this,a);else{const l=this.#n.getFocusMemory(this);if(l&&t.contains(l)&&Er(l))i.preventDefault(),l.focus();else{const h=this.#l(),d=this.#d()[0];(h||d||t).focus()}}},o=i=>{if(!this.#o.loop||this.#t||i.key!=="Tab"||!this.#n.isActiveScope(this))return;const a=this.#u();if(a.length===0)return;const c=a[0],l=a[a.length-1];!i.shiftKey&&n.activeElement===l?(i.preventDefault(),c.focus()):i.shiftKey&&n.activeElement===c&&(i.preventDefault(),l.focus())};this.#r.push(j(n,"focusin",r,{capture:!0}),j(t,"keydown",o));const s=new MutationObserver(()=>{const i=this.#n.getFocusMemory(this);if(i&&!t.contains(i)){const a=this.#l(),c=this.#d()[0],l=a||c;l?(l.focus(),this.#n.setFocusMemory(this,l)):t.focus()}});s.observe(t,{childList:!0,subtree:!0}),this.#r.push(()=>s.disconnect())}#u(){return this.#e?Or(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}#l(){return this.#u()[0]||null}#d(){return this.#e?Cr(this.#e,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return G([()=>t.ref.current,()=>t.enabled.current],([r,o])=>{r&&o?(n||(n=new un(t)),n.mount(r)):n&&(n.unmount(),n=null)}),zt(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}}function Kr(e,t){R(t,!0);let n=v(t,"enabled",3,!1),r=v(t,"trapFocus",3,!1),o=v(t,"loop",3,!1),s=v(t,"onCloseAutoFocus",3,W),i=v(t,"onOpenAutoFocus",3,W);const a=un.use({enabled:w(()=>n()),trap:w(()=>r()),loop:o(),onCloseAutoFocus:w(()=>s()),onOpenAutoFocus:w(()=>i()),ref:t.ref});var c=F(),l=T(c);k(l,()=>t.focusScope??K,()=>({props:a.props})),C(e,c),N()}globalThis.bitsTextSelectionLayers??=new Map;class dn{static create(t){return new dn(t)}opts;domContext;#t=W;constructor(t){this.opts=t,this.domContext=new Xe(t.ref);let n=W;G(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),n(),n=this.#e()),()=>{n(),this.#r(),globalThis.bitsTextSelectionLayers.delete(this)}))}#e(){return Rt(j(this.domContext.getDocument(),"pointerdown",this.#n),j(this.domContext.getDocument(),"pointerup",$n(this.#r,this.opts.onPointerUp.current)))}#n=t=>{const n=this.opts.ref.current,r=t.target;!mt(n)||!mt(r)||!this.opts.enabled.current||!Ms(this)||!ai(n,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&(this.#t=Ts(n,this.domContext.getDocument().body)))};#r=()=>{this.#t(),this.#t=W}}const Dn=e=>e.style.userSelect||e.style.webkitUserSelect;function Ts(e,t){const n=Dn(t),r=Dn(e);return ae(t,"none"),ae(e,"text"),()=>{ae(t,n),ae(e,r)}}function ae(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function Ms(e){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const n=t.at(-1);return n?n[0]===e:!1}function Vr(e,t){R(t,!0);let n=v(t,"preventOverflowTextSelection",3,!0),r=v(t,"onPointerDown",3,W),o=v(t,"onPointerUp",3,W);dn.create({id:w(()=>t.id),onPointerDown:w(()=>r()),onPointerUp:w(()=>o()),enabled:w(()=>t.enabled&&n()),ref:t.ref});var s=F(),i=T(s);k(i,()=>t.children??K),C(e,s),N()}globalThis.bitsIdCounter??={current:0};function fn(e="bits"){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}class Fs{#t;#e=0;#n=M();#r;constructor(t){this.#t=t}#o(){this.#e-=1,this.#r&&this.#e<=0&&(this.#r(),y(this.#n,void 0),this.#r=void 0)}get(...t){return this.#e+=1,u(this.#n)===void 0&&(this.#r=qn(()=>{y(this.#n,this.#t(...t),!0)})),Z(()=>()=>{this.#o()}),u(this.#n)}}const ue=new wo;let ce=M(null),Ne=null,Zt=null,Qt=!1;const _n=w(()=>{for(const e of ue.values())if(e)return!0;return!1});let ke=null;const Is=new Fs(()=>{function e(){document.body.setAttribute("style",u(ce)??""),document.body.style.removeProperty("--scrollbar-width"),Mn&&Ne?.(),y(ce,null)}function t(){Zt!==null&&(window.clearTimeout(Zt),Zt=null)}function n(o,s){t(),Qt=!0,ke=Date.now();const i=ke,a=()=>{Zt=null,ke===i&&(zr(ue)?Qt=!1:(Qt=!1,s()))},c=o===null?24:o;Zt=window.setTimeout(a,c)}function r(){u(ce)===null&&ue.size===0&&!Qt&&y(ce,document.body.getAttribute("style"),!0)}return G(()=>_n.current,()=>{if(!_n.current)return;r(),Qt=!1;const o=getComputedStyle(document.documentElement),s=getComputedStyle(document.body),i=o.scrollbarGutter?.includes("stable")||s.scrollbarGutter?.includes("stable"),a=window.innerWidth-document.documentElement.clientWidth,l={padding:Number.parseInt(s.paddingRight??"0",10)+a,margin:Number.parseInt(s.marginRight??"0",10)};a>0&&!i&&(document.body.style.paddingRight=`${l.padding}px`,document.body.style.marginRight=`${l.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Mn&&(Ne=j(document,"touchmove",h=>{h.target===document.documentElement&&(h.touches.length>1||h.preventDefault())},{passive:!1})),lt(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),zt(()=>()=>{Ne?.()}),{get lockMap(){return ue},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});class Rs{#t=fn();#e;#n=()=>null;#r;locked;constructor(t,n=()=>null){this.#e=t,this.#n=n,this.#r=Is.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#t,this.#e??!1),this.locked=w(()=>this.#r.lockMap.get(this.#t)??!1,r=>this.#r.lockMap.set(this.#t,r)),zt(()=>{if(this.#r.lockMap.delete(this.#t),zr(this.#r.lockMap))return;const r=this.#n();this.#r.scheduleCleanupIfNoNewLocks(r,()=>{this.#r.resetBodyStyle()})}))}}function zr(e){for(const[t,n]of e)if(n)return!0;return!1}function ye(e,t){R(t,!0);let n=v(t,"preventScroll",3,!0),r=v(t,"restoreScrollDelay",3,null);n()&&new Rs(n(),()=>r()),N()}var Ns=ct("<!> <!>",1),ks=ct("<!> <div><!></div>",1);function Ds(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"ref",15,null),s=v(t,"forceMount",3,!1),i=v(t,"interactOutsideBehavior",3,"ignore"),a=v(t,"onCloseAutoFocus",3,W),c=v(t,"onEscapeKeydown",3,W),l=v(t,"onOpenAutoFocus",3,W),h=v(t,"onInteractOutside",3,W),d=v(t,"preventScroll",3,!0),m=v(t,"trapFocus",3,!0),f=v(t,"restoreScrollDelay",3,null),g=V(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const p=en.create({id:w(()=>r()),ref:w(()=>o(),O=>o(O))}),b=x(()=>ot(g,p.props));var S=F(),A=T(S);{var E=O=>{Kr(O,{get ref(){return p.opts.ref},loop:!0,get trapFocus(){return m()},get enabled(){return p.root.opts.open.current},get onCloseAutoFocus(){return a()},onOpenAutoFocus:P=>{l()(P),!P.defaultPrevented&&(P.preventDefault(),or(0,()=>p.opts.ref.current?.focus()))},focusScope:(P,D)=>{let X=()=>D?.().props;Wr(P,Q(()=>u(b),{get enabled(){return p.root.opts.open.current},get ref(){return p.opts.ref},onEscapeKeydown:z=>{c()(z),!z.defaultPrevented&&p.root.handleClose()},children:(z,_)=>{Lr(z,Q(()=>u(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},get interactOutsideBehavior(){return i()},onInteractOutside:B=>{h()(B),!B.defaultPrevented&&p.root.handleClose()},children:(B,J)=>{Vr(B,Q(()=>u(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},children:(L,H)=>{var q=F(),et=T(q);{var $=U=>{var pt=Ns(),Gt=T(pt);{var Xt=Mt=>{ye(Mt,{get preventScroll(){return d()},get restoreScrollDelay(){return f()}})};rt(Gt,Mt=>{p.root.opts.open.current&&Mt(Xt)})}var Ie=de(Gt,2);{let Mt=x(()=>({props:ot(u(b),X()),...p.snippetProps}));k(Ie,()=>t.child,()=>u(Mt))}C(U,pt)},Y=U=>{var pt=ks(),Gt=T(pt);ye(Gt,{get preventScroll(){return d()}});var Xt=de(Gt,2);Ct(Xt,Mt=>({...Mt}),[()=>ot(u(b),X())]);var Ie=At(Xt);k(Ie,()=>t.children??K),Ot(Xt),C(U,pt)};rt(et,U=>{t.child?U($):U(Y,!1)})}C(L,q)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};rt(A,O=>{(p.shouldRender||s())&&O(E)})}C(e,S),N()}var _s=ct("<div><!></div>");function Bs(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"forceMount",3,!1),s=v(t,"ref",15,null),i=V(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const a=nn.create({id:w(()=>r()),ref:w(()=>s(),m=>s(m))}),c=x(()=>ot(i,a.props));var l=F(),h=T(l);{var d=m=>{var f=F(),g=T(f);{var p=S=>{var A=F(),E=T(A);{let O=x(()=>({props:ot(u(c)),...a.snippetProps}));k(E,()=>t.child,()=>u(O))}C(S,A)},b=S=>{var A=_s();Ct(A,O=>({...O}),[()=>ot(u(c))]);var E=At(A);k(E,()=>t.children??K,()=>a.snippetProps),Ot(A),C(S,A)};rt(g,S=>{t.child?S(p):S(b,!1)})}C(m,f)};rt(h,m=>{(a.shouldRender||o())&&m(d)})}C(e,l),N()}var Ls=ct("<div><!></div>");function Ws(e,t){const n=Vt();R(t,!0);let r=v(t,"id",19,()=>Ht(n)),o=v(t,"ref",15,null),s=V(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const i=tn.create({id:w(()=>r()),ref:w(()=>o(),m=>o(m))}),a=x(()=>ot(s,i.props));var c=F(),l=T(c);{var h=m=>{var f=F(),g=T(f);k(g,()=>t.child,()=>({props:u(a)})),C(m,f)},d=m=>{var f=Ls();Ct(f,()=>({...u(a)}));var g=At(f);k(g,()=>t.children??K),Ot(f),C(m,f)};rt(l,m=>{t.child?m(h):m(d,!1)})}C(e,c),N()}const Ks=["top","right","bottom","left"],xt=Math.min,nt=Math.max,be=Math.round,le=Math.floor,ft=e=>({x:e,y:e}),Vs={left:"right",right:"left",bottom:"top",top:"bottom"},zs={start:"end",end:"start"};function ze(e,t,n){return nt(e,xt(t,n))}function yt(e,t){return typeof e=="function"?e(t):e}function bt(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function hn(e){return e==="x"?"y":"x"}function gn(e){return e==="y"?"height":"width"}const Hs=new Set(["top","bottom"]);function dt(e){return Hs.has(bt(e))?"y":"x"}function pn(e){return hn(dt(e))}function js(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=pn(e),s=gn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=we(i)),[i,we(i)]}function Us(e){const t=we(e);return[He(e),t,He(t)]}function He(e){return e.replace(/start|end/g,t=>zs[t])}const Bn=["left","right"],Ln=["right","left"],Gs=["top","bottom"],Xs=["bottom","top"];function Ys(e,t,n){switch(e){case"top":case"bottom":return n?t?Ln:Bn:t?Bn:Ln;case"left":case"right":return t?Gs:Xs;default:return[]}}function qs(e,t,n,r){const o=jt(e);let s=Ys(bt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(He)))),s}function we(e){return e.replace(/left|right|bottom|top/g,t=>Vs[t])}function Zs(e){return{top:0,right:0,bottom:0,left:0,...e}}function Hr(e){return typeof e!="number"?Zs(e):{top:e,right:e,bottom:e,left:e}}function xe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Wn(e,t,n){let{reference:r,floating:o}=e;const s=dt(t),i=pn(t),a=gn(i),c=bt(t),l=s==="y",h=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:h,y:r.y-o.height};break;case"bottom":f={x:h,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(jt(t)){case"start":f[i]-=m*(n&&l?-1:1);break;case"end":f[i]+=m*(n&&l?-1:1);break}return f}async function Qs(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=yt(t,e),g=Hr(f),b=a[m?d==="floating"?"reference":"floating":d],S=xe(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),A=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),O=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},I=xe(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:E,strategy:c}):A);return{top:(S.top-I.top+g.top)/O.y,bottom:(I.bottom-S.bottom+g.bottom)/O.y,left:(S.left-I.left+g.left)/O.x,right:(I.right-S.right+g.right)/O.x}}const Js=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:d}=Wn(l,r,c),m=r,f={},g=0;for(let b=0;b<a.length;b++){var p;const{name:S,fn:A}=a[b],{x:E,y:O,data:I,reset:P}=await A({x:h,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:l,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:Qs},elements:{reference:e,floating:t}});h=E??h,d=O??d,f={...f,[S]:{...f[S],...I}},P&&g<=50&&(g++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(l=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:h,y:d}=Wn(l,m,c)),b=-1)}return{x:h,y:d,placement:m,strategy:o,middlewareData:f}},$s=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=yt(e,t)||{};if(l==null)return{};const d=Hr(h),m={x:n,y:r},f=pn(o),g=gn(f),p=await i.getDimensions(l),b=f==="y",S=b?"top":"left",A=b?"bottom":"right",E=b?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[f]-m[f]-s.floating[g],I=m[f]-s.reference[f],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let D=P?P[E]:0;(!D||!await(i.isElement==null?void 0:i.isElement(P)))&&(D=a.floating[E]||s.floating[g]);const X=O/2-I/2,z=D/2-p[g]/2-1,_=xt(d[S],z),B=xt(d[A],z),J=_,L=D-p[g]-B,H=D/2-p[g]/2+X,q=ze(J,H,L),et=!c.arrow&&jt(o)!=null&&H!==q&&s.reference[g]/2-(H<J?_:B)-p[g]/2<0,$=et?H<J?H-J:H-L:0;return{[f]:m[f]+$,data:{[f]:q,centerOffset:H-q-$,...et&&{alignmentOffset:$}},reset:et}}}),ta=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...b}=yt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=bt(o),A=dt(a),E=bt(a)===a,O=await(c.isRTL==null?void 0:c.isRTL(l.floating)),I=m||(E||!p?[we(a)]:Us(a)),P=g!=="none";!m&&P&&I.push(...qs(a,p,g,O));const D=[a,...I],X=await c.detectOverflow(t,b),z=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&z.push(X[S]),d){const H=js(o,i,O);z.push(X[H[0]],X[H[1]])}if(_=[..._,{placement:o,overflows:z}],!z.every(H=>H<=0)){var B,J;const H=(((B=s.flip)==null?void 0:B.index)||0)+1,q=D[H];if(q&&(!(d==="alignment"?A!==dt(q):!1)||_.every(Y=>dt(Y.placement)===A?Y.overflows[0]>0:!0)))return{data:{index:H,overflows:_},reset:{placement:q}};let et=(J=_.filter($=>$.overflows[0]<=0).sort(($,Y)=>$.overflows[1]-Y.overflows[1])[0])==null?void 0:J.placement;if(!et)switch(f){case"bestFit":{var L;const $=(L=_.filter(Y=>{if(P){const U=dt(Y.placement);return U===A||U==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(U=>U>0).reduce((U,pt)=>U+pt,0)]).sort((Y,U)=>Y[1]-U[1])[0])==null?void 0:L[0];$&&(et=$);break}case"initialPlacement":et=a;break}if(o!==et)return{reset:{placement:et}}}return{}}}};function Kn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vn(e){return Ks.some(t=>e[t]>=0)}const ea=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=yt(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Kn(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Vn(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Kn(i,n.floating);return{data:{escapedOffsets:a,escaped:Vn(a)}}}default:return{}}}}},jr=new Set(["left","top"]);async function na(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=bt(n),a=jt(n),c=dt(n)==="y",l=jr.has(i)?-1:1,h=s&&c?-1:1,d=yt(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(f=a==="end"?g*-1:g),c?{x:f*h,y:m*l}:{x:m*l,y:f*h}}const ra=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await na(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:S=>{let{x:A,y:E}=S;return{x:A,y:E}}},...l}=yt(e,t),h={x:n,y:r},d=await s.detectOverflow(t,l),m=dt(bt(o)),f=hn(m);let g=h[f],p=h[m];if(i){const S=f==="y"?"top":"left",A=f==="y"?"bottom":"right",E=g+d[S],O=g-d[A];g=ze(E,g,O)}if(a){const S=m==="y"?"top":"left",A=m==="y"?"bottom":"right",E=p+d[S],O=p-d[A];p=ze(E,p,O)}const b=c.fn({...t,[f]:g,[m]:p});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[f]:i,[m]:a}}}}}},ia=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=yt(e,t),h={x:n,y:r},d=dt(o),m=hn(d);let f=h[m],g=h[d];const p=yt(a,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const E=m==="y"?"height":"width",O=s.reference[m]-s.floating[E]+b.mainAxis,I=s.reference[m]+s.reference[E]-b.mainAxis;f<O?f=O:f>I&&(f=I)}if(l){var S,A;const E=m==="y"?"width":"height",O=jr.has(bt(o)),I=s.reference[d]-s.floating[E]+(O&&((S=i.offset)==null?void 0:S[d])||0)+(O?0:b.crossAxis),P=s.reference[d]+s.reference[E]+(O?0:((A=i.offset)==null?void 0:A[d])||0)-(O?b.crossAxis:0);g<I?g=I:g>P&&(g=P)}return{[m]:f,[d]:g}}}},sa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=yt(e,t),h=await i.detectOverflow(t,l),d=bt(o),m=jt(o),f=dt(o)==="y",{width:g,height:p}=s.floating;let b,S;d==="top"||d==="bottom"?(b=d,S=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(S=d,b=m==="end"?"top":"bottom");const A=p-h.top-h.bottom,E=g-h.left-h.right,O=xt(p-h[b],A),I=xt(g-h[S],E),P=!t.middlewareData.shift;let D=O,X=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(X=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=A),P&&!m){const _=nt(h.left,0),B=nt(h.right,0),J=nt(h.top,0),L=nt(h.bottom,0);f?X=g-2*(_!==0||B!==0?_+B:nt(h.left,h.right)):D=p-2*(J!==0||L!==0?J+L:nt(h.top,h.bottom))}await c({...t,availableWidth:X,availableHeight:D});const z=await i.getDimensions(a.floating);return g!==z.width||p!==z.height?{reset:{rects:!0}}:{}}}};function Pe(){return typeof window<"u"}function Ut(e){return Ur(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gt(e){var t;return(t=(Ur(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ur(e){return Pe()?e instanceof Node||e instanceof it(e).Node:!1}function st(e){return Pe()?e instanceof Element||e instanceof it(e).Element:!1}function ht(e){return Pe()?e instanceof HTMLElement||e instanceof it(e).HTMLElement:!1}function zn(e){return!Pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}const aa=new Set(["inline","contents"]);function se(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=at(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aa.has(o)}const ca=new Set(["table","td","th"]);function la(e){return ca.has(Ut(e))}const ua=[":popover-open",":modal"];function Te(e){return ua.some(t=>{try{return e.matches(t)}catch{return!1}})}const da=["transform","translate","scale","rotate","perspective"],fa=["transform","translate","scale","rotate","perspective","filter"],ha=["paint","layout","strict","content"];function mn(e){const t=vn(),n=st(e)?at(e):e;return da.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||fa.some(r=>(n.willChange||"").includes(r))||ha.some(r=>(n.contain||"").includes(r))}function ga(e){let t=St(e);for(;ht(t)&&!Kt(t);){if(mn(t))return t;if(Te(t))return null;t=St(t)}return null}function vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pa=new Set(["html","body","#document"]);function Kt(e){return pa.has(Ut(e))}function at(e){return it(e).getComputedStyle(e)}function Me(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||zn(e)&&e.host||gt(e);return zn(t)?t.host:t}function Gr(e){const t=St(e);return Kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ht(t)&&se(t)?t:Gr(t)}function ee(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Gr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=it(o);if(s){const a=je(i);return t.concat(i,i.visualViewport||[],se(o)?o:[],a&&n?ee(a):[])}return t.concat(o,ee(o,[],n))}function je(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xr(e){const t=at(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ht(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=be(n)!==s||be(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function yn(e){return st(e)?e:e.contextElement}function Bt(e){const t=yn(e);if(!ht(t))return ft(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Xr(t);let i=(s?be(n.width):n.width)/r,a=(s?be(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ma=ft(0);function Yr(e){const t=it(e);return!vn()||!t.visualViewport?ma:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function va(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==it(e)?!1:t}function kt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=yn(e);let i=ft(1);t&&(r?st(r)&&(i=Bt(r)):i=Bt(e));const a=va(s,n,r)?Yr(s):ft(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,h=o.width/i.x,d=o.height/i.y;if(s){const m=it(s),f=r&&st(r)?it(r):r;let g=m,p=je(g);for(;p&&r&&f!==g;){const b=Bt(p),S=p.getBoundingClientRect(),A=at(p),E=S.left+(p.clientLeft+parseFloat(A.paddingLeft))*b.x,O=S.top+(p.clientTop+parseFloat(A.paddingTop))*b.y;c*=b.x,l*=b.y,h*=b.x,d*=b.y,c+=E,l+=O,g=it(p),p=je(g)}}return xe({width:h,height:d,x:c,y:l})}function Fe(e,t){const n=Me(e).scrollLeft;return t?t.left+n:kt(gt(e)).left+n}function qr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Fe(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function ya(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=gt(r),a=t?Te(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=ft(1);const h=ft(0),d=ht(r);if((d||!d&&!s)&&((Ut(r)!=="body"||se(i))&&(c=Me(r)),ht(r))){const f=kt(r);l=Bt(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}const m=i&&!d&&!s?qr(i,c):ft(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+m.x,y:n.y*l.y-c.scrollTop*l.y+h.y+m.y}}function ba(e){return Array.from(e.getClientRects())}function wa(e){const t=gt(e),n=Me(e),r=e.ownerDocument.body,o=nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Fe(e);const a=-n.scrollTop;return at(r).direction==="rtl"&&(i+=nt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Hn=25;function xa(e,t){const n=it(e),r=gt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const h=vn();(!h||h&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=Fe(r);if(l<=0){const h=r.ownerDocument,d=h.body,m=getComputedStyle(d),f=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-f);g<=Hn&&(s-=g)}else l<=Hn&&(s+=l);return{width:s,height:i,x:a,y:c}}const Sa=new Set(["absolute","fixed"]);function Aa(e,t){const n=kt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ht(e)?Bt(e):ft(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function jn(e,t,n){let r;if(t==="viewport")r=xa(e,n);else if(t==="document")r=wa(gt(e));else if(st(t))r=Aa(t,n);else{const o=Yr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return xe(r)}function Zr(e,t){const n=St(e);return n===t||!st(n)||Kt(n)?!1:at(n).position==="fixed"||Zr(n,t)}function Oa(e,t){const n=t.get(e);if(n)return n;let r=ee(e,[],!1).filter(a=>st(a)&&Ut(a)!=="body"),o=null;const s=at(e).position==="fixed";let i=s?St(e):e;for(;st(i)&&!Kt(i);){const a=at(i),c=mn(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Sa.has(o.position)||se(i)&&!c&&Zr(e,i))?r=r.filter(h=>h!==i):o=a,i=St(i)}return t.set(e,r),r}function Ca(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Te(t)?[]:Oa(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((l,h)=>{const d=jn(t,h,o);return l.top=nt(d.top,l.top),l.right=xt(d.right,l.right),l.bottom=xt(d.bottom,l.bottom),l.left=nt(d.left,l.left),l},jn(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ea(e){const{width:t,height:n}=Xr(e);return{width:t,height:n}}function Pa(e,t,n){const r=ht(t),o=gt(t),s=n==="fixed",i=kt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ft(0);function l(){c.x=Fe(o)}if(r||!r&&!s)if((Ut(t)!=="body"||se(o))&&(a=Me(t)),r){const f=kt(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&l();s&&!r&&o&&l();const h=o&&!r&&!s?qr(o,a):ft(0),d=i.left+a.scrollLeft-c.x-h.x,m=i.top+a.scrollTop-c.y-h.y;return{x:d,y:m,width:i.width,height:i.height}}function De(e){return at(e).position==="static"}function Un(e,t){if(!ht(e)||at(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return gt(e)===n&&(n=n.ownerDocument.body),n}function Qr(e,t){const n=it(e);if(Te(e))return n;if(!ht(e)){let o=St(e);for(;o&&!Kt(o);){if(st(o)&&!De(o))return o;o=St(o)}return n}let r=Un(e,t);for(;r&&la(r)&&De(r);)r=Un(r,t);return r&&Kt(r)&&De(r)&&!mn(r)?n:r||ga(e)||n}const Ta=async function(e){const t=this.getOffsetParent||Qr,n=this.getDimensions,r=await n(e.floating);return{reference:Pa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ma(e){return at(e).direction==="rtl"}const Fa={convertOffsetParentRelativeRectToViewportRelativeRect:ya,getDocumentElement:gt,getClippingRect:Ca,getOffsetParent:Qr,getElementRects:Ta,getClientRects:ba,getDimensions:Ea,getScale:Bt,isElement:st,isRTL:Ma};function Jr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ia(e,t){let n=null,r;const o=gt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:h,top:d,width:m,height:f}=l;if(a||t(),!m||!f)return;const g=le(d),p=le(o.clientWidth-(h+m)),b=le(o.clientHeight-(d+f)),S=le(h),E={rootMargin:-g+"px "+-p+"px "+-b+"px "+-S+"px",threshold:nt(0,xt(1,c))||1};let O=!0;function I(P){const D=P[0].intersectionRatio;if(D!==c){if(!O)return i();D?i(!1,D):r=setTimeout(()=>{i(!1,1e-7)},1e3)}D===1&&!Jr(l,e.getBoundingClientRect())&&i(),O=!1}try{n=new IntersectionObserver(I,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(I,E)}n.observe(e)}return i(!0),s}function Ra(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=yn(e),h=o||s?[...l?ee(l):[],...ee(t)]:[];h.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),s&&S.addEventListener("resize",n)});const d=l&&a?Ia(l,n):null;let m=-1,f=null;i&&(f=new ResizeObserver(S=>{let[A]=S;A&&A.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=f)==null||E.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let g,p=c?kt(e):null;c&&b();function b(){const S=kt(e);p&&!Jr(p,S)&&n(),p=S,g=requestAnimationFrame(b)}return n(),()=>{var S;h.forEach(A=>{o&&A.removeEventListener("scroll",n),s&&A.removeEventListener("resize",n)}),d?.(),(S=f)==null||S.disconnect(),f=null,c&&cancelAnimationFrame(g)}}const Na=ra,ka=oa,Da=ta,_a=sa,Ba=ea,La=$s,Wa=ia,Ka=(e,t,n)=>{const r=new Map,o={platform:Fa,...n},s={...o.platform,_c:r};return Js(e,t,{...o,platform:s})};function Ft(e){return typeof e=="function"?e():e}function $r(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gn(e,t){const n=$r(e);return Math.round(t*n)/n}function vc(e){return{[`--bits-${e}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${e}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${e}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${e}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${e}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function Va(e){const t=e.whileElementsMounted,n=x(()=>Ft(e.open)??!0),r=x(()=>Ft(e.middleware)),o=x(()=>Ft(e.transform)??!0),s=x(()=>Ft(e.placement)??"bottom"),i=x(()=>Ft(e.strategy)??"absolute"),a=x(()=>Ft(e.sideOffset)??0),c=x(()=>Ft(e.alignOffset)??0),l=e.reference;let h=M(0),d=M(0);const m=ut(null);let f=M(_t(u(i))),g=M(_t(u(s))),p=M(_t({})),b=M(!1),S=!1,A=0;const E=x(()=>{const _=m.current?Gn(m.current,u(h)):u(h),B=m.current?Gn(m.current,u(d)):u(d);return u(o)?{position:u(f),left:"0",top:"0",transform:`translate(${_}px, ${B}px)`,...m.current&&$r(m.current)>=1.5&&{willChange:"transform"}}:{position:u(f),left:`${_}px`,top:`${B}px`}});let O;function I(){if(l.current===null||m.current===null)return;const _=l.current,B=m.current,J=++A;Ka(_,B,{middleware:u(r),placement:u(s),strategy:u(i)}).then(L=>{if(J!==A||l.current!==_||m.current!==B)return;if(za(_)){y(p,{...u(p),hide:{...u(p).hide,referenceHidden:!0}},!0);return}if(!u(n)&&u(h)!==0&&u(d)!==0){const q=Math.max(Math.abs(u(a)),Math.abs(u(c)),15);if(L.x<=q&&L.y<=q)return}y(h,L.x,!0),y(d,L.y,!0),y(f,L.strategy,!0),y(g,L.placement,!0),y(p,L.middlewareData,!0),y(b,!0)})}function P(){typeof O=="function"&&(O(),O=void 0),A++}function D(){if(P(),t===void 0){I();return}u(n)&&(l.current===null||m.current===null||(O=t(l.current,m.current,I)))}function X(){!u(n)&&m.current===null&&y(b,!1)}function z(){return[u(r),u(s),u(i),u(a),u(c),u(n)]}return Z(()=>{t===void 0&&u(n)&&I()}),Z(D),Z(()=>{if(t!==void 0){if(z(),!u(n)){S=!1;return}if(!u(b)){S=!1;return}if(!S){S=!0;return}I()}}),Z(X),Z(()=>P),{floating:m,reference:l,get strategy(){return u(f)},get placement(){return u(g)},get middlewareData(){return u(p)},get isPositioned(){return u(b)},get floatingStyles(){return u(E)},get update(){return I}}}function za(e){return e instanceof Element?!e.isConnected||e instanceof HTMLElement&&e.hidden?!0:e.getClientRects().length===0:!1}const Ha={top:"bottom",right:"left",bottom:"top",left:"right"},bn=new Tt("Floating.Root"),Xn=new Tt("Floating.Content"),wn=new Tt("Floating.Root");class Se{static create(t=!1){return t?wn.set(new Se):bn.set(new Se)}anchorNode=ut(null);customAnchorNode=ut(null);triggerNode=ut(null);constructor(){Z(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}}class Ae{static create(t,n=!1){return n?Xn.set(new Ae(t,wn.get())):Xn.set(new Ae(t,bn.get()))}opts;root;contentRef=ut(null);wrapperRef=ut(null);arrowRef=ut(null);contentAttachment=tt(this.contentRef);wrapperAttachment=tt(this.wrapperRef);arrowAttachment=tt(this.arrowRef);arrowId=ut(fn());#t=x(()=>{if(typeof this.opts.style=="string")return Jt(this.opts.style);if(!this.opts.style)return{}});#e=void 0;#n=new ei(()=>this.arrowRef.current??void 0);#r=x(()=>this.#n?.width??0);#o=x(()=>this.#n?.height??0);#i=x(()=>this.opts.side?.current+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:""));#a=x(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]);#s=x(()=>u(this.#a).length>0);get hasExplicitBoundaries(){return u(this.#s)}set hasExplicitBoundaries(t){y(this.#s,t)}#c=x(()=>({padding:this.opts.collisionPadding.current,boundary:u(this.#a).filter(bi),altBoundary:this.hasExplicitBoundaries}));get detectOverflowOptions(){return u(this.#c)}set detectOverflowOptions(t){y(this.#c,t)}#u=M(void 0);#l=M(void 0);#d=M(void 0);#h=M(void 0);#g=x(()=>[Na({mainAxis:this.opts.sideOffset.current+u(this.#o),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&ka({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?Wa():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&Da({...this.detectOverflowOptions}),_a({...this.detectOverflowOptions,apply:({rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:s}=t.reference;y(this.#u,n,!0),y(this.#l,r,!0),y(this.#d,o,!0),y(this.#h,s,!0)}}),this.arrowRef.current&&La({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),ja({arrowWidth:u(this.#r),arrowHeight:u(this.#o)}),this.opts.hideWhenDetached.current&&Ba({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean));get middleware(){return u(this.#g)}set middleware(t){y(this.#g,t)}floating;#p=x(()=>Ua(this.floating.placement));get placedSide(){return u(this.#p)}set placedSide(t){y(this.#p,t)}#m=x(()=>Ga(this.floating.placement));get placedAlign(){return u(this.#m)}set placedAlign(t){y(this.#m,t)}#f=x(()=>this.floating.middlewareData.arrow?.x??0);get arrowX(){return u(this.#f)}set arrowX(t){y(this.#f,t)}#v=x(()=>this.floating.middlewareData.arrow?.y??0);get arrowY(){return u(this.#v)}set arrowY(t){y(this.#v,t)}#y=x(()=>this.floating.middlewareData.arrow?.centerOffset!==0);get cannotCenterArrow(){return u(this.#y)}set cannotCenterArrow(t){y(this.#y,t)}#b=M();get contentZIndex(){return u(this.#b)}set contentZIndex(t){y(this.#b,t,!0)}#w=x(()=>Ha[this.placedSide]);get arrowBaseSide(){return u(this.#w)}set arrowBaseSide(t){y(this.#w,t)}#x=x(()=>({id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,"--bits-floating-available-width":`${u(this.#u)}px`,"--bits-floating-available-height":`${u(this.#l)}px`,"--bits-floating-anchor-width":`${u(this.#d)}px`,"--bits-floating-anchor-height":`${u(this.#h)}px`,...this.floating.middlewareData.hide?.referenceHidden&&{visibility:"hidden","pointer-events":"none"},...u(this.#t)},dir:this.opts.dir.current,...this.wrapperAttachment}));get wrapperProps(){return u(this.#x)}set wrapperProps(t){y(this.#x,t)}#S=x(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:er({...u(this.#t)}),...this.contentAttachment}));get props(){return u(this.#S)}set props(t){y(this.#S,t)}#A=x(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0}));get arrowStyle(){return u(this.#A)}set arrowStyle(t){y(this.#A,t)}constructor(t,n){this.opts=t,this.root=n,this.#e=t.updatePositionStrategy,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),G(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=Va({strategy:()=>this.opts.strategy.current,placement:()=>u(this.#i),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>Ra(...r,{animationFrame:this.#e?.current==="always"}),open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),Z(()=>{this.floating.isPositioned&&this.opts.onPlaced?.current()}),G(()=>this.contentRef.current,r=>{if(!r||!this.opts.enabled.current)return;const o=Ge(r),s=o.requestAnimationFrame(()=>{if(this.contentRef.current!==r||!this.opts.enabled.current)return;const i=o.getComputedStyle(r).zIndex;i!==this.contentZIndex&&(this.contentZIndex=i)});return()=>{o.cancelAnimationFrame(s)}}),Z(()=>{this.floating.floating.current=this.wrapperRef.current})}}class Oe{static create(t,n=!1){return n?new Oe(t,wn.get()):new Oe(t,bn.get())}opts;root;constructor(t,n){this.opts=t,this.root=n,t.virtualEl&&t.virtualEl.current?n.triggerNode=Jn(t.virtualEl.current):n.triggerNode=t.ref}}function ja(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[l,h]=xn(n),d={start:"0%",center:"50%",end:"100%"}[h],m=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+c/2;let g="",p="";return l==="bottom"?(g=i?d:`${m}px`,p=`${-c}px`):l==="top"?(g=i?d:`${m}px`,p=`${r.floating.height+c}px`):l==="right"?(g=`${-c}px`,p=i?d:`${f}px`):l==="left"&&(g=`${r.floating.width+c}px`,p=i?d:`${f}px`),{data:{x:g,y:p}}}}}function xn(e){const[t,n="center"]=e.split("-");return[t,n]}function Ua(e){return xn(e)[0]}function Ga(e){return xn(e)[1]}function yc(e,t){R(t,!0);let n=v(t,"tooltip",3,!1);Se.create(n());var r=F(),o=T(r);k(o,()=>t.children??K),C(e,r),N()}function bc(e,t){R(t,!0);let n=v(t,"tooltip",3,!1);Oe.create({id:w(()=>t.id),virtualEl:w(()=>t.virtualEl),ref:t.ref},n());var r=F(),o=T(r);k(o,()=>t.children??K),C(e,r),N()}function Xa(e,t){R(t,!0);let n=v(t,"side",3,"bottom"),r=v(t,"sideOffset",3,0),o=v(t,"align",3,"center"),s=v(t,"alignOffset",3,0),i=v(t,"arrowPadding",3,0),a=v(t,"avoidCollisions",3,!0),c=v(t,"collisionBoundary",19,()=>[]),l=v(t,"collisionPadding",3,0),h=v(t,"hideWhenDetached",3,!1),d=v(t,"onPlaced",3,()=>{}),m=v(t,"sticky",3,"partial"),f=v(t,"updatePositionStrategy",3,"optimized"),g=v(t,"strategy",3,"fixed"),p=v(t,"dir",3,"ltr"),b=v(t,"style",19,()=>({})),S=v(t,"wrapperId",19,fn),A=v(t,"customAnchor",3,null),E=v(t,"tooltip",3,!1);const O=Ae.create({side:w(()=>n()),sideOffset:w(()=>r()),align:w(()=>o()),alignOffset:w(()=>s()),id:w(()=>t.id),arrowPadding:w(()=>i()),avoidCollisions:w(()=>a()),collisionBoundary:w(()=>c()),collisionPadding:w(()=>l()),hideWhenDetached:w(()=>h()),onPlaced:w(()=>d()),sticky:w(()=>m()),updatePositionStrategy:w(()=>f()),strategy:w(()=>g()),dir:w(()=>p()),style:w(()=>b()),enabled:w(()=>t.enabled),wrapperId:w(()=>S()),customAnchor:w(()=>A())},E()),I=x(()=>ot(O.wrapperProps,{style:{pointerEvents:"auto"}}));var P=F(),D=T(P);k(D,()=>t.content??K,()=>({props:O.props,wrapperProps:u(I)})),C(e,P),N()}function Ya(e,t){R(t,!0),po(()=>{t.onPlaced?.()});var n=F(),r=T(n);k(r,()=>t.content??K,()=>({props:{},wrapperProps:{}})),C(e,n),N()}function qa(e,t){let n=v(t,"isStatic",3,!1),r=V(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=F(),s=T(o);{var i=c=>{Ya(c,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=c=>{Xa(c,Q({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};rt(s,c=>{n()?c(i):c(a,!1)})}C(e,o)}var Za=ct("<!> <!>",1);function to(e,t){R(t,!0);let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=v(t,"tooltip",3,!1),c=v(t,"contentPointerEvents",3,"auto"),l=V(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);const h=x(()=>t.preventScroll??!0),d=x(()=>t.strategy??(u(h)?"fixed":"absolute"));qa(e,{get isStatic(){return i()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return u(d)},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get enabled(){return t.enabled},get tooltip(){return a()},content:(f,g)=>{let p=()=>g?.().props,b=()=>g?.().wrapperProps;var S=Za(),A=T(S);{var E=P=>{ye(P,{get preventScroll(){return u(h)}})},O=P=>{ye(P,{get preventScroll(){return u(h)}})};rt(A,P=>{t.forceMount&&t.enabled?P(E):t.forceMount||P(O,1)})}var I=de(A,2);Kr(I,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(D,X)=>{let z=()=>X?.().props;Wr(D,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(_,B)=>{Lr(_,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return n()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(L,H)=>{let q=()=>H?.().props;Vr(L,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(et,$)=>{var Y=F(),U=T(Y);{let pt=x(()=>({props:ot(l,p(),q(),z(),{style:{pointerEvents:c()}}),wrapperProps:b()}));k(U,()=>t.popper??K,()=>u(pt))}C(et,Y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),C(f,S)},$$slots:{content:!0}}),N()}function wc(e,t){let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=V(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var c=F(),l=T(c);{var h=d=>{to(d,Q({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return i()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};rt(l,d=>{t.shouldRender&&d(h)})}C(e,c)}function xc(e,t){let n=v(t,"interactOutsideBehavior",3,"close"),r=v(t,"trapFocus",3,!0),o=v(t,"isValidEvent",3,()=>!1),s=v(t,"customAnchor",3,null),i=v(t,"isStatic",3,!1),a=V(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);to(e,Q({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return s()},get isStatic(){return i()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return n()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return o()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}function Sc(e,t){R(t,!0);let n=v(t,"open",15,!1),r=V(t,["$$slots","$$events","$$legacy","open"]);var o=F(),s=T(o);Et(s,()=>Oi,(i,a)=>{a(i,Q(()=>r,{get open(){return n()},set open(c){n(c)}}))}),C(e,o),N()}function Qa(e,t){let n=V(t,["$$slots","$$events","$$legacy"]);var r=F(),o=T(r);Et(o,()=>Li,(s,i)=>{i(s,Q(()=>n))}),C(e,r)}function Ac(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class"]);var o=F(),s=T(o);{let i=x(()=>Pt("text-lg font-semibold",t.class));Et(s,()=>Ei,(a,c)=>{c(a,Q({"data-slot":"alert-dialog-title",get class(){return u(i)}},()=>r,{get ref(){return n()},set ref(l){n(l)}}))})}C(e,o),N()}function Oc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class"]);var o=F(),s=T(o);{let i=x(()=>t.class||Pt(Qn()));Et(s,()=>Ti,(a,c)=>{c(a,Q({"data-slot":"alert-dialog-action",get class(){return u(i)}},()=>r,{get ref(){return n()},set ref(l){n(l)}}))})}C(e,o),N()}function Cc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class"]);var o=F(),s=T(o);{let i=x(()=>t.class||Pt(Qn({variant:"ghost"})));Et(s,()=>Fi,(a,c)=>{c(a,Q({"data-slot":"alert-dialog-cancel",get class(){return u(i)}},()=>r,{get ref(){return n()},set ref(l){n(l)}}))})}C(e,o),N()}var Ja=ct("<div><!></div>");function Ec(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Ja();Ct(o,i=>({"data-slot":"alert-dialog-footer",class:i,...r}),[()=>Pt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t.class)]);var s=At(o);k(s,()=>t.children??K),Ot(o),Zn(o,i=>n(i),()=>n()),C(e,o),N()}var $a=ct("<div><!></div>");function Pc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=$a();Ct(o,i=>({"data-slot":"alert-dialog-header",class:i,...r}),[()=>Pt("flex flex-col gap-2 text-center sm:text-start",t.class)]);var s=At(o);k(s,()=>t.children??K),Ot(o),Zn(o,i=>n(i),()=>n()),C(e,o),N()}function tc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class"]);var o=F(),s=T(o);{let i=x(()=>Pt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));Et(s,()=>Bs,(a,c)=>{c(a,Q({"data-slot":"alert-dialog-overlay",get class(){return u(i)}},()=>r,{get ref(){return n()},set ref(l){n(l)}}))})}C(e,o),N()}var ec=ct("<!> <!>",1);function Tc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class","portalProps"]);Qa(e,Q(()=>t.portalProps,{children:(o,s)=>{var i=ec(),a=T(i);tc(a,{});var c=de(a,2);{let l=x(()=>Pt("bg-[var(--color-bg-elevated)] border-[var(--color-border)] text-[var(--color-text-primary)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));Et(c,()=>Ds,(h,d)=>{d(h,Q({"data-slot":"alert-dialog-content",get class(){return u(l)}},()=>r,{get ref(){return n()},set ref(m){n(m)}}))})}C(o,i)},$$slots:{default:!0}})),N()}function Mc(e,t){R(t,!0);let n=v(t,"ref",15,null),r=V(t,["$$slots","$$events","$$legacy","ref","class"]);var o=F(),s=T(o);{let i=x(()=>Pt("text-[var(--color-text-secondary)] text-sm",t.class));Et(s,()=>Ws,(a,c)=>{c(a,Q({"data-slot":"alert-dialog-description",get class(){return u(i)}},()=>r,{get ref(){return n()},set ref(l){n(l)}}))})}C(e,o),N()}export{Tr as $,Tc as A,Oc as B,Tt as C,Br as D,Ee as E,yc as F,Sc as G,oe as H,We as I,Xe as J,fc as K,Ye as L,Dr as M,on as N,Ke as O,xc as P,Qe as Q,en as R,ie as S,Kr as T,Wr as U,Lr as V,Vr as W,ye as X,Bs as Y,Ei as Z,Mr as _,tt as a,ds as a0,fe as a1,te as a2,hi as a3,fi as a4,ur as a5,di as a6,lr as a7,hc as a8,gc as a9,pc as aa,mc as ab,zt as ac,Mn as ad,uc as ae,lt as af,xi as ag,bo as ah,hr as ai,wo as aj,Ws as ak,Wt as b,ar as c,cr as d,cs as e,Ht as f,dc as g,w as h,mt as i,_r as j,Rr as k,Nr as l,ot as m,W as n,kr as o,wc as p,vc as q,bc as r,er as s,Li as t,Pc as u,Ac as v,G as w,Mc as x,Ec as y,Cc as z};
@@ -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};