@lobu/runtime-server 20.2.0 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/catalogs/automations.json +0 -8
  2. package/dist/component.json +1 -1
  3. package/dist/connectors/README.md +15 -16
  4. package/dist/connectors/github.ts +274 -193
  5. package/dist/connectors/google_calendar.ts +54 -160
  6. package/dist/connectors/google_drive.ts +106 -131
  7. package/dist/connectors/google_gmail.ts +53 -30
  8. package/dist/connectors/hackernews.ts +2 -5
  9. package/dist/connectors/jira.ts +71 -27
  10. package/dist/connectors/linear.ts +55 -21
  11. package/dist/connectors/microsoft_outlook.ts +151 -110
  12. package/dist/connectors/postgres.ts +19 -11
  13. package/dist/connectors/producthunt.ts +11 -7
  14. package/dist/connectors/reddit.ts +36 -6
  15. package/dist/connectors/rss.ts +2 -2
  16. package/dist/connectors/whatsapp_web.ts +5 -4
  17. package/dist/connectors/x.ts +32 -17
  18. package/dist/connectors/youtube.ts +18 -5
  19. package/dist/db/migrations/20260917000000_views.sql +271 -0
  20. package/dist/db/migrations/20260917000001_views_attach_index.sql +14 -0
  21. package/dist/db/migrations/20260918000000_runs_turn_tool_event_uniq.sql +51 -0
  22. package/dist/db/migrations/20260923230000_runs_connector_artifact_hash.sql +32 -0
  23. package/dist/db/migrations/20260924000000_resource_source_files.sql +17 -0
  24. package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
  25. package/dist/dependencies.bun.lock +113 -102
  26. package/dist/guest.bundle.js +78 -10
  27. package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
  28. package/dist/owletto/dist/assets/_-XlUwOWCI.js +2 -0
  29. package/dist/owletto/dist/assets/_agentId-B2DrawIk.js +1 -0
  30. package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
  31. package/dist/owletto/dist/assets/_automationId-BLnqLtUv.js +1 -0
  32. package/dist/owletto/dist/assets/{_connectorKey._connectionId-BAJGfcy7.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
  33. package/dist/owletto/dist/assets/{_connectorKey.index-BBF8vGJS.js → _connectorKey.index-C_yKycN_.js} +1 -1
  34. package/dist/owletto/dist/assets/_conversationId-CpuEvflw.js +1 -0
  35. package/dist/owletto/dist/assets/_deploymentId-BL9tnDFl.js +1 -0
  36. package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
  37. package/dist/owletto/dist/assets/_owner-Cg50UU6m.js +1 -0
  38. package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
  39. package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
  40. package/dist/owletto/dist/assets/_slug-DbD-wv2m.js +1 -0
  41. package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
  42. package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
  43. package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
  44. package/dist/owletto/dist/assets/accept-invitation-BmQKbQem.js +1 -0
  45. package/dist/owletto/dist/assets/activity-route-view-BvtAoGVt.js +1 -0
  46. package/dist/owletto/dist/assets/{agent-card-controls-CZO6GI0s.js → agent-card-controls-bhTMPoVi.js} +1 -1
  47. package/dist/owletto/dist/assets/{agent-client-setup-list-_chLOorY.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
  48. package/dist/owletto/dist/assets/{agent-connect-pages-DWBgSIYT.js → agent-connect-pages-DkDlFVY5.js} +1 -1
  49. package/dist/owletto/dist/assets/{agent-editor-form-BTNlg0kQ.js → agent-editor-form-DwHD9j1Y.js} +1 -1
  50. package/dist/owletto/dist/assets/{agent-guardrails-route-B5uoMC6o.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
  51. package/dist/owletto/dist/assets/{agent-loading-shells-CLoLeFcB.js → agent-loading-shells-BQLjzMPy.js} +1 -1
  52. package/dist/owletto/dist/assets/{agent-permissions-matrix-TP00-MYL.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
  53. package/dist/owletto/dist/assets/{agent-skill-context-D4a2QCoZ.js → agent-skill-context-s42Q4Wjo.js} +1 -1
  54. package/dist/owletto/dist/assets/{agent-skills-route-KVDDTbJB.js → agent-skills-route-Cwq1QrhW.js} +1 -1
  55. package/dist/owletto/dist/assets/{agent-subpage-shell-DuVYZvBE.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
  56. package/dist/owletto/dist/assets/agent-thread-D7AGGjRV.js +8 -0
  57. package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
  58. package/dist/owletto/dist/assets/agents-workbench-Cl7FO7b3.js +1 -0
  59. package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +127 -0
  60. package/dist/owletto/dist/assets/{app._appId-D0_LQTJU.js → app._appId-CqYz3AOO.js} +1 -1
  61. package/dist/owletto/dist/assets/automation-detail-content-CKSywvzE.js +1 -0
  62. package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
  63. package/dist/owletto/dist/assets/{calendar-C0XpOHd8.js → calendar-CHXehtu0.js} +1 -1
  64. package/dist/owletto/dist/assets/{callback-CO_K9eR-.js → callback-DZ3YyXeV.js} +1 -1
  65. package/dist/owletto/dist/assets/{card-DeFQuU_J.js → card-4Ull9W6d.js} +1 -1
  66. package/dist/owletto/dist/assets/{claim-CUpWOSie.js → claim-BGLCPLXq.js} +1 -1
  67. package/dist/owletto/dist/assets/clients-C7ubnFsS.js +1 -0
  68. package/dist/owletto/dist/assets/{code-editor-BqGUZFt6.js → code-editor-BHiWR94J.js} +1 -1
  69. package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
  70. package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
  71. package/dist/owletto/dist/assets/connected._clientId-7RU89sVW.js +1 -0
  72. package/dist/owletto/dist/assets/{connection-BgAlYjeV.js → connection-CTaUGXl6.js} +1 -1
  73. package/dist/owletto/dist/assets/{connection-feed-detail-B3ePAinf.js → connection-feed-detail-B1xieiEh.js} +1 -1
  74. package/dist/owletto/dist/assets/{connector-provenance-DgsDg0Z9.js → connector-provenance-DRdUEmQ1.js} +1 -1
  75. package/dist/owletto/dist/assets/{connectors-CqPQPo9U.js → connectors-NBwCLuZg.js} +1 -1
  76. package/dist/owletto/dist/assets/{consent-bswcIzsf.js → consent-fmhPPlpi.js} +1 -1
  77. package/dist/owletto/dist/assets/{core.esm-DsLgjoel.js → core.esm-C-eNiUAl.js} +1 -1
  78. package/dist/owletto/dist/assets/{create-Dwo04oWV.js → create-8bBbQJGY.js} +1 -1
  79. package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
  80. package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
  81. package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
  82. package/dist/owletto/dist/assets/{create._connectorKey-CCBb2pil.js → create._connectorKey-CHAotlsF.js} +1 -1
  83. package/dist/owletto/dist/assets/{cronstrue-ChFyC9ps.js → cronstrue-C5yTgk5z.js} +1 -1
  84. package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
  85. package/dist/owletto/dist/assets/deployments-D1gbQwsy.js +1 -0
  86. package/dist/owletto/dist/assets/deployments-body-DycIGlnL.js +1 -0
  87. package/dist/owletto/dist/assets/device-DyPnQkhO.js +1 -0
  88. package/dist/owletto/dist/assets/{device-pin-tombstone-1ikyqSdb.js → device-pin-tombstone-CwJitllC.js} +1 -1
  89. package/dist/owletto/dist/assets/device-rows-BBhW1C7Y.js +1 -0
  90. package/dist/owletto/dist/assets/{device._deviceId-DTYKGBY8.js → device._deviceId-XswfXHOc.js} +1 -1
  91. package/dist/owletto/dist/assets/entity-options-utGBmFX0.js +1 -0
  92. package/dist/owletto/dist/assets/entity-page-BxwuqqWk.js +1 -0
  93. package/dist/owletto/dist/assets/entity-type-page-BrWqk6so.js +1 -0
  94. package/dist/owletto/dist/assets/event-page-LIm4EDmJ.js +1 -0
  95. package/dist/owletto/dist/assets/events-feed-C4L8mQV7.js +1 -0
  96. package/dist/owletto/dist/assets/{full-page-spinner-BN2G_YiM.js → full-page-spinner-DsU-Cb3L.js} +1 -1
  97. package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
  98. package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
  99. package/dist/owletto/dist/assets/{index-hSE2E46p.js → index-1YrrvVJ4.js} +1 -1
  100. package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
  101. package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
  102. package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
  103. package/dist/owletto/dist/assets/index-C8CR2-Ck.css +1 -0
  104. package/dist/owletto/dist/assets/{index-OUb5Mlez.js → index-CDz3-ieP.js} +10 -10
  105. package/dist/owletto/dist/assets/{index-C6VAJ8Ku.js → index-CQ4s6nzy.js} +1 -1
  106. package/dist/owletto/dist/assets/index-CpWKAAGX.js +1 -0
  107. package/dist/owletto/dist/assets/{index-vdqhlocx.js → index-D2dcENg2.js} +1 -1
  108. package/dist/owletto/dist/assets/{index-C2oCgDX7.js → index-DCK0KhMM.js} +1 -1
  109. package/dist/owletto/dist/assets/{index-C-u4yR8Z.js → index-DXqiRON3.js} +1 -1
  110. package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
  111. package/dist/owletto/dist/assets/index-DtRfQcRH.js +7898 -0
  112. package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
  113. package/dist/owletto/dist/assets/index-DwtfHCHB.js +1 -0
  114. package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
  115. package/dist/owletto/dist/assets/index-nOYvNROJ.js +1 -0
  116. package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
  117. package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
  118. package/dist/owletto/dist/assets/{json-diff-DnsW7Pin.js → json-diff-DYeX-xLk.js} +2 -2
  119. package/dist/owletto/dist/assets/{list-skeleton-CHzLN7GK.js → list-skeleton-s4GPSJ8J.js} +1 -1
  120. package/dist/owletto/dist/assets/login-Di5VF2F_.js +1 -0
  121. package/dist/owletto/dist/assets/logout-BuaQGSnw.js +1 -0
  122. package/dist/owletto/dist/assets/member-scope-gate-CJqJZk7T.js +1 -0
  123. package/dist/owletto/dist/assets/memory-browse-page-Bibfs2sK.js +101 -0
  124. package/dist/owletto/dist/assets/missing-view-CD4DOaG8.js +1 -0
  125. package/dist/owletto/dist/assets/{model-selector-DfbmHjLu.js → model-selector-XC5CI2Et.js} +1 -1
  126. package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
  127. package/dist/owletto/dist/assets/{new-Df_dY6Z5.js → new-BzkA1sq2.js} +1 -1
  128. package/dist/owletto/dist/assets/new-C3f0BShb.js +1 -0
  129. package/dist/owletto/dist/assets/new-DA5LF6iB.js +1 -0
  130. package/dist/owletto/dist/assets/{oauth-workspace-access-D9GmiMfK.js → oauth-workspace-access-D6epOq0R.js} +1 -1
  131. package/dist/owletto/dist/assets/{organization-uSDYkJpX.js → organization-DOtBRqDQ.js} +1 -1
  132. package/dist/owletto/dist/assets/{permissions-Fe0DP6b8.js → permissions-D8uJHINS.js} +1 -1
  133. package/dist/owletto/dist/assets/{proposal-review-shell-D9HwnDda.js → proposal-review-shell-C3K-JXjb.js} +1 -1
  134. package/dist/owletto/dist/assets/{recent-C03LhMD7.js → recent-CFcWceBl.js} +1 -1
  135. package/dist/owletto/dist/assets/{renderer-CHNejd95.js → renderer-1nRJFMGx.js} +2 -2
  136. package/dist/owletto/dist/assets/{reset-password-CuISnlG_.js → reset-password-9RTWhBEb.js} +1 -1
  137. package/dist/owletto/dist/assets/runs-_yVh6PPB.js +1 -0
  138. package/dist/owletto/dist/assets/{runs-panel-DsdESupx.js → runs-panel-B2852xus.js} +1 -1
  139. package/dist/owletto/dist/assets/runs-table--dnFQatY.js +1 -0
  140. package/dist/owletto/dist/assets/{schema-value-normalization-B--OWDL8.js → schema-value-normalization-BspxVEGy.js} +1 -1
  141. package/dist/owletto/dist/assets/{settings-wGNHtsDP.js → settings-9lDASETT.js} +1 -1
  142. package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
  143. package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
  144. package/dist/owletto/dist/assets/{switch-Dzse_XFM.js → switch-CxDXvPGE.js} +1 -1
  145. package/dist/owletto/dist/assets/use-applied-views-DvMT3wap.js +1 -0
  146. package/dist/owletto/dist/assets/{use-mention-search-uyW1Uwf6.js → use-mention-search-CeTEE3oE.js} +1 -1
  147. package/dist/owletto/dist/assets/view-frame-HoBawpT2.js +1 -0
  148. package/dist/owletto/dist/index.html +2 -2
  149. package/dist/providers.json +0 -1
  150. package/dist/server-main.bundle.mjs +8997 -7479
  151. package/npm-shrinkwrap.json +543 -485
  152. package/package.json +5 -2
  153. package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
  154. package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
  155. package/vendor/connector-sdk/dist/connector-types.d.ts +28 -15
  156. package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
  157. package/vendor/connector-sdk/dist/define-connector.js +4 -1
  158. package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
  159. package/vendor/connector-sdk/dist/http-client.js +15 -13
  160. package/vendor/connector-sdk/dist/index.d.ts +1 -1
  161. package/vendor/connector-sdk/dist/retry.d.ts +15 -3
  162. package/vendor/connector-sdk/dist/retry.js +40 -64
  163. package/vendor/connector-sdk/package.json +1 -1
  164. package/vendor/core/dist/agent-policy.js +3 -0
  165. package/vendor/core/dist/connector-query-errors.d.ts +3 -3
  166. package/vendor/core/dist/connector-query-errors.js +8 -3
  167. package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
  168. package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
  169. package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
  170. package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
  171. package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
  172. package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
  173. package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
  174. package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
  175. package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
  176. package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
  177. package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
  178. package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
  179. package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
  180. package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
  181. package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
  182. package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
  183. package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
  184. package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
  185. package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
  186. package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
  187. package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
  188. package/vendor/core/dist/contracts/tools/source-files.js +55 -0
  189. package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
  190. package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
  191. package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
  192. package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
  193. package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
  194. package/vendor/core/dist/contracts/tools/view-path.js +24 -0
  195. package/vendor/core/dist/contracts/worker/protocol.d.ts +90 -8
  196. package/vendor/core/dist/contracts/worker/protocol.js +70 -10
  197. package/vendor/core/dist/index.d.ts +1 -1
  198. package/vendor/core/dist/provider-config-types.d.ts +0 -9
  199. package/vendor/core/dist/reserved.d.ts +3 -3
  200. package/vendor/core/dist/reserved.js +9 -1
  201. package/vendor/core/dist/sdk-compat.d.ts +1 -1
  202. package/vendor/core/dist/utils/secret-redaction.js +2 -0
  203. package/vendor/core/package.json +30 -5
  204. package/vendor/views/dist/api.d.ts +184 -0
  205. package/vendor/views/dist/api.js +410 -0
  206. package/vendor/views/dist/bridge.d.ts +141 -0
  207. package/vendor/views/dist/bridge.js +330 -0
  208. package/vendor/views/dist/index.d.ts +12 -0
  209. package/vendor/views/dist/index.js +10 -0
  210. package/vendor/views/package.json +35 -0
  211. package/dist/owletto/dist/assets/_-Ds4DyQjj.js +0 -2
  212. package/dist/owletto/dist/assets/_-VmyR6aN_.js +0 -1
  213. package/dist/owletto/dist/assets/_agentId-BAVnp0c7.js +0 -1
  214. package/dist/owletto/dist/assets/_agentId-Df-3rGi5.js +0 -1
  215. package/dist/owletto/dist/assets/_automationId-D696vOjd.js +0 -1
  216. package/dist/owletto/dist/assets/_conversationId-Ci4rgrHm.js +0 -1
  217. package/dist/owletto/dist/assets/_deploymentId-Iy-D5PDq.js +0 -1
  218. package/dist/owletto/dist/assets/_name-CeGwb0oK.js +0 -1
  219. package/dist/owletto/dist/assets/_owner-CFR1G8OX.js +0 -1
  220. package/dist/owletto/dist/assets/_skillKey-DuLcQWBu.js +0 -1
  221. package/dist/owletto/dist/assets/_slug-CDSO20ac.js +0 -1
  222. package/dist/owletto/dist/assets/accept-invitation-Db5jklHT.js +0 -1
  223. package/dist/owletto/dist/assets/activity-route-view-DVW3DoB7.js +0 -1
  224. package/dist/owletto/dist/assets/agent-thread-CzCJU3-R.js +0 -134
  225. package/dist/owletto/dist/assets/agents-DFs57C3c.js +0 -1
  226. package/dist/owletto/dist/assets/agents-workbench-C2bUlJP2.js +0 -1
  227. package/dist/owletto/dist/assets/automation-detail-content-DWkdhnv2.js +0 -1
  228. package/dist/owletto/dist/assets/automations-DFs57C3c.js +0 -1
  229. package/dist/owletto/dist/assets/clients-DhYr4lyL.js +0 -1
  230. package/dist/owletto/dist/assets/connect-Dtb-E5An.js +0 -1
  231. package/dist/owletto/dist/assets/connect._clientId-DWtceAAw.js +0 -1
  232. package/dist/owletto/dist/assets/connected._clientId-CMe-wTuV.js +0 -1
  233. package/dist/owletto/dist/assets/create-CcXUdke7.js +0 -1
  234. package/dist/owletto/dist/assets/create-Cp6hMoeU.js +0 -1
  235. package/dist/owletto/dist/assets/create-automation-form-CJ4meayB.js +0 -1
  236. package/dist/owletto/dist/assets/deployments-CjfFxyDA.js +0 -1
  237. package/dist/owletto/dist/assets/deployments-body-Cg0KiWGr.js +0 -1
  238. package/dist/owletto/dist/assets/device-DpY67Jaj.js +0 -1
  239. package/dist/owletto/dist/assets/device-rows-Cp3yMcuV.js +0 -1
  240. package/dist/owletto/dist/assets/entity-options-1EaSGMX4.js +0 -1
  241. package/dist/owletto/dist/assets/entity-page-DJmM70dv.js +0 -1
  242. package/dist/owletto/dist/assets/entity-type-page-C3mT7tXn.js +0 -1
  243. package/dist/owletto/dist/assets/events-feed-iliGfjit.js +0 -1
  244. package/dist/owletto/dist/assets/guardrails-CLlnRRy9.js +0 -1
  245. package/dist/owletto/dist/assets/identity-MSLryUi8.js +0 -1
  246. package/dist/owletto/dist/assets/index-3o4Eepb4.js +0 -1
  247. package/dist/owletto/dist/assets/index-BUr8321-.js +0 -7898
  248. package/dist/owletto/dist/assets/index-Bulu5ldM.js +0 -1
  249. package/dist/owletto/dist/assets/index-BvbfITqH.js +0 -1
  250. package/dist/owletto/dist/assets/index-ChcQMdod.css +0 -1
  251. package/dist/owletto/dist/assets/index-Clw9ZBj-.js +0 -1
  252. package/dist/owletto/dist/assets/index-D2oL4Ydo.js +0 -1
  253. package/dist/owletto/dist/assets/index-D7wulT4y.js +0 -1
  254. package/dist/owletto/dist/assets/index-DOLFe19K.js +0 -1
  255. package/dist/owletto/dist/assets/index-DTSA0Xh1.js +0 -1
  256. package/dist/owletto/dist/assets/index-DxXXVPU0.js +0 -1
  257. package/dist/owletto/dist/assets/index-nzvsA3hT.js +0 -1
  258. package/dist/owletto/dist/assets/login-CCKNM0gV.js +0 -1
  259. package/dist/owletto/dist/assets/logout-B-N2aodZ.js +0 -1
  260. package/dist/owletto/dist/assets/member-scope-gate-B560Wg-t.js +0 -1
  261. package/dist/owletto/dist/assets/memory-browse-page-DMDqKJn7.js +0 -101
  262. package/dist/owletto/dist/assets/models-M51OGDRE.js +0 -1
  263. package/dist/owletto/dist/assets/new-BVQS9H-Y.js +0 -1
  264. package/dist/owletto/dist/assets/new-DxDVE9nL.js +0 -1
  265. package/dist/owletto/dist/assets/runs-BnYdToDc.js +0 -1
  266. package/dist/owletto/dist/assets/runs-table-B7jKuILd.js +0 -1
  267. package/dist/owletto/dist/assets/settings-Bg9yCCoN.js +0 -1
  268. package/dist/owletto/dist/assets/skills-CN5Ube7A.js +0 -1
  269. package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
  270. package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
@@ -0,0 +1 @@
1
+ import{hT as o,j as e}from"./index-DtRfQcRH.js";import{A as n}from"./agent-guardrails-route-0PsTrqMC.js";import"./model-selector-XC5CI2Et.js";import"./agent-subpage-shell-DtzoRy6N.js";import"./agent-loading-shells-BQLjzMPy.js";import"./agent-card-controls-bhTMPoVi.js";import"./switch-CxDXvPGE.js";function d(){const{owner:r,agentId:t}=o.useParams();return e.jsx(n,{owner:r,agentId:t})}export{d as component};
@@ -0,0 +1 @@
1
+ import{r as x,j as n,B as p,bA as T,bB as C,bC as L,bz as S,bf as E,u as M,bD as I,bq as N,bE as R,aW as D,br as P,L as j,bF as B,bG as O,bH as W,bI as z,bv as F,ah as v,bJ as K,N as U,bK as H,bL as G,bM as q,E as A,bN as J,bO as Q,bP as Y,aY as Z}from"./index-DtRfQcRH.js";import{L as V}from"./list-skeleton-s4GPSJ8J.js";import{c as X}from"./cronstrue-C5yTgk5z.js";const ee=[{value:"all",label:"All"},{value:"event",label:"Event"},{value:"schedule",label:"Schedule"},{value:"manual",label:"Manual"}];function te({pending:e,onConfirm:t}){const[s,r]=x.useState(!1);return s?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(p,{type:"button",variant:"destructive",size:"sm",disabled:e,onClick:t,children:"Delete"}),n.jsx(p,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!1),children:"Cancel"})]}):n.jsx(p,{type:"button",variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete",onClick:()=>r(!0),children:n.jsx(T,{className:"h-4 w-4"})})}function ne(e){try{return X.toString(e.trim(),{throwExceptionOnParseError:!0})}catch{return`On schedule ${e.trim()}`}}function se(e){return e.toLowerCase()==="github"?"GitHub":C(e)}function ae(e){return C(e.replace(/^\$/,""))}function re(e){if(!e||typeof e!="object"||Array.isArray(e))return"";const t=e;return typeof t.repository=="string"?` in ${t.repository}`:typeof t.channel_id=="string"?` in #${t.channel_id}`:typeof t.resource_ref=="string"?` for ${t.resource_ref}`:""}function oe(e){return Array.isArray(e.triggers)?e.triggers.filter(t=>!!t&&typeof t=="object"):[]}function ie(e){if(e.kind==="schedule"&&typeof e.cron=="string")return ne(e.cron);if(e.kind==="event"&&e.source!=="workspace"&&typeof e.connector_key=="string"){const t=Array.isArray(e.event_types)?e.event_types.filter(r=>typeof r=="string"):[],s=t.length>0?t.join(" or "):"an event";return`${se(e.connector_key)} sends ${s}${re(e.match)}`}if(e.kind==="event"&&e.source==="workspace"){const t=Array.isArray(e.event_types)?e.event_types.filter(l=>typeof l=="string"):[],s=t.length>0?t.join(" or "):"an event",r=typeof e.entity_type=="string"?` on ${ae(e.entity_type)}`:"";return`another Automation writes ${s}${r}`}return null}function le(e){return e.health==="degraded"?"error":"enabled"}function ce(e){const t=oe(e),s=e.name?.trim()||"Untitled automation",r=t.some(o=>o.kind==="event"),l=t.some(o=>o.kind==="schedule"),m=r?"event":l?"schedule":"manual",u=t.map(ie).filter(o=>!!o);let d="When started manually";u.length===1?d=`When ${u[0]}`:u.length>1&&(d=`When ${u[0]}${u.slice(1).map(o=>`, or when ${o}`).join("")}`);const i=t.some(o=>o.kind==="event"&&o.output==="reply_to_source")?"source":"silent";return{key:`automation:${e.automation_id}`,kind:m,when:d,does:s,output:{destination:i},state:le(e),sortTime:e.next_run_at?Date.parse(e.next_run_at):null,automation:e}}const y={event:0,schedule:1,manual:2};function ue(e){return e.map(ce).sort((t,s)=>t.state!==s.state?t.state==="enabled"?-1:1:y[t.kind]!==y[s.kind]?y[t.kind]-y[s.kind]:t.sortTime!==s.sortTime?t.sortTime===null?1:s.sortTime===null?-1:t.sortTime-s.sortTime:t.when.localeCompare(s.when)||t.key.localeCompare(s.key))}const de={kind:"all",output:"any",state:"any"};function me(e,t){return e.filter(s=>(t.kind==="all"||s.kind===t.kind)&&(t.output==="any"||(t.output==="reply"?s.output.destination==="source":s.output.destination==="silent"))&&(t.state==="any"||(t.state==="active"?s.state==="enabled":s.state==="error")))}const w="bg-muted text-muted-foreground",fe={event:{label:"Event",icon:z},schedule:{label:"Schedule",icon:W},manual:{label:"Manual",icon:O}};function he({agentName:e,deviceLabel:t}){const s=t?{label:t,icon:H}:e?{label:e,icon:G}:{label:"Manual · any client",icon:q},{label:r,icon:l}=s;return n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(l,{className:"h-3 w-3"}),r]})}function xe({lastRunAt:e,nextRunAt:t}){const s=e?`Ran ${A(e)}`:t?`Next run ${A(t)}`:"Never run";return n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(J,{className:"h-3 w-3"}),s]})}function pe({count:e}){return e<=0?null:n.jsxs(v,{variant:"secondary",className:w,children:[n.jsx(Q,{className:"h-3 w-3"}),e," ",e===1?"client":"clients"]})}function ye(e){const t=Array.isArray(e.triggers)?e.triggers:[];for(const s of t)if(s&&typeof s=="object"&&s.kind==="event"&&s.source!=="workspace"&&typeof s.connector_key=="string")return s.connector_key;return null}function ve(e,t){return`flex items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-accent/50 ${e===t-1?"":"border-b"}`}function be({automation:e,agentName:t,deviceLabel:s,connectorDisplay:r,owner:l,onRemove:m,removing:u,rowClass:d}){const i=e.automation,o=i.automation_id,b=fe[e.kind],g=i.entity_name&&i.entity_type?`${i.entity_name} · ${i.entity_type}`:null,f=[e.when,g].filter(Boolean).join(" — "),h=i.health==="degraded"?i.health_reasons?.[0]||"Needs attention":null;return n.jsxs("div",{className:d,children:[n.jsxs(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:o},search:{view:"activity",run_id:void 0},className:"flex min-w-0 flex-1 items-center gap-3",children:[r?n.jsx(F,{icon:r.icon,iconUrl:r.iconUrl,name:r.name,faviconDomain:r.faviconDomain,className:"h-7 w-7 shrink-0 rounded-md text-[10px]"}):n.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border",children:n.jsx(b.icon,{className:"h-3.5 w-3.5 text-muted-foreground"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("span",{className:"truncate text-sm font-medium",children:e.does}),n.jsx(he,{agentName:t,deviceLabel:s}),n.jsx(xe,{lastRunAt:i.last_run_completed_at??i.last_fired_at??null,nextRunAt:i.next_run_at??null}),n.jsx(pe,{count:i.processing_client_count??0}),h?n.jsxs(v,{variant:"secondary",className:"max-w-full whitespace-normal bg-amber-500/10 text-left text-amber-700 dark:text-amber-400",children:[n.jsx(K,{className:"h-3 w-3 shrink-0"}),h]}):null]}),f?n.jsx("p",{className:"truncate text-xs text-muted-foreground",children:f}):null]})]}),n.jsx(j,{to:"/$owner/automations/$automationId",params:{owner:l,automationId:o},search:{view:"definition",run_id:void 0},className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground","aria-label":"Edit",children:n.jsx(U,{className:"h-3.5 w-3.5"})}),n.jsx(te,{pending:u,onConfirm:m})]})}function ge({owner:e,organizationId:t,isWorkspaceLoading:s}){const[r,l]=x.useState(de),m=L(t??void 0),{data:u=[]}=S({enabled:!!t}),{data:d=[]}=E(),{data:i=[]}=M(t),o=I(),b=x.useMemo(()=>{const a=new Map;for(const c of u)a.set(c.agentId,c.name);return a},[u]),g=x.useMemo(()=>{const a=new Map;for(const c of d)a.set(c.id,c.label||c.platform||c.id);return a},[d]),f=x.useMemo(()=>ue(m.data??[]),[m.data]),h=x.useMemo(()=>me(f,r),[f,r]),$=s||m.isLoading,k=n.jsx(p,{asChild:!0,size:"sm",className:"h-8 shrink-0 text-xs",children:n.jsxs(j,{to:"/$owner/automations/new",params:{owner:e},children:[n.jsx(B,{className:"mr-1.5 h-3.5 w-3.5"}),"New automation"]})});return $?n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex justify-end",children:k}),n.jsx(V,{label:"Loading automations",actions:!0})]}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"What runs on its own — on a schedule, on an event, or when you ask."}),n.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[n.jsx("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:ee.map(a=>n.jsx(p,{type:"button",variant:r.kind===a.value?"secondary":"ghost","aria-pressed":r.kind===a.value,size:"sm",className:"h-7 px-2 text-xs",onClick:()=>l(c=>({...c,kind:a.value})),children:a.label},a.value))}),n.jsx("div",{className:"ml-auto shrink-0",children:k})]}),f.length===0?n.jsx(N,{icon:R,title:"No automations yet",description:"Automations act on their own — reply to a message, run a nightly summary, react to a ticket. Use New automation to create one."}):h.length===0?n.jsx(N,{icon:D.automations.icon,title:"No automations match this filter",description:"Try another trigger type.",secondaryActionLabel:"Show all",secondaryOnAction:()=>l(a=>({...a,kind:"all"}))}):n.jsx("div",{className:"overflow-hidden rounded-lg border",children:h.map((a,c)=>n.jsx(be,{automation:a,agentName:a.automation.managed_agent_id?b.get(a.automation.managed_agent_id)??a.automation.managed_agent_id:null,deviceLabel:a.automation.device_worker_id?g.get(a.automation.device_worker_id)??a.automation.device_worker_id:null,connectorDisplay:(()=>{const _=ye(a.automation);return _?P(_,i):null})(),owner:e,rowClass:ve(c,h.length),removing:o.isPending,onRemove:()=>o.mutate(a.automation.automation_id)},a.key))})]})}function _e(){const{owner:e}=Y.useParams();return n.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 pt-4 pb-8 lg:px-6",children:n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(Z,{owner:e,children:t=>n.jsx("div",{className:"mx-auto flex min-h-0 w-full min-w-0 max-w-3xl flex-1 flex-col",children:n.jsx(ge,{owner:t.ownerSlug,organizationId:t.organizationId,isWorkspaceLoading:t.isWorkspaceLoading})})})})})}export{_e as component};
@@ -0,0 +1 @@
1
+ import{bU as t,j as p,bV as m}from"./index-DtRfQcRH.js";import{M as i}from"./memory-browse-page-Bibfs2sK.js";import"./switch-CxDXvPGE.js";import"./entity-type-page-BrWqk6so.js";import"./json-diff-DYeX-xLk.js";import"./index-CDz3-ieP.js";import"./index-Vcq4gwWv.js";import"./code-editor-BHiWR94J.js";import"./schema-value-normalization-BspxVEGy.js";import"./calendar-CHXehtu0.js";import"./core.esm-C-eNiUAl.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./view-frame-HoBawpT2.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-CD4DOaG8.js";import"./use-applied-views-DvMT3wap.js";import"./member-scope-gate-CJqJZk7T.js";function M(){const{owner:o,entityType:r}=t.useParams(),{create:e}=t.useSearch();return p.jsx(i,{ownerSlug:o,typeScope:m(r),create:e??!1})}export{M as component};
@@ -0,0 +1 @@
1
+ import{b6 as s,b7 as n,j as e}from"./index-DtRfQcRH.js";import{A as m}from"./activity-route-view-BvtAoGVt.js";import{E as a}from"./events-feed-C4L8mQV7.js";import"./device-automation-BIjs7DZJ.js";import"./agent-thread-storage-U6htL3ad.js";import"./pending-seed-CPbfgnLX.js";import"./clients-C7ubnFsS.js";import"./client-rows-EJSKR6z1.js";import"./connection-label-BobuYiAG.js";import"./calendar-CHXehtu0.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./agent-loading-shells-BQLjzMPy.js";import"./member-scope-gate-CJqJZk7T.js";import"./use-applied-views-DvMT3wap.js";function A(){const{owner:o}=s.useParams(),r=s.useSearch();if(o==="me"){const t=n(r),i={sortBy:"date",sortOrder:"desc",...t.contentIds?.length?{contentIds:t.contentIds}:{clientIds:t.clientIds,mcpActivityId:t.mcpActivityId}};return e.jsxs("div",{className:"mx-auto flex w-full max-w-3xl flex-col gap-6 px-4 py-6 lg:px-6",children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Your MCP activity"}),e.jsx(a,{organizationId:null,ownerSlug:"me",filters:i})]})}return e.jsx(m,{owner:o,search:r,attentionLens:!1})}export{A as component};
@@ -0,0 +1 @@
1
+ import{gE as e,gF as n,j as m}from"./index-DtRfQcRH.js";import{E as i}from"./event-page-LIm4EDmJ.js";import"./events-feed-C4L8mQV7.js";import"./use-applied-views-DvMT3wap.js";import"./clients-C7ubnFsS.js";import"./renderer-1nRJFMGx.js";import"./card-4Ull9W6d.js";import"./view-frame-HoBawpT2.js";import"./app-bridge-BH3g2mKG.js";import"./missing-view-CD4DOaG8.js";function l(){const{owner:o,eventId:r}=e.useParams(),t=n(r);return t===null?null:m.jsx(i,{owner:o,eventId:t})}export{l as component};
@@ -0,0 +1 @@
1
+ import{hl as n,j as o,aY as r}from"./index-DtRfQcRH.js";import{A as a}from"./agent-connect-pages-DkDlFVY5.js";import"./agent-client-setup-list-BBbq_2B1.js";import"./clients-C7ubnFsS.js";import"./client-rows-EJSKR6z1.js";function g(){const{owner:t}=n.useParams();return o.jsx(r,{owner:t,children:({ownerSlug:e})=>o.jsx(a,{owner:e})})}export{g as component};
@@ -1,3 +1,3 @@
1
- import{r as _,j as L,cP as Je,dU as Ve,aj as ze,aS as _e}from"./index-BUr8321-.js";import{T as Be,P as be,E as S,S as U,g as qe,R as Ke,V as $e,F as ve,a as $,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-OUb5Mlez.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let R=1e9,F=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(R<1e9&&Math.min(o,a)>R*16||F>0&&Date.now()>F)return Math.min(o,a)>R*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);V.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:V;for(let h=0;h<d;h++){if(h>R||F>0&&!(h&63)&&Date.now()>F)return oe(t,e,n,l,i,r);let m=V.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const V=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(R=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,F=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Ge(){return!Y}function Re(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=$.define(),Fe=ve.define(),k=U.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Fe))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Re(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Ge())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Re(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Ge()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=$e.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const K=$.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:K.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:K.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=U.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(K)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||Ke.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Fe.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=$.define(),N=U.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
1
+ import{r as _,j as L,cm as Je,dd as Ue,al as ze,aV as _e}from"./index-DtRfQcRH.js";import{T as Be,P as be,E as S,S as V,g as qe,R as Ke,V as $e,F as ve,a as $,b as H,G as Q,W as Z,D as M,l as Qe,h as Ze,c as Ye,C as Xe,d as le,s as et,e as tt,j as nt}from"./index-CDz3-ieP.js";class x{constructor(e,n,l,i){this.fromA=e,this.toA=n,this.fromB=l,this.toB=i}offset(e,n=e){return new x(this.fromA+e,this.toA+e,this.fromB+n,this.toB+n)}}function E(t,e,n,l,i,r){if(t==l)return[];let o=X(t,e,n,l,i,r),a=ee(t,e+o,n,l,i+o,r);e+=o,n-=a,i+=o,r-=a;let d=n-e,c=r-i;if(!d||!c)return[new x(e,n,i,r)];if(d>c){let s=t.slice(e,n).indexOf(l.slice(i,r));if(s>-1)return[new x(e,e+s,i,i),new x(e+s+c,n,r,r)]}else if(c>d){let s=l.slice(i,r).indexOf(t.slice(e,n));if(s>-1)return[new x(e,e,i,i+s),new x(n,n,i+s+d,r)]}if(d==1||c==1)return[new x(e,n,i,r)];let f=Me(t,e,n,l,i,r);if(f){let[s,u,h]=f;return E(t,e,s,l,i,u).concat(E(t,s+h,n,l,u+h,r))}return rt(t,e,n,l,i,r)}let R=1e9,F=0,Y=!1;function rt(t,e,n,l,i,r){let o=n-e,a=r-i;if(R<1e9&&Math.min(o,a)>R*16||F>0&&Date.now()>F)return Math.min(o,a)>R*64?[new x(e,n,i,r)]:oe(t,e,n,l,i,r);let d=Math.ceil((o+a)/2);U.reset(d),z.reset(d);let c=(h,m)=>t.charCodeAt(e+h)==l.charCodeAt(i+m),f=(h,m)=>t.charCodeAt(n-h-1)==l.charCodeAt(r-m-1),s=(o-a)%2!=0?z:null,u=s?null:U;for(let h=0;h<d;h++){if(h>R||F>0&&!(h&63)&&Date.now()>F)return oe(t,e,n,l,i,r);let m=U.advance(h,o,a,d,s,!1,c)||z.advance(h,o,a,d,u,!0,f);if(m)return it(t,e,n,e+m[0],l,i,r,i+m[1])}return[new x(e,n,i,r)]}class Le{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,n,l,i,r,o,a){for(let d=-e+this.start;d<=e-this.end;d+=2){let c=i+d,f=d==-e||d!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,s=f-d;for(;f<n&&s<l&&a(f,s);)f++,s++;if(this.vec[c]=f,f>n)this.end+=2;else if(s>l)this.start+=2;else if(r){let u=i+(n-l)-d;if(u>=0&&u<this.len&&r.vec[u]!=-1)if(o){let h=r.vec[u];if(h>=n-f)return[h,i+h-u]}else{let h=n-r.vec[u];if(f>=h)return[f,s]}}}return null}}const U=new Le,z=new Le;function it(t,e,n,l,i,r,o,a){let d=!1;return!O(t,l)&&++l==n&&(d=!0),!O(i,a)&&++a==o&&(d=!0),d?[new x(e,n,r,o)]:E(t,e,l,i,r,a).concat(E(t,l,n,i,a,o))}function De(t,e){let n=1,l=Math.min(t,e);for(;n<l;)n=n<<1;return n}function X(t,e,n,l,i,r){if(e==n||e==r||t.charCodeAt(e)!=l.charCodeAt(i))return 0;let o=De(n-e,r-i);for(let a=e,d=i;;){let c=a+o,f=d+o;if(c>n||f>r||t.slice(a,c)!=l.slice(d,f)){if(o==1)return a-e-(O(t,a)?0:1);o=o>>1}else{if(c==n||f==r)return c-e;a=c,d=f}}}function ee(t,e,n,l,i,r){if(e==n||i==r||t.charCodeAt(n-1)!=l.charCodeAt(r-1))return 0;let o=De(n-e,r-i);for(let a=n,d=r;;){let c=a-o,f=d-o;if(c<e||f<i||t.slice(c,a)!=l.slice(f,d)){if(o==1)return n-a-(O(t,a)?0:1);o=o>>1}else{if(c==e||f==i)return n-c;a=c,d=f}}}function q(t,e,n,l,i,r,o,a){let d=l.slice(i,r),c=null;for(;;){if(c||o<a)return c;for(let f=e+o;;){O(t,f)||f++;let s=f+o;if(O(t,s)||(s+=s==f+1?1:-1),s>=n)break;let u=t.slice(f,s),h=-1;for(;(h=d.indexOf(u,h+1))!=-1;){let m=X(t,s,n,l,i+h+u.length,r),p=ee(t,e,f,l,i,i+h),g=u.length+m+p;(!c||c[2]<g)&&(c=[f-p,i+h-p,g])}f=s}if(a<0)return c;o=o>>1}}function Me(t,e,n,l,i,r){let o=n-e,a=r-i;if(o<a){let d=Me(l,i,r,t,e,n);return d&&[d[1],d[0],d[2]]}return o<4||a*2<o?null:q(t,e,n,l,i,r,Math.floor(o/4),-1)}function oe(t,e,n,l,i,r){Y=!0;let o=n-e,a=r-i,d;if(o<a){let u=q(l,i,r,t,e,n,Math.floor(o/6),50);d=u&&[u[1],u[0],u[2]]}else d=q(t,e,n,l,i,r,Math.floor(a/6),50);if(!d)return[new x(e,n,i,r)];let[c,f,s]=d;return E(t,e,c,l,i,f).concat(E(t,c+s,n,l,f+s,r))}function Se(t,e){for(let n=1;n<t.length;n++){let l=t[n-1],i=t[n];l.toA>i.fromA-e&&l.toB>i.fromB-e&&(t[n-1]=new x(l.fromA,i.toA,l.fromB,i.toB),t.splice(n--,1))}}function lt(t,e,n){for(;;){Se(n,1);let l=!1;for(let i=0;i<n.length;i++){let r=n[i],o,a;(o=X(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA+o,r.toA,r.fromB+o,r.toB)),(a=ee(t,r.fromA,r.toA,e,r.fromB,r.toB))&&(r=n[i]=new x(r.fromA,r.toA-a,r.fromB,r.toB-a));let d=r.toA-r.fromA,c=r.toB-r.fromB;if(d&&c)continue;let f=r.fromA-(i?n[i-1].toA:0),s=(i<n.length-1?n[i+1].fromA:t.length)-r.toA;if(!f||!s)continue;let u=d?t.slice(r.fromA,r.toA):e.slice(r.fromB,r.toB);f<=u.length&&t.slice(r.fromA-f,r.fromA)==u.slice(u.length-f)?(n[i]=new x(r.fromA-f,r.toA-f,r.fromB-f,r.toB-f),l=!0):s<=u.length&&t.slice(r.toA,r.toA+s)==u.slice(0,s)&&(n[i]=new x(r.fromA+s,r.toA+s,r.fromB+s,r.toB+s),l=!0)}if(!l)break}return n}function ot(t,e,n){for(let l=0,i=0;i<t.length;i++){let r=t[i],o=r.toA-r.fromA,a=r.toB-r.fromB;if(o&&a||o>3||a>3){let d=i==t.length-1?e.length:t[i+1].fromA,c=r.fromA-l,f=d-r.toA,s=fe(e,r.fromA,c),u=ae(e,r.toA,f),h=r.fromA-s,m=u-r.toA;if((!o||!a)&&h&&m){let p=Math.max(o,a),[g,A,T]=o?[e,r.fromA,r.toA]:[n,r.fromB,r.toB];p>h&&e.slice(s,r.fromA)==g.slice(T-h,T)?(r=t[i]=new x(s,s+o,r.fromB-h,r.toB-h),s=r.fromA,u=ae(e,r.toA,d-r.toA)):p>m&&e.slice(r.toA,u)==g.slice(A,A+m)&&(r=t[i]=new x(u-o,u,r.fromB+m,r.toB+m),u=r.toA,s=fe(e,r.fromA,r.fromA-l)),h=r.fromA-s,m=u-r.toA}if(h||m)r=t[i]=new x(r.fromA-h,r.toA+m,r.fromB-h,r.toB+m);else if(o){if(!a){let p=de(e,r.fromA,r.toA),g,A=p<0?-1:se(e,r.toA,r.fromA);p>-1&&(g=p-r.fromA)<=f&&e.slice(r.fromA,p)==e.slice(r.toA,r.toA+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toA-A)<=c&&e.slice(r.fromA-g,r.fromA)==e.slice(A,r.toA)&&(r=t[i]=r.offset(-g))}}else{let p=de(n,r.fromB,r.toB),g,A=p<0?-1:se(n,r.toB,r.fromB);p>-1&&(g=p-r.fromB)<=f&&n.slice(r.fromB,p)==n.slice(r.toB,r.toB+g)?r=t[i]=r.offset(g):A>-1&&(g=r.toB-A)<=c&&n.slice(r.fromB-g,r.fromB)==n.slice(A,r.toB)&&(r=t[i]=r.offset(-g))}}l=r.toA}return Se(t,3),t}let y;try{y=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function ye(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function Ee(t,e){if(e==t.length)return 0;let n=t.charCodeAt(e);return n<192?ye(n)?1:0:y?!Ne(n)||e==t.length-1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e,e+2))?2:0:0}function je(t,e){if(!e)return 0;let n=t.charCodeAt(e-1);return n<192?ye(n)?1:0:y?!Te(n)||e==1?y.test(String.fromCharCode(n))?1:0:y.test(t.slice(e-2,e))?2:0:0}const Oe=8;function ae(t,e,n){if(e==t.length||!je(t,e))return e;for(let l=e,i=e+n,r=0;r<Oe;r++){let o=Ee(t,l);if(!o||l+o>i)return l;l+=o}return e}function fe(t,e,n){if(!e||!Ee(t,e))return e;for(let l=e,i=e-n,r=0;r<Oe;r++){let o=je(t,l);if(!o||l-o<i)return l;l-=o}return e}function se(t,e,n){for(;e!=n;e--)if(t.charCodeAt(e-1)==10)return e;return-1}function de(t,e,n){for(;e!=n;e++)if(t.charCodeAt(e)==10)return e;return-1}const Ne=t=>t>=55296&&t<=56319,Te=t=>t>=56320&&t<=57343;function O(t,e){return!e||e==t.length||!Ne(t.charCodeAt(e-1))||!Te(t.charCodeAt(e))}function at(t,e,n){var l;let i=n?.override;return i?i(t,e):(R=((l=n?.scanLimit)!==null&&l!==void 0?l:1e9)>>1,F=n?.timeout?Date.now()+n.timeout:0,Y=!1,lt(t,e,E(t,0,t.length,e,0,e.length)))}function Ge(){return!Y}function Re(t,e,n){return ot(at(t,e,n),t,e)}const D=ve.define({combine:t=>t[0]}),ft=$.define(),Fe=ve.define(),k=V.define({create(t){return null},update(t,e){for(let n of e.effects)n.is(ft)&&(t=n.value);for(let n of e.state.facet(Fe))t=n(t,e);return t}});class j{constructor(e,n,l,i,r,o=!0){this.changes=e,this.fromA=n,this.toA=l,this.fromB=i,this.toB=r,this.precise=o}offset(e,n){return e||n?new j(this.changes,this.fromA+e,this.toA+e,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,n,l){let i=Re(e.toString(),n.toString(),l);return Ie(i,e,n,0,0,Ge())}static updateA(e,n,l,i,r){return ge(me(e,i,!0,l.length),e,n,l,r)}static updateB(e,n,l,i,r){return ge(me(e,i,!1,n.length),e,n,l,r)}}function ce(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.to==t&&r.to==e&&t<n.length&&e<l.length?[t+1,e+1]:[i.from,r.from]}function ue(t,e,n,l){let i=n.lineAt(t),r=l.lineAt(e);return i.from==t&&r.from==e?[t,e]:[i.to+1,r.to+1]}function Ie(t,e,n,l,i,r){let o=[];for(let a=0;a<t.length;a++){let d=t[a],[c,f]=ce(d.fromA+l,d.fromB+i,e,n),[s,u]=ue(d.toA+l,d.toB+i,e,n),h=[d.offset(-c+l,-f+i)];for(;a<t.length-1;){let m=t[a+1],[p,g]=ce(m.fromA+l,m.fromB+i,e,n);if(p>s+1&&g>u+1)break;h.push(m.offset(-c+l,-f+i)),[s,u]=ue(m.toA+l,m.toB+i,e,n),a++}o.push(new j(h,c,Math.max(c,s),f,Math.max(f,u),r))}return o}const W=1e3;function he(t,e,n,l){let i=0,r=t.length;for(;;){if(i==r){let f=0,s=0;i&&({toA:f,toB:s}=t[i-1]);let u=e-(n?f:s);return[f+u,s+u]}let o=i+r>>1,a=t[o],[d,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(d>e)r=o;else if(c<=e)i=o+1;else return l?[a.fromA,a.fromB]:[a.toA,a.toB]}}function me(t,e,n,l){let i=[];return e.iterChangedRanges((r,o,a,d)=>{let c=0,f=n?e.length:l,s=0,u=n?l:e.length;r>W&&([c,s]=he(t,r-W,n,!0)),o<e.length-W&&([f,u]=he(t,o+W,n,!1));let h=d-a-(o-r),m,[p,g]=n?[h,0]:[0,h];i.length&&(m=i[i.length-1]).toA>=c?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:f,toB:u,diffA:m.diffA+p,diffB:m.diffB+g}:i.push({fromA:c,toA:f,fromB:s,toB:u,diffA:p,diffB:g})}),i}function ge(t,e,n,l,i){if(!t.length)return e;let r=[];for(let o=0,a=0,d=0,c=0;;o++){let f=o==t.length?null:t[o],s=f?f.fromA+a:n.length,u=f?f.fromB+d:l.length;for(;c<e.length;){let g=e[c];if(f&&(g.toA+a>s||g.toB+d>u))break;r.push(g.offset(a,d)),c++}if(!f)break;let h=f.toA+a+f.diffA,m=f.toB+d+f.diffB,p=Re(n.sliceString(s,h),l.sliceString(u,m),i);for(let g of Ie(p,n,l,s,u,Ge()))r.push(g);for(a+=f.diffA,d+=f.diffB;c<e.length;){let g=e[c];if(g.fromA+a>h&&g.fromB+d>m)break;c++}}return r}const st={scanLimit:500},We=$e.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=Ce(t))}update(t){(t.docChanged||t.viewportChanged||dt(t.startState,t.state)||ct(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=Ce(t.view))}},{decorations:t=>t.deco});function dt(t,e){return t.field(k,!1)!=e.field(k,!1)}function ct(t,e){return t.facet(D)!=e.facet(D)}const pe=M.line({class:"cm-changedLine"}),He=M.mark({class:"cm-changedText"}),ut=M.mark({tagName:"ins",class:"cm-insertedLine"}),ht=M.mark({tagName:"del",class:"cm-deletedLine"}),xe=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function mt(t,e,n,l,i,r){let o=n?t.fromA:t.fromB,a=n?t.toA:t.toB,d=0;if(o!=a){i.add(o,o,pe),i.add(o,a,n?ht:ut),r&&r.add(o,o,xe);for(let c=e.iterRange(o,a-1),f=o;!c.next().done;){if(c.lineBreak){f++,i.add(f,f,pe),r&&r.add(f,f,xe);continue}let s=f+c.value.length;if(l)for(;d<t.changes.length;){let u=t.changes[d],h=o+(n?u.fromA:u.fromB),m=o+(n?u.toA:u.toB),p=Math.max(f,h),g=Math.min(s,m);if(p<g&&i.add(p,g,He),m<s)d++;else break}f=s}}}function Ce(t){let e=t.state.field(k),{side:n,highlightChanges:l,markGutter:i,overrideChunk:r}=t.state.facet(D),o=n=="a",a=new H,d=i?new H:null,{from:c,to:f}=t.viewport;for(let s of e){if((o?s.fromA:s.fromB)>=f)break;(o?s.toA:s.toB)>c&&(!r||!r(t.state,s,a,d))&&mt(s,t.state.doc,o,l,a,d)}return{deco:a.finish(),gutter:d&&d.finish()}}const K=$.define({map:(t,e)=>e.mapPos(t)});class gt extends Z{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent=e.state.phrase("$ unchanged lines",this.lines),n.addEventListener("click",l=>{let i=e.posAtDOM(l.target);e.dispatch({effects:K.of(i)});let{side:r,sibling:o}=e.state.facet(D);o&&o().dispatch({effects:K.of(pt(i,e.state.field(k),r=="a"))})}),n}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function pt(t,e,n){let l=0,i=0;for(let r=0;;r++){let o=r<e.length?e[r]:null;if(!o||(n?o.fromA:o.fromB)>=t)return i+(t-l);[l,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}const xt=V.define({create(t){return M.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(K)&&(t=t.update({filter:l=>l!=n.value}));if(t.size&&e.state.field(k)!=e.startState.field(k,!1)){let n=e.state.facet(D).side=="a",l=[];for(let i of e.state.field(k))t.between(n?i.fromA:i.fromB,n?i.toA:i.toB,r=>{l.push(r)});l.length&&(t=t.update({filter:i=>l.indexOf(i)<0}))}return t},provide:t=>S.decorations.from(t)});function Ct({margin:t=3,minSize:e=4}){return xt.init(n=>At(n,t,e))}function At(t,e,n){let l=new H,i=t.facet(D).side=="a",r=t.field(k),o=1;for(let a=0;;a++){let d=a<r.length?r[a]:null,c=a?o+e:1,f=d?t.doc.lineAt(i?d.fromA:d.fromB).number-1-e:t.doc.lines,s=f-c+1;if(s>=n&&l.add(t.doc.line(c).from,t.doc.line(f).to,M.replace({widget:new gt(s),block:!0})),!d)break;o=t.doc.lineAt(Math.min(t.doc.length,i?d.toA:d.toB)).number}return l.finish()}const kt=S.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),wt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},Bt=be.low(qe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(We))===null||e===void 0?void 0:e.gutter)||Ke.empty},widgetMarker:(t,e)=>e instanceof Pe?wt:null}));function bt(t){var e;let n=typeof t.original=="string"?Be.of(t.original.split(/\r?\n/)):t.original,l=t.diffConfig||st;return[be.low(We),Mt,kt,S.editorAttributes.of({class:"cm-merge-b"}),Fe.of((i,r)=>{let o=r.effects.find(a=>a.is(te));return o&&(i=j.updateA(i,o.value.doc,r.startState.doc,o.value.changes,l)),r.docChanged&&(i=j.updateB(i,r.state.field(N),r.newDoc,r.changes,l)),i}),D.of({highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1,syntaxHighlightDeletions:t.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(e=t.mergeControls)!==null&&e!==void 0?e:!0,overrideChunk:t.allowInlineDiffs?jt:void 0,side:"b"}),N.init(()=>n),t.gutter!==!1?Bt:[],t.collapseUnchanged?Ct(t.collapseUnchanged):[],k.init(i=>j.build(n,i.doc,l))]}const te=$.define(),N=V.define({create:()=>Be.empty,update(t,e){for(let n of e.effects)n.is(te)&&(t=n.value.doc);return t}}),Ae=new WeakMap;class Pe extends Z{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||(this.dom=this.buildDOM(e))}}function vt(t,e,n){let l=Ae.get(e.changes);if(l)return l;let i=o=>{let{highlightChanges:a,syntaxHighlightDeletions:d,syntaxHighlightDeletionsMaxLength:c,mergeControls:f}=t.facet(D),s=document.createElement("div");if(s.className="cm-deletedChunk",f){let w=s.appendChild(document.createElement("div"));w.className="cm-chunkButtons";let b=C=>{C.preventDefault(),Lt(o,o.posAtDOM(s))},v=C=>{C.preventDefault(),Dt(o,o.posAtDOM(s))};if(typeof f=="function")w.appendChild(f("accept",b)),w.appendChild(f("reject",v));else{let C=w.appendChild(document.createElement("button"));C.name="accept",C.textContent=t.phrase("Accept"),C.onmousedown=b;let B=w.appendChild(document.createElement("button"));B.name="reject",B.textContent=t.phrase("Reject"),B.onmousedown=v}}if(n||e.fromA>=e.toA)return s;let u=o.state.field(N).sliceString(e.fromA,e.endA),h=d&&t.facet(Qe),m=T(),p=e.changes,g=0,A=!1;function T(){let w=s.appendChild(document.createElement("div"));return w.className="cm-deletedLine",w.appendChild(document.createElement("del"))}function I(w,b,v){for(let C=w;C<b;){if(u.charAt(C)==`
2
2
  `){m.firstChild||m.appendChild(document.createElement("br")),m=T(),C++;continue}let B=b,ne=v+(A?" cm-deletedText":""),re=!1,J=u.indexOf(`
3
- `,C);if(J>-1&&J<b&&(B=J),a&&g<p.length){let G=Math.max(0,A?p[g].toA:p[g].fromA);G<=B&&(B=G,A&&g++,re=!0)}if(B>C){let G=document.createTextNode(u.slice(C,B));if(ne){let ie=m.appendChild(document.createElement("span"));ie.className=ne,ie.appendChild(G)}else m.appendChild(G);C=B}re&&(A=!A)}}if(h&&e.toA-e.fromA<=c){let w=h.parser.parse(u),b=0;Ze(w,{style:v=>Ye(t,v)},(v,C,B)=>{v>b&&I(b,v,""),I(v,C,B),b=C}),I(b,u.length,"")}else I(0,u.length,"");return m.firstChild||m.appendChild(document.createElement("br")),s},r=M.widget({block:!0,side:-1,widget:new Pe(i)});return Ae.set(e.changes,r),r}function Lt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(d=>d.fromB<=l&&d.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=t.state.field(N);i.fromB!=i.toB&&i.toA<=o.length&&(r+=t.state.lineBreak);let a=Xe.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:r},o.length);return t.dispatch({effects:te.of({doc:a.apply(o),changes:a}),userEvent:"accept"}),!0}function Dt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(a=>a.fromB<=l&&a.endB>=l);if(!i)return!1;let o=n.field(N).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(o+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function ke(t){let e=new H;for(let n of t.field(k)){let l=t.facet(D).overrideChunk&&Ue(t,n);e.add(n.fromB,n.fromB,vt(t,n,!!l))}return e.finish()}const Mt=U.define({create:t=>ke(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?ke(e.state):t},provide:t=>S.decorations.from(t)}),we=new WeakMap;function Ue(t,e){let n=we.get(e);if(n!==void 0)return n;n=null;let l=t.field(N),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==o&&r<10){let a=[],d=0,c=e.fromA,f=e.fromB;for(let s of e.changes){if(s.fromA<s.toA){d+=s.toA-s.fromA;let u=l.sliceString(c+s.fromA,c+s.toA);if(/\n/.test(u))break e;a.push(M.widget({widget:new St(u),side:-1}).range(f+s.fromB))}s.fromB<s.toB&&a.push(He.range(f+s.fromB,f+s.toB))}d<e.endA-e.fromA-r*2&&(n=a)}return we.set(e,n),n}class St extends Z{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const yt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Et=M.line({class:"cm-inlineChangedLine"});function jt(t,e,n,l){let i=Ue(t,e),r=0;if(!i)return!1;for(let o=t.doc.lineAt(e.fromB);;){for(l&&l.add(o.from,o.from,yt),n.add(o.from,o.from,Et);r<i.length&&i[r].to<=o.to;){let a=i[r++];n.add(a.from,a.to,a.value)}if(o.to>=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const Ot=S.theme({"&":{backgroundColor:"var(--background)",color:"var(--foreground)",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"0.5rem",overflow:"hidden",width:"100%"},"& .cm-scroller":{overflow:"auto",maxHeight:"20rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace'},".cm-content":{padding:"6px 0"},".cm-gutters":{backgroundColor:"var(--muted)",color:"var(--muted-foreground)",border:"none",borderRight:"1px solid var(--border)"},".cm-changedLine":{backgroundColor:"color-mix(in oklch, var(--chart-2) 14%, transparent)"},".cm-changedText":{background:"color-mix(in oklch, var(--chart-2) 32%, transparent)"},".cm-deletedChunk":{backgroundColor:"color-mix(in oklch, var(--destructive) 10%, transparent)"},".cm-deletedText":{background:"color-mix(in oklch, var(--destructive) 28%, transparent)"},".cm-collapsedLines":{background:"var(--muted)",color:"var(--muted-foreground)",padding:"2px 8px"}});function P(t){if(Array.isArray(t))return t.map(P);if(t&&typeof t=="object"){const e={};for(const n of Object.keys(t).sort())e[n]=P(t[n]);return e}return t}function Nt({before:t,after:e}){const n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;const l=new S({state:le.create({doc:e,extensions:[le.readOnly.of(!0),S.editable.of(!1),S.lineWrapping,et(tt,{fallback:!0}),nt(),bt({original:t,mergeControls:!1,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}),Ot]}),parent:n.current});return()=>l.destroy()},[t,e]),L.jsx("div",{ref:n,className:"w-full"})}function Rt({before:t,after:e}){const[n,l]=_.useState(!1);if(!t&&!e)return null;const i=!!(t&&e);return L.jsxs("div",{className:"mt-2",children:[L.jsxs("button",{type:"button",onClick:()=>l(!n),className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?L.jsx(Je,{className:"h-3 w-3"}):L.jsx(Ve,{className:"h-3 w-3"}),i?n?"Hide diff":"Show diff":n?"Hide details":"Show details"]}),n&&(i?L.jsx("div",{className:"mt-2",children:L.jsx(Nt,{before:JSON.stringify(P(t),null,2),after:JSON.stringify(P(e),null,2)})}):L.jsxs("div",{className:"mt-2",children:[L.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-muted-foreground",children:e?"After":"Before"}),L.jsx("pre",{className:ze(_e,"max-h-48 overflow-auto p-2 text-xs"),children:JSON.stringify(e??t,null,2)})]}))]})}export{Rt as J};
3
+ `,C);if(J>-1&&J<b&&(B=J),a&&g<p.length){let G=Math.max(0,A?p[g].toA:p[g].fromA);G<=B&&(B=G,A&&g++,re=!0)}if(B>C){let G=document.createTextNode(u.slice(C,B));if(ne){let ie=m.appendChild(document.createElement("span"));ie.className=ne,ie.appendChild(G)}else m.appendChild(G);C=B}re&&(A=!A)}}if(h&&e.toA-e.fromA<=c){let w=h.parser.parse(u),b=0;Ze(w,{style:v=>Ye(t,v)},(v,C,B)=>{v>b&&I(b,v,""),I(v,C,B),b=C}),I(b,u.length,"")}else I(0,u.length,"");return m.firstChild||m.appendChild(document.createElement("br")),s},r=M.widget({block:!0,side:-1,widget:new Pe(i)});return Ae.set(e.changes,r),r}function Lt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=t.state.field(k).find(d=>d.fromB<=l&&d.endB>=l);if(!i)return!1;let r=t.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=t.state.field(N);i.fromB!=i.toB&&i.toA<=o.length&&(r+=t.state.lineBreak);let a=Xe.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:r},o.length);return t.dispatch({effects:te.of({doc:a.apply(o),changes:a}),userEvent:"accept"}),!0}function Dt(t,e){let{state:n}=t,l=e??n.selection.main.head,i=n.field(k).find(a=>a.fromB<=l&&a.endB>=l);if(!i)return!1;let o=n.field(N).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(o+=n.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function ke(t){let e=new H;for(let n of t.field(k)){let l=t.facet(D).overrideChunk&&Ve(t,n);e.add(n.fromB,n.fromB,vt(t,n,!!l))}return e.finish()}const Mt=V.define({create:t=>ke(t),update(t,e){return e.state.field(k,!1)!=e.startState.field(k,!1)?ke(e.state):t},provide:t=>S.decorations.from(t)}),we=new WeakMap;function Ve(t,e){let n=we.get(e);if(n!==void 0)return n;n=null;let l=t.field(N),i=t.doc,r=l.lineAt(e.endA).number-l.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(r==o&&r<10){let a=[],d=0,c=e.fromA,f=e.fromB;for(let s of e.changes){if(s.fromA<s.toA){d+=s.toA-s.fromA;let u=l.sliceString(c+s.fromA,c+s.toA);if(/\n/.test(u))break e;a.push(M.widget({widget:new St(u),side:-1}).range(f+s.fromB))}s.fromB<s.toB&&a.push(He.range(f+s.fromB,f+s.toB))}d<e.endA-e.fromA-r*2&&(n=a)}return we.set(e,n),n}class St extends Z{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let n=document.createElement("del");return n.className="cm-deletedText",n.textContent=this.text,n}}const yt=new class extends Q{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},Et=M.line({class:"cm-inlineChangedLine"});function jt(t,e,n,l){let i=Ve(t,e),r=0;if(!i)return!1;for(let o=t.doc.lineAt(e.fromB);;){for(l&&l.add(o.from,o.from,yt),n.add(o.from,o.from,Et);r<i.length&&i[r].to<=o.to;){let a=i[r++];n.add(a.from,a.to,a.value)}if(o.to>=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const Ot=S.theme({"&":{backgroundColor:"var(--background)",color:"var(--foreground)",fontSize:"12px",border:"1px solid var(--border)",borderRadius:"0.5rem",overflow:"hidden",width:"100%"},"& .cm-scroller":{overflow:"auto",maxHeight:"20rem",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace'},".cm-content":{padding:"6px 0"},".cm-gutters":{backgroundColor:"var(--muted)",color:"var(--muted-foreground)",border:"none",borderRight:"1px solid var(--border)"},".cm-changedLine":{backgroundColor:"color-mix(in oklch, var(--chart-2) 14%, transparent)"},".cm-changedText":{background:"color-mix(in oklch, var(--chart-2) 32%, transparent)"},".cm-deletedChunk":{backgroundColor:"color-mix(in oklch, var(--destructive) 10%, transparent)"},".cm-deletedText":{background:"color-mix(in oklch, var(--destructive) 28%, transparent)"},".cm-collapsedLines":{background:"var(--muted)",color:"var(--muted-foreground)",padding:"2px 8px"}});function P(t){if(Array.isArray(t))return t.map(P);if(t&&typeof t=="object"){const e={};for(const n of Object.keys(t).sort())e[n]=P(t[n]);return e}return t}function Nt({before:t,after:e}){const n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;const l=new S({state:le.create({doc:e,extensions:[le.readOnly.of(!0),S.editable.of(!1),S.lineWrapping,et(tt,{fallback:!0}),nt(),bt({original:t,mergeControls:!1,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}),Ot]}),parent:n.current});return()=>l.destroy()},[t,e]),L.jsx("div",{ref:n,className:"w-full"})}function Rt({before:t,after:e}){const[n,l]=_.useState(!1);if(!t&&!e)return null;const i=!!(t&&e);return L.jsxs("div",{className:"mt-2",children:[L.jsxs("button",{type:"button",onClick:()=>l(!n),className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?L.jsx(Je,{className:"h-3 w-3"}):L.jsx(Ue,{className:"h-3 w-3"}),i?n?"Hide diff":"Show diff":n?"Hide details":"Show details"]}),n&&(i?L.jsx("div",{className:"mt-2",children:L.jsx(Nt,{before:JSON.stringify(P(t),null,2),after:JSON.stringify(P(e),null,2)})}):L.jsxs("div",{className:"mt-2",children:[L.jsx("p",{className:"mb-1 text-[10px] font-medium uppercase text-muted-foreground",children:e?"After":"Before"}),L.jsx("pre",{className:ze(_e,"max-h-48 overflow-auto p-2 text-xs"),children:JSON.stringify(e??t,null,2)})]}))]})}export{Rt as J};
@@ -1 +1 @@
1
- import{j as s,S as e}from"./index-BUr8321-.js";function m({label:r,actions:l=!1}){return s.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":r,children:Array.from({length:4},(d,a)=>s.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${a===3?"":"border-b"}`,children:[s.jsx(e,{className:"h-7 w-7 shrink-0 rounded-md"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[s.jsx(e,{className:"h-4 w-40"}),s.jsx(e,{className:"h-3 w-24"})]}),l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(e,{className:"h-8 w-8 rounded-md"}),s.jsx(e,{className:"h-8 w-8 rounded-md"})]}):null]},a))})}export{m as L};
1
+ import{j as s,S as e}from"./index-DtRfQcRH.js";function m({label:r,actions:l=!1}){return s.jsx("div",{className:"overflow-hidden rounded-lg border",role:"status","aria-label":r,children:Array.from({length:4},(d,a)=>s.jsxs("div",{className:`flex items-center gap-3 px-3 py-2.5 ${a===3?"":"border-b"}`,children:[s.jsx(e,{className:"h-7 w-7 shrink-0 rounded-md"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[s.jsx(e,{className:"h-4 w-40"}),s.jsx(e,{className:"h-3 w-24"})]}),l?s.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[s.jsx(e,{className:"h-8 w-8 rounded-md"}),s.jsx(e,{className:"h-8 w-8 rounded-md"})]}):null]},a))})}export{m as L};
@@ -0,0 +1 @@
1
+ import{a4 as je,as as we,v as ve,at as ke,a9 as Ne,r,au as se,j as e,s as x,av as Se,aw as A,ax as Ce,ay as Ee,az as Le,ap as Ue,ai as Fe,aq as Pe,aA as re}from"./index-DtRfQcRH.js";import{s as Me}from"./index-1YrrvVJ4.js";import{C as Ie,c as ze}from"./card-4Ull9W6d.js";function R(u){if(!u||typeof u!="object")return null;const p=u.error;if(typeof p=="string")return p;if(p&&typeof p=="object"){const y=p.message;if(typeof y=="string"&&y.length>0)return y}const m=u.message;return typeof m=="string"&&m.length>0?m:null}async function ie(u,p){if(typeof window>"u")return;const m=window.PasswordCredential;if(!(!m||!navigator.credentials?.store))try{const y=new m({id:u,password:p});await navigator.credentials.store(y)}catch{}}function C(u){return u?u.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":u:null}function $e(){const u=je(),p=we(),{session:m,isReady:y}=ve(),{data:a,isLoading:L,error:q}=ke(),o=Ne({from:"/auth/login"}),$=o.invitationOrg,[b,j]=r.useState("social"),[c,U]=r.useState(o.intent??"sign-in"),[B,ae]=r.useState(""),[i,O]=r.useState(()=>o.loginHint??""),[v,oe]=r.useState(""),[k,le]=r.useState(""),[F,H]=r.useState(""),[ce,_]=r.useState(!1),[l,d]=r.useState(null),[P,s]=r.useState(null),[de,V]=r.useState(!1),[ue,J]=r.useState(!1),[Q,me]=r.useState(!1),G=r.useRef(!1),E=o.callbackUrl,K=o.mode==="extension",T=o.error==="account_not_linked",X=C(o.errorDescription||o.error),M=Object.values(a?.social??{}).some(Boolean),N=!!a?.magicLink,I=!!a?.phone,f=!!a?.emailPassword,Y=!!a?.passkey,h=!!a?.singleUserMode,Z=!!a?.hasUser,W=h,w=r.useMemo(()=>{const t=[];return f&&t.push("email-password"),M&&t.push("social"),N&&t.push("magic-link"),I&&t.push("whatsapp"),t},[f,N,M,I]),ge=r.useMemo(()=>f?w.filter(t=>t!=="magic-link"&&t!=="social"):w,[w,f]),D=q instanceof Error?q.message:q?"Unable to load sign-in options.":null;r.useEffect(()=>{if(m){const t=se(E);E?window.location.href=t:u({to:"/"})}},[m,u,E]),r.useEffect(()=>{!a||w.length===0||w.includes(b)||j(w[0])},[a,b,w]),r.useEffect(()=>{!N||!T||(j("magic-link"),o.loginHint&&!i&&O(o.loginHint))},[N,T,o.loginHint,i]),r.useEffect(()=>{o.intent&&U(o.intent)},[o.intent]),r.useEffect(()=>{if(!h||!a)return;const t=Z?"sign-in":"sign-up";c!==t&&U(t)},[h,Z,a,c]);const S=()=>E?se(E):"/",ee=async t=>{d(t),s(null);try{const n=await A.social({provider:t,callbackURL:S(),newUserCallbackURL:E?S():`/?onboard_provider=${encodeURIComponent(t)}`}),g=R(n);if(g){const z=C(g);z?.toLowerCase().includes("magic link")&&j("magic-link"),s(z)}}catch(n){s(C(n instanceof Error?n.message:`Failed to sign in with ${t}`))}finally{d(null)}};r.useEffect(()=>{if(G.current||!y||m||L||!a||o.error)return;const t=o.provider;t&&Object.hasOwn(a.social??{},t)&&a.social?.[t]&&(G.current=!0,ee(t))},[a,L,m,y,o.provider,o.error]);const te=async()=>{if(i){d("magic-link"),s(null);try{return await A.magicLink({email:i,callbackURL:S()}),V(!0),!0}catch(t){return s(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{d(null)}}},pe=async t=>{t.preventDefault(),await te()},fe=async t=>{if(t.preventDefault(),!(!i||!v)){d("email-password"),s(null);try{if(c==="sign-up"){const n=await Ee.email({email:i,password:v,name:B||i.split("@")[0]||"User",callbackURL:S()}),g=R(n);if(g){s(C(g));return}if(await ie(i,v),await p.invalidateQueries({queryKey:["organizations"]}),h&&Y)try{await Le.passkey.addPasskey({name:B||`${navigator.platform||"This device"}`})}catch{}}else{const n=await A.email({email:i,password:v,callbackURL:S()}),g=R(n);if(g){s(C(g));return}if(!n?.data){s("Invalid email or password");return}await ie(i,v)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:R(n);s(g||"Authentication failed")}finally{d(null)}}},ne=async()=>{s(null),me(!0),d("local");try{const t=await Ce();if(!t.ok){const n=await t.json().catch(()=>null);s(n?.error_description??"Could not sign in to your local install.");return}window.location.href=S()}catch(t){s(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{d(null)}};r.useEffect(()=>{W&&a&&!m&&!Q&&ne()},[W,a,m,Q]);const he=async()=>{if(!i){s("Enter your email address first to reset your password.");return}d("reset-password-request"),s(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Ue(`${Fe}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:i,redirectTo:t})});if(!n.ok)throw await Pe(n);J(!0)}catch(t){s(t instanceof Error?t.message:"Failed to send password reset email")}finally{d(null)}},xe=async t=>{if(t.preventDefault(),!!k){d("phone"),s(null);try{await re.sendOtp({phoneNumber:k}),_(!0)}catch(n){s(n instanceof Error?n.message:"Failed to send verification code")}finally{d(null)}}},be=async t=>{if(t.preventDefault(),!(!k||!F)){d("verify"),s(null);try{await re.verify({phoneNumber:k,code:F})}catch(n){s(n instanceof Error?n.message:"Invalid verification code"),d(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:$?`Sign in to join ${$}`:h&&c==="sign-up"?"Set up your local install":h?"Welcome back":c==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:$?"Sign in with the email your invitation was sent to.":h&&c==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":h?"Sign in to your local install.":K?"Sign in to connect the browser extension":c==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),h&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),K&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Ie,{children:e.jsx(ze,{children:W?e.jsx("div",{className:"space-y-4",children:P?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:P}),e.jsx("button",{type:"button",disabled:l!==null,onClick:ne,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(x,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[L&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(x,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!L&&D&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",D]}),!L&&!D&&w.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),f&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>U("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>U("sign-up"),children:"Sign Up"})]}),ge.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[f&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("email-password"),children:"Email + Password"}),M&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("social"),children:"Social"}),!f&&N&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("magic-link"),children:"Magic Link"}),I&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>j("whatsapp"),children:"WhatsApp"})]}),T&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),X&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:X}),P&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:P}),(f||b==="social")&&M&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(a?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Me.find(ye=>ye.provider===t),g=n?.icon,z=n?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>ee(t),disabled:l!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[l===t?e.jsx(x,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):e.jsx(Se,{className:"w-4 h-4"}),"Continue with ",z]},t)}),f&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),f&&e.jsxs("form",{onSubmit:fe,className:"space-y-4",children:[c==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:B,onChange:t=>ae(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:i,onChange:t=>{O(t.target.value),J(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:v,onChange:t=>oe(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!i||!v,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:c==="sign-up"?"Creating account...":"Signing in..."})]}):c==="sign-up"?h?"Create local account":"Create Account":"Sign In"}),c==="sign-in"&&Y&&e.jsx("button",{type:"button",disabled:l!==null,onClick:async()=>{s(null),d("passkey");try{const t=await A.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";s(C(n)??n);return}window.location.href=S()}catch(t){const n=t instanceof Error?t.message:String(t);s(C(n)??n)}finally{d(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),c==="sign-in"&&N&&e.jsx("button",{type:"button",disabled:l!==null||!i,onClick:async()=>{await te()&&j("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),c==="sign-in"&&e.jsx("button",{type:"button",disabled:l!==null||!i,onClick:he,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),c==="sign-in"&&ue&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),b==="magic-link"&&N&&(de?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:i}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>V(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:i,onChange:t=>O(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!i,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),b==="whatsapp"&&I&&(ce?e.jsxs("form",{onSubmit:be,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:k})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:F,onChange:t=>H(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:l!==null||F.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{_(!1),H("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:k,onChange:t=>le(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!k,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(x,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{$e as component};
@@ -0,0 +1 @@
1
+ import{r,ar as n,j as e}from"./index-DtRfQcRH.js";function s(){return r.useEffect(()=>{n().catch(t=>console.error("Sign out failed:",t)).finally(()=>{window.location.href="/"})},[]),e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Signing out..."})})}export{s as component};
@@ -0,0 +1 @@
1
+ import{j as e,S as o,v as c,w as u,a5 as d,bq as h,fg as b,B as g,L as p,a7 as x}from"./index-DtRfQcRH.js";function f({rows:t=5}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading members",children:Array.from({length:t}).map((a,s)=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(o,{className:"h-8 w-8 shrink-0 rounded-full"}),e.jsx(o,{className:"h-4 w-40"})]},s))})}function l({title:t,body:a,ctaLabel:s,showCta:n,callbackUrl:r}){return e.jsx(h,{icon:b,title:t,description:a,children:s&&n?e.jsx(g,{asChild:!0,className:"mt-4",children:e.jsx(p,{to:"/auth/login",search:x({callbackUrl:r,intent:"sign-in"}),children:s})}):null})}function y({children:t}){const{isAuthenticated:a,isReady:s}=c(),{isMember:n,isLoading:r}=u(),i=d({select:m=>m.href});return!s||r?e.jsx(f,{}):a?n?e.jsx(e.Fragment,{children:t}):e.jsx(l,{title:"Join to see members",body:"Emails and member details are only visible to members of this workspace. Use the banner above to join.",callbackUrl:i}):e.jsx(l,{title:"Sign in to see members",body:"The members of this workspace are only visible to people who have signed in.",ctaLabel:"Sign in",showCta:!0,callbackUrl:i})}export{y as M};