@xopcai/xopc 0.0.90 → 0.0.91

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 (290) hide show
  1. package/README.md +36 -12
  2. package/README.zh-CN.md +36 -12
  3. package/dist/browser-ext/manifest.json +1 -1
  4. package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
  5. package/dist/extensions/feishu/src/workflow-progress.js +1 -1
  6. package/dist/extensions/telegram/src/plugin.js +1 -1
  7. package/dist/extensions/telegram/src/routing-integration.js +2 -2
  8. package/dist/extensions/telegram/src/workflow-progress.js +1 -1
  9. package/dist/extensions/telegram/xopc.extension.json +1 -1
  10. package/dist/extensions/weixin/src/api/api.js +2 -2
  11. package/dist/extensions/weixin/src/auth/accounts.js +1 -1
  12. package/dist/extensions/weixin/src/cdn/upload.js +1 -1
  13. package/dist/extensions/weixin/src/media/data-url.js +1 -1
  14. package/dist/extensions/weixin/src/messaging/debug-mode.js +1 -1
  15. package/dist/extensions/weixin/src/messaging/inbound.js +1 -1
  16. package/dist/extensions/weixin/src/messaging/process-message.js +1 -1
  17. package/dist/extensions/weixin/src/plugin.js +1 -1
  18. package/dist/extensions/weixin/src/storage/sync-buf.js +1 -1
  19. package/dist/extensions/weixin/src/workflow-progress.js +1 -1
  20. package/dist/gateway/static/root/assets/Combination-HAlzriaz.js +41 -0
  21. package/dist/gateway/static/root/assets/agents-bVWUlrlD.js +222 -0
  22. package/dist/gateway/static/root/assets/apps-page-CIC8bmvZ.js +1 -0
  23. package/dist/gateway/static/root/assets/{attachment-preview-renderer-CpyoFbs4.js → attachment-preview-renderer-DBAxQXb-.js} +2 -2
  24. package/dist/gateway/static/root/assets/{attachment-process-heavy-CqVriadb.js → attachment-process-heavy-Csq3TrrP.js} +4 -4
  25. package/dist/gateway/static/root/assets/channels-settings-C8G8RAAP.js +1 -0
  26. package/dist/gateway/static/root/assets/{channels-status-swr-BrtH2VzC.js → channels-status-swr-CYWL5DLD.js} +1 -1
  27. package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +1 -0
  28. package/dist/gateway/static/root/assets/{cron-api-CyqbgfHM.js → cron-api-TVqLlGAC.js} +1 -1
  29. package/dist/gateway/static/root/assets/cron-page-BtcFYlvv.js +1 -0
  30. package/dist/gateway/static/root/assets/dist-CUV1uY5f.js +1 -0
  31. package/dist/gateway/static/root/assets/{extension-debug-page-D6Ak0STa.js → extension-debug-page-mTLHRDp1.js} +1 -1
  32. package/dist/gateway/static/root/assets/{extension-page-Q0P3d6DW.js → extension-page-iI8BI7WK.js} +1 -1
  33. package/dist/gateway/static/root/assets/{extension-settings-page-CL55LwU_.js → extension-settings-page-ByXcdubM.js} +1 -1
  34. package/dist/gateway/static/root/assets/{fetch-Dqa9iTWl.js → fetch-BWtQq_Ys.js} +1 -1
  35. package/dist/gateway/static/root/assets/{field-primitives-HUR6JElP.js → field-primitives-BsZ-4VT5.js} +1 -1
  36. package/dist/gateway/static/root/assets/{heartbeat-config-api-DusckjUX.js → heartbeat-config-api-WjTsRLCU.js} +1 -1
  37. package/dist/gateway/static/root/assets/{index-BYcGfwcE.js → index-CKkR-v9U.js} +85 -81
  38. package/dist/gateway/static/root/assets/index-VlELBY99.css +1 -0
  39. package/dist/gateway/static/root/assets/logs-page-ClnIpxfd.js +1 -0
  40. package/dist/gateway/static/root/assets/note-detail-page-B91pLkEI.css +1 -0
  41. package/dist/gateway/static/root/assets/note-detail-page-DJ2Mb4x7.js +179 -0
  42. package/dist/gateway/static/root/assets/note-time-JLBPSLzK.js +1 -0
  43. package/dist/gateway/static/root/assets/notes-page-BE-75qz9.js +1 -0
  44. package/dist/gateway/static/root/assets/{pdf-BnEvgIXZ.js → pdf-epILhEOn.js} +1 -1
  45. package/dist/gateway/static/root/assets/preload-helper-zJ_50EbN.js +1 -0
  46. package/dist/gateway/static/root/assets/sessions-page-bJJkWtTl.js +1 -0
  47. package/dist/gateway/static/root/assets/{settings-form-section-a0qGVOlr.js → settings-form-section-DSYCknxM.js} +1 -1
  48. package/dist/gateway/static/root/assets/settings-page-WcMXLq2U.js +3 -0
  49. package/dist/gateway/static/root/assets/share-preview-page-awRqs4hV.js +2 -0
  50. package/dist/gateway/static/root/assets/skills-page-Lu-i1JG7.js +2 -0
  51. package/dist/gateway/static/root/assets/{theme-store-C0Ehmdo5.js → theme-store-BC-42BoZ.js} +1 -1
  52. package/dist/gateway/static/root/assets/toast-z0toXu32.js +1 -0
  53. package/dist/gateway/static/root/assets/url-CY1RQKTU.js +3 -0
  54. package/dist/gateway/static/root/assets/{utils-DRQryzdn.js → utils-DX3TQuap.js} +1 -1
  55. package/dist/gateway/static/root/assets/vendor-codemirror-DYoKfS8f.js +45 -0
  56. package/dist/gateway/static/root/assets/{voice-api-key-field-D0viACE2.js → voice-api-key-field-B5uKlDqA.js} +1 -1
  57. package/dist/gateway/static/root/assets/{workflow-page.utils-DnG8JBhV.js → workflow-page.utils-ClC37yEp.js} +1 -1
  58. package/dist/gateway/static/root/assets/workflows-page-C7VhIXtR.js +27 -0
  59. package/dist/gateway/static/root/index.html +10 -8
  60. package/dist/package.js +1 -1
  61. package/dist/src/agent/agent-manager.js +7 -7
  62. package/dist/src/agent/agent-scope.js +1 -1
  63. package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -1
  64. package/dist/src/agent/context/workspace-seed.js +2 -2
  65. package/dist/src/agent/goals/goal-run-store.js +4 -4
  66. package/dist/src/agent/goals/persistent-goal-service.js +1 -1
  67. package/dist/src/agent/goals/post-turn.js +2 -2
  68. package/dist/src/agent/image/load-image-media.js +2 -2
  69. package/dist/src/agent/ipc/bus.js +1 -1
  70. package/dist/src/agent/ipc/inbox.js +2 -2
  71. package/dist/src/agent/ipc/socket.js +1 -1
  72. package/dist/src/agent/mcp/bundle-mcp-materialize.js +1 -1
  73. package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
  74. package/dist/src/agent/mcp/mcp-transport-config.js +1 -1
  75. package/dist/src/agent/mcp/mcp-transport.js +1 -1
  76. package/dist/src/agent/memory/builtin-memory-store.js +1 -1
  77. package/dist/src/agent/memory/dreaming/deep-promotion.js +1 -1
  78. package/dist/src/agent/memory/dreaming/events.js +1 -1
  79. package/dist/src/agent/memory/dreaming/last-run.js +1 -1
  80. package/dist/src/agent/memory/dreaming/light-sweep.js +1 -1
  81. package/dist/src/agent/memory/dreaming/preview.js +1 -1
  82. package/dist/src/agent/memory/dreaming/rem-patterns.js +1 -1
  83. package/dist/src/agent/memory/dreaming/short-term-store.js +1 -1
  84. package/dist/src/agent/memory/dreaming/utils.js +1 -1
  85. package/dist/src/agent/memory/plugin-discovery.js +1 -1
  86. package/dist/src/agent/models/manager.js +1 -1
  87. package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
  88. package/dist/src/agent/reply/post-compaction-context.js +1 -1
  89. package/dist/src/agent/reply/workspace-boundary-read.js +1 -1
  90. package/dist/src/agent/sandbox/path-policy.js +2 -2
  91. package/dist/src/agent/service/build-direct-message-content.js +1 -1
  92. package/dist/src/agent/service.js +4 -4
  93. package/dist/src/agent/session/session-inspector.js +1 -1
  94. package/dist/src/agent/skills/config.js +1 -1
  95. package/dist/src/agent/skills/hub-hash.js +2 -2
  96. package/dist/src/agent/skills/hub-lock.js +1 -1
  97. package/dist/src/agent/skills/hub-pull.js +2 -2
  98. package/dist/src/agent/skills/index.js +1 -1
  99. package/dist/src/agent/skills/managed-store.js +1 -1
  100. package/dist/src/agent/skills/scanner.js +1 -1
  101. package/dist/src/agent/skills/skill-manage-ops.js +1 -1
  102. package/dist/src/agent/skills/skill-manager.js +1 -1
  103. package/dist/src/agent/tools/dreaming-tool.js +1 -1
  104. package/dist/src/agent/tools/factory.js +1 -1
  105. package/dist/src/agent/tools/image-generate-tool.js +1 -1
  106. package/dist/src/agent/tools/send-media.js +1 -1
  107. package/dist/src/agent/tools/skill-manage-tool.js +1 -1
  108. package/dist/src/agent/tools/workflow-tool.js +1 -1
  109. package/dist/src/agent/tools/write.js +1 -1
  110. package/dist/src/agent/workflow/catalog.js +1 -1
  111. package/dist/src/auth/credentials.js +3 -3
  112. package/dist/src/auth/profiles/store.js +1 -1
  113. package/dist/src/auth/sync-provider-auth.js +1 -1
  114. package/dist/src/browser/cache-dir-policy.js +1 -1
  115. package/dist/src/browser/cdp-local-launcher.js +2 -2
  116. package/dist/src/browser/providers/browser-ext-install.js +3 -3
  117. package/dist/src/browser/providers/cloakbrowser.js +4 -4
  118. package/dist/src/browser/providers/playwright-doctor.js +1 -1
  119. package/dist/src/browser/stealth.js +1 -1
  120. package/dist/src/channels/attachments/inbound-persist.js +1 -1
  121. package/dist/src/channels/attachments/outbound-tts-persist.js +1 -1
  122. package/dist/src/channels/outbound/persist-store.js +1 -1
  123. package/dist/src/channels/pairing/allow-from-file.js +1 -1
  124. package/dist/src/channels/pairing/pairing-store.js +2 -2
  125. package/dist/src/chat-commands/agent-edit.js +2 -2
  126. package/dist/src/chat-commands/builtins/config.js +2 -2
  127. package/dist/src/chat-commands/context.js +1 -1
  128. package/dist/src/cli/commands/config.js +1 -1
  129. package/dist/src/cli/commands/doctor/checks/config-health.js +1 -1
  130. package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
  131. package/dist/src/cli/commands/doctor/checks/session-integrity.js +2 -2
  132. package/dist/src/cli/commands/doctor/checks/state-integrity.js +1 -1
  133. package/dist/src/cli/commands/doctor/checks/workspace-status.js +1 -1
  134. package/dist/src/cli/commands/extension-dev.js +1 -1
  135. package/dist/src/cli/commands/extension-marketplace.js +1 -1
  136. package/dist/src/cli/commands/extension-pack.js +1 -1
  137. package/dist/src/cli/commands/gateway/logs.js +1 -1
  138. package/dist/src/cli/commands/image.js +1 -1
  139. package/dist/src/cli/commands/init.js +4 -4
  140. package/dist/src/cli/commands/onboard.js +1 -1
  141. package/dist/src/cli/utils/init-workspace-core.js +2 -2
  142. package/dist/src/commands/agents.config.js +1 -1
  143. package/dist/src/config/agent-profile.js +1 -1
  144. package/dist/src/config/gateway-bind.js +1 -1
  145. package/dist/src/config/index.js +5 -5
  146. package/dist/src/config/loader.js +2 -2
  147. package/dist/src/config/models-json.js +2 -2
  148. package/dist/src/config/paths-state.js +1 -1
  149. package/dist/src/config/profile.js +2 -2
  150. package/dist/src/config/workspace-path.js +1 -1
  151. package/dist/src/cron/executor.js +2 -2
  152. package/dist/src/cron/persistence.js +1 -1
  153. package/dist/src/cron/run-log-store.js +1 -1
  154. package/dist/src/daemon/constants.js +1 -1
  155. package/dist/src/daemon/install-plan.js +2 -2
  156. package/dist/src/daemon/launchd.js +2 -2
  157. package/dist/src/daemon/schtasks.js +2 -2
  158. package/dist/src/daemon/systemd.js +2 -2
  159. package/dist/src/extensions/bundle-mcp.js +1 -1
  160. package/dist/src/extensions/discover-extensions.js +1 -1
  161. package/dist/src/extensions/health.js +1 -1
  162. package/dist/src/extensions/loader.js +1 -1
  163. package/dist/src/extensions/lockfile.js +2 -2
  164. package/dist/src/extensions/update.js +1 -1
  165. package/dist/src/gateway/agents-admin.js +3 -3
  166. package/dist/src/gateway/file-path-classifier.js +2 -2
  167. package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
  168. package/dist/src/gateway/hono/lib/config-payload.js +2 -1
  169. package/dist/src/gateway/hono/lib/config-payload.js.map +1 -1
  170. package/dist/src/gateway/hono/lib/extension-store.js +2 -2
  171. package/dist/src/gateway/hono/lib/static-ui.js +2 -2
  172. package/dist/src/gateway/hono/middleware/auth.js +1 -2
  173. package/dist/src/gateway/hono/middleware/auth.js.map +1 -1
  174. package/dist/src/gateway/hono/oauth.js +1 -1
  175. package/dist/src/gateway/hono/routes/agents.js +1 -1
  176. package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
  177. package/dist/src/gateway/hono/routes/config-patch/gateway.d.ts +2 -2
  178. package/dist/src/gateway/hono/routes/config-patch/gateway.js +12 -0
  179. package/dist/src/gateway/hono/routes/config-patch/gateway.js.map +1 -1
  180. package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
  181. package/dist/src/gateway/hono/routes/dreaming.js +1 -1
  182. package/dist/src/gateway/hono/routes/host-fs.js +2 -2
  183. package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
  184. package/dist/src/gateway/hono/routes/lazy-bundles.js.map +1 -1
  185. package/dist/src/gateway/hono/routes/models.js +1 -1
  186. package/dist/src/gateway/hono/routes/notes.d.ts +3 -0
  187. package/dist/src/gateway/hono/routes/notes.js +274 -0
  188. package/dist/src/gateway/hono/routes/notes.js.map +1 -0
  189. package/dist/src/gateway/hono/routes/sessions.js.map +1 -1
  190. package/dist/src/gateway/hono/routes/shares.js +1 -1
  191. package/dist/src/gateway/hono/routes/workspace.js +4 -4
  192. package/dist/src/gateway/lock.js +3 -3
  193. package/dist/src/gateway/ports.js +1 -1
  194. package/dist/src/gateway/service/agent-runner.js +2 -2
  195. package/dist/src/gateway/service/marketplace-service.js +2 -2
  196. package/dist/src/gateway/service.d.ts +3 -0
  197. package/dist/src/gateway/service.js +11 -1
  198. package/dist/src/gateway/service.js.map +1 -1
  199. package/dist/src/gateway/workspace-fs-file-list.js +1 -1
  200. package/dist/src/gateway/workspace-ripgrep.d.ts +6 -0
  201. package/dist/src/gateway/workspace-ripgrep.js +62 -11
  202. package/dist/src/gateway/workspace-ripgrep.js.map +1 -1
  203. package/dist/src/infra/brew.js +1 -1
  204. package/dist/src/infra/package-json.js +1 -1
  205. package/dist/src/infra/package-update-steps.js +1 -1
  206. package/dist/src/infra/path-env.js +2 -2
  207. package/dist/src/infra/restart.js +2 -2
  208. package/dist/src/infra/stable-node-path.js +1 -1
  209. package/dist/src/infra/update-check.js +1 -1
  210. package/dist/src/infra/update-global.js +1 -1
  211. package/dist/src/infra/update-lock.js +3 -3
  212. package/dist/src/infra/update-runner.js +1 -1
  213. package/dist/src/infra/update-startup.js +2 -2
  214. package/dist/src/infra/write-file-atomic.js +2 -2
  215. package/dist/src/notes/attachment-ref.d.ts +9 -0
  216. package/dist/src/notes/attachment-ref.js +27 -0
  217. package/dist/src/notes/attachment-ref.js.map +1 -0
  218. package/dist/src/notes/index.d.ts +4 -0
  219. package/dist/src/notes/index.js +4 -0
  220. package/dist/src/notes/note-attachment-sync.d.ts +7 -0
  221. package/dist/src/notes/note-attachment-sync.js +46 -0
  222. package/dist/src/notes/note-attachment-sync.js.map +1 -0
  223. package/dist/src/notes/note-index-meta.d.ts +14 -0
  224. package/dist/src/notes/note-index-meta.js +87 -0
  225. package/dist/src/notes/note-index-meta.js.map +1 -0
  226. package/dist/src/notes/paths.d.ts +5 -0
  227. package/dist/src/notes/paths.js +23 -0
  228. package/dist/src/notes/paths.js.map +1 -0
  229. package/dist/src/notes/service.d.ts +42 -0
  230. package/dist/src/notes/service.js +331 -0
  231. package/dist/src/notes/service.js.map +1 -0
  232. package/dist/src/notes/store.d.ts +33 -0
  233. package/dist/src/notes/store.js +317 -0
  234. package/dist/src/notes/store.js.map +1 -0
  235. package/dist/src/notes/types.d.ts +162 -0
  236. package/dist/src/notes/types.js +1 -0
  237. package/dist/src/providers/auth-runtime/auth-profile-store.js +1 -1
  238. package/dist/src/providers/index.js +2 -2
  239. package/dist/src/providers/model-registry.js +1 -1
  240. package/dist/src/session/config-store.js +2 -2
  241. package/dist/src/session/init-session-turn.js +2 -2
  242. package/dist/src/session/parity/jsonl-transcript-io.js +2 -2
  243. package/dist/src/session/parity/sessions-json-file.js +1 -1
  244. package/dist/src/session/parity/transcript-file-lock.js +2 -2
  245. package/dist/src/session/parity/transcript-paths.js +1 -1
  246. package/dist/src/session/resolve-session.js +4 -4
  247. package/dist/src/session/search-index-cache.js +1 -1
  248. package/dist/src/session/search-index.js +1 -1
  249. package/dist/src/session/session-title.js +2 -2
  250. package/dist/src/session/store.js +6 -6
  251. package/dist/src/share/share-auto.js +2 -2
  252. package/dist/src/share/share-store.js +3 -3
  253. package/dist/src/share/share-thumbnail.js +2 -2
  254. package/dist/src/share/share-zip.js +1 -1
  255. package/dist/src/share/site-share-store.js +3 -3
  256. package/dist/src/share/site-static-serve.js +1 -1
  257. package/dist/src/tui/clipboard-image.js +3 -3
  258. package/dist/src/tui/theme-manager.js +1 -1
  259. package/dist/src/tui/tui-keybindings-file.js +1 -1
  260. package/dist/src/tui/tui-scoped-models.js +2 -2
  261. package/dist/src/tui/tui-settings.js +1 -1
  262. package/dist/src/tui/tui.js +3 -3
  263. package/dist/src/tunnel/frpc-binary.js +3 -3
  264. package/dist/src/tunnel/frpc-config.js +1 -1
  265. package/dist/src/tunnel/frpc-extract.js +1 -1
  266. package/dist/src/tunnel/tunnel-state.js +1 -1
  267. package/dist/src/utils/logger/audit.js +1 -1
  268. package/dist/src/utils/logger/log-store.js +1 -1
  269. package/dist/src/utils/logger/rotation.js +1 -1
  270. package/dist/src/voice/tts/audio.js +1 -1
  271. package/dist/src/voice/tts/providers/edge-speech.js +2 -2
  272. package/dist/src/workflows/store/event-store.js +1 -1
  273. package/dist/src/workflows/store/run-store.js +1 -1
  274. package/package.json +1 -1
  275. package/dist/gateway/static/root/assets/agents-cPvvYLXo.js +0 -222
  276. package/dist/gateway/static/root/assets/apps-page-Bk1_P5FJ.js +0 -1
  277. package/dist/gateway/static/root/assets/channels-settings-CZoeQwHz.js +0 -1
  278. package/dist/gateway/static/root/assets/cron-page-BpLdiQN8.js +0 -1
  279. package/dist/gateway/static/root/assets/dist-BTWC-BTN.js +0 -45
  280. package/dist/gateway/static/root/assets/dist-BpAiK86n.js +0 -1
  281. package/dist/gateway/static/root/assets/eye-DAfL1U7M.js +0 -1
  282. package/dist/gateway/static/root/assets/index-V7MQ7834.css +0 -1
  283. package/dist/gateway/static/root/assets/logs-page-_HcZ2fgK.js +0 -1
  284. package/dist/gateway/static/root/assets/sessions-page-iezSMjho.js +0 -1
  285. package/dist/gateway/static/root/assets/settings-page-C9_nYQwM.js +0 -3
  286. package/dist/gateway/static/root/assets/share-preview-page-DExl7CJy.js +0 -2
  287. package/dist/gateway/static/root/assets/skills-page-BlgGD93t.js +0 -2
  288. package/dist/gateway/static/root/assets/url-fxyYANfA.js +0 -3
  289. package/dist/gateway/static/root/assets/vendor-codemirror-D0yxdRpg.js +0 -58
  290. package/dist/gateway/static/root/assets/workflows-page-BvMobnJP.js +0 -27
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <h1 align="center"><a href="https://xopc.ai">xopc</a></h1>
7
7
 
8
8
  <p align="center">
9
- <strong>The OPC workstation that grows with you.</strong><br />
9
+ <strong>The AI workstation that grows with you.</strong><br />
10
10
  A self-hosted, local-first AI for one-person companies — terminal, browser, desktop, mobile, and messengers. One brain everywhere.<br />
11
11
  Bring your own keys. Extend without forking.
12
12
  </p>
@@ -37,26 +37,42 @@
37
37
 
38
38
  ## Get started
39
39
 
40
- Install, onboard, and chat — three commands:
40
+ ### One-liner (recommended)
41
+
42
+ **Linux, macOS, WSL2, Termux**
43
+
44
+ ```bash
45
+ curl -fsSL https://xopc.ai/install.sh | bash
46
+ ```
47
+
48
+ **Windows (native, PowerShell)**
49
+
50
+ > **Heads up:** Native Windows runs xopc without WSL — CLI, gateway, TUI, and tools all work natively. Prefer WSL2? Use the bash one-liner above there too.
51
+
52
+ Run this in PowerShell:
53
+
54
+ ```powershell
55
+ iex (irm https://xopc.ai/install.ps1)
56
+ ```
57
+
58
+ The installer detects your OS, installs **Node.js ≥ 22** when needed, and installs **`@xopcai/xopc`**. China mirror: add `--cn` (bash) or `-Cn` (PowerShell), or pass `--registry https://registry.npmmirror.com`.
59
+
60
+ ### Onboard & chat
41
61
 
42
62
  ```bash
43
- npm install -g @xopcai/xopc
44
63
  xopc onboard # faster: xopc onboard --quick
45
64
  xopc tui --local
46
65
  ```
47
66
 
48
67
  > **New here?** Start with **`xopc tui --local`** (embedded agent, no gateway). Run **`xopc gateway`** when you want the **web console** or **messengers** (Telegram, WeChat, Feishu).
49
68
 
50
- **Requirements:** Node.js **≥ 22**. Use **pnpm** when developing from a git clone.
51
-
52
- **China / slow `registry.npmjs.org`:** add `--registry=https://registry.npmmirror.com` to `npm install`, or `npm config set registry https://registry.npmmirror.com`. For a slow Electron download during `pnpm install` from source:
69
+ ### npm (already have Node.js 22+)
53
70
 
54
71
  ```bash
55
- export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
56
- export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
72
+ npm install -g @xopcai/xopc
57
73
  ```
58
74
 
59
- Both variables are required for `electron:build` on macOS (DMG needs `electron-builder-binaries`). Use **electron-builder 26.11.1** so DMG downloads do not incorrectly use `ELECTRON_MIRROR` (older versions 404 on `cdn.npmmirror.com/binaries/electron/dmg-builder@…`).
75
+ Or with pnpm: `pnpm add -g @xopcai/xopc` · China: `npm install -g @xopcai/xopc --registry=https://registry.npmmirror.com`
60
76
 
61
77
  ### More commands
62
78
 
@@ -70,14 +86,22 @@ xopc gateway service install # OS service; xopc gateway stop | sta
70
86
  xopc profile list # optional isolated state profiles
71
87
  ```
72
88
 
73
- **From source:**
89
+ **From source** (installer or pnpm workspace):
74
90
 
75
91
  ```bash
92
+ # installer — clone, build, and add ~/.local/bin/xopc wrapper
93
+ curl -fsSL https://xopc.ai/install.sh | bash -s -- --install-method git
94
+
95
+ # or manual checkout
76
96
  git clone https://github.com/xopcai/xopc.git && cd xopc
77
- pnpm install && pnpm run dev -- agent -i
78
- pnpm run build # Node + web console → dist/
97
+ corepack enable && pnpm install && pnpm run build
98
+ pnpm exec xopc onboard
79
99
  ```
80
100
 
101
+ Windows git install: `& ([scriptblock]::Create((irm https://xopc.ai/install.ps1))) -InstallMethod git`
102
+
103
+ **Requirements:** Node.js **≥ 22** (the one-liner handles this). Use **pnpm** when hacking from a git clone. More install options on **[xopc.ai](https://xopc.ai)** and **[Getting started](https://xopcai.github.io/xopc/getting-started)**.
104
+
81
105
  ---
82
106
 
83
107
  ## Why xopc
package/README.zh-CN.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <h1 align="center"><a href="https://xopc.ai">xopc</a></h1>
7
7
 
8
8
  <p align="center">
9
- <strong>与你一起成长的 OPC 工作站。</strong><br />
9
+ <strong>与你一起成长的 AI 工作站。</strong><br />
10
10
  可自托管的本地优先 AI——为一人公司准备;终端、浏览器、桌面、手机与 IM,一处配置,同一个大脑。<br />
11
11
  自带钥匙,无需 fork 即可扩展。
12
12
  </p>
@@ -37,26 +37,42 @@
37
37
 
38
38
  ## 快速开始
39
39
 
40
- 安装、向导、开聊——三条命令:
40
+ ### 一键安装(推荐)
41
+
42
+ **Linux、macOS、WSL2、Termux**
43
+
44
+ ```bash
45
+ curl -fsSL https://xopc.ai/install.sh | bash
46
+ ```
47
+
48
+ **Windows(原生 PowerShell)**
49
+
50
+ > **提示:** 原生 Windows 无需 WSL 即可运行 xopc——CLI、网关、TUI 与工具均可在本机使用。若更习惯 WSL2,在 WSL 里执行上面的 bash 命令即可。
51
+
52
+ 在 PowerShell 中运行:
53
+
54
+ ```powershell
55
+ iex (irm https://xopc.ai/install.ps1)
56
+ ```
57
+
58
+ 安装脚本会自动识别系统、在需要时安装 **Node.js ≥ 22**,并安装 **`@xopcai/xopc`**。国内镜像:bash 加 `--cn`,PowerShell 加 `-Cn`,或指定 `--registry https://registry.npmmirror.com`。
59
+
60
+ ### 配置并开聊
41
61
 
42
62
  ```bash
43
- npm install -g @xopcai/xopc
44
63
  xopc onboard # 更快:xopc onboard --quick
45
64
  xopc tui --local
46
65
  ```
47
66
 
48
67
  > **第一次用?** 先跑 **`xopc tui --local`**(本地嵌入式对话,不用网关)。需要 **网页控制台** 或 **Telegram / 微信 / 飞书** 时再执行 **`xopc gateway`**。
49
68
 
50
- **环境:** Node.js **≥ 22**。在本仓库开发建议用 **pnpm**。
51
-
52
- **中国大陆用户:** `npm install` 可加 `--registry=https://registry.npmmirror.com`,或 `npm config set registry https://registry.npmmirror.com`。从源码 `pnpm install` 时若 Electron 下载慢,可先设置:
69
+ ### npm(已具备 Node.js 22+)
53
70
 
54
71
  ```bash
55
- export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
56
- export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
72
+ npm install -g @xopcai/xopc
57
73
  ```
58
74
 
59
- macOS DMG 时需要同时设置上述两个镜像;请使用 **electron-builder 26.11.1**,否则 DMG 工具会错误地走 `ELECTRON_MIRROR`,在 `cdn.npmmirror.com/binaries/electron/dmg-builder@…` 上 404。
75
+ 也可用 pnpm:`pnpm add -g @xopcai/xopc` · 国内:`npm install -g @xopcai/xopc --registry=https://registry.npmmirror.com`
60
76
 
61
77
  ### 更多命令
62
78
 
@@ -70,14 +86,22 @@ xopc gateway service install # OS 系统服务;xopc gateway stop | status
70
86
  xopc profile list # 可选:独立状态 Profile
71
87
  ```
72
88
 
73
- **从源码开发:**
89
+ **从源码**(安装脚本或 pnpm workspace):
74
90
 
75
91
  ```bash
92
+ # 安装脚本 — 克隆、构建,并写入 ~/.local/bin/xopc 包装命令
93
+ curl -fsSL https://xopc.ai/install.sh | bash -s -- --install-method git
94
+
95
+ # 或手动克隆
76
96
  git clone https://github.com/xopcai/xopc.git && cd xopc
77
- pnpm install && pnpm run dev -- agent -i
78
- pnpm run build # Node + 网页 → dist/
97
+ corepack enable && pnpm install && pnpm run build
98
+ pnpm exec xopc onboard
79
99
  ```
80
100
 
101
+ Windows 源码安装:`& ([scriptblock]::Create((irm https://xopc.ai/install.ps1))) -InstallMethod git`
102
+
103
+ **环境:** Node.js **≥ 22**(一键脚本会自动处理)。在本仓库魔改请用 **pnpm**。更多安装方式见 **[xopc.ai](https://xopc.ai)** 与 **[快速开始](https://xopcai.github.io/xopc/zh/getting-started)**。
104
+
81
105
  ---
82
106
 
83
107
  ## 为什么选 xopc
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "xopc Browser Bridge",
4
- "version": "0.0.90",
4
+ "version": "0.0.91",
5
5
  "description": "Browser automation bridge for xopc — executes commands in Chrome via the local xopc daemon.",
6
6
  "permissions": [
7
7
  "debugger",
@@ -1,8 +1,8 @@
1
1
  import { checkFileSafety } from "../../../../src/agent/prompt/safety.js";
2
2
  import { getMimeType } from "../../../../src/channels/media.js";
3
3
  import { getWorkspacePath } from "../../../../src/config/workspace-path-helpers.js";
4
- import { promises } from "node:fs";
5
4
  import path from "node:path";
5
+ import { promises } from "node:fs";
6
6
  import { Readable } from "node:stream";
7
7
  //#region extensions/feishu/src/outbound/media-load.ts
8
8
  function isPathUnderRoots(resolved, roots) {
@@ -1,6 +1,6 @@
1
+ import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
1
2
  import { createLogger } from "../../../src/utils/logger/index.js";
2
3
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
4
4
  import { resolveFeishuAccount } from "./state/accounts.js";
5
5
  import { createFeishuClient } from "./transport/client/client.js";
6
6
  import { editMessageFeishu } from "./outbound/actions.js";
@@ -1,6 +1,6 @@
1
+ import { TelegramConfigSchema, init_config_schema } from "./config-schema.js";
1
2
  import { createLogger } from "../../../src/utils/logger/index.js";
2
3
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { TelegramConfigSchema, init_config_schema } from "./config-schema.js";
4
4
  import { getWorkflowProgressBroker } from "../../../src/agent/workflow/progress-broker.js";
5
5
  import "../../../src/agent/workflow/index.js";
6
6
  import { transcribe } from "../../../src/voice/stt/transcribe-core.js";
@@ -1,7 +1,7 @@
1
- import { createLogger } from "../../../src/utils/logger/index.js";
2
- import { init_logger } from "../../../src/utils/logger.js";
3
1
  import { buildSessionKey } from "../../../src/routing/session-key.js";
4
2
  import { applyIdentityLinks, resolveRoute } from "../../../src/routing/resolve-route.js";
3
+ import { createLogger } from "../../../src/utils/logger/index.js";
4
+ import { init_logger } from "../../../src/utils/logger.js";
5
5
  import "../../../src/routing/index.js";
6
6
  //#region extensions/telegram/src/routing-integration.ts
7
7
  init_logger();
@@ -1,6 +1,6 @@
1
+ import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
1
2
  import { createLogger } from "../../../src/utils/logger/index.js";
2
3
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
4
4
  //#region extensions/telegram/src/workflow-progress.ts
5
5
  init_session_key();
6
6
  init_logger();
@@ -2,7 +2,7 @@
2
2
  "id": "telegram",
3
3
  "name": "Telegram Channel",
4
4
  "description": "Bundled Telegram Bot channel (private workspace sources; ships inside @xopcai/xopc dist/)",
5
- "version": "0.0.90",
5
+ "version": "0.0.91",
6
6
  "kind": "channel",
7
7
  "main": "src/index.ts",
8
8
  "channels": ["telegram"],
@@ -1,8 +1,8 @@
1
1
  import { logger } from "../util/logger.js";
2
2
  import { redactBody, redactUrl } from "../util/redact.js";
3
- import crypto from "node:crypto";
4
- import fs from "node:fs";
5
3
  import path from "node:path";
4
+ import fs from "node:fs";
5
+ import crypto from "node:crypto";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { Agent, fetch as fetch$1 } from "undici";
8
8
  //#region extensions/weixin/src/api/api.ts
@@ -1,8 +1,8 @@
1
1
  import { logger } from "../util/logger.js";
2
2
  import { normalizeWeixinAccountId } from "./weixin-account-id.js";
3
3
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
4
- import fs from "node:fs";
5
4
  import path from "node:path";
5
+ import fs from "node:fs";
6
6
  //#region extensions/weixin/src/auth/accounts.ts
7
7
  const DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com";
8
8
  const CDN_BASE_URL = "https://novac2c.cdn.weixin.qq.com/c2c";
@@ -6,9 +6,9 @@ import { getUploadUrl } from "../api/api.js";
6
6
  import { getExtensionFromContentTypeOrUrl } from "../media/mime.js";
7
7
  import { aesEcbPaddedSize } from "./aes-ecb.js";
8
8
  import { uploadBufferToCdn } from "./cdn-upload.js";
9
+ import path from "node:path";
9
10
  import crypto from "node:crypto";
10
11
  import fs from "node:fs/promises";
11
- import path from "node:path";
12
12
  //#region extensions/weixin/src/cdn/upload.ts
13
13
  /**
14
14
  * Download a remote media URL (image, video, file) to a local temp file in destDir.
@@ -1,7 +1,7 @@
1
1
  import { getExtensionFromMime } from "./mime.js";
2
+ import path from "node:path";
2
3
  import { randomBytes } from "node:crypto";
3
4
  import fs from "node:fs/promises";
4
- import path from "node:path";
5
5
  //#region extensions/weixin/src/media/data-url.ts
6
6
  /**
7
7
  * Parse `data:mime;base64,...` into buffer (aligned with Telegram `parseDataUrl`).
@@ -1,7 +1,7 @@
1
1
  import { logger } from "../util/logger.js";
2
2
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
3
- import fs from "node:fs";
4
3
  import path from "node:path";
4
+ import fs from "node:fs";
5
5
  //#region extensions/weixin/src/messaging/debug-mode.ts
6
6
  /**
7
7
  * Per-bot debug mode toggle, persisted to disk so it survives gateway restarts.
@@ -3,8 +3,8 @@ import { generateId } from "../util/random.js";
3
3
  import { MessageItemType } from "../api/types.js";
4
4
  import { canonicalWeixinPeerId, normalizeWeixinAccountId } from "../auth/weixin-account-id.js";
5
5
  import { resolveWeixinRootDir } from "../storage/state-dir.js";
6
- import fs from "node:fs";
7
6
  import path from "node:path";
7
+ import fs from "node:fs";
8
8
  //#region extensions/weixin/src/messaging/inbound.ts
9
9
  /**
10
10
  * contextToken is issued per-message by the Weixin getupdates API and must
@@ -11,9 +11,9 @@ import { downloadMediaFromItem } from "../media/media-download.js";
11
11
  import { isDebugMode } from "./debug-mode.js";
12
12
  import { sendMessageWeixin } from "./send.js";
13
13
  import { handleSlashCommand } from "./slash-commands.js";
14
+ import path from "node:path";
14
15
  import { randomBytes } from "node:crypto";
15
16
  import { mkdir, readFile, writeFile } from "node:fs/promises";
16
- import path from "node:path";
17
17
  //#region extensions/weixin/src/messaging/process-message.ts
18
18
  function extractTextBody(itemList) {
19
19
  if (!itemList?.length) return "";
@@ -1,6 +1,6 @@
1
+ import { WeixinConfigSchema, init_config_schema } from "./config-schema.js";
1
2
  import { createLogger } from "../../../src/utils/logger/index.js";
2
3
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { WeixinConfigSchema, init_config_schema } from "./config-schema.js";
4
4
  import { getWorkflowProgressBroker } from "../../../src/agent/workflow/progress-broker.js";
5
5
  import "../../../src/agent/workflow/index.js";
6
6
  import { evaluateAccess, resolveDmPolicy } from "../../../src/channels/security.js";
@@ -1,6 +1,6 @@
1
1
  import { resolveWeixinRootDir } from "./state-dir.js";
2
- import fs from "node:fs";
3
2
  import path from "node:path";
3
+ import fs from "node:fs";
4
4
  //#region extensions/weixin/src/storage/sync-buf.ts
5
5
  function resolveAccountsDir() {
6
6
  return path.join(resolveWeixinRootDir(), "accounts");
@@ -1,6 +1,6 @@
1
+ import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
1
2
  import { createLogger } from "../../../src/utils/logger/index.js";
2
3
  import { init_logger } from "../../../src/utils/logger.js";
3
- import { init_session_key, parseSessionKey } from "../../../src/routing/session-key.js";
4
4
  import { getContextToken } from "./messaging/inbound.js";
5
5
  import { resolveWeixinAccount } from "./auth/accounts.js";
6
6
  import { sendMessageWeixin } from "./messaging/send.js";
@@ -0,0 +1,41 @@
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,i as n,t as r}from"./vendor-react-BOUWij0V.js";var i=e(n(),1),a=r(),o=e(t(),1);function s(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function c(...e){return t=>{let n=!1,r=e.map(e=>{let r=s(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():s(e[t],null)}}}}function l(...e){return o.useCallback(c(...e),e)}typeof window<`u`&&window.document&&window.document.createElement;function u(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function d(e,t){let n=o.createContext(t),r=e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,a.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=o.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function f(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r),s=n.length;n=[...n,r];let c=t=>{let{scope:n,children:r,...c}=t,l=n?.[e]?.[s]||i,u=o.useMemo(()=>c,Object.values(c));return(0,a.jsx)(l.Provider,{value:u,children:r})};c.displayName=t+`Provider`;function l(n,a){let c=a?.[e]?.[s]||i,l=o.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[c,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,p(i,...t)]}function p(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function m(e){let t=h(e),n=o.forwardRef((e,n)=>{let{children:r,...i}=e,s=o.Children.toArray(r),c=s.find(v);if(c){let e=c.props.children,r=s.map(t=>t===c?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:t);return(0,a.jsx)(t,{...i,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,r):null})}return(0,a.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function h(e){let t=o.forwardRef((e,t)=>{let{children:n,...r}=e;if(o.isValidElement(n)){let e=b(n),i=y(r,n.props);return n.type!==o.Fragment&&(i.ref=t?c(t,e):e),o.cloneElement(n,i)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g=Symbol(`radix.slottable`);function _(e){let t=({children:e})=>(0,a.jsx)(a.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=g,t}function v(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===g}function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var x=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=m(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...o}=e,s=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,a.jsx)(s,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function S(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function C(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}function w(e,t=globalThis?.document){let n=C(e);o.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ee=`DismissableLayer`,T=`dismissableLayer.update`,E=`dismissableLayer.pointerDownOutside`,te=`dismissableLayer.focusOutside`,ne,re=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),D=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:c,onDismiss:d,...f}=e,p=o.useContext(re),[m,h]=o.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=o.useState({}),v=l(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=y.indexOf(b),C=m?y.indexOf(m):-1,ee=p.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,te=oe(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!E||n||(i?.(e),c?.(e),e.defaultPrevented||d?.())},g),D=se(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||d?.())},g);return w(e=>{C===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},g),o.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(ne=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),ce(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=ne)}},[m,g,n,p]),o.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),ce())},[m,p]),o.useEffect(()=>{let e=()=>_({});return document.addEventListener(T,e),()=>document.removeEventListener(T,e)},[]),(0,a.jsx)(x.div,{...f,ref:v,style:{pointerEvents:ee?E?`auto`:`none`:void 0,...e.style},onFocusCapture:u(e.onFocusCapture,D.onFocusCapture),onBlurCapture:u(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:u(e.onPointerDownCapture,te.onPointerDownCapture)})});D.displayName=ee;var ie=`DismissableLayerBranch`,ae=o.forwardRef((e,t)=>{let n=o.useContext(re),r=o.useRef(null),i=l(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,a.jsx)(x.div,{...e,ref:i})});ae.displayName=ie;function oe(e,t=globalThis?.document){let n=C(e),r=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){le(E,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function se(e,t=globalThis?.document){let n=C(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&le(te,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ce(){let e=new CustomEvent(T);document.dispatchEvent(e)}function le(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?S(i,a):i.dispatchEvent(a)}var O=0;function ue(){o.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??de()),document.body.insertAdjacentElement(`beforeend`,e[1]??de()),O++,()=>{O===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),O--}},[])}function de(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var k=`focusScope.autoFocusOnMount`,A=`focusScope.autoFocusOnUnmount`,fe={bubbles:!1,cancelable:!0},pe=`FocusScope`,me=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...c}=e,[u,d]=o.useState(null),f=C(i),p=C(s),m=o.useRef(null),h=l(t,e=>d(e)),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(g.paused||!u)return;let t=e.target;u.contains(t)?m.current=t:j(m.current,{select:!0})},t=function(e){if(g.paused||!u)return;let t=e.relatedTarget;t!==null&&(u.contains(t)||j(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&j(u)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,u,g.paused]),o.useEffect(()=>{if(u){M.add(g);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(k,fe);u.addEventListener(k,f),u.dispatchEvent(t),t.defaultPrevented||(he(Se(_e(u)),{select:!0}),document.activeElement===e&&j(u))}return()=>{u.removeEventListener(k,f),setTimeout(()=>{let t=new CustomEvent(A,fe);u.addEventListener(A,p),u.dispatchEvent(t),t.defaultPrevented||j(e??document.body,{select:!0}),u.removeEventListener(A,p),M.remove(g)},0)}}},[u,f,p,g]);let _=o.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&j(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&j(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,a.jsx)(x.div,{tabIndex:-1,...c,ref:h,onKeyDown:_})});me.displayName=pe;function he(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(j(r,{select:t}),document.activeElement!==n)return}function ge(e){let t=_e(e);return[ve(t,e),ve(t.reverse(),e)]}function _e(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(let n of e)if(!ye(n,{upTo:t}))return n}function ye(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function be(e){return e instanceof HTMLInputElement&&`select`in e}function j(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&be(e)&&t&&e.select()}}var M=xe();function xe(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=N(e,t),e.unshift(t)},remove(t){e=N(e,t),e[0]?.resume()}}}function N(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Se(e){return e.filter(e=>e.tagName!==`A`)}var P=globalThis?.document?o.useLayoutEffect:()=>{},Ce=o.useId||(()=>void 0),we=0;function Te(e){let[t,n]=o.useState(Ce());return P(()=>{e||n(e=>e??String(we++))},[e]),e||(t?`radix-${t}`:``)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[s,c]=o.useState(!1);P(()=>c(!0),[]);let l=n||s&&globalThis?.document?.body;return l?i.createPortal((0,a.jsx)(x.div,{...r,ref:t}),l):null});De.displayName=Ee;function Oe(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var ke=e=>{let{present:t,children:n}=e,r=Ae(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=l(r.ref,je(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};ke.displayName=`Presence`;function Ae(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),[s,c]=Oe(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{let e=F(r.current);a.current=s===`mounted`?e:`none`},[s]),P(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=F(t);e?c(`MOUNT`):o===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),P(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=F(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=F(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function F(e){return e?.animationName||`none`}function je(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Me=o.useInsertionEffect||P;function Ne({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=Pe({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=Fe(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function Pe({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return Me(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Fe(e){return typeof e==`function`}var Ie=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},I=new WeakMap,L=new WeakMap,R={},z=0,Le=function(e){return e&&(e.host||Le(e.parentNode))},Re=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Le(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ze=function(e,t,n,r){var i=Re(t,Array.isArray(e)?e:[e]);R[n]||(R[n]=new WeakMap);var a=R[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(I.get(e)||0)+1,l=(a.get(e)||0)+1;I.set(e,c),a.set(e,l),o.push(e),c===1&&i&&L.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),z++,function(){o.forEach(function(e){var t=I.get(e)-1,i=a.get(e)-1;I.set(e,t),a.set(e,i),t||(L.has(e)||e.removeAttribute(r),L.delete(e)),i||e.removeAttribute(n)}),z--,z||(I=new WeakMap,I=new WeakMap,L=new WeakMap,R={})}},Be=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ze(r,i,n,`aria-hidden`)):function(){return null}},B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)};function Ve(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function He(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var V=`right-scroll-bar-position`,H=`width-before-scroll-bar`,Ue=`with-scroll-bars-hidden`,We=`--removed-body-scroll-bar-size`;function U(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ge(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ke=typeof window<`u`?o.useLayoutEffect:o.useEffect,qe=new WeakMap;function Je(e,t){var n=Ge(t||null,function(t){return e.forEach(function(e){return U(e,t)})});return Ke(function(){var t=qe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||U(e,null)}),i.forEach(function(e){r.has(e)||U(e,a)})}qe.set(n,e)},[e]),n}function Ye(e){return e}function Xe(e,t){t===void 0&&(t=Ye);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ze(e){e===void 0&&(e={});var t=Xe(null);return t.options=B({async:!0,ssr:!1},e),t}var Qe=function(e){var t=e.sideCar,n=Ve(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,B({},n))};Qe.isSideCarExport=!0;function $e(e,t){return e.useMedium(t),Qe}var et=Ze(),W=function(){},G=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:W,onWheelCapture:W,onTouchMoveCapture:W}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ve(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Je([n,t]),w=B(B({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:et,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),B(B({},w),{ref:C})):o.createElement(y,B({},w,{className:l,ref:C}),c))});G.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},G.classNames={fullWidth:H,zeroRight:V};var tt,nt=function(){if(tt)return tt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function rt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=nt();return t&&e.setAttribute(`nonce`,t),e}function it(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function at(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ot=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rt())&&(it(t,n),at(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},st=function(){var e=ot();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ct=function(){var e=st();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},lt={left:0,top:0,right:0,gap:0},K=function(e){return parseInt(e||``,10)||0},ut=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[K(n),K(r),K(i)]},dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return lt;var t=ut(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ft=ct(),q=`data-scroll-locked`,pt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Ue} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${q}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${V} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${H} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${V} .${V} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${H} .${H} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${q}] {
36
+ ${We}: ${s}px;
37
+ }
38
+ `},mt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ht=function(){o.useEffect(function(){return document.body.setAttribute(q,(mt()+1).toString()),function(){var e=mt()-1;e<=0?document.body.removeAttribute(q):document.body.setAttribute(q,e.toString())}},[])},gt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ht();var a=o.useMemo(function(){return dt(i)},[i]);return o.createElement(ft,{styles:pt(a,!t,i,n?``:`!important`)})},J=!1;if(typeof window<`u`)try{var Y=Object.defineProperty({},"passive",{get:function(){return J=!0,!0}});window.addEventListener(`test`,Y,Y),window.removeEventListener(`test`,Y,Y)}catch{J=!1}var X=J?{passive:!1}:!1,_t=function(e){return e.tagName===`TEXTAREA`},vt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!_t(e)&&n[t]===`visible`)},yt=function(e){return vt(e,`overflowY`)},bt=function(e){return vt(e,`overflowX`)},Z=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ct(e,r)){var i=wt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},St=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ct=function(e,t){return e===`v`?yt(t):bt(t)},wt=function(e,t){return e===`v`?xt(t):St(t)},Tt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Et=function(e,t,n,r,i){var a=Tt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=wt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ct(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Q=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dt=function(e){return[e.deltaX,e.deltaY]},Ot=function(e){return e&&`current`in e?e.current:e},kt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},At=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},jt=0,$=[];function Mt(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(jt++)[0],a=o.useState(ct)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=He([e.lockRef.current],(e.shards||[]).map(Ot),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=Q(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Z(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Z(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Et(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!$.length||$[$.length-1]!==a)){var r=`deltaY`in n?Dt(n):Q(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&kt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(Ot).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Nt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=Q(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,Dt(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Q(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return $.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,X),document.addEventListener(`touchmove`,l,X),document.addEventListener(`touchstart`,d,X),function(){$=$.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,X),document.removeEventListener(`touchmove`,l,X),document.removeEventListener(`touchstart`,d,X)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:At(i)}):null,m?o.createElement(gt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Nt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Pt=$e(et,Mt),Ft=o.forwardRef(function(e,t){return o.createElement(G,B({},e,{ref:t,sideCar:Pt}))});Ft.classNames=G.classNames;export{f as _,De as a,l as b,me as c,C as d,x as f,d as g,_ as h,ke as i,ue as l,m,Be as n,Te as o,S as p,Ne as r,P as s,Ft as t,D as u,u as v,c as y};