@rubytech/create-sitedesk-code 0.1.387 → 0.1.389

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 (296) hide show
  1. package/dist/__tests__/joblogic-excluded.test.js +39 -0
  2. package/dist/index.js +21 -0
  3. package/package.json +1 -1
  4. package/payload/platform/config/brand.json +3 -3
  5. package/payload/platform/plugins/.claude-plugin/marketplace.json +0 -10
  6. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +21 -2
  7. package/payload/platform/plugins/docs/references/admin-session.md +4 -0
  8. package/payload/platform/plugins/docs/references/admin-ui.md +18 -1
  9. package/payload/platform/plugins/docs/references/joblogic.md +2 -0
  10. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +7 -3
  11. package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +2 -0
  12. package/payload/platform/plugins/work/PLUGIN.md +3 -0
  13. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.d.ts +2 -0
  14. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.d.ts.map +1 -0
  15. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.js +98 -0
  16. package/payload/platform/plugins/work/mcp/dist/__tests__/session-metering.test.js.map +1 -0
  17. package/payload/platform/plugins/work/mcp/dist/index.js +16 -0
  18. package/payload/platform/plugins/work/mcp/dist/index.js.map +1 -1
  19. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.d.ts +53 -0
  20. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.d.ts.map +1 -0
  21. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.js +80 -0
  22. package/payload/platform/plugins/work/mcp/dist/tools/session-metering.js.map +1 -0
  23. package/payload/platform/plugins/work/mcp/package.json +2 -1
  24. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  25. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
  26. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  27. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  28. package/payload/platform/services/claude-session-manager/dist/http-server.js +98 -8
  29. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  30. package/payload/platform/services/claude-session-manager/dist/pricing.d.ts +45 -0
  31. package/payload/platform/services/claude-session-manager/dist/pricing.d.ts.map +1 -0
  32. package/payload/platform/services/claude-session-manager/dist/pricing.js +57 -0
  33. package/payload/platform/services/claude-session-manager/dist/pricing.js.map +1 -0
  34. package/payload/platform/services/claude-session-manager/dist/session-metering.d.ts +38 -0
  35. package/payload/platform/services/claude-session-manager/dist/session-metering.d.ts.map +1 -0
  36. package/payload/platform/services/claude-session-manager/dist/session-metering.js +292 -0
  37. package/payload/platform/services/claude-session-manager/dist/session-metering.js.map +1 -0
  38. package/payload/platform/templates/specialists/agents/project-manager.md +1 -1
  39. package/payload/premium-plugins/.claude-plugin/marketplace.json +0 -15
  40. package/payload/server/public/assets/{AdminLoginScreens-BejIjbmU.js → AdminLoginScreens-CerrEc_m.js} +1 -1
  41. package/payload/server/public/assets/AdminShell-cRTvNRbo.js +1 -0
  42. package/payload/server/public/assets/{Checkbox-1F1tzqca.js → Checkbox-Dh2pLMFN.js} +1 -1
  43. package/payload/server/public/assets/{Transcript-DkGa4CQH.js → Transcript-B_GVJujB.js} +1 -1
  44. package/payload/server/public/assets/{admin-DqQARkjy.js → admin-BXaYelnR.js} +1 -1
  45. package/payload/server/public/assets/{browser-nDtEK6RC.js → browser-fhjGE7fH.js} +1 -1
  46. package/payload/server/public/assets/calendar-PnZudAtc.js +1 -0
  47. package/payload/server/public/assets/chat-Dy_zrjKS.js +1 -0
  48. package/payload/server/public/assets/chevron-left-IB6TmMZ_.js +1 -0
  49. package/payload/server/public/assets/data-B2IcjAj6.js +1 -0
  50. package/payload/server/public/assets/{graph-DFyicKd7.js → graph-CycO3tkW.js} +2 -2
  51. package/payload/server/public/assets/{graph-labels-D3BQdcpD.js → graph-labels-DlSsSpBV.js} +1 -1
  52. package/payload/server/public/assets/{operator-BxrjWdT9.js → operator-L4kBC-zS.js} +1 -1
  53. package/payload/server/public/assets/page-D5E-Ng4D.js +1 -0
  54. package/payload/server/public/assets/page-M8sD9LOi.js +32 -0
  55. package/payload/server/public/assets/{public-DbdqfdYq.js → public-BmnajF3K.js} +1 -1
  56. package/payload/server/public/assets/{rotate-ccw-BkX8HODe.js → rotate-ccw-W5HhvAbo.js} +1 -1
  57. package/payload/server/public/assets/useSubAccountSwitcher-D1TI1xvd.css +1 -0
  58. package/payload/server/public/assets/useSubAccountSwitcher-UqZbmzYy.js +9 -0
  59. package/payload/server/public/browser.html +4 -4
  60. package/payload/server/public/calendar.html +5 -5
  61. package/payload/server/public/chat.html +8 -8
  62. package/payload/server/public/data.html +7 -7
  63. package/payload/server/public/graph.html +8 -8
  64. package/payload/server/public/index.html +10 -10
  65. package/payload/server/public/operator.html +10 -10
  66. package/payload/server/public/public.html +8 -8
  67. package/payload/server/server.js +444 -315
  68. package/payload/platform/plugins/joblogic/.claude-plugin/plugin.json +0 -21
  69. package/payload/platform/plugins/joblogic/PLUGIN.md +0 -182
  70. package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/index.js +0 -193
  71. package/payload/platform/plugins/joblogic/lib/mcp-spawn-tee/package.json +0 -3
  72. package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts +0 -2
  73. package/payload/platform/plugins/joblogic/mcp/dist/index.d.ts.map +0 -1
  74. package/payload/platform/plugins/joblogic/mcp/dist/index.js +0 -229
  75. package/payload/platform/plugins/joblogic/mcp/dist/index.js.map +0 -1
  76. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts +0 -31
  77. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.d.ts.map +0 -1
  78. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js +0 -78
  79. package/payload/platform/plugins/joblogic/mcp/dist/lib/auth.js.map +0 -1
  80. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts +0 -35
  81. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.d.ts.map +0 -1
  82. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js +0 -106
  83. package/payload/platform/plugins/joblogic/mcp/dist/lib/client.js.map +0 -1
  84. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts +0 -8
  85. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.d.ts.map +0 -1
  86. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js +0 -41
  87. package/payload/platform/plugins/joblogic/mcp/dist/lib/idempotency.js.map +0 -1
  88. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts +0 -21
  89. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.d.ts.map +0 -1
  90. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js +0 -47
  91. package/payload/platform/plugins/joblogic/mcp/dist/lib/secrets.js.map +0 -1
  92. package/payload/platform/plugins/joblogic/mcp/package.json +0 -10
  93. package/payload/platform/plugins/joblogic/skills/joblogic/SKILL.md +0 -32
  94. package/payload/platform/plugins/sales/.claude-plugin/plugin.json +0 -8
  95. package/payload/platform/plugins/sales/PLUGIN.md +0 -106
  96. package/payload/platform/plugins/sales/references/close-tracking.md +0 -69
  97. package/payload/platform/plugins/sales/references/comparisons.md +0 -99
  98. package/payload/platform/plugins/sales/references/competitive-positioning.md +0 -51
  99. package/payload/platform/plugins/sales/references/faq.md +0 -73
  100. package/payload/platform/plugins/sales/references/objection-handling.md +0 -157
  101. package/payload/platform/plugins/sales/references/pricing.md +0 -101
  102. package/payload/premium-plugins/teaching/.claude-plugin/plugin.json +0 -8
  103. package/payload/premium-plugins/teaching/PLUGIN.md +0 -58
  104. package/payload/premium-plugins/teaching/skills/interactive-tutor/SKILL.md +0 -59
  105. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/assessment.md +0 -70
  106. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +0 -43
  107. package/payload/premium-plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +0 -83
  108. package/payload/premium-plugins/teaching/skills/lesson-planner/SKILL.md +0 -48
  109. package/payload/premium-plugins/teaching/skills/lesson-planner/references/context-gathering.md +0 -41
  110. package/payload/premium-plugins/teaching/skills/lesson-planner/references/plan-structure.md +0 -94
  111. package/payload/premium-plugins/teaching/skills/study-pack-builder/SKILL.md +0 -52
  112. package/payload/premium-plugins/teaching/skills/study-pack-builder/references/disaggregation.md +0 -49
  113. package/payload/premium-plugins/teaching/skills/study-pack-builder/references/materials.md +0 -116
  114. package/payload/premium-plugins/venture-studio/.claude-plugin/plugin.json +0 -8
  115. package/payload/premium-plugins/venture-studio/PLUGIN.md +0 -128
  116. package/payload/premium-plugins/venture-studio/bin/scaffold.sh +0 -116
  117. package/payload/premium-plugins/venture-studio/skills/brand-pack/SKILL.md +0 -256
  118. package/payload/premium-plugins/venture-studio/skills/brand-pack/references/color-psychology.md +0 -118
  119. package/payload/premium-plugins/venture-studio/skills/investor-data-room/SKILL.md +0 -436
  120. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/business-plan-template.md +0 -64
  121. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitive-battlecard.md +0 -37
  122. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/competitor-analysis.md +0 -32
  123. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/compliance-research-checklist.md +0 -53
  124. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/data-room-structure.md +0 -88
  125. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/deck-blueprint-template.md +0 -39
  126. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/design-tokens-application.md +0 -79
  127. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/html-pdf-pipeline.md +0 -236
  128. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/internal-workings-scrub.md +0 -33
  129. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/monetization-strategy.md +0 -35
  130. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/pricing-strategy.md +0 -37
  131. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/strategy-frameworks.md +0 -46
  132. package/payload/premium-plugins/venture-studio/skills/investor-data-room/references/termsheet-template.md +0 -88
  133. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/index.html +0 -1565
  134. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/render-pdf.mjs +0 -91
  135. package/payload/premium-plugins/venture-studio/skills/investor-data-room/templates/prospectus/term_sheet.html +0 -715
  136. package/payload/premium-plugins/venture-studio/skills/legal-essentials/SKILL.md +0 -65
  137. package/payload/premium-plugins/venture-studio/skills/office-hours/SKILL.md +0 -587
  138. package/payload/premium-plugins/venture-studio/skills/prototype-host/SKILL.md +0 -179
  139. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/cloudflared-ingress-edit.md +0 -81
  140. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/scaffold-frameworks.md +0 -60
  141. package/payload/premium-plugins/venture-studio/skills/prototype-host/references/systemd-user-service.md +0 -104
  142. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/SKILL.md +0 -342
  143. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/aarrr-metrics.md +0 -275
  144. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/assumption-testing.md +0 -93
  145. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/boolean-search.md +0 -308
  146. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/build-measure-learn.md +0 -262
  147. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/business-model-canvas.md +0 -171
  148. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/commitment-signals.md +0 -246
  149. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/design-thinking.md +0 -183
  150. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/earlyvangelist.md +0 -190
  151. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/first-principles.md +0 -58
  152. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/fishbone.md +0 -114
  153. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/five-whys.md +0 -43
  154. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/ice-scoring.md +0 -237
  155. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/innovation-accounting.md +0 -290
  156. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/jtbd.md +0 -105
  157. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/landing-page.md +0 -361
  158. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-sizing.md +0 -58
  159. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/market-type.md +0 -167
  160. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mom-test.md +0 -193
  161. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/mvp-types.md +0 -200
  162. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/og-images.md +0 -239
  163. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pareto.md +0 -103
  164. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/persona-development.md +0 -291
  165. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pivot-types.md +0 -225
  166. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/positioning-statement.md +0 -179
  167. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/prd.md +0 -363
  168. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/pre-mortem.md +0 -74
  169. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/problem-validation.md +0 -253
  170. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/product-market-fit.md +0 -256
  171. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/research-synthesis.md +0 -276
  172. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/strategy-red-team.md +0 -41
  173. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/three-engines-of-growth.md +0 -248
  174. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/validation-tests.md +0 -89
  175. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/value-proposition-canvas.md +0 -121
  176. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/win-loss-analysis.md +0 -242
  177. package/payload/premium-plugins/venture-studio/skills/zero-to-prototype/references/workflow-mapping.md +0 -271
  178. package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +0 -21
  179. package/payload/premium-plugins/writer-craft/PLUGIN.md +0 -134
  180. package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +0 -108
  181. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts +0 -8
  182. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts.map +0 -1
  183. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js +0 -71
  184. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js.map +0 -1
  185. package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/package.json +0 -7
  186. package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/index.js +0 -193
  187. package/payload/premium-plugins/writer-craft/lib/mcp-spawn-tee/package.json +0 -3
  188. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts +0 -51
  189. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts.map +0 -1
  190. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js +0 -196
  191. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js.map +0 -1
  192. package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/package.json +0 -7
  193. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts +0 -3
  194. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts.map +0 -1
  195. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js +0 -58
  196. package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js.map +0 -1
  197. package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts +0 -3
  198. package/payload/premium-plugins/writer-craft/mcp/dist/index.d.ts.map +0 -1
  199. package/payload/premium-plugins/writer-craft/mcp/dist/index.js +0 -403
  200. package/payload/premium-plugins/writer-craft/mcp/dist/index.js.map +0 -1
  201. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts +0 -14
  202. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.d.ts.map +0 -1
  203. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js +0 -47
  204. package/payload/premium-plugins/writer-craft/mcp/dist/lib/neo4j.js.map +0 -1
  205. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts +0 -117
  206. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.d.ts.map +0 -1
  207. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js +0 -138
  208. package/payload/premium-plugins/writer-craft/mcp/dist/lib/voice-corpus.js.map +0 -1
  209. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts +0 -90
  210. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.d.ts.map +0 -1
  211. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js +0 -609
  212. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-distil-profile.js.map +0 -1
  213. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts +0 -19
  214. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.d.ts.map +0 -1
  215. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js +0 -124
  216. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-ingest-session-text.js.map +0 -1
  217. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts +0 -38
  218. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.d.ts.map +0 -1
  219. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js +0 -93
  220. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-record-feedback.js.map +0 -1
  221. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts +0 -61
  222. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +0 -1
  223. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js +0 -171
  224. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-retrieve-conditioning.js.map +0 -1
  225. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts +0 -35
  226. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.d.ts.map +0 -1
  227. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js +0 -127
  228. package/payload/premium-plugins/writer-craft/mcp/dist/tools/voice-tag-content.js.map +0 -1
  229. package/payload/premium-plugins/writer-craft/mcp/package-lock.json +0 -1327
  230. package/payload/premium-plugins/writer-craft/mcp/package.json +0 -19
  231. package/payload/premium-plugins/writer-craft/mcp/scripts/smoke.mjs +0 -420
  232. package/payload/premium-plugins/writer-craft/mcp/src/index.ts +0 -457
  233. package/payload/premium-plugins/writer-craft/mcp/src/lib/neo4j.ts +0 -56
  234. package/payload/premium-plugins/writer-craft/mcp/src/lib/voice-corpus.ts +0 -154
  235. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +0 -833
  236. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-ingest-session-text.ts +0 -153
  237. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +0 -148
  238. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +0 -270
  239. package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +0 -181
  240. package/payload/premium-plugins/writer-craft/mcp/tsconfig.json +0 -8
  241. package/payload/premium-plugins/writer-craft/skills/citation-style/SKILL.md +0 -94
  242. package/payload/premium-plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +0 -77
  243. package/payload/premium-plugins/writer-craft/skills/citation-style/references/citation-rules.md +0 -103
  244. package/payload/premium-plugins/writer-craft/skills/citation-style/references/journal-article-models.md +0 -74
  245. package/payload/premium-plugins/writer-craft/skills/citation-style/references/other-source-models.md +0 -146
  246. package/payload/premium-plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +0 -70
  247. package/payload/premium-plugins/writer-craft/skills/editorial-practice/SKILL.md +0 -108
  248. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/copyediting.md +0 -73
  249. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +0 -85
  250. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +0 -78
  251. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/line-editing.md +0 -55
  252. package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/self-editing.md +0 -89
  253. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +0 -114
  254. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +0 -73
  255. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +0 -76
  256. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +0 -67
  257. package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +0 -86
  258. package/payload/premium-plugins/writer-craft/skills/point-of-view/SKILL.md +0 -97
  259. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +0 -72
  260. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +0 -91
  261. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +0 -71
  262. package/payload/premium-plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +0 -85
  263. package/payload/premium-plugins/writer-craft/skills/prose-craft/SKILL.md +0 -100
  264. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +0 -72
  265. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/repetition.md +0 -71
  266. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +0 -64
  267. package/payload/premium-plugins/writer-craft/skills/prose-craft/references/word-economy.md +0 -93
  268. package/payload/premium-plugins/writer-craft/skills/reader-engagement/SKILL.md +0 -100
  269. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +0 -79
  270. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +0 -81
  271. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +0 -67
  272. package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +0 -94
  273. package/payload/premium-plugins/writer-craft/skills/review-manuscript/SKILL.md +0 -111
  274. package/payload/premium-plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +0 -119
  275. package/payload/premium-plugins/writer-craft/skills/review-prose/SKILL.md +0 -99
  276. package/payload/premium-plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +0 -112
  277. package/payload/premium-plugins/writer-craft/skills/review-scene/SKILL.md +0 -99
  278. package/payload/premium-plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +0 -95
  279. package/payload/premium-plugins/writer-craft/skills/story-architecture/SKILL.md +0 -106
  280. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +0 -118
  281. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +0 -66
  282. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +0 -87
  283. package/payload/premium-plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +0 -82
  284. package/payload/premium-plugins/writer-craft/skills/story-blueprint/SKILL.md +0 -133
  285. package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +0 -118
  286. package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +0 -128
  287. package/payload/premium-plugins/writer-craft/skills/voice-mirror/SKILL.md +0 -241
  288. package/payload/server/public/assets/AdminShell-D2-uBSB5.js +0 -1
  289. package/payload/server/public/assets/calendar-CO4Bwmho.js +0 -1
  290. package/payload/server/public/assets/chat-DeIge_bC.js +0 -1
  291. package/payload/server/public/assets/chevron-left-DhVdq0aN.js +0 -1
  292. package/payload/server/public/assets/data-B1GIdzHk.js +0 -1
  293. package/payload/server/public/assets/page-ByDLq_o1.js +0 -1
  294. package/payload/server/public/assets/page-D-Ep4bXd.js +0 -32
  295. package/payload/server/public/assets/useSubAccountSwitcher-DMbRhLPv.js +0 -9
  296. package/payload/server/public/assets/useSubAccountSwitcher-DS0iqSkP.css +0 -1
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-CAM3fms7.js";import{C as t,D as n,L as r,M as i,P as a,_ as o,a as s,c,d as ee,f as l,g as te,h as ne,i as u,m as d,n as f,o as p,r as re,t as ie,u as ae,v as oe,w as se,x as ce,y as m}from"./useSubAccountSwitcher-DMbRhLPv.js";import{t as h}from"./chevron-left-DhVdq0aN.js";import{i as le}from"./Transcript-DkGa4CQH.js";import{i as ue,t as de}from"./graph-labels-D3BQdcpD.js";var fe=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),pe=n(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),me=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),he=n(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ge=n(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),_e=n(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),g=n(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ve=n(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);function ye(e){let t=new Set,n=[];for(let r of e)for(let e of r.labels)e&&(t.has(e)||de.has(e)&&(t.add(e),n.push(e)));return n}var _=e(r(),1),v=i();function y(e){if(!e)return``;let t=new Date(e).getTime();return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function be({conversations:e,sessionKey:t,onBack:n}){let[r,i]=(0,_.useState)(null),a=s(e);return r?(0,v.jsxs)(`div`,{className:`op-conv op-conv-reader`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:()=>i(null),"aria-label":`Back to conversations`,children:[(0,v.jsx)(h,{size:16}),` Back`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:p(r)})]}),(0,v.jsx)(le,{sessionId:r.sessionId,projectDir:r.projectDir,sessionKey:t,forceDeliveredOnly:!0,suppressDirectives:r.source===`store`,store:r.source===`store`?{accountId:r.accountId,remoteJid:r.remoteJid}:void 0},c(r))]}):(0,v.jsxs)(`div`,{className:`op-conv op-conv-list`,children:[(0,v.jsxs)(`div`,{className:`op-conv-bar`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-back`,onClick:n,"aria-label":`Back to chat`,children:[(0,v.jsx)(h,{size:16}),` Chat`]}),(0,v.jsx)(`span`,{className:`op-conv-title`,children:`Conversations`})]}),a.map(e=>(0,v.jsxs)(`div`,{className:`op-conv-group`,children:[(0,v.jsxs)(`div`,{className:`op-conv-group-head`,children:[(0,v.jsx)(ae,{channel:e.channel,size:14}),e.label]}),e.rows.map(e=>(0,v.jsxs)(`button`,{type:`button`,className:`op-conv-row`,onClick:()=>{console.info(`[operator-ui] op=reader-open channel=${e.channel} key=${c(e)} readonly=true source=${e.source}`),i(e)},children:[(0,v.jsx)(`span`,{className:`op-conv-name`,children:p(e)}),e.modelGated&&(0,v.jsx)(`span`,{className:`op-conv-gated`,role:`img`,"aria-label":`Model unavailable`,children:(0,v.jsx)(g,{size:13})}),(0,v.jsx)(`span`,{className:`op-conv-when`,children:y(e.lastMessageAt)})]},c(e)))]},e.channel))]})}var b=/\.(png|jpe?g|gif|webp|svg)$/i;function xe(e){return b.test(e)}var Se=`maxy-data-view`,Ce=95*1024*1024,we=48*1024*1024;function Te(){return typeof window>`u`?`list`:window.localStorage.getItem(Se)===`grid`?`grid`:`list`}function Ee(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,v.jsx)(l,{cacheKey:e,surface:`data`,onSessionExpired:({code:e,path:t})=>{console.warn(`[admin-auth] outcome=session-expired-redirect code=${e} path=${t} surface=data`);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},children:(0,v.jsx)(`div`,{className:`data-page data-page-full`,children:(0,v.jsx)(x,{cacheKey:e})})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-empty`,children:[(0,v.jsx)(`p`,{children:`You are not signed in.`}),(0,v.jsxs)(`p`,{children:[`Open the `,(0,v.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})}):(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:18,className:`spin`}),` Loading…`]})})}function x({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(w,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})}function De(){if(typeof window>`u`)return`.`;let e=new URLSearchParams(window.location.hash.replace(/^#/,``)).get(`path`);return e&&e.length>0?e:`.`}function Oe(e){if(typeof window>`u`)return;let t=new URL(window.location.href);t.hash=e===`.`?``:`path=${encodeURIComponent(e)}`,window.history.replaceState(window.history.state,``,t.toString())}function ke(e){return new Promise((t,n)=>{let r=[],i=()=>e.readEntries(e=>{e.length===0?t(r):(r.push(...e),i())},n);i()})}function S(e){return new Promise((t,n)=>e.file(t,n))}async function Ae(e,t=``){let n=[];for(let r of e){if(!r)continue;let e=t?`${t}/${r.name}`:r.name;if(r.isFile)n.push({file:await S(r),relpath:e});else if(r.isDirectory){let t=await ke(r.createReader());n.push(...await Ae(t,e))}}return n}function je(e,t){if(e===422&&typeof t==`string`){if(/exceeds the .* limit/i.test(t))return`size`;if(/unsupported file type/i.test(t))return`mime`}return`http=${e}`}function C({adminFetch:e,cacheKey:n,sessionRefetchNonce:r}){let[i,a]=(0,_.useState)(``),s=(0,_.useRef)(null),[c,ee]=(0,_.useState)(``),[l,p]=(0,_.useState)(null),[ie,ae]=(0,_.useState)(`hybrid`),[h,le]=(0,_.useState)(!1),[de,g]=(0,_.useState)(null),[y,be]=(0,_.useState)(null),[b,Ee]=(0,_.useState)(0),[x,ke]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>De()),[w,Me]=(0,_.useState)(null),[T,Fe]=(0,_.useState)(()=>Te()),[E,Re]=(0,_.useState)(null),[D,ze]=(0,_.useState)([]),[O,Be]=(0,_.useState)(!1),[Ve,He]=(0,_.useState)(null),[Ue,We]=(0,_.useState)(!1),[k,A]=(0,_.useState)(null),[Ge,j]=(0,_.useState)(null),[Ke,qe]=(0,_.useState)(null),[Je,Ye]=(0,_.useState)(!1),[Xe,Ze]=(0,_.useState)(null),M=(0,_.useRef)(null),[Qe,N]=(0,_.useState)(0),[$e,P]=(0,_.useState)(!1),[et,tt]=(0,_.useState)(``),[F,I]=(0,_.useState)(null),[nt,rt]=(0,_.useState)(``),[it,L]=(0,_.useState)(null),R=(()=>{let e=S===`.`?[]:S.split(`/`).filter(Boolean);return e.length>=2&&e[0]===`accounts`})(),[z,B]=(0,_.useState)(!1),at=(0,_.useRef)(null),[V,H]=(0,_.useState)(!1),ot=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=i.trim();if(!e){ee(``),p(null),g(null);return}ke(!1);let t=setTimeout(()=>ee(e),300);return()=>clearTimeout(t)},[i]),(0,_.useEffect)(()=>{if(!c){le(!1);return}let t=!1;return le(!0),g(null),e(`/api/admin/graph-search?q=${encodeURIComponent(c)}&labels=FileArtifact&limit=20${x?`&threshold=0`:``}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(p(e.results),ae(e.mode??`hybrid`),Ee(typeof e.suppressed==`number`?e.suppressed:0))}).catch(e=>{t||g(e instanceof Error?e.message:String(e))}).finally(()=>{t||le(!1)}),()=>{t=!0}},[c,e,r,x]);let st=(0,_.useMemo)(()=>l?ye(l):[],[l]),U=y&&st.includes(y)?y:null,W=(0,_.useMemo)(()=>l?U?l.filter(e=>e.labels.includes(U)):l:null,[l,U]),ct=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=document.createElement(`a`);i.href=r,i.rel=`noopener noreferrer`,document.body.appendChild(i),i.click(),i.remove()},[n]);(0,_.useEffect)(()=>{if(!l)return;let e=l.filter(e=>{let t=e.properties.relativePath;return typeof t!=`string`||t.length===0});e.length>0&&console.warn(`[data-search] op=locate-link-missing nodeId=${e.map(e=>e.nodeId).join(`,`)}`)},[l]),(0,_.useEffect)(()=>{let t=!1;return Be(!0),He(null),e(`/api/admin/files?path=${encodeURIComponent(S===`.`?``:S)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(Me(e.entries),ze(e.displayPath??[]))}).catch(e=>{t||(Me([]),ze([]),He(e instanceof Error?e.message:String(e)))}).finally(()=>{t||Be(!1)}),()=>{t=!0}},[e,S,Qe,r]),(0,_.useEffect)(()=>{Oe(S)},[S]);let lt=(0,_.useCallback)(()=>{N(e=>e+1)},[]),G=(0,_.useCallback)(e=>{B(!1),C(e)},[]),ut=(0,_.useCallback)(e=>{let t=e.properties.relativePath;if(typeof t!=`string`||t.length===0)return;let n=t.lastIndexOf(`/`),r=n===-1?`.`:t.slice(0,n);console.log(`[data-search] op=locate nodeId=${e.nodeId} folder=${r}`),a(``),g(null),be(null),G(r)},[G]),dt=(0,_.useCallback)(()=>{if(S===`.`||S===``)return;let e=S.split(`/`).filter(Boolean);e.pop(),C(e.length===0?`.`:e.join(`/`))},[S]),ft=(0,_.useCallback)(e=>{re(n,S===`.`?e.name:`${S}/${e.name}`)},[S,n]),[K,pt]=(0,_.useState)(!1),[q,mt]=(0,_.useState)(new Set),ht=(0,_.useRef)(null),J=(0,_.useRef)(!1),Y=typeof navigator<`u`&&typeof navigator.share==`function`&&typeof navigator.canShare==`function`,gt=(0,_.useCallback)(e=>{pt(!0),mt(new Set([e])),console.info(`[data-ui] op=select-enter count=1`)},[]),X=(0,_.useCallback)(e=>{pt(!1),mt(new Set),console.info(`[data-ui] op=select-exit reason=${e}`)},[]),Z=(0,_.useCallback)(e=>{mt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),_t=(0,_.useCallback)(e=>{J.current=!1,ht.current=setTimeout(()=>{J.current=!0,gt(e)},500)},[gt]),Q=(0,_.useCallback)(()=>{ht.current&&=(clearTimeout(ht.current),null)},[]),vt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}ft(e)},[K,Z,ft]),yt=(0,_.useCallback)(e=>{Fe(e),typeof window<`u`&&window.localStorage.setItem(Se,e),console.info(`[data] op=view-mode mode=${e}`)},[]),bt=(0,_.useCallback)(e=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}Re({src:f(n,S===`.`?e.name:`${S}/${e.name}`),alt:e.displayName??e.name})},[K,Z,S,n]),xt=(0,_.useCallback)(()=>(w??[]).filter(e=>e.kind===`file`&&q.has(e.name)),[w,q]),St=(0,_.useCallback)(()=>(w??[]).filter(e=>(e.kind===`file`||e.kind===`directory`)&&q.has(e.name)),[w,q]),Ct=(0,_.useCallback)(()=>{let e=St(),t=e.some(e=>e.kind===`directory`);e.length===1&&!t?ft(e[0]):e.length>=1&&u(n,e.map(e=>S===`.`?e.name:`${S}/${e.name}`)),X(`action`)},[St,ft,S,n,X]),wt=(0,_.useCallback)(async()=>{let t=xt(),n=t.filter(e=>!e.protected),r=t.length-n.length;Ze(r>0?`${r} protected file(s) kept`:null);for(let t of n){let n=S===`.`?t.name:`${S}/${t.name}`;try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`)}catch(e){Ze(e instanceof Error?e.message:String(e))}}N(e=>e+1),X(`action`)},[xt,S,e,X]),Tt=(0,_.useCallback)(async()=>{let e=xt();if(console.info(`[data-ui] op=share supported=${Y} count=${e.length}`),Y)try{let t=await Promise.all(e.map(async e=>{let t=S===`.`?e.name:`${S}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,i=await(await fetch(r)).blob();return new File([i],e.name,{type:i.type||`application/octet-stream`})}));navigator.canShare({files:t})&&await navigator.share({files:t})}catch(e){console.warn(`[data-ui] op=share-failed err=${e instanceof Error?e.message:String(e)}`)}},[xt,Y,S,n]),Et=(0,_.useCallback)(()=>{M.current?.click()},[]),Dt=(0,_.useCallback)((e,t={})=>{let r=(r,i,a)=>{let o=new URLSearchParams({session_key:n,path:S===`.`?``:S,filename:e.name});t.relpath&&o.set(`relpath`,t.relpath),t.token&&o.set(`token`,t.token);for(let[e,t]of Object.entries(i))o.set(e,t);return new Promise(t=>{let n=new XMLHttpRequest;n.open(`POST`,`/api/admin/files/upload?${o.toString()}`),n.setRequestHeader(`Content-Type`,e.type||`application/octet-stream`),a&&(n.upload.onprogress=e=>{e.lengthComputable&&a(e.loaded)}),n.onload=()=>{let e={};try{e=JSON.parse(n.responseText)}catch{}t({status:n.status,data:e})},n.onerror=()=>t({status:0,data:{}}),n.onabort=()=>t({status:0,data:{error:`aborted`}}),n.send(r)})};if(e.size<=Ce)return r(e,{},n=>t.onProgress?.(n,e.size));let i=`${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`,a=Math.ceil(e.size/we);return(async()=>{let n={status:0,data:{}};for(let o=0;o<a;o++){let s=o*we;if(n=await r(e.slice(s,Math.min(s+we,e.size)),{uploadId:i,seq:String(o),total:String(a)},n=>t.onProgress?.(s+n,e.size)),!(n.status>=200&&n.status<300))return n}return n})()},[n,S]),Ot=(0,_.useCallback)(async e=>{j(null),We(!0),A({loaded:0,total:e.size});try{let{status:t,data:n}=await Dt(e,{onProgress:(e,t)=>A({loaded:e,total:t})});t>=200&&t<300&&n.path?(C(n.path.split(`/`).slice(0,-1).join(`/`)||`.`),N(e=>e+1)):j(t===0?`Network error during upload — the connection failed before the server responded.`:n.error??`Upload failed (HTTP ${t}).`)}finally{We(!1),A(null),M.current&&(M.current.value=``)}},[Dt]),kt=(0,_.useCallback)(e=>{R&&Array.from(e.dataTransfer.types).includes(`Files`)&&(e.preventDefault(),Ye(!0))},[R]),At=(0,_.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||Ye(!1)},[]),jt=(0,_.useCallback)(async e=>{e.preventDefault(),Ye(!1);let t=Math.random().toString(16).slice(2,10),n=Array.from(e.dataTransfer.items);if(console.info(`[data-ui] op=drop-received token=${t} items=${n.length}`),n.length===0)return;if(!R){console.info(`[data-ui] op=drop-rejected token=${t} reason=no-write`),j(`Open a folder inside your account to upload`);return}let r=n.map(e=>e.webkitGetAsEntry?.()).filter(e=>!!e);We(!0),j(null),qe(null);let i=performance.now();try{let e=await Ae(r),n=e.reduce((e,t)=>e+t.file.size,0),a=new Set(e.map(e=>e.relpath.split(`/`).slice(0,-1).join(`/`)).filter(Boolean)).size;console.info(`[data-ui] op=drop-walk token=${t} files=${e.length} dirs=${a} bytes=${n}`);let o=0,s=[];for(let n=0;n<e.length;n++){let{file:r,relpath:i}=e[n];console.info(`[data-ui] op=drop-file token=${t} rel="${i}" i=${n+1}/${e.length}`),A({loaded:0,total:r.size});let{status:a,data:c}=await Dt(r,{relpath:i,token:t,onProgress:(e,t)=>A({loaded:e,total:t})});if(a>=200&&a<300)o++,console.info(`[data-ui] op=drop-file-ok token=${t} rel="${i}"`);else{let e=a===0?`http=0`:je(a,c.error);s.push(`${i} (${e})`),console.info(`[data-ui] op=drop-file-skip token=${t} rel="${i}" reason=${e}`)}}let c=Math.round(performance.now()-i);console.info(`[data-ui] op=drop-done token=${t} uploaded=${o} skipped=${s.length} ms=${c}`),qe(`Uploaded ${o}, skipped ${s.length}${s.length?`: ${s.join(`, `)}`:``}`),N(e=>e+1)}catch(e){j(e instanceof Error?e.message:String(e))}finally{We(!1),A(null)}},[R,Dt]),Mt=(0,_.useCallback)(async()=>{let t=et.trim();if(t){L(null);try{let n=await e(`/api/admin/files/folder`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:S===`.`?``:S,name:t})}),r=await n.json().catch(()=>({error:`HTTP ${n.status}`}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);P(!1),tt(``),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}}},[e,et,S]),Nt=(0,_.useCallback)(async()=>{if(!F)return;let t=nt.trim();if(!t)return;L(null);let n=S===`.`?F:`${S}/${F}`;try{let r=await e(`/api/admin/files/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({path:n,newName:t})}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);I(null),rt(``),X(`action`),N(e=>e+1)}catch(e){L(e instanceof Error?e.message:String(e))}},[e,nt,F,S,X]);(0,_.useEffect)(()=>{if(!z)return;let e=e=>{at.current&&!at.current.contains(e.target)&&B(!1)},t=e=>{e.key===`Escape`&&B(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[z]),(0,_.useEffect)(()=>{if(!V)return;let e=e=>{ot.current&&!ot.current.contains(e.target)&&H(!1)},t=e=>{e.key===`Escape`&&H(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[V]);let $=(0,_.useCallback)(e=>D.slice(0,e+1).map(e=>e.name).join(`/`),[D]),Pt=D.length>=2,Ft=Pt?[{name:`.`,label:`data`},...D.slice(0,D.length-2).map((e,t)=>({name:$(t),label:e.displayName??e.name}))]:[];return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-toolbar`,children:[K?(0,v.jsxs)(`button`,{type:`button`,className:`data-select-cancel`,onClick:()=>X(`cancel`),"aria-label":`Cancel selection`,children:[(0,v.jsx)(d,{size:14}),` Cancel`]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`data-search-input`,children:[i===``&&(0,v.jsx)(ue,{size:14}),(0,v.jsx)(`input`,{ref:s,type:`text`,value:i,onChange:e=>a(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),h&&(0,v.jsx)(m,{size:14,className:`spin`}),i!==``&&(0,v.jsx)(`button`,{type:`button`,className:`data-search-inline-btn`,onClick:()=>{a(``),s.current?.focus()},title:`Clear search`,"aria-label":`Clear search`,children:(0,v.jsx)(d,{size:14})})]}),(0,v.jsxs)(`div`,{className:`data-toolbar-actions`,ref:ot,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-action-overflow`,onClick:()=>H(e=>!e),"aria-haspopup":`menu`,"aria-expanded":V,"aria-label":`File actions`,title:`File actions`,children:(0,v.jsx)(t,{size:16})}),(0,v.jsxs)(`div`,{className:`data-action-group`,role:`group`,"aria-label":`File actions`,"data-open":V?`true`:void 0,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{lt(),H(!1)},disabled:O,title:`Refresh this folder`,"aria-label":`Refresh this folder`,children:[O?(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(o,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Refresh`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{Et(),H(!1)},disabled:Ue||!R,title:R?`Upload a file`:`Open a folder inside your account to upload`,"aria-label":`Upload a file`,children:[Ue?k&&k.total>0?(0,v.jsxs)(`span`,{className:`data-upload-pct`,children:[Math.round(k.loaded/k.total*100),`%`]}):(0,v.jsx)(m,{size:16,className:`spin`}):(0,v.jsx)(ve,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`Upload`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{P(e=>!e),tt(``),L(null),H(!1)},disabled:Ue||!R,title:R?`New folder`:`Open a folder inside your account to create one`,"aria-label":`New folder`,children:[(0,v.jsx)(pe,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:`New folder`})]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-action-btn`,onClick:()=>{yt(T===`grid`?`list`:`grid`),H(!1)},title:T===`grid`?`List view`:`Grid view`,"aria-label":T===`grid`?`Switch to list view`:`Switch to grid view`,"aria-pressed":T===`grid`,children:[T===`grid`?(0,v.jsx)(ge,{size:16}):(0,v.jsx)(he,{size:16}),(0,v.jsx)(`span`,{className:`data-action-label`,children:T===`grid`?`List view`:`Grid view`})]})]})]})]}),(0,v.jsxs)(`div`,{className:`data-breadcrumbs`,children:[S!==`.`&&(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-back-btn`,onClick:dt,title:`Up one level`,"aria-label":`Up one level`,children:(0,v.jsx)(fe,{size:14})}),Pt?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,ref:at,children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb data-crumb-ellipsis`,onClick:()=>B(e=>!e),"aria-haspopup":`menu`,"aria-expanded":z,"aria-label":`Show parent folders`,title:`Show parent folders`,children:`…`}),z&&(0,v.jsx)(`div`,{className:`data-crumb-menu`,role:`menu`,children:Ft.map(e=>(0,v.jsx)(`button`,{type:`button`,role:`menuitem`,className:`data-crumb-menu-item`,onClick:()=>G(e.name),title:e.label,children:e.label},e.name))})]}),[D.length-2,D.length-1].map(e=>{let t=D[e];return(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(e)),title:t.name,children:t.displayName??t.name})]},$(e))})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G(`.`),children:`data`}),D.map((e,t)=>(0,v.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,v.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,v.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>G($(t)),title:e.name,children:e.displayName??e.name})]},$(t)))]})]}),$e&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`Folder name`,value:et,autoFocus:!0,onChange:e=>tt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Mt(),e.key===`Escape`&&P(!1)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Mt,children:`Create`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>P(!1),children:`Cancel`})]}),F&&(0,v.jsxs)(`div`,{className:`data-inline-form`,children:[(0,v.jsx)(`input`,{type:`text`,className:`data-inline-input`,placeholder:`New name`,value:nt,autoFocus:!0,onChange:e=>rt(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Nt(),e.key===`Escape`&&I(null)}}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn`,onClick:Nt,children:`Rename`}),(0,v.jsx)(`button`,{type:`button`,className:`data-btn data-btn-ghost`,onClick:()=>I(null),children:`Cancel`})]}),it&&(0,v.jsx)(`div`,{className:`data-error`,children:it}),(0,v.jsx)(`input`,{type:`file`,ref:M,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&Ot(t)}})]}),(0,v.jsxs)(`div`,{className:`data-body`,"data-drag-active":Je?`true`:void 0,onDragEnter:kt,onDragOver:kt,onDragLeave:At,onDrop:jt,children:[(de!==null||l!==null)&&(0,v.jsxs)(`section`,{className:`data-panel`,children:[de&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,de]}),st.length>0&&(0,v.jsx)(`div`,{className:`data-chip-row`,role:`group`,"aria-label":`Filter by type`,children:st.map(e=>{let t=e===U;return(0,v.jsx)(`button`,{type:`button`,className:`data-chip`,"data-active":t,onClick:()=>be(t?null:e),children:Pe([e])??e},e)})}),l&&!h&&(0,v.jsxs)(`div`,{className:`data-results-meta`,children:[W.length,` of `,l.length,` result`,l.length===1?``:`s`]}),l&&!h&&!U&&b>0&&!x&&(0,v.jsxs)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!0),children:[b,` low-confidence result`,b===1?``:`s`,` hidden — show all`]}),l&&!h&&!U&&x&&(0,v.jsx)(`button`,{type:`button`,className:`data-suppressed-banner`,onClick:()=>ke(!1),children:`Showing all results — hide low-confidence`}),l&&l.length===0&&!h&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),W&&W.length>0&&(0,v.jsx)(`ul`,{className:`data-results`,children:W.map(e=>(0,v.jsx)(Ne,{hit:e,mode:ie,onDownload:ct,onLocate:ut},e.nodeId))})]}),(0,v.jsxs)(`section`,{className:`data-panel`,children:[k&&(0,v.jsxs)(`div`,{className:`data-upload-progress`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":k.total>0?Math.round(k.loaded/k.total*100):void 0,children:[(0,v.jsx)(`div`,{className:`data-upload-progress-track`,children:(0,v.jsx)(`div`,{className:`data-upload-progress-fill`,style:{width:`${k.total>0?Math.round(k.loaded/k.total*100):0}%`}})}),(0,v.jsxs)(`span`,{className:`data-upload-progress-label`,children:[`Uploading… `,k.total>0?`${Math.round(k.loaded/k.total*100)}%`:``]})]}),Ge&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,Ge]}),Ke&&(0,v.jsx)(`div`,{className:`data-status`,children:Ke}),Xe&&(0,v.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,Xe]}),Ve&&(0,v.jsx)(`div`,{className:`data-error`,children:Ve}),O&&(0,v.jsxs)(`div`,{className:`data-loading`,children:[(0,v.jsx)(m,{size:14,className:`spin`}),` Loading…`]}),!K&&!O&&w&&w.length>0&&(0,v.jsxs)(`div`,{className:`data-select-hint`,children:[(0,v.jsx)(_e,{size:13}),(0,v.jsx)(`span`,{children:`Press and hold a file to select, rename, or delete it.`})]}),!O&&w&&w.length===0&&!Ve&&(0,v.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!O&&w&&w.length>0&&T===`grid`&&(0,v.jsx)(`ul`,{className:`data-grid`,children:w.map(e=>{let t=e.displayName??e.name,r=K&&q.has(e.name);if(e.kind===`directory`)return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t})]})},e.name);if(e.kind===`file`){let i=xe(e.name),a=S===`.`?e.name:`${S}/${e.name}`;return(0,v.jsx)(`li`,{className:`data-grid-cell`,"data-selected":r?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-grid-tile${i?` data-grid-tile-image`:``}`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>i?bt(e):vt(e),title:K?void 0:i?`Preview ${t}`:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),i?(0,v.jsx)(`img`,{className:`data-grid-thumb`,src:f(n,a),alt:t,loading:`lazy`,onError:()=>console.warn(`[data] op=thumb-error path=${a}`)}):(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,title:e.name,children:t}),!i&&(0,v.jsx)(`span`,{className:`data-grid-sub`,children:Ie(e.sizeBytes)})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-grid-cell`,children:(0,v.jsxs)(`div`,{className:`data-grid-tile data-entry-disabled`,children:[(0,v.jsx)(ce,{size:28,className:`data-grid-glyph`}),(0,v.jsx)(`span`,{className:`data-grid-label`,children:t}),(0,v.jsx)(`span`,{className:`data-grid-sub`,children:`special`})]})},e.name)})}),!O&&w&&w.length>0&&T===`list`&&(0,v.jsx)(`ul`,{className:`data-entries`,children:w.map(e=>{let t=e.displayName??e.name;if(e.kind===`directory`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>{if(J.current){J.current=!1;return}if(K){Z(e.name);return}G(S===`.`?e.name:`${S}/${e.name}`)},children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsx)(me,{size:14}),(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t})]})},e.name)}if(e.kind===`file`){let n=K&&q.has(e.name);return(0,v.jsx)(`li`,{className:`data-entry`,"data-selected":n?`true`:void 0,children:(0,v.jsxs)(`button`,{type:`button`,className:`data-entry-btn data-entry-file`,onPointerDown:()=>_t(e.name),onPointerUp:Q,onPointerMove:Q,onPointerLeave:Q,onPointerCancel:Q,onClick:()=>vt(e),title:K?void 0:`Download ${t}`,children:[K&&(0,v.jsx)(`span`,{className:`data-entry-select-indicator`,"aria-hidden":`true`}),(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:t}),(0,v.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${Le(e.modifiedAt)}`,children:[Ie(e.sizeBytes),` · `,Le(e.modifiedAt)]})]})]})},e.name)}return(0,v.jsx)(`li`,{className:`data-entry`,children:(0,v.jsx)(`div`,{className:`data-entry-btn data-entry-file data-entry-disabled`,children:(0,v.jsxs)(`span`,{className:`data-entry-text`,children:[(0,v.jsx)(`span`,{className:`data-entry-name`,children:t}),(0,v.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})})},e.name)})})]})]}),K&&(0,v.jsx)(`div`,{className:`data-select-bar`,role:`toolbar`,"aria-label":`Selection actions`,children:(0,v.jsxs)(`div`,{className:`data-select-bar-inner`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Tt,disabled:!Y||q.size===0,title:Y?`Share selected files`:`Sharing is not supported on this device`,children:[(0,v.jsx)(te,{size:16}),` Share`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:Ct,disabled:q.size===0,children:[(0,v.jsx)(se,{size:16}),` Download`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action`,onClick:()=>{let e=[...q][0];e&&(I(e),rt(e))},disabled:q.size!==1,children:[(0,v.jsx)(oe,{size:16}),` Rename`]}),(0,v.jsxs)(`button`,{type:`button`,className:`data-select-action data-select-delete`,onClick:wt,disabled:q.size===0,children:[(0,v.jsx)(ne,{size:16}),` Delete`]})]})}),E&&(0,v.jsx)(`div`,{className:`chat-attachment-overlay`,role:`dialog`,"aria-label":E.alt,onClick:()=>Re(null),children:(0,v.jsx)(`img`,{className:`chat-attachment-overlay-image`,src:E.src,alt:E.alt})})]})}function w({adminFetch:e,cacheKey:t,sessionRefetchNonce:n}){(0,_.useEffect)(()=>{console.info(`[data-ui] op=mount header=operator home=absent`)},[]);let r=(0,_.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]),i=(0,_.useCallback)(e=>{e===`chat`&&(window.location.href=`/`)},[]),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(`files`),{subAccounts:l,activeAccountId:te,switching:ne,switchAccount:u}=ie(t);return(0,_.useEffect)(()=>{if(!t)return;let e=!1;return fetch(`/api/whatsapp-reader/conversations?session_key=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():{conversations:[]}).then(t=>{e||o(t.conversations??[])}).catch(()=>{}),()=>{e=!0}},[t]),(0,v.jsxs)(`main`,{className:`data-main`,children:[(0,v.jsx)(ee,{variant:`operator`,onNavigate:i,onOpenConversations:a.length>0?()=>c(`conversations`):void 0,onToggleSidebar:()=>{},sidebarOpen:!1,onLogout:r,onDisconnect:async()=>!0,disconnecting:!1,subAccounts:l,activeAccountId:te,switchingAccount:ne,onSwitchAccount:u}),s===`conversations`?(0,v.jsx)(be,{conversations:a,sessionKey:t,onBack:()=>c(`files`)}):(0,v.jsx)(C,{adminFetch:e,cacheKey:t,sessionRefetchNonce:n})]})}function Me({cacheKey:e}){let{adminFetch:t,cacheKey:n,sessionRefetchNonce:r}=a({initialCacheKey:e,surface:`data`});return(0,v.jsx)(`div`,{className:`data-page`,children:(0,v.jsx)(`main`,{className:`data-main`,children:(0,v.jsx)(C,{adminFetch:t,cacheKey:n,sessionRefetchNonce:r})})})}function Ne({hit:e,mode:t,onDownload:n,onLocate:r}){let i=T(e.properties),a=Fe(e.properties),o=Pe(e.labels),s=E(e.properties),[c,ee]=(0,_.useState)(!1),l=a&&a.length>280,te=c||!l?a:a?.slice(0,280)+`…`,ne=t===`bm25`?`bm25 ${e.bm25Score.toFixed(2)}`:`vector ${e.vectorScore.toFixed(2)} · bm25 ${e.bm25Score.toFixed(2)} · combined ${e.score.toFixed(2)}`,u=e.properties.relativePath,d=typeof u==`string`&&u.length>0,f=d?u.lastIndexOf(`/`):-1,p=d?f===-1?`data`:u.slice(0,f):null;return(0,v.jsxs)(`li`,{className:`data-result`,children:[(0,v.jsxs)(`div`,{role:`button`,tabIndex:0,className:`data-result-open`,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e))},"aria-label":`Download ${i??o??`file`}`,children:[o&&(0,v.jsx)(`div`,{className:`data-result-header`,children:(0,v.jsx)(`span`,{className:`data-result-labels`,children:o})}),i&&(0,v.jsx)(`div`,{className:`data-result-title`,children:i}),a&&(0,v.jsx)(`pre`,{className:`data-result-body`,children:te}),(0,v.jsxs)(`div`,{className:`data-result-scores`,children:[s&&(0,v.jsxs)(`span`,{className:`data-result-updated`,children:[`Updated `,Le(s),` · `]}),ne]})]}),d&&(0,v.jsxs)(`button`,{type:`button`,className:`data-result-locate`,onClick:()=>r(e),title:`Locate in ${p}`,"aria-label":`Locate in ${p}`,children:[(0,v.jsx)(me,{size:12}),p]}),l&&(0,v.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>ee(e=>!e),children:c?`Show less`:`Show more`})]})}function Pe(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function T(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function Fe(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function E(e){for(let t of[`updatedAt`,`modifiedAt`,`fetchedAt`,`createdAt`,`lastModified`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function Ie(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function Le(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}export{Me as n,Ee as t};