forge-openclaw-plugin 0.3.15 → 0.3.16

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 (362) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/{action-bar-B9MYlps2.js → action-bar-DgrmzFrI.js} +1 -1
  3. package/dist/assets/{activity-page-DbzbChcE.js → activity-page-CF451ueg.js} +1 -1
  4. package/dist/assets/{ai-surface-workspace-CF0257Hs.js → ai-surface-workspace-DtwybxJB.js} +1 -1
  5. package/dist/assets/{atlas-panel-CO3RYAKn.js → atlas-panel-CB3uYk_K.js} +1 -1
  6. package/dist/assets/{calendar-page-BuuHKEHC.js → calendar-page-BYsDuLnh.js} +1 -1
  7. package/dist/assets/{calendar-rules-DKftgNx5.js → calendar-rules-DXuOv2J-.js} +1 -1
  8. package/dist/assets/{calendar-week-toolbar-ChIpkT-G.js → calendar-week-toolbar-8PJmiUE_.js} +1 -1
  9. package/dist/assets/{companion-sync-lab-page-BZRX4Btw.js → companion-sync-lab-page-DzWNOaBh.js} +1 -1
  10. package/dist/assets/{daily-metrics-dashboard-CXDsaAQd.js → daily-metrics-dashboard-CHcYxDhs.js} +1 -1
  11. package/dist/assets/{define-workbench-box-CpG0Zb1L.js → define-workbench-box-DcI0_QKW.js} +1 -1
  12. package/dist/assets/{entity-link-multiselect-Dl4rZqdg.js → entity-link-multiselect-C--AiCMb.js} +1 -1
  13. package/dist/assets/{entity-note-count-link-Bs1aKYyD.js → entity-note-count-link-xne6mshj.js} +1 -1
  14. package/dist/assets/{entity-notes-surface-B56XSw7M.js → entity-notes-surface-jy6Psist.js} +1 -1
  15. package/dist/assets/{execution-board-D66C_ikW.js → execution-board-BSUZCIIx.js} +1 -1
  16. package/dist/assets/{faceted-token-search-Dg2rjknH.js → faceted-token-search-BMQ1Wwzt.js} +1 -1
  17. package/dist/assets/{flagship-signal-deck-C6KVPhmM.js → flagship-signal-deck-DjcskRwF.js} +1 -1
  18. package/dist/assets/{floating-action-menu-DAFAEBcA.js → floating-action-menu-cGhbJ2tc.js} +1 -1
  19. package/dist/assets/{generic-node-view-C6DK5hJ6.js → generic-node-view-DNVwfqqq.js} +1 -1
  20. package/dist/assets/{goal-detail-page-CC4VXud6.js → goal-detail-page-dAbyCilO.js} +1 -1
  21. package/dist/assets/{goal-dialog-15hD8EBp.js → goal-dialog-DH50D0tP.js} +1 -1
  22. package/dist/assets/{goals-page-CQ2lJMzI.js → goals-page-DkMy9mPD.js} +1 -1
  23. package/dist/assets/{habits-page-a7KVPaQp.js → habits-page-CCQR8rg6.js} +1 -1
  24. package/dist/assets/{health-boxes-DqgvIYoL.js → health-boxes-BPTgGM6G.js} +1 -1
  25. package/dist/assets/index-VzCGTBS_.css +1 -0
  26. package/dist/assets/{index-FpGANF9S.js → index-izRKx6JK.js} +2 -2
  27. package/dist/assets/{inline-note-fields-COgzxr_7.js → inline-note-fields-D4mCM1gO.js} +1 -1
  28. package/dist/assets/{insight-flow-dialog-Dmb6NSGp.js → insight-flow-dialog-Btp6bkbV.js} +1 -1
  29. package/dist/assets/{insights-page-OnqR4cYI.js → insights-page-1qM4mxjS.js} +1 -1
  30. package/dist/assets/{kanban-boxes-BWUzntCV.js → kanban-boxes-u_A-UJG-.js} +1 -1
  31. package/dist/assets/{kanban-page-BI16Gzp_.js → kanban-page-CKCa_3Qb.js} +1 -1
  32. package/dist/assets/{knowledge-graph-page-DxEBaEke.js → knowledge-graph-page-BZOxRv19.js} +1 -1
  33. package/dist/assets/{life-force-page-CDEXEQai.js → life-force-page-BZlyA144.js} +1 -1
  34. package/dist/assets/{life-force-workspace-C7UOnJEf.js → life-force-workspace-CtAWZXNw.js} +1 -1
  35. package/dist/assets/{metric-tile-boeHB1R1.js → metric-tile-Bkx2btO2.js} +1 -1
  36. package/dist/assets/{movement-boxes-BUSqaTL2.js → movement-boxes-QZ2EIS9q.js} +1 -1
  37. package/dist/assets/{movement-page-DcbO0497.js → movement-page-B-3ihggI.js} +1 -1
  38. package/dist/assets/{note-markdown-DXXI3W3V.js → note-markdown-BWedRE3c.js} +1 -1
  39. package/dist/assets/{note-tags-input-CYh3TVW2.js → note-tags-input-DZkCqI1w.js} +1 -1
  40. package/dist/assets/{notes-boxes-CMJXX2K0.js → notes-boxes-DGFmt7Dp.js} +1 -1
  41. package/dist/assets/{notes-page-DvHMcQey.js → notes-page-DYkn04tz.js} +1 -1
  42. package/dist/assets/{open-in-graph-button-4UYrp1XP.js → open-in-graph-button-CjvkEj1P.js} +1 -1
  43. package/dist/assets/{orbit-map-BwK7sDaC.js → orbit-map-CRHSPenk.js} +1 -1
  44. package/dist/assets/{overview-page-Z5vaUTm3.js → overview-page-D6LsjPWe.js} +1 -1
  45. package/dist/assets/{page-hero-DvrM83_C.js → page-hero-BLhM8FF3.js} +1 -1
  46. package/dist/assets/{pill-cluster-DYI3Ibj8.js → pill-cluster-B5bYs_e2.js} +1 -1
  47. package/dist/assets/{preference-entity-handoff-button-C2ATjvws.js → preference-entity-handoff-button-CfCQl3cW.js} +1 -1
  48. package/dist/assets/{preferences-page-BAexXHye.js → preferences-page-OltGdsQ2.js} +1 -1
  49. package/dist/assets/{project-collections-B9nr-Ts-.js → project-collections-FfBIVwXu.js} +1 -1
  50. package/dist/assets/{project-detail-page-B9PqyPu9.js → project-detail-page-CCm3iZPQ.js} +1 -1
  51. package/dist/assets/{project-dialog-CBA-D65n.js → project-dialog-B_J1ESMk.js} +1 -1
  52. package/dist/assets/{project-management-hierarchy-page-DXK14jn0.js → project-management-hierarchy-page-BNzvtNZj.js} +1 -1
  53. package/dist/assets/{project-management-section-nav-DJ3QKCtr.js → project-management-section-nav-DBNHt9p5.js} +1 -1
  54. package/dist/assets/{projects-boxes-iBu_PRqe.js → projects-boxes-BvlVsO5q.js} +1 -1
  55. package/dist/assets/{projects-page-CdAk-ByT.js → projects-page-BUf7KV-_.js} +1 -1
  56. package/dist/assets/{psyche-behaviors-page-CbhhTfU2.js → psyche-behaviors-page-jtyhdpJ1.js} +1 -1
  57. package/dist/assets/{psyche-flashcards-page-DQaw_vUQ.js → psyche-flashcards-page-05606-97.js} +1 -1
  58. package/dist/assets/{psyche-goal-map-page-C-ZTVOEP.js → psyche-goal-map-page-Cw-aqS3Y.js} +1 -1
  59. package/dist/assets/{psyche-graph-DYzeClxn.js → psyche-graph-0E22QHPe.js} +1 -1
  60. package/dist/assets/{psyche-metrics-page-C9hKn10A.js → psyche-metrics-page-DBFVPeMa.js} +1 -1
  61. package/dist/assets/{psyche-mode-guide-page-CR8e984W.js → psyche-mode-guide-page-DI-LNEDT.js} +1 -1
  62. package/dist/assets/psyche-modes-page-CaMupyfi.js +1 -0
  63. package/dist/assets/{psyche-page-CTdIDkw9.js → psyche-page-CFBq0YKf.js} +1 -1
  64. package/dist/assets/{psyche-patterns-page-Drgm-f7I.js → psyche-patterns-page-sp4ikoef.js} +1 -1
  65. package/dist/assets/{psyche-questionnaire-builder-page-gRwdGXde.js → psyche-questionnaire-builder-page-DEt0UDsz.js} +1 -1
  66. package/dist/assets/{psyche-questionnaire-detail-page-CIP9b2UI.js → psyche-questionnaire-detail-page-BXQbOE6A.js} +1 -1
  67. package/dist/assets/{psyche-questionnaire-run-detail-page-SYndwtF3.js → psyche-questionnaire-run-detail-page-Cd3ClsSK.js} +1 -1
  68. package/dist/assets/{psyche-questionnaire-run-page-CXiJyd5i.js → psyche-questionnaire-run-page-D_EokOQm.js} +1 -1
  69. package/dist/assets/{psyche-questionnaires-page-CFPKwA3O.js → psyche-questionnaires-page-D1Ov2L4n.js} +1 -1
  70. package/dist/assets/{psyche-report-detail-page-dU30a2WE.js → psyche-report-detail-page-9HyPr8BJ.js} +1 -1
  71. package/dist/assets/{psyche-reports-page-Cn0EBndy.js → psyche-reports-page-BeyJg5fb.js} +1 -1
  72. package/dist/assets/{psyche-schemas-beliefs-page-Bab4xSWv.js → psyche-schemas-beliefs-page-DNmf-Vma.js} +1 -1
  73. package/dist/assets/{psyche-screen-time-page-lIe6GQxJ.js → psyche-screen-time-page-DJMDR5oo.js} +1 -1
  74. package/dist/assets/{psyche-self-observation-page-BTE3KfIl.js → psyche-self-observation-page-DFKXG1Yv.js} +1 -1
  75. package/dist/assets/{psyche-values-page-DclBZ9xw.js → psyche-values-page-TWKth89J.js} +1 -1
  76. package/dist/assets/{question-flow-dialog-Ded2E85L.js → question-flow-dialog-D-_EvoAt.js} +1 -1
  77. package/dist/assets/{report-chain-fields-DY640iqL.js → report-chain-fields-Dy-jBQDn.js} +1 -1
  78. package/dist/assets/{rewards-page-FxUXB76B.js → rewards-page-D3ymEd2X.js} +1 -1
  79. package/dist/assets/{scheduling-rules-editor-jakFfxqF.js → scheduling-rules-editor-CAd290IE.js} +1 -1
  80. package/dist/assets/{schema-badge-30B5syHA.js → schema-badge-BLaVI1D7.js} +1 -1
  81. package/dist/assets/{schemas-Db29G8NU.js → schemas-B0Pa-V-A.js} +1 -1
  82. package/dist/assets/{select-menu-BF2zI3RW.js → select-menu-DcS4Ukjf.js} +1 -1
  83. package/dist/assets/{settings-agents-page-Bh-Bv6FQ.js → settings-agents-page-Bt38HhEJ.js} +1 -1
  84. package/dist/assets/{settings-bin-page-DT8JJero.js → settings-bin-page-DqyVI1i1.js} +1 -1
  85. package/dist/assets/{settings-calendar-page-BA4_Qqiu.js → settings-calendar-page-DPSSZV3s.js} +1 -1
  86. package/dist/assets/{settings-data-page-K4kpmQJY.js → settings-data-page-BdHsD1C_.js} +1 -1
  87. package/dist/assets/{settings-logs-page-DkuNPAZo.js → settings-logs-page-D9OnWoFq.js} +1 -1
  88. package/dist/assets/{settings-mobile-page-4pCNwD91.js → settings-mobile-page-DFpsXA4M.js} +1 -1
  89. package/dist/assets/{settings-models-page-CZHG3t7W.js → settings-models-page-DaFXLp-O.js} +1 -1
  90. package/dist/assets/{settings-page-B_Be0vOY.js → settings-page-m_3iYPwU.js} +1 -1
  91. package/dist/assets/{settings-rewards-page-C6nFTWJu.js → settings-rewards-page-B2aBm-dA.js} +1 -1
  92. package/dist/assets/{settings-section-nav-Lo-VKCfZ.js → settings-section-nav-CMeU19Rx.js} +1 -1
  93. package/dist/assets/{settings-users-page-CVzNp4-m.js → settings-users-page-D8jyewJl.js} +1 -1
  94. package/dist/assets/{settings-wiki-page-DXM--7BB.js → settings-wiki-page-DjOgQJAh.js} +1 -1
  95. package/dist/assets/{sleep-page-DvPdZMKx.js → sleep-page-D8-dA4bE.js} +1 -1
  96. package/dist/assets/{sports-page-DjuZlOur.js → sports-page-CK3PgPKB.js} +1 -1
  97. package/dist/assets/{strategies-page-PE1IlatS.js → strategies-page-aFpJath-.js} +1 -1
  98. package/dist/assets/{strategy-detail-page-C4KiEGCI.js → strategy-detail-page-CobF5qLv.js} +1 -1
  99. package/dist/assets/{strategy-dialog-Cwf7Y3P5.js → strategy-dialog-Fgoaoob5.js} +1 -1
  100. package/dist/assets/{surface-ubuOfukq.js → surface-D0dqgX-k.js} +1 -1
  101. package/dist/assets/{task-detail-page-B3SMFZQ3.js → task-detail-page-CDK79bzk.js} +1 -1
  102. package/dist/assets/{task-dialog-CI_Fy_FW.js → task-dialog-eCDTF8xe.js} +4 -4
  103. package/dist/assets/{timebox-planning-dialog-BtFuVoA1.js → timebox-planning-dialog-CNZIGSpd.js} +1 -1
  104. package/dist/assets/{today-boxes-CYuxSkZf.js → today-boxes-CYfskVrM.js} +1 -1
  105. package/dist/assets/{today-page-CHGpLEZ3.js → today-page-Bnh8wopq.js} +1 -1
  106. package/dist/assets/{training-load-page-GZJF-Yy5.js → training-load-page-C7lq-jqy.js} +1 -1
  107. package/dist/assets/{user-badge-ByhC6bMU.js → user-badge-MEZuJiir.js} +1 -1
  108. package/dist/assets/{utility-widgets-ilORjDmg.js → utility-widgets-h5eG2jvc.js} +1 -1
  109. package/dist/assets/{vitals-page-mdEqIm_9.js → vitals-page-eoFnQ3XL.js} +1 -1
  110. package/dist/assets/{weekly-review-page-C8W-yg5r.js → weekly-review-page-C7BU1gkK.js} +1 -1
  111. package/dist/assets/{weight-loss-page-BApTknCn.js → weight-loss-page-Cc7Do3XY.js} +1 -1
  112. package/dist/assets/{wiki-article-markdown-DBccllQg.js → wiki-article-markdown-CCKoSptz.js} +1 -1
  113. package/dist/assets/{wiki-editor-page-BfRfH1O3.js → wiki-editor-page-BpbxZrgz.js} +1 -1
  114. package/dist/assets/{wiki-ingest-history-page-C-6H3MU6.js → wiki-ingest-history-page-D5Wfr8pc.js} +1 -1
  115. package/dist/assets/{wiki-ingest-modal-DnlhByD_.js → wiki-ingest-modal-DhRVsEwC.js} +1 -1
  116. package/dist/assets/{wiki-page-DPZ55e3x.js → wiki-page-1vf-HErs.js} +1 -1
  117. package/dist/assets/{workbench-flow-page-_-NKIx5R.js → workbench-flow-page-y9FxDbKO.js} +1 -1
  118. package/dist/assets/{workbench-page-NIAzggwX.js → workbench-page-Da16AZvN.js} +1 -1
  119. package/dist/assets/{workout-detail-page-3fxr6HL4.js → workout-detail-page-Cq0YamXF.js} +1 -1
  120. package/dist/index.html +2 -2
  121. package/dist/openclaw/api-client.js +28 -2
  122. package/dist/openclaw/local-runtime.js +31 -14
  123. package/dist/server/{server → apps/api}/src/app.js +1 -1
  124. package/dist/server/{server → apps/api}/src/connectors/box-registry.js +3 -3
  125. package/dist/server/{server → apps/api}/src/db.js +23 -4
  126. package/dist/server/{server → apps/api}/src/health-weight-loss.js +1 -1
  127. package/dist/server/{server → apps/api}/src/questionnaire-seeds.js +1 -1
  128. package/dist/server/{server → apps/api}/src/repositories/ai-connectors.js +1 -1
  129. package/dist/server/{server → apps/api}/src/repositories/habits.js +1 -1
  130. package/dist/server/{server → apps/api}/src/services/companion-iroh.js +4 -1
  131. package/dist/server/{server → apps/api}/src/services/doctor.js +3 -3
  132. package/dist/server/{server → apps/api}/src/services/gamification-assets.js +1 -1
  133. package/dist/server/{server → apps/api}/src/services/gamification.js +1 -1
  134. package/dist/server/{server → apps/api}/src/services/knowledge-graph.js +3 -3
  135. package/dist/server/{server → apps/api}/src/types.js +2 -2
  136. package/dist/server/{server → apps/api}/src/watch-mobile.js +1 -1
  137. package/openclaw.plugin.json +1 -1
  138. package/package.json +3 -3
  139. package/server/index.js +3 -3
  140. package/skills/forge-openclaw/SKILL.md +5 -5
  141. package/dist/assets/index-ClJbJhca.css +0 -1
  142. package/dist/assets/psyche-modes-page-lQdpAcY3.js +0 -1
  143. /package/dist/server/{server → apps/api}/migrations/001_core.sql +0 -0
  144. /package/dist/server/{server → apps/api}/migrations/002_psyche.sql +0 -0
  145. /package/dist/server/{server → apps/api}/migrations/003_habits.sql +0 -0
  146. /package/dist/server/{server → apps/api}/migrations/004_habit_links.sql +0 -0
  147. /package/dist/server/{server → apps/api}/migrations/005_habit_psyche_links.sql +0 -0
  148. /package/dist/server/{server → apps/api}/migrations/006_work_adjustments.sql +0 -0
  149. /package/dist/server/{server → apps/api}/migrations/007_weekly_review_closures.sql +0 -0
  150. /package/dist/server/{server → apps/api}/migrations/008_calendar_execution.sql +0 -0
  151. /package/dist/server/{server → apps/api}/migrations/009_true_calendar_events.sql +0 -0
  152. /package/dist/server/{server → apps/api}/migrations/010_calendar_selection_state.sql +0 -0
  153. /package/dist/server/{server → apps/api}/migrations/011_calendar_timezone_backfill.sql +0 -0
  154. /package/dist/server/{server → apps/api}/migrations/012_work_block_ranges.sql +0 -0
  155. /package/dist/server/{server → apps/api}/migrations/013_microsoft_local_auth_settings.sql +0 -0
  156. /package/dist/server/{server → apps/api}/migrations/014_note_tags_and_ephemeral.sql +0 -0
  157. /package/dist/server/{server → apps/api}/migrations/015_multi_user_and_strategies.sql +0 -0
  158. /package/dist/server/{server → apps/api}/migrations/016_health_companion.sql +0 -0
  159. /package/dist/server/{server → apps/api}/migrations/016_strategy_contracts_and_user_graph.sql +0 -0
  160. /package/dist/server/{server → apps/api}/migrations/017_preferences.sql +0 -0
  161. /package/dist/server/{server → apps/api}/migrations/018_preference_catalogs.sql +0 -0
  162. /package/dist/server/{server → apps/api}/migrations/019_wiki_memory.sql +0 -0
  163. /package/dist/server/{server → apps/api}/migrations/020_wiki_page_hierarchy.sql +0 -0
  164. /package/dist/server/{server → apps/api}/migrations/021_hide_evidence_from_wiki_index.sql +0 -0
  165. /package/dist/server/{server → apps/api}/migrations/022_wiki_ingest_background.sql +0 -0
  166. /package/dist/server/{server → apps/api}/migrations/023_diagnostic_logs.sql +0 -0
  167. /package/dist/server/{server → apps/api}/migrations/024_questionnaires.sql +0 -0
  168. /package/dist/server/{server → apps/api}/migrations/025_ai_model_connections.sql +0 -0
  169. /package/dist/server/{server → apps/api}/migrations/026_custom_theme_settings.sql +0 -0
  170. /package/dist/server/{server → apps/api}/migrations/027_ai_processors.sql +0 -0
  171. /package/dist/server/{server → apps/api}/migrations/028_movement_domain.sql +0 -0
  172. /package/dist/server/{server → apps/api}/migrations/029_watch_micro_capture.sql +0 -0
  173. /package/dist/server/{server → apps/api}/migrations/030_surface_layouts.sql +0 -0
  174. /package/dist/server/{server → apps/api}/migrations/031_ai_processor_runtime_upgrades.sql +0 -0
  175. /package/dist/server/{server → apps/api}/migrations/032_ai_connectors.sql +0 -0
  176. /package/dist/server/{server → apps/api}/migrations/033_movement_trip_point_sync.sql +0 -0
  177. /package/dist/server/{server → apps/api}/migrations/034_movement_segment_sync.sql +0 -0
  178. /package/dist/server/{server → apps/api}/migrations/035_google_local_auth_settings.sql +0 -0
  179. /package/dist/server/{server → apps/api}/migrations/036_google_local_auth_client_secret.sql +0 -0
  180. /package/dist/server/{server → apps/api}/migrations/037_workbench_public_inputs_and_run_inputs.sql +0 -0
  181. /package/dist/server/{server → apps/api}/migrations/038_data_management_settings.sql +0 -0
  182. /package/dist/server/{server → apps/api}/migrations/039_life_force_and_action_points.sql +0 -0
  183. /package/dist/server/{server → apps/api}/migrations/040_screen_time_domain.sql +0 -0
  184. /package/dist/server/{server → apps/api}/migrations/041_companion_source_states.sql +0 -0
  185. /package/dist/server/{server → apps/api}/migrations/042_movement_boxes.sql +0 -0
  186. /package/dist/server/{server → apps/api}/migrations/043_movement_box_overlap_overrides.sql +0 -0
  187. /package/dist/server/{server → apps/api}/migrations/044_macos_local_calendar_provider.sql +0 -0
  188. /package/dist/server/{server → apps/api}/migrations/045_sleep_nights_and_raw_segments.sql +0 -0
  189. /package/dist/server/{server → apps/api}/migrations/046_work_item_hierarchy.sql +0 -0
  190. /package/dist/server/{server → apps/api}/migrations/047_sleep_source_records.sql +0 -0
  191. /package/dist/server/{server → apps/api}/migrations/048_task_run_git_context.sql +0 -0
  192. /package/dist/server/{server → apps/api}/migrations/049_agent_runtime_sessions.sql +0 -0
  193. /package/dist/server/{server → apps/api}/migrations/050_agent_token_bootstrap_policy.sql +0 -0
  194. /package/dist/server/{server → apps/api}/migrations/051_agent_token_scope_policy.sql +0 -0
  195. /package/dist/server/{server → apps/api}/migrations/052_agent_identity_tightening.sql +0 -0
  196. /package/dist/server/{server → apps/api}/migrations/053_agent_runtime_session_canonical_labels.sql +0 -0
  197. /package/dist/server/{server → apps/api}/migrations/054_sqlite_backed_wiki_memory.sql +0 -0
  198. /package/dist/server/{server → apps/api}/migrations/055_gamification_progression.sql +0 -0
  199. /package/dist/server/{server → apps/api}/migrations/056_gamification_equipment.sql +0 -0
  200. /package/dist/server/{server → apps/api}/migrations/057_gamification_catalog_cleanup.sql +0 -0
  201. /package/dist/server/{server → apps/api}/migrations/058_gamification_theme_preference.sql +0 -0
  202. /package/dist/server/{server → apps/api}/migrations/059_data_backup_retention.sql +0 -0
  203. /package/dist/server/{server → apps/api}/migrations/060_psyche_devrage_metrics.sql +0 -0
  204. /package/dist/server/{server → apps/api}/migrations/061_health_workout_raw_evidence.sql +0 -0
  205. /package/dist/server/{server → apps/api}/migrations/062_health_mobile_sync_sessions.sql +0 -0
  206. /package/dist/server/{server → apps/api}/migrations/063_psyche_flashcards.sql +0 -0
  207. /package/dist/server/{server → apps/api}/migrations/064_health_workout_time_series_identity.sql +0 -0
  208. /package/dist/server/{server → apps/api}/migrations/065_weight_loss_nutrition_insights.sql +0 -0
  209. /package/dist/server/{server → apps/api}/migrations/066_watch_action_receipts.sql +0 -0
  210. /package/dist/server/{server → apps/api}/migrations/067_weight_loss_daily_active_overrides.sql +0 -0
  211. /package/dist/server/{server → apps/api}/migrations/068_remove_generated_movement_wiki_logs.sql +0 -0
  212. /package/dist/server/{server → apps/api}/migrations/069_psyche_devrage_cumulative_rage.sql +0 -0
  213. /package/dist/server/{server → apps/api}/migrations/070_health_mobile_sync_completion_index.sql +0 -0
  214. /package/dist/server/{server → apps/api}/migrations/071_agent_runtime_claude_identity.sql +0 -0
  215. /package/dist/server/{server → apps/api}/src/data-management-types.js +0 -0
  216. /package/dist/server/{server → apps/api}/src/debug.js +0 -0
  217. /package/dist/server/{server → apps/api}/src/demo-data.js +0 -0
  218. /package/dist/server/{server → apps/api}/src/discovery-advertiser.js +0 -0
  219. /package/dist/server/{server → apps/api}/src/e2e-server.js +0 -0
  220. /package/dist/server/{server → apps/api}/src/errors.js +0 -0
  221. /package/dist/server/{server → apps/api}/src/health-workout-adapters.js +0 -0
  222. /package/dist/server/{server → apps/api}/src/health-workout-analytics.js +0 -0
  223. /package/dist/server/{server → apps/api}/src/health.js +0 -0
  224. /package/dist/server/{server → apps/api}/src/index.js +0 -0
  225. /package/dist/server/{server → apps/api}/src/managers/base.js +0 -0
  226. /package/dist/server/{server → apps/api}/src/managers/contracts.js +0 -0
  227. /package/dist/server/{server → apps/api}/src/managers/platform/api-gateway-manager.js +0 -0
  228. /package/dist/server/{server → apps/api}/src/managers/platform/audit-manager.js +0 -0
  229. /package/dist/server/{server → apps/api}/src/managers/platform/authentication-manager.js +0 -0
  230. /package/dist/server/{server → apps/api}/src/managers/platform/authorization-manager.js +0 -0
  231. /package/dist/server/{server → apps/api}/src/managers/platform/background-job-manager.js +0 -0
  232. /package/dist/server/{server → apps/api}/src/managers/platform/configuration-manager.js +0 -0
  233. /package/dist/server/{server → apps/api}/src/managers/platform/database-manager.js +0 -0
  234. /package/dist/server/{server → apps/api}/src/managers/platform/event-bus-manager.js +0 -0
  235. /package/dist/server/{server → apps/api}/src/managers/platform/external-service-manager.js +0 -0
  236. /package/dist/server/{server → apps/api}/src/managers/platform/health-manager.js +0 -0
  237. /package/dist/server/{server → apps/api}/src/managers/platform/llm-manager.js +0 -0
  238. /package/dist/server/{server → apps/api}/src/managers/platform/migration-manager.js +0 -0
  239. /package/dist/server/{server → apps/api}/src/managers/platform/mock-workbench-provider.js +0 -0
  240. /package/dist/server/{server → apps/api}/src/managers/platform/openai-responses-provider.js +0 -0
  241. /package/dist/server/{server → apps/api}/src/managers/platform/search-index-manager.js +0 -0
  242. /package/dist/server/{server → apps/api}/src/managers/platform/secrets-manager.js +0 -0
  243. /package/dist/server/{server → apps/api}/src/managers/platform/session-manager.js +0 -0
  244. /package/dist/server/{server → apps/api}/src/managers/platform/storage-manager.js +0 -0
  245. /package/dist/server/{server → apps/api}/src/managers/platform/token-manager.js +0 -0
  246. /package/dist/server/{server → apps/api}/src/managers/platform/transaction-manager.js +0 -0
  247. /package/dist/server/{server → apps/api}/src/managers/platform/trusted-network.js +0 -0
  248. /package/dist/server/{server → apps/api}/src/managers/runtime.js +0 -0
  249. /package/dist/server/{server → apps/api}/src/managers/type-guards.js +0 -0
  250. /package/dist/server/{server → apps/api}/src/movement.js +0 -0
  251. /package/dist/server/{server → apps/api}/src/openapi.js +0 -0
  252. /package/dist/server/{server → apps/api}/src/preferences-seeds.js +0 -0
  253. /package/dist/server/{server → apps/api}/src/preferences-types.js +0 -0
  254. /package/dist/server/{server → apps/api}/src/psyche-types.js +0 -0
  255. /package/dist/server/{server → apps/api}/src/questionnaire-flow.js +0 -0
  256. /package/dist/server/{server → apps/api}/src/questionnaire-types.js +0 -0
  257. /package/dist/server/{server → apps/api}/src/repositories/activity-events.js +0 -0
  258. /package/dist/server/{server → apps/api}/src/repositories/agent-runtime-sessions.js +0 -0
  259. /package/dist/server/{server → apps/api}/src/repositories/ai-processors.js +0 -0
  260. /package/dist/server/{server → apps/api}/src/repositories/calendar.js +0 -0
  261. /package/dist/server/{server → apps/api}/src/repositories/collaboration.js +0 -0
  262. /package/dist/server/{server → apps/api}/src/repositories/deleted-entities.js +0 -0
  263. /package/dist/server/{server → apps/api}/src/repositories/diagnostic-logs.js +0 -0
  264. /package/dist/server/{server → apps/api}/src/repositories/domains.js +0 -0
  265. /package/dist/server/{server → apps/api}/src/repositories/entity-ownership.js +0 -0
  266. /package/dist/server/{server → apps/api}/src/repositories/event-log.js +0 -0
  267. /package/dist/server/{server → apps/api}/src/repositories/gamification.js +0 -0
  268. /package/dist/server/{server → apps/api}/src/repositories/goals.js +0 -0
  269. /package/dist/server/{server → apps/api}/src/repositories/model-settings.js +0 -0
  270. /package/dist/server/{server → apps/api}/src/repositories/notes.js +0 -0
  271. /package/dist/server/{server → apps/api}/src/repositories/preferences.js +0 -0
  272. /package/dist/server/{server → apps/api}/src/repositories/projects.js +0 -0
  273. /package/dist/server/{server → apps/api}/src/repositories/psyche.js +0 -0
  274. /package/dist/server/{server → apps/api}/src/repositories/questionnaires.js +0 -0
  275. /package/dist/server/{server → apps/api}/src/repositories/rewards.js +0 -0
  276. /package/dist/server/{server → apps/api}/src/repositories/settings.js +0 -0
  277. /package/dist/server/{server → apps/api}/src/repositories/strategies.js +0 -0
  278. /package/dist/server/{server → apps/api}/src/repositories/surface-layouts.js +0 -0
  279. /package/dist/server/{server → apps/api}/src/repositories/tags.js +0 -0
  280. /package/dist/server/{server → apps/api}/src/repositories/task-runs.js +0 -0
  281. /package/dist/server/{server → apps/api}/src/repositories/tasks.js +0 -0
  282. /package/dist/server/{server → apps/api}/src/repositories/users.js +0 -0
  283. /package/dist/server/{server → apps/api}/src/repositories/weekly-reviews.js +0 -0
  284. /package/dist/server/{server → apps/api}/src/repositories/wiki-memory.js +0 -0
  285. /package/dist/server/{server → apps/api}/src/repositories/work-adjustments.js +0 -0
  286. /package/dist/server/{server → apps/api}/src/runtime-data-root.js +0 -0
  287. /package/dist/server/{server → apps/api}/src/screen-time.js +0 -0
  288. /package/dist/server/{server → apps/api}/src/seed-demo.js +0 -0
  289. /package/dist/server/{server → apps/api}/src/services/calendar-runtime.js +0 -0
  290. /package/dist/server/{server → apps/api}/src/services/context.js +0 -0
  291. /package/dist/server/{server → apps/api}/src/services/dashboard.js +0 -0
  292. /package/dist/server/{server → apps/api}/src/services/data-management.js +0 -0
  293. /package/dist/server/{server → apps/api}/src/services/devrage-scanner.js +0 -0
  294. /package/dist/server/{server → apps/api}/src/services/devrage.js +0 -0
  295. /package/dist/server/{server → apps/api}/src/services/entity-crud.js +0 -0
  296. /package/dist/server/{server → apps/api}/src/services/git-helper.js +0 -0
  297. /package/dist/server/{server → apps/api}/src/services/google-calendar-oauth-config.js +0 -0
  298. /package/dist/server/{server → apps/api}/src/services/insights.js +0 -0
  299. /package/dist/server/{server → apps/api}/src/services/legacy-wiki-markdown-import.js +0 -0
  300. /package/dist/server/{server → apps/api}/src/services/life-force-model.js +0 -0
  301. /package/dist/server/{server → apps/api}/src/services/life-force.js +0 -0
  302. /package/dist/server/{server → apps/api}/src/services/macos-calendar-helper.js +0 -0
  303. /package/dist/server/{server → apps/api}/src/services/openai-codex-oauth.js +0 -0
  304. /package/dist/server/{server → apps/api}/src/services/projects.js +0 -0
  305. /package/dist/server/{server → apps/api}/src/services/psyche-observation-calendar.js +0 -0
  306. /package/dist/server/{server → apps/api}/src/services/psyche.js +0 -0
  307. /package/dist/server/{server → apps/api}/src/services/relations.js +0 -0
  308. /package/dist/server/{server → apps/api}/src/services/reviews.js +0 -0
  309. /package/dist/server/{server → apps/api}/src/services/run-recovery.js +0 -0
  310. /package/dist/server/{server → apps/api}/src/services/tagging.js +0 -0
  311. /package/dist/server/{server → apps/api}/src/services/task-run-watchdog.js +0 -0
  312. /package/dist/server/{server → apps/api}/src/services/work-time.js +0 -0
  313. /package/dist/server/{server → apps/api}/src/web.js +0 -0
  314. /package/dist/server/{src → apps/web/src}/components/customization/utility-widgets.js +0 -0
  315. /package/dist/server/{src → apps/web/src}/components/ui/info-tooltip.js +0 -0
  316. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/calendar/calendar-boxes.js +0 -0
  317. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/goals/goals-boxes.js +0 -0
  318. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/habits/habits-boxes.js +0 -0
  319. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/health/health-boxes.js +0 -0
  320. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/insights/insights-boxes.js +0 -0
  321. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/kanban/kanban-boxes.js +0 -0
  322. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/movement/movement-boxes.js +0 -0
  323. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/notes/notes-boxes.js +0 -0
  324. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/overview/overview-boxes.js +0 -0
  325. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/preferences/preferences-boxes.js +0 -0
  326. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/projects/projects-boxes.js +0 -0
  327. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/psyche/psyche-boxes.js +0 -0
  328. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/questionnaires/questionnaires-boxes.js +0 -0
  329. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/review/review-boxes.js +0 -0
  330. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/shared/define-workbench-box.js +0 -0
  331. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/shared/generic-node-view.js +0 -0
  332. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/strategies/strategies-boxes.js +0 -0
  333. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/tasks/tasks-boxes.js +0 -0
  334. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/today/today-boxes.js +0 -0
  335. /package/dist/server/{src → apps/web/src}/components/workbench-boxes/wiki/wiki-boxes.js +0 -0
  336. /package/dist/server/{src → apps/web/src}/lib/api-error.js +0 -0
  337. /package/dist/server/{src → apps/web/src}/lib/api.js +0 -0
  338. /package/dist/server/{src → apps/web/src}/lib/calendar-name-deduper.js +0 -0
  339. /package/dist/server/{src → apps/web/src}/lib/data-management-types.js +0 -0
  340. /package/dist/server/{src → apps/web/src}/lib/date-keys.js +0 -0
  341. /package/dist/server/{src → apps/web/src}/lib/diagnostics.js +0 -0
  342. /package/dist/server/{src → apps/web/src}/lib/entity-visuals.js +0 -0
  343. /package/dist/server/{src → apps/web/src}/lib/gamification-catalog.js +0 -0
  344. /package/dist/server/{src → apps/web/src}/lib/knowledge-graph-types.js +0 -0
  345. /package/dist/server/{src → apps/web/src}/lib/knowledge-graph.js +0 -0
  346. /package/dist/server/{src → apps/web/src}/lib/psyche-schemas.js +0 -0
  347. /package/dist/server/{src → apps/web/src}/lib/psyche-types.js +0 -0
  348. /package/dist/server/{src → apps/web/src}/lib/questionnaire-types.js +0 -0
  349. /package/dist/server/{src → apps/web/src}/lib/runtime-paths.js +0 -0
  350. /package/dist/server/{src → apps/web/src}/lib/schemas.js +0 -0
  351. /package/dist/server/{src → apps/web/src}/lib/snapshot-normalizer.js +0 -0
  352. /package/dist/server/{src → apps/web/src}/lib/theme-system.js +0 -0
  353. /package/dist/server/{src → apps/web/src}/lib/types.js +0 -0
  354. /package/dist/server/{src → apps/web/src}/lib/utils.js +0 -0
  355. /package/dist/server/{src → apps/web/src}/lib/weight-loss-energy-model.js +0 -0
  356. /package/dist/server/{src → apps/web/src}/lib/weight-loss-types.js +0 -0
  357. /package/dist/server/{src → apps/web/src}/lib/workbench/boxes.js +0 -0
  358. /package/dist/server/{src → apps/web/src}/lib/workbench/contracts.js +0 -0
  359. /package/dist/server/{src → apps/web/src}/lib/workbench/nodes.js +0 -0
  360. /package/dist/server/{src → apps/web/src}/lib/workbench/registry.js +0 -0
  361. /package/dist/server/{src → apps/web/src}/lib/workbench/runtime.js +0 -0
  362. /package/dist/server/{src → apps/web/src}/lib/workbench/tool-catalog.js +0 -0
@@ -1 +1 @@
1
- import{j as e,bX as m,aK as b}from"./vendor-BwL6m4SE.js";import{I as h,T as u,B as j}from"./index-FpGANF9S.js";function x(r){return`${r}_${Math.random().toString(36).slice(2,10)}`}function f(){return{id:x("emotion"),emotionDefinitionId:null,label:"",intensity:55,note:""}}function N(){return{id:x("thought"),text:"",parentMode:"",criticMode:"",beliefId:null}}function k(){return{id:x("behavior"),text:"",mode:"",behaviorId:null}}function w(){return{id:x("timeline"),stage:"",modeId:null,label:"",note:""}}function n({title:r,description:t,onAdd:o,addLabel:l}){return e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium text-[var(--ui-ink-strong)]",children:r}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-[var(--ui-ink-soft)]",children:t})]}),e.jsxs(j,{type:"button",variant:"secondary",size:"sm",onClick:o,children:[e.jsx(m,{className:"size-4"}),l]})]})}function c({onClick:r}){return e.jsx("button",{type:"button",className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-faint)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:r,"aria-label":"Remove row",children:e.jsx(b,{className:"size-4"})})}function A({title:r,description:t,addLabel:o,items:l,onChange:i,placeholder:a}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:r,description:t,addLabel:o,onAdd:()=>i([...l,""])}),e.jsx("div",{className:"grid gap-3",children:l.map((s,d)=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsx(h,{value:s,onChange:v=>i(l.map((p,g)=>g===d?v.target.value:p)),placeholder:a}),e.jsx(c,{onClick:()=>i(l.filter((v,p)=>p!==d))})]},`${r}-${d}`))})]})}function E({items:r,onChange:t,definitions:o}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What emotions were present?",description:"Add one emotion at a time, set the intensity, and note what stood out.",addLabel:"Add emotion",onAdd:()=>t([...r,f()])}),e.jsx("div",{className:"grid gap-3",children:r.map(l=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-[minmax(0,1fr)_9rem]",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Emotion"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:l.emotionDefinitionId??"",onChange:i=>{const a=o.find(s=>s.id===i.target.value);t(r.map(s=>s.id===l.id?{...s,emotionDefinitionId:i.target.value||null,label:(a==null?void 0:a.label)??s.label}:s))},children:[e.jsx("option",{value:"",children:"Choose or type your own"}),o.map(i=>e.jsx("option",{value:i.id,children:i.label},i.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Intensity"}),e.jsxs("div",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("input",{type:"range",min:0,max:100,value:l.intensity,onChange:i=>t(r.map(a=>a.id===l.id?{...a,intensity:Number(i.target.value)}:a))}),e.jsxs("div",{className:"mt-2 text-sm text-[var(--ui-ink-faint)]",children:[l.intensity,"%"]})]})]})]}),e.jsx(c,{onClick:()=>t(r.filter(i=>i.id!==l.id))})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"If the preset is not right, how would you name it?"}),e.jsx(h,{value:l.label,onChange:i=>t(r.map(a=>a.id===l.id?{...a,label:i.target.value}:a)),placeholder:"Tight sadness, panic, shame, relief..."})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"What was notable about this emotion?"}),e.jsx(u,{value:l.note,onChange:i=>t(r.map(a=>a.id===l.id?{...a,note:i.target.value}:a)),placeholder:"Short note about what made this emotion stand out."})]})]},l.id))})]})}function T({items:r,onChange:t,beliefs:o,modes:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What did your mind start saying?",description:"Capture the thought itself first, then optionally link a belief or mode influence.",addLabel:"Add thought",onAdd:()=>t([...r,N()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("label",{className:"grid flex-1 gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Thought"}),e.jsx(u,{value:i.text,onChange:a=>t(r.map(s=>s.id===i.id?{...s,text:a.target.value}:s)),placeholder:"What sentence, image, or conclusion showed up?"})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Parent mode influence"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.parentMode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,parentMode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Critic mode influence"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.criticMode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,criticMode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Linked belief"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.beliefId??"",onChange:a=>t(r.map(s=>s.id===i.id?{...s,beliefId:a.target.value||null}:s)),children:[e.jsx("option",{value:"",children:"None"}),o.map(a=>e.jsx("option",{value:a.id,children:a.statement},a.id))]})]})]})]},i.id))})]})}function B({items:r,onChange:t,behaviors:o,modes:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What did you do, or want to do?",description:"Capture the move itself, then optionally link an existing behavior and the mode context around it.",addLabel:"Add behavior",onAdd:()=>t([...r,k()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("label",{className:"grid flex-1 gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Behavior or urge"}),e.jsx(u,{value:i.text,onChange:a=>t(r.map(s=>s.id===i.id?{...s,text:a.target.value}:s)),placeholder:"What did you do, or what move did you feel pulled toward?"})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Linked existing behavior"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.behaviorId??"",onChange:a=>{const s=o.find(d=>d.id===a.target.value);t(r.map(d=>d.id===i.id?{...d,behaviorId:a.target.value||null,text:s&&!d.text?s.title:d.text}:d))},children:[e.jsx("option",{value:"",children:"None"}),o.map(a=>e.jsx("option",{value:a.id,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Mode or urge context"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.mode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,mode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]})]})]},i.id))})]})}function L({items:r,onChange:t,modes:o,stages:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"How did your state shift through the chain?",description:"Build the mode timeline one moment at a time instead of typing parser syntax.",addLabel:"Add timeline moment",onAdd:()=>t([...r,w()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-3",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Stage"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.stage,onChange:a=>t(r.map(s=>s.id===i.id?{...s,stage:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"Choose stage"}),l.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Mode"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.modeId??"",onChange:a=>{const s=o.find(d=>d.id===a.target.value);t(r.map(d=>d.id===i.id?{...d,modeId:a.target.value||null,label:s&&!d.label?s.title:d.label}:d))},children:[e.jsx("option",{value:"",children:"Choose mode"}),o.map(a=>e.jsx("option",{value:a.id,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Moment label"}),e.jsx(h,{value:i.label,onChange:a=>t(r.map(s=>s.id===i.id?{...s,label:a.target.value}:s)),placeholder:"What was happening in this moment?"})]})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"What was important about this shift?"}),e.jsx(u,{value:i.note,onChange:a=>t(r.map(s=>s.id===i.id?{...s,note:a.target.value}:s)),placeholder:"Short note about how the mode showed up or what it was protecting."})]})]},i.id))})]})}export{B,E,L as M,A as S,T};
1
+ import{j as e,bX as m,aK as b}from"./vendor-BwL6m4SE.js";import{I as h,T as u,B as j}from"./index-izRKx6JK.js";function x(r){return`${r}_${Math.random().toString(36).slice(2,10)}`}function f(){return{id:x("emotion"),emotionDefinitionId:null,label:"",intensity:55,note:""}}function N(){return{id:x("thought"),text:"",parentMode:"",criticMode:"",beliefId:null}}function k(){return{id:x("behavior"),text:"",mode:"",behaviorId:null}}function w(){return{id:x("timeline"),stage:"",modeId:null,label:"",note:""}}function n({title:r,description:t,onAdd:o,addLabel:l}){return e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium text-[var(--ui-ink-strong)]",children:r}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-[var(--ui-ink-soft)]",children:t})]}),e.jsxs(j,{type:"button",variant:"secondary",size:"sm",onClick:o,children:[e.jsx(m,{className:"size-4"}),l]})]})}function c({onClick:r}){return e.jsx("button",{type:"button",className:"rounded-full bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-faint)] transition hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]",onClick:r,"aria-label":"Remove row",children:e.jsx(b,{className:"size-4"})})}function A({title:r,description:t,addLabel:o,items:l,onChange:i,placeholder:a}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:r,description:t,addLabel:o,onAdd:()=>i([...l,""])}),e.jsx("div",{className:"grid gap-3",children:l.map((s,d)=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsx(h,{value:s,onChange:v=>i(l.map((p,g)=>g===d?v.target.value:p)),placeholder:a}),e.jsx(c,{onClick:()=>i(l.filter((v,p)=>p!==d))})]},`${r}-${d}`))})]})}function E({items:r,onChange:t,definitions:o}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What emotions were present?",description:"Add one emotion at a time, set the intensity, and note what stood out.",addLabel:"Add emotion",onAdd:()=>t([...r,f()])}),e.jsx("div",{className:"grid gap-3",children:r.map(l=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-[minmax(0,1fr)_9rem]",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Emotion"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:l.emotionDefinitionId??"",onChange:i=>{const a=o.find(s=>s.id===i.target.value);t(r.map(s=>s.id===l.id?{...s,emotionDefinitionId:i.target.value||null,label:(a==null?void 0:a.label)??s.label}:s))},children:[e.jsx("option",{value:"",children:"Choose or type your own"}),o.map(i=>e.jsx("option",{value:i.id,children:i.label},i.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Intensity"}),e.jsxs("div",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3",children:[e.jsx("input",{type:"range",min:0,max:100,value:l.intensity,onChange:i=>t(r.map(a=>a.id===l.id?{...a,intensity:Number(i.target.value)}:a))}),e.jsxs("div",{className:"mt-2 text-sm text-[var(--ui-ink-faint)]",children:[l.intensity,"%"]})]})]})]}),e.jsx(c,{onClick:()=>t(r.filter(i=>i.id!==l.id))})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"If the preset is not right, how would you name it?"}),e.jsx(h,{value:l.label,onChange:i=>t(r.map(a=>a.id===l.id?{...a,label:i.target.value}:a)),placeholder:"Tight sadness, panic, shame, relief..."})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"What was notable about this emotion?"}),e.jsx(u,{value:l.note,onChange:i=>t(r.map(a=>a.id===l.id?{...a,note:i.target.value}:a)),placeholder:"Short note about what made this emotion stand out."})]})]},l.id))})]})}function T({items:r,onChange:t,beliefs:o,modes:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What did your mind start saying?",description:"Capture the thought itself first, then optionally link a belief or mode influence.",addLabel:"Add thought",onAdd:()=>t([...r,N()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("label",{className:"grid flex-1 gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Thought"}),e.jsx(u,{value:i.text,onChange:a=>t(r.map(s=>s.id===i.id?{...s,text:a.target.value}:s)),placeholder:"What sentence, image, or conclusion showed up?"})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Parent mode influence"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.parentMode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,parentMode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Critic mode influence"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.criticMode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,criticMode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Linked belief"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.beliefId??"",onChange:a=>t(r.map(s=>s.id===i.id?{...s,beliefId:a.target.value||null}:s)),children:[e.jsx("option",{value:"",children:"None"}),o.map(a=>e.jsx("option",{value:a.id,children:a.statement},a.id))]})]})]})]},i.id))})]})}function B({items:r,onChange:t,behaviors:o,modes:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"What did you do, or want to do?",description:"Capture the move itself, then optionally link an existing behavior and the mode context around it.",addLabel:"Add behavior",onAdd:()=>t([...r,k()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("label",{className:"grid flex-1 gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Behavior or urge"}),e.jsx(u,{value:i.text,onChange:a=>t(r.map(s=>s.id===i.id?{...s,text:a.target.value}:s)),placeholder:"What did you do, or what move did you feel pulled toward?"})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Linked existing behavior"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.behaviorId??"",onChange:a=>{const s=o.find(d=>d.id===a.target.value);t(r.map(d=>d.id===i.id?{...d,behaviorId:a.target.value||null,text:s&&!d.text?s.title:d.text}:d))},children:[e.jsx("option",{value:"",children:"None"}),o.map(a=>e.jsx("option",{value:a.id,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Mode or urge context"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.mode,onChange:a=>t(r.map(s=>s.id===i.id?{...s,mode:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"None"}),l.map(a=>e.jsx("option",{value:a.title,children:a.title},a.id))]})]})]})]},i.id))})]})}function L({items:r,onChange:t,modes:o,stages:l}){return e.jsxs("div",{className:"grid gap-3",children:[e.jsx(n,{title:"How did your state shift through the chain?",description:"Build the mode timeline one moment at a time instead of typing parser syntax.",addLabel:"Add timeline moment",onAdd:()=>t([...r,w()])}),e.jsx("div",{className:"grid gap-3",children:r.map(i=>e.jsxs("div",{className:"grid gap-4 rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"grid flex-1 gap-4 md:grid-cols-3",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Stage"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.stage,onChange:a=>t(r.map(s=>s.id===i.id?{...s,stage:a.target.value}:s)),children:[e.jsx("option",{value:"",children:"Choose stage"}),l.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Mode"}),e.jsxs("select",{className:"rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-3 text-sm text-[var(--ui-ink-strong)]",value:i.modeId??"",onChange:a=>{const s=o.find(d=>d.id===a.target.value);t(r.map(d=>d.id===i.id?{...d,modeId:a.target.value||null,label:s&&!d.label?s.title:d.label}:d))},children:[e.jsx("option",{value:"",children:"Choose mode"}),o.map(a=>e.jsx("option",{value:a.id,children:a.title},a.id))]})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"Moment label"}),e.jsx(h,{value:i.label,onChange:a=>t(r.map(s=>s.id===i.id?{...s,label:a.target.value}:s)),placeholder:"What was happening in this moment?"})]})]}),e.jsx(c,{onClick:()=>t(r.filter(a=>a.id!==i.id))})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-[var(--ui-ink-soft)]",children:"What was important about this shift?"}),e.jsx(u,{value:i.note,onChange:a=>t(r.map(s=>s.id===i.id?{...s,note:a.target.value}:s)),placeholder:"Short note about how the mode showed up or what it was protecting."})]})]},i.id))})]})}export{B,E,L as M,A as S,T};
@@ -1 +1 @@
1
- import{r as S,j as t,aF as le,ds as ce,aI as J,aG as Z,dt as ee,b7 as de,bG as ue}from"./vendor-BwL6m4SE.js";import{j as me,i as he,k as pe}from"./state-Bpe5dF3T.js";import{d as ke,dX as ge,aq as fe,bb as ye,e as Ce,V as be,B as j,dY as A,k as N,C as D,c as P,P as re,cO as ve,dZ as xe,d_ as we}from"./index-FpGANF9S.js";import{P as Se}from"./page-hero-DvrM83_C.js";import"./motion-DcgUnXhY.js";import"./ui-B9TWEtCx.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";const U=[{id:"xp_levels",label:"XP and level",trophyCount:8,unlockCount:4},{id:"streaks",label:"Streak and comeback",trophyCount:14,unlockCount:10},{id:"tasks",label:"Tasks and focus runs",trophyCount:14,unlockCount:4},{id:"projects",label:"Projects, goals, and strategy",trophyCount:14,unlockCount:4},{id:"wiki",label:"Wiki, notes, and knowledge graph",trophyCount:16,unlockCount:6},{id:"psyche",label:"Psyche",trophyCount:18,unlockCount:10},{id:"habits",label:"Habits, Life Force, and health",trophyCount:8,unlockCount:8},{id:"agents",label:"Agents and collaboration",trophyCount:4,unlockCount:2}],je=[1,2,3,5,7,14,21,30,45,60,90,180,365,730],Ae=[1,2,3,5,7,10,14,21,30,60];function e(r,l){return{metric:r,threshold:l}}function n(...r){return{allOf:r}}function $(r){return r.toLowerCase().replace(/['’]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Te(r,l){const u=(r+1)/l;return u>.82?"platinum":u>.55?"gold":u>.25?"silver":"bronze"}function _e(r){return r==="platinum"?"legendary":r==="gold"?"hard":r==="silver"?"standard":"intro"}function Ne(r){return r==="platinum"?"legendary":r==="gold"?"epic":r==="silver"?"rare":"common"}function Pe(r){return`item-${r.kind}-${$(r.category)}-${$(r.title)}`}function a(r,l,u,d,i,m){return{category:r,kind:"trophy",title:l,summary:i,requirement:u,requirementText:d,reward:`${l} trophy on the Forge shelf`}}function o(r,l,u,d,i,m,p){return{category:r,kind:"unlock",title:l,summary:m,requirement:d,requirementText:i,reward:`${l} cosmetic`,unlockType:u,rewardPayload:p}}const Re=[a("xp_levels","The First Heat",e("nonManualXp",5e3),"Earn 5,000 non-manual XP.","The first real furnace of work is hot enough to be noticed."),a("xp_levels","Bellows Graduate",e("nonManualXp",1e4),"Earn 10,000 non-manual XP.","Your reward ledger is no longer a spark; it is a system."),a("xp_levels","Iron Apprentice",e("nonManualXp",2e4),"Earn 20,000 non-manual XP.","You have repeated the work enough that the anvil knows your hand."),a("xp_levels","Steel Temper",e("nonManualXp",5e4),"Earn 50,000 non-manual XP.","Pressure has started to make the metal cleaner instead of louder."),a("xp_levels","Crown of Coals",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A visible crown for an invisible mountain of completed work."),a("xp_levels","Obsidian Master",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","The Forge Smith stops testing your seriousness and starts respecting it."),a("xp_levels","Star-Forge Adept",e("nonManualXp",5e5),"Earn 500,000 non-manual XP.","Your XP trail burns like a constellation across the operating system."),a("xp_levels","Mythic Smith",e("nonManualXp",1e6),"Earn 1,000,000 non-manual XP.","A ridiculous trophy for a ridiculous amount of lived execution.")],Fe=[o("xp_levels","Obsidian Smith","mascot_skin",e("nonManualXp",8e3),"Earn 8,000 non-manual XP.","A dramatic black-iron Forge Smith skin.",{mascotSkin:"obsidian-smith"}),o("xp_levels","Molten Progress Bar","hud_treatment",e("nonManualXp",25e3),"Earn 25,000 non-manual XP.","A bright molten XP fill for the level ring.",{hudTreatment:"molten-progress"}),o("xp_levels","Apex Level Frame","icon_frame",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A high-tier frame for level and trophy icons.",{iconFrame:"apex-level"}),o("xp_levels","Masterwork Glow","celebration_variant",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","A stronger forge-bell reveal for major unlocks.",{celebrationVariant:"masterwork-glow"})],Ee=[a("streaks","Spark Kept",e("longestStreakDays",1),"Play one qualifying day.","The first day is small, but the forge heard it."),a("streaks","Three-Day Furnace",e("longestStreakDays",3),"Reach a 3-day streak.","Three returns make the first shape of discipline."),a("streaks","Week-Fire",e("longestStreakDays",7),"Reach a 7-day streak.","Seven days changes the temperature of your life."),a("streaks","Twin-Week Bellows",e("longestStreakDays",14),"Reach a 14-day streak.","Two weeks of showing up makes the room expect you."),a("streaks","Cinder Discipline",e("longestStreakDays",21),"Reach a 21-day streak.","The fire is not accidental anymore."),a("streaks","Monthly Forge",e("longestStreakDays",30),"Reach a 30-day streak.","A full month of returns becomes a personal weather system."),a("streaks","Sixty-Day Flame",e("longestStreakDays",60),"Reach a 60-day streak.","The Smith grows stronger because you stopped disappearing."),a("streaks","Quarter-Anvil",e("longestStreakDays",90),"Reach a 90-day streak.","Ninety days is not motivation. It is architecture."),a("streaks","Half-Year Inferno",e("longestStreakDays",180),"Reach a 180-day streak.","The forge is now a season of your life."),a("streaks","Year of Steel",e("longestStreakDays",365),"Reach a 365-day streak.","A year of returns. The anvil has become a witness."),a("streaks","Comeback Hammer",e("comebackAfter7Count",1),"Return after 7+ missed days and complete a qualifying action.","You came back after the room went cold."),a("streaks","Repair Artist",e("comebackAfter7Count",3),"Complete 3 major comebacks.","Breaking the chain did not become breaking the story."),a("streaks","Rust Refuser",n(e("comebackAfter7Count",5),e("longestStreakDays",30)),"Complete 5 major comebacks and reach a 30-day streak.","You repeatedly turned absence into a new strike."),a("streaks","Relentless Return",n(e("comebackAfter7Count",8),e("longestStreakDays",90)),"Complete 8 major comebacks and reach a 90-day streak.","This trophy is for the part of you that keeps coming back.")],Ie=[o("streaks","Bronze Ember Flame","streak_effect",e("longestStreakDays",3),"Reach a 3-day streak.","A small ember around the streak HUD.",{streakEffect:"bronze-ember"}),o("streaks","Blue Forge-Fire","streak_effect",e("longestStreakDays",7),"Reach a 7-day streak.","A cool blue streak flame.",{streakEffect:"blue-forge-fire"}),o("streaks","Violet Arc Flame","streak_effect",e("longestStreakDays",21),"Reach a 21-day streak.","A sharper violet flame effect.",{streakEffect:"violet-arc"}),o("streaks","Molten Crown Fire","streak_effect",e("longestStreakDays",60),"Reach a 60-day streak.","A crown-like fire treatment for streaks.",{streakEffect:"molten-crown"}),o("streaks","Stern Pressure Pose","mascot_pose",e("comebackAfter7Count",1),"Complete a major comeback.","Unlocks the Smith's stern pressure pose.",{mascotPose:"stern-pressure"}),o("streaks","Comeback Pose","mascot_pose",e("comebackAfter7Count",2),"Complete 2 major comebacks.","Unlocks the Smith's comeback repair pose.",{mascotPose:"comeback"}),o("streaks","Awakening Forge Pose","mascot_pose",e("longestStreakDays",30),"Reach a 30-day streak.","Unlocks the forge awakening mascot pose.",{mascotPose:"awakening-forge"}),o("streaks","Yearfire Aura","streak_effect",e("longestStreakDays",365),"Reach a 365-day streak.","A huge aura for year-scale presence.",{streakEffect:"yearfire-aura"}),o("streaks","Old Foundry Shelf","trophy_shelf",e("longestStreakDays",90),"Reach a 90-day streak.","A warmer trophy shelf skin.",{trophyShelf:"old-foundry"}),o("streaks","Relentless Bell","celebration_variant",e("longestStreakDays",180),"Reach a 180-day streak.","A heavier celebration sound-and-spark treatment.",{celebrationVariant:"relentless-bell"})],Me=[a("tasks","First Strike",e("taskCompletionCount",25),"Complete 25 tasks.","A real task trail begins."),a("tasks","Clean Swing",n(e("taskCompletionCount",50),e("focusRunCount",10)),"Complete 50 tasks and 10 task runs.","Tasks and time-tracked execution start to converge."),a("tasks","Five Rivets",n(e("taskCompletionCount",75),e("taskCloseoutReportCount",5)),"Complete 75 tasks and 5 completion reports.","You are leaving proof behind, not just checkmarks."),a("tasks","Task Blade",n(e("taskCompletionCount",120),e("focusRunCount",25)),"Complete 120 tasks and 25 task runs.","A sharp blade forged out of repeated finishes."),a("tasks","Anvil Marathon",n(e("taskCompletionCount",300),e("focusRunCount",75)),"Complete 300 tasks and 75 task runs.","The long road achievement for serious execution."),a("tasks","Deep-Work Maul",e("creditedFocusMinutes",3e3),"Log 3,000 credited focus minutes.","The heavy hammer of deliberate time."),a("tasks","Planned Heat",e("plannedFocusRunCount",25),"Complete 25 planned task runs.","You planned the heat before striking the metal."),a("tasks","Closeout Scribe",e("taskCloseoutReportCount",25),"Write 25 task completion reports.","The Forge remembers what changed because you wrote it down."),a("tasks","Hundred-Hammer Road",e("taskCompletionCount",500),"Complete 500 tasks.","A road paved with finished work."),a("tasks","Timebox Knight",n(e("plannedFocusRunCount",75),e("creditedFocusMinutes",7500)),"Complete 75 planned runs and 7,500 focus minutes.","A trophy for time that obeyed the mission."),a("tasks","Backlog Breaker",e("taskCompletionCount",750),"Complete 750 tasks.","The backlog learned to fear your return."),a("tasks","Execution Monarch",n(e("taskCompletionCount",1e3),e("focusRunCount",200)),"Complete 1,000 tasks and 200 task runs.","A crown for turning vague intention into finished artifacts."),a("tasks","Forge Ledger Exact",e("taskCloseoutReportCount",100),"Write 100 task completion reports.","The most boring discipline becomes the most useful history."),a("tasks","The Hammer Does Not Blink",n(e("taskCompletionCount",1500),e("creditedFocusMinutes",15e3)),"Complete 1,500 tasks and 15,000 focus minutes.","For absurd consistency under real load.")],Ke=[o("tasks","Hammer Cursor","icon_frame",e("taskCompletionCount",75),"Complete 75 tasks.","A hammer-shaped action accent.",{iconFrame:"hammer-cursor"}),o("tasks","Focus Rail Glow","hud_treatment",e("focusRunCount",25),"Complete 25 task runs.","A task-run glow for compact HUDs.",{hudTreatment:"focus-rail-glow"}),o("tasks","Completion Burst","celebration_variant",e("taskCloseoutReportCount",25),"Write 25 completion reports.","A sharper task-completion burst.",{celebrationVariant:"completion-burst"}),o("tasks","Ember Knight","mascot_skin",e("taskCompletionCount",500),"Complete 500 tasks.","A molten-armored Forge Smith skin for execution mastery.",{mascotSkin:"ember-knight"})],$e=[a("projects","Aligned Spark",e("goalLinkedTaskCompletionCount",25),"Complete 25 goal-linked tasks.","Work starts pointing at something bigger."),a("projects","Goal Rivet",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",3)),"Complete 50 goal-linked tasks across 3 goals.","Several goals now have real rivets, not just titles."),a("projects","Strategist's Seal",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",5)),"Complete 50 goal-linked tasks across 5 goals.","A seal for strategy that survived contact with execution."),a("projects","Project Spine",n(e("projectLinkedTaskCompletionCount",100),e("activeProjectCount",5)),"Complete 100 project-linked tasks while maintaining 5 active projects.","The work has a spine across multiple initiatives."),a("projects","Strategy Weld",e("strategyCount",10),"Create 10 strategies.","You forged planning layers instead of improvising every day."),a("projects","Purpose Hammer",e("goalLinkedTaskCompletionCount",150),"Complete 150 goal-linked tasks.","The hammer keeps landing where your stated life points."),a("projects","Arc Builder",n(e("projectLinkedTaskCompletionCount",250),e("distinctGoalsWithCompletions",8)),"Complete 250 project-linked tasks across 8 goals.","Multiple arcs moved because you kept building."),a("projects","North-Star Foundry",n(e("goalLinkedTaskCompletionCount",300),e("strategyCount",20)),"Complete 300 goal-linked tasks and create 20 strategies.","The north star is no longer decorative."),a("projects","Project Finisher",e("projectCompletionCount",5),"Complete 5 projects.","Finished projects leave heavier evidence than active dreams."),a("projects","Life-Work Crown",n(e("projectCompletionCount",10),e("goalLinkedTaskCompletionCount",500)),"Complete 10 projects and 500 goal-linked tasks.","A crown for long arcs that actually closed."),a("projects","Portfolio Anvil",e("activeProjectCount",12),"Maintain 12 active projects.","A large operating portfolio, held without flattening."),a("projects","Tracer Bullet Guild",n(e("projectCompletionCount",15),e("strategyCount",35)),"Complete 15 projects and create 35 strategies.","Strategy and delivery joined hands repeatedly."),a("projects","Mountain Moved",e("goalLinkedTaskCompletionCount",1e3),"Complete 1,000 goal-linked tasks.","The trophy for moving a mountain one task at a time."),a("projects","The Work Had A Spine",n(e("projectCompletionCount",25),e("distinctGoalsWithCompletions",12)),"Complete 25 projects across 12 goals.","Your life map became execution history.")],Le=[o("projects","Goal Compass Frame","icon_frame",e("goalLinkedTaskCompletionCount",50),"Complete 50 goal-linked tasks.","A compass frame for aligned-work trophies.",{iconFrame:"goal-compass"}),o("projects","War-Room Iron Shelf","trophy_shelf",e("projectLinkedTaskCompletionCount",150),"Complete 150 project-linked tasks.","A darker tactical trophy shelf.",{trophyShelf:"war-room-iron"}),o("projects","North-Star HUD","hud_treatment",e("strategyCount",20),"Create 20 strategies.","A strategy-forward HUD treatment.",{hudTreatment:"north-star"}),o("projects","Foundry Compass Burst","celebration_variant",e("projectCompletionCount",10),"Complete 10 projects.","A compass-shaped major reveal.",{celebrationVariant:"foundry-compass"})],Ge=[a("wiki","First Inscription",e("wikiPageCount",50),"Create 50 wiki pages.","Knowledge has started to become an archive."),a("wiki","Memory Rivet",e("noteCount",100),"Create 100 notes.","The system remembers because you gave it material."),a("wiki","Archive Ember",n(e("wikiPageCount",150),e("wikiLinkCount",50)),"Create 150 wiki pages and 50 wiki links.","The archive starts connecting to itself."),a("wiki","Knowledge Anvil",n(e("wikiPageCount",250),e("wikiLinkCount",150)),"Create 250 wiki pages and 150 wiki links.","A serious anvil of memory and links."),a("wiki","Living Index",n(e("wikiPageWithSummaryCount",100),e("linkedWikiPageCount",100)),"Maintain 100 wiki pages with summaries and linked entities.","Pages now carry shape, summary, and relationships."),a("wiki","Black Library",n(e("wikiPageCount",500),e("wikiLinkCount",300)),"Create 500 wiki pages and 300 wiki links.","The great hard knowledge trophy."),a("wiki","Obsidian Index",n(e("wikiPageWithSummaryCount",250),e("wikiLinkCount",500)),"Maintain 250 summarized pages and 500 links.","The archive is no longer just big; it is navigable."),a("wiki","Graph Lantern",e("knowledgeGraphNodeCount",500),"Reach 500 Knowledge Graph nodes.","The graph has enough stars to navigate by."),a("wiki","Entity Weaver",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","Your memory connects to the operating system."),a("wiki","Codex Temper",n(e("wikiPageCount",750),e("wikiLinkCount",750)),"Create 750 wiki pages and 750 wiki links.","A codex tempered by breadth and connection."),a("wiki","Note Furnace",e("noteCount",500),"Create 500 notes.","Raw notes became a real furnace of evidence."),a("wiki","Archive Cartographer",n(e("wikiPageWithSummaryCount",400),e("linkedWikiPageCount",300)),"Maintain 400 summarized pages and 300 linked pages.","You mapped the archive enough that it can map you back."),a("wiki","The Shelf Breathes",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","The knowledge system feels alive at a glance."),a("wiki","Librarian of Coals",n(e("noteCount",1e3),e("wikiLinkCount",1e3)),"Create 1,000 notes and 1,000 wiki links.","A trophy for the long, quiet archive discipline."),a("wiki","Living Codex",n(e("wikiPageCount",1500),e("wikiPageWithSummaryCount",750),e("wikiLinkCount",1500)),"Create 1,500 pages, 750 summarized pages, and 1,500 links.","The living memory crown."),a("wiki","Memory Starfield",e("knowledgeGraphNodeCount",2e3),"Reach 2,000 Knowledge Graph nodes.","The graph becomes a sky.")],Oe=[o("wiki","Quiet Library Shelf","trophy_shelf",e("wikiPageCount",150),"Create 150 wiki pages.","A quiet library shelf skin.",{trophyShelf:"quiet-library"}),o("wiki","Rune Page Frame","icon_frame",e("wikiLinkCount",150),"Create 150 wiki links.","A runic frame for knowledge trophies.",{iconFrame:"rune-page"}),o("wiki","Scholar Glass HUD","hud_treatment",e("wikiPageWithSummaryCount",100),"Maintain 100 summarized wiki pages.","A glassy scholar HUD treatment.",{hudTreatment:"scholar-glass"}),o("wiki","Archive Sparks","celebration_variant",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","A page-flare reveal variant.",{celebrationVariant:"archive-sparks"}),o("wiki","Astral Archive Shelf","trophy_shelf",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","A cosmic trophy shelf for memory work.",{trophyShelf:"astral-archive"}),o("wiki","Reading Smith Pose","mascot_pose",e("wikiPageWithSummaryCount",250),"Maintain 250 summarized wiki pages.","Unlocks the Forge Smith reading pose.",{mascotPose:"reading"})],De=[a("psyche","Named Spark",e("psycheValueCount",5),"Create 5 Psyche values.","You named the values the forge should obey."),a("psyche","Pattern Tongs",e("behaviorPatternCount",5),"Create 5 behavior patterns.","The recurring loops are now held with tongs."),a("psyche","Belief Crucible",e("beliefEntryCount",5),"Create 5 belief entries.","Beliefs entered the fire where they can be worked."),a("psyche","Mode Lantern",e("modeProfileCount",3),"Create 3 mode profiles.","The inner cast has names and lantern light."),a("psyche","Trigger Witness",e("triggerReportCount",3),"Create 3 trigger reports.","You turned moments of activation into evidence."),a("psyche","Mode Cartographer",n(e("modeProfileCount",8),e("linkedModeProfileCount",8)),"Create 8 mode profiles, each linked to a value, behavior, or pattern.","A map of modes, not a pile of labels."),a("psyche","Trigger Alchemist",n(e("triggerReportRichCount",30),e("triggerReportCompletedCount",20)),"Complete 30 rich trigger reports and mark 20 reports beyond draft.","Activation was turned into material for change."),a("psyche","Pattern Breaker",n(e("behaviorPatternCount",20),e("behaviorPatternWithReplacementCount",10)),"Create 20 patterns and link 10 to replacement responses.","The old loops now have counter-moves."),a("psyche","Belief Temperer",n(e("beliefEntryCount",25),e("beliefFlexibleAlternativeCount",25)),"Create 25 beliefs with flexible alternatives.","Rigid beliefs were heated until they could bend."),a("psyche","Value Blade",n(e("psycheValueCount",10),e("goalLinkedTaskCompletionCount",100)),"Create 10 values and complete 100 goal-linked tasks.","Values and work started cutting in the same direction."),a("psyche","Shadow Temper",n(e("modeProfileCount",12),e("triggerReportRichCount",50)),"Create 12 modes and 50 rich trigger reports.","Shadow material became usable steel."),a("psyche","Inner Forge",n(e("psycheValueCount",12),e("behaviorPatternCount",25),e("beliefFlexibleAlternativeCount",30)),"Create 12 values, 25 patterns, and 30 flexible beliefs.","A full inner forge takes shape."),a("psyche","Schema Bell",e("questionnaireRunCount",40),"Complete 40 questionnaire runs.","Structured self-observation rang the bell repeatedly."),a("psyche","Mode Guide",e("modeGuideSessionCount",5),"Complete 5 mode guide sessions.","Guided mode work became an actual practice."),a("psyche","Repair Script",e("behaviorCount",10),"Create 10 Psyche behaviors.","Behaviors now carry repair plans, not just names."),a("psyche","Flexible Self",e("beliefFlexibleAlternativeCount",50),"Create 50 beliefs with flexible alternatives.","A trophy for not letting old beliefs remain iron cages."),a("psyche","Trigger Cartography",e("triggerReportRichCount",100),"Create 100 rich trigger reports.","The map of activation became detailed enough to steer by."),a("psyche","The Inner Council",n(e("modeProfileCount",20),e("behaviorCount",20),e("beliefFlexibleAlternativeCount",75)),"Create 20 modes, 20 behaviors, and 75 flexible beliefs.","The inner system became a council instead of noise.")],He=[o("psyche","Scholar Smith","mascot_skin",e("psycheValueCount",7),"Create 7 Psyche values.","A wise, bookish Forge Smith skin.",{mascotSkin:"scholar-smith"}),o("psyche","Wise Smith Pose","mascot_pose",e("modeProfileCount",3),"Create 3 mode profiles.","Unlocks the wise mentor pose.",{mascotPose:"wise"}),o("psyche","Reflection Frame","icon_frame",e("beliefEntryCount",10),"Create 10 belief entries.","A reflective frame for Psyche trophies.",{iconFrame:"reflection"}),o("psyche","Mode Lens HUD","hud_treatment",e("modeProfileCount",8),"Create 8 mode profiles.","A HUD tuned to Psyche work.",{hudTreatment:"mode-lens"}),o("psyche","Shadow Smith","mascot_skin",e("triggerReportRichCount",25),"Create 25 rich trigger reports.","A darker Smith skin for shadow work.",{mascotSkin:"shadow-smith"}),o("psyche","Arcane Metallurgist","mascot_skin",e("beliefFlexibleAlternativeCount",25),"Create 25 beliefs with flexible alternatives.","A rune-lit Smith skin for deep reflection.",{mascotSkin:"arcane-metallurgist"}),o("psyche","Inner-Fire Halo","streak_effect",e("psycheValueCount",10),"Create 10 Psyche values.","A halo-like flame for reflective momentum.",{streakEffect:"inner-fire-halo"}),o("psyche","Mode Lantern Reveal","celebration_variant",e("modeProfileCount",12),"Create 12 mode profiles.","A lantern reveal for Psyche unlocks.",{celebrationVariant:"mode-lantern"}),o("psyche","Therapist's Shelf","trophy_shelf",e("triggerReportRichCount",50),"Create 50 rich trigger reports.","A quiet shelf for inner-work trophies.",{trophyShelf:"therapist-shelf"}),o("psyche","Prismatic Crucible","celebration_variant",e("beliefFlexibleAlternativeCount",50),"Create 50 flexible belief alternatives.","A prismatic reveal for belief work.",{celebrationVariant:"prismatic-crucible"})],ze=[a("habits","Ritual Spark",e("habitAlignedCount",25),"Record 25 aligned habit check-ins.","Your recurring commitments have started to leave marks."),a("habits","Routine Rivet",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","The habit rail is no longer decorative."),a("habits","Habit Heat",n(e("habitAlignedCount",150),e("habitStreakMax",14)),"Record 150 aligned check-ins and a 14-day habit streak.","One behavior got hot enough to shape you."),a("habits","Ritual Iron",e("habitAlignedCount",365),"Record 365 aligned habit check-ins.","The hard habit trophy."),a("habits","Recovery Shield",e("recoveryEventCount",50),"Earn 50 recovery rewards.","Recovery was treated as part of the work."),a("habits","Life-Force Alloy",e("lifeForceSnapshotCount",100),"Record 100 Life Force day snapshots.","Energy accounting became a usable alloy."),a("habits","Sleep Temper",e("healthSleepSessionCount",120),"Import 120 sleep sessions.","Sleep became evidence, not a guess."),a("habits","Vitality Forge",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","Body data and execution entered the same forge.")],Be=[o("habits","Recovery Blue Flame","streak_effect",e("recoveryEventCount",20),"Earn 20 recovery rewards.","A cooler recovery flame.",{streakEffect:"recovery-blue"}),o("habits","Ritual Check Glow","hud_treatment",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","A habit-check glow for the HUD.",{hudTreatment:"ritual-check"}),o("habits","Storm Forger","mascot_skin",e("workoutSessionCount",50),"Import 50 workouts.","A storm-lit Smith skin for movement arcs.",{mascotSkin:"storm-forger"}),o("habits","Clockwork Smith","mascot_skin",e("habitAlignedCount",150),"Record 150 aligned habit check-ins.","A clockwork skin for ritual precision.",{mascotSkin:"clockwork-smith"}),o("habits","Vital Flame","streak_effect",e("healthSleepSessionCount",90),"Import 90 sleep sessions.","A vital-sign flame around streak indicators.",{streakEffect:"vital-flame"}),o("habits","Life-Force Frame","icon_frame",e("lifeForceSnapshotCount",100),"Record 100 Life Force snapshots.","An AP-inspired frame for body trophies.",{iconFrame:"life-force"}),o("habits","Steady-State Aura","streak_effect",e("habitStreakMax",60),"Reach a 60-day habit streak.","An aura for long stable rituals.",{streakEffect:"steady-state"}),o("habits","Celestial Smith","mascot_skin",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","A celestial skin for body stewardship.",{mascotSkin:"celestial-smith"})],We=[a("agents","Companion Spark",e("agentActionCount",5),"Record 5 agent actions.","The first sign of a working human-agent council."),a("agents","Bot Bellows",e("agentCompletedActionCount",20),"Complete 20 agent actions.","Agents are not just present; they are moving work."),a("agents","Council Spark",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","The collaboration trophy for meaningful assisted work."),a("agents","Guild Forge",n(e("agentCompletedActionCount",100),e("collaborationRewardCount",100)),"Complete 100 agent actions and earn 100 collaboration rewards.","The Forge has become a small guild.")],Ue=[o("agents","Guild Badge Frame","icon_frame",e("agentCompletedActionCount",20),"Complete 20 agent actions.","A guild frame for agent trophies.",{iconFrame:"guild-badge"}),o("agents","Council Sparks Reveal","celebration_variant",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","A council-sparks reveal for collaboration.",{celebrationVariant:"council-sparks"})],Ye=[...Re,...Fe,...Ee,...Ie,...Me,...Ke,...$e,...Le,...Ge,...Oe,...De,...He,...ze,...Be,...We,...Ue];function Xe(){let r=0,l=0,u=0;const d=new Map;return Ye.map(i=>{const m=U.find(L=>L.id===i.category);if(!m)throw new Error(`Unknown gamification category ${i.category}`);const p=d.get(i.category)??{trophy:0,unlock:0},x=p[i.kind];p[i.kind]+=1,d.set(i.category,p);const R=i.kind==="trophy"?m.trophyCount:m.unlockCount,v=Te(x,R),F=`${i.kind}-${$(i.category)}-${$(i.title)}`,w=i.kind==="trophy"?l++:u++;return{id:F,kind:i.kind,category:i.category,tier:v,difficulty:_e(v),hidden:i.hidden??!1,title:i.title,summary:i.summary,requirement:i.requirement,requirementText:i.requirementText,reward:i.reward,unlockType:i.kind==="unlock"?i.unlockType??"icon_frame":null,rewardPayload:i.kind==="unlock"?i.rewardPayload??{}:{trophyId:F},assetKey:Pe(i),sheetKey:`${i.kind==="trophy"?"trophies":"unlocks"}-r${Math.floor(w/10)+1}-c${w%10+1}`,rarity:Ne(v),sortOrder:r++}})}const y=Xe();function qe(){if(y.length!==144)throw new Error(`GAMIFICATION_CATALOG must contain exactly 144 items; found ${y.length}.`);const r=y.filter(d=>d.kind==="trophy").length,l=y.filter(d=>d.kind==="unlock").length;if(r!==96||l!==48)throw new Error(`GAMIFICATION_CATALOG must contain 96 trophies and 48 unlocks; found ${r}/${l}.`);for(const d of U){const i=y.filter(p=>p.category===d.id&&p.kind==="trophy").length,m=y.filter(p=>p.category===d.id&&p.kind==="unlock").length;if(i!==d.trophyCount||m!==d.unlockCount)throw new Error(`${d.id} expected ${d.trophyCount}/${d.unlockCount}, found ${i}/${m}.`)}if(new Set(y.map(d=>d.assetKey)).size!==y.length)throw new Error("Every trophy and unlock must have a unique asset key.")}qe();const te=U.map(r=>({id:r.id,label:r.label})),Ve=Array.from({length:30},(r,l)=>`mascot-state-${String(l+1).padStart(3,"0")}`),Qe=je.map((r,l)=>[r,`mascot-state-${String(17+l).padStart(3,"0")}`]),Je=Ae.map((r,l)=>[r,`mascot-state-${String(10-l).padStart(3,"0")}`]),z=Ve;if(z.length!==30)throw new Error(`GAMIFICATION_MASCOT_KEYS must contain exactly 30 mascot/state keys; found ${z.length}.`);function Ze(r){switch(r.category){case"xp_levels":return"#f59e0b";case"streaks":return"#fb923c";case"tasks":return"#f97316";case"projects":return"#38bdf8";case"wiki":return"#a78bfa";case"psyche":return"#8b5cf6";case"habits":return"#4ade80";case"agents":return"#22d3ee";default:return"#f59e0b"}}function et(r){return["cinematic stylized blacksmith game icon",r.category.replace(/_/g," "),r.kind,r.title,"obsidian iron, ember gold, cool violet and cyan steel highlights, no text"].join(", ")}const tt=Object.fromEntries(y.map(r=>[r.assetKey,{key:r.assetKey,role:"item",itemKind:r.kind,alt:`${r.title} ${r.kind} icon.`,dominantColor:Ze(r),tierFrame:r.tier,sourcePath:`gamification/source/themes/dark-fantasy/items/${r.assetKey}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/items/${r.assetKey}-{size}.webp`,sheetKey:r.sheetKey,prompt:et(r)}])),at=Object.fromEntries(z.map(r=>{const l=Number(r.replace("mascot-state-","")),u=l<=10,d=l>=17;return[r,{key:r,role:d||u?"streak":"mascot",alt:u?"The Forge Smith in a safe cold-forge absence state.":"The Forge Smith mascot in a dramatic blacksmith game-art pose.",dominantColor:u?"#64748b":d?"#fb923c":"#38bdf8",tierFrame:"none",sourcePath:`gamification/source/themes/dark-fantasy/mascots/${r}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/mascots/${r}-{size}.webp`,sheetKey:null,prompt:"dramatic Forge Smith blacksmith mascot, premium game art, no text, no watermark"}]}));({...tt,...at});function T(r){r.currentTarget.hidden=!0}const rt=["all","bronze","silver","gold","platinum"],st=[{id:"trophies",label:"Trophies"},{id:"unlocks",label:"Unlocks"},{id:"armory",label:"Mascot Armory"},{id:"streak",label:"Streak Forge"}],B={mascot_skin:{field:"selectedMascotSkin",payloadKey:"mascotSkin",label:"Mascot skin"},hud_treatment:{field:"selectedHudTreatment",payloadKey:"hudTreatment",label:"HUD treatment"},streak_effect:{field:"selectedStreakEffect",payloadKey:"streakEffect",label:"Streak flame"},trophy_shelf:{field:"selectedTrophyShelf",payloadKey:"trophyShelf",label:"Trophy shelf"},celebration_variant:{field:"selectedCelebrationVariant",payloadKey:"celebrationVariant",label:"Celebration"}};function se(r){switch(r){case"platinum":return"border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] bg-[var(--ui-accent-soft)] text-[var(--primary)]";case"gold":return"border-[color-mix(in_srgb,var(--warning)_32%,var(--ui-border-subtle)_68%)] bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]";case"silver":return"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";default:return"border-[color-mix(in_srgb,var(--warning)_26%,var(--ui-border-subtle)_74%)] bg-[var(--ui-warning-soft)] text-[var(--warning)]"}}const ae="min-w-0 overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4",H="min-w-0 overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",C="text-[var(--ui-ink-strong)]",b="text-[var(--ui-ink-soft)]",_="text-[var(--ui-ink-faint)]",W="bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";function ot(r){const l=r.unlockType?B[r.unlockType]:null,u=l?r.rewardPayload[l.payloadKey]:null;return typeof u=="string"?u:null}function nt({item:r,gamificationTheme:l,onSelect:u}){return t.jsxs("button",{type:"button",onClick:()=>u(r),className:P("group relative min-h-[19rem] overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 text-left shadow-[var(--ui-shadow-soft)] transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] hover:bg-[var(--ui-surface-hover)]",!r.unlocked&&"opacity-78"),children:[t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsx(N,{className:P("border",se(r.tier)),children:r.tier}),t.jsx(N,{className:W,children:r.unlocked?"earned":"locked"})]}),t.jsx("div",{className:"mt-3 grid place-items-center",children:t.jsx("img",{src:A(r.assetKey,512,l),alt:"",onError:T,className:P("size-36 object-contain drop-shadow-[var(--ui-shadow-soft)] transition group-hover:scale-[1.03]",!r.unlocked&&"grayscale")})}),t.jsxs("div",{className:"mt-3 min-w-0",children:[t.jsx("div",{className:`font-display text-lg ${C}`,children:r.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:r.unlocked?r.summary:r.requirementText})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:r.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[r.progressCurrent,"/",r.progressTarget]}),t.jsxs("span",{children:[r.progressPercent,"%"]})]})]})]})}function kt(){var X,q,V,Q;const r=ke(),l=ge(),u=me(),d=fe(),i=Array.isArray(r.selectedUserIds)?r.selectedUserIds:[],[m,p]=S.useState("trophies"),[x,R]=S.useState("all"),[v,F]=S.useState("all"),[w,L]=S.useState("all"),[G,oe]=S.useState(""),[k,E]=S.useState(null),I=he({queryKey:["forge-gamification-catalog",...i],queryFn:()=>we(i)}),M=ye(i),Y=pe({mutationFn:s=>xe(s,i),onSuccess:async()=>{await Promise.all([u.invalidateQueries({queryKey:["forge-gamification-catalog"]}),u.invalidateQueries({queryKey:["forge-xp-metrics"]})]),d(ve.util.invalidateTags(["Gamification"]))}}),g=(X=I.data)==null?void 0:X.catalog,O=(g==null?void 0:g.items)??[],ne=S.useMemo(()=>{const s=G.trim().toLowerCase();return O.filter(c=>m==="trophies"&&c.kind!=="trophy"||m==="unlocks"&&c.kind!=="unlock"||(m==="armory"||m==="streak")&&c.kind!=="unlock"||m==="armory"&&!c.unlockType||m==="streak"&&c.unlockType!=="streak_effect"||x!=="all"&&c.category!==x||v!=="all"&&c.tier!==v||w==="unlocked"&&!c.unlocked||w==="locked"&&c.unlocked?!1:s?`${c.title} ${c.summary} ${c.requirementText} ${c.reward}`.toLowerCase().includes(s):!0)},[x,O,G,w,m,v]),h=(g==null?void 0:g.equipment)??((q=M.data)==null?void 0:q.metrics.equipment)??null,ie=O.filter(s=>s.kind==="unlock"&&s.unlockType&&B[s.unlockType]);return I.isError?t.jsx(Ce,{eyebrow:"Rewards",error:I.error,onRetry:()=>void I.refetch()}):t.jsxs("div",{className:"mx-auto grid w-full max-w-[1320px] gap-5",children:[t.jsx(Se,{title:"Trophy Hall",description:"Achievements are earned from real Forge behavior: tasks, runs, goals, wiki links, Psyche work, habits, Life Force, health, and collaboration.",badge:g?`${g.unlockedCount}/${g.totalCount} earned`:"Loading",actions:(V=M.data)!=null&&V.metrics?t.jsx(be,{metrics:M.data.metrics.profile}):null}),t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.42fr)]",children:[t.jsxs("div",{className:ae,children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(s=>t.jsxs(j,{type:"button",variant:m===s.id?"primary":"secondary",size:"sm",onClick:()=>p(s.id),children:[s.id==="trophies"?t.jsx(le,{className:"size-4"}):null,s.id==="armory"?t.jsx(ce,{className:"size-4"}):null,s.id==="streak"?t.jsx(J,{className:"size-4"}):null,s.id==="unlocks"?t.jsx(Z,{className:"size-4"}):null,s.label]},s.id))}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap items-center gap-2",children:[["all","unlocked","locked"].map(s=>t.jsxs(j,{type:"button",variant:w===s?"primary":"secondary",size:"sm",onClick:()=>L(s),children:[s==="locked"?t.jsx(ee,{className:"size-4"}):null,s]},s)),t.jsxs("label",{className:`ml-auto flex min-h-10 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 text-sm ${b} sm:min-w-[16rem]`,children:[t.jsx(de,{className:`size-4 shrink-0 ${_}`}),t.jsx("input",{value:G,onChange:s=>oe(s.target.value),placeholder:"Search rewards",className:"min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] outline-none placeholder:text-[var(--ui-ink-faint)]"})]})]}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:[t.jsx(j,{type:"button",variant:x==="all"?"primary":"secondary",size:"sm",onClick:()=>R("all"),children:"all categories"}),te.map(s=>t.jsx(j,{type:"button",variant:x===s.id?"primary":"secondary",size:"sm",onClick:()=>R(s.id),children:s.label},s.id))]}),t.jsx("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:rt.map(s=>t.jsx(j,{type:"button",variant:v===s?"primary":"secondary",size:"sm",onClick:()=>F(s),children:s},s))})]}),t.jsxs("div",{className:ae,children:[t.jsxs("div",{className:`flex items-center gap-2 text-sm font-semibold ${C}`,children:[t.jsx(Z,{className:"size-4 text-[var(--tertiary)]"}),"Near completion"]}),((g==null?void 0:g.nextTargets)??[]).map(s=>t.jsxs("button",{type:"button",onClick:()=>E(s),className:"grid min-w-0 grid-cols-[2.75rem_minmax(0,1fr)_3rem] items-center gap-3 rounded-2xl border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-2 text-left transition hover:bg-[var(--ui-surface-hover)]",children:[t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:"size-11 object-contain"}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block truncate text-sm ${C}`,children:s.title}),t.jsx("span",{className:`block truncate text-[11px] ${_}`,children:s.requirementText})]}),t.jsxs("span",{className:`text-right text-xs ${b}`,children:[s.progressPercent,"%"]})]},s.id))]})]}),m==="armory"?t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(18rem,0.42fr)_minmax(0,1fr)]",children:[t.jsxs("div",{className:"relative min-h-[24rem] overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 shadow-[var(--ui-shadow-soft)]",children:[t.jsx("img",{src:A(((Q=M.data)==null?void 0:Q.metrics.mascot.spriteKey)??"mascot-state-014",512,l),alt:"Forge Smith mascot",onError:T,className:"absolute inset-x-0 bottom-0 mx-auto h-[23rem] object-contain"}),t.jsxs("div",{className:"relative z-10",children:[t.jsx(N,{className:"bg-[var(--ui-accent-soft)] text-[var(--tertiary)]",children:"Equipped"}),t.jsxs("div",{className:`mt-3 grid gap-1 text-sm ${b}`,children:[t.jsxs("span",{children:["Skin: ",(h==null?void 0:h.selectedMascotSkin)??"default"]}),t.jsxs("span",{children:["HUD: ",(h==null?void 0:h.selectedHudTreatment)??"default"]}),t.jsxs("span",{children:["Flame: ",(h==null?void 0:h.selectedStreakEffect)??"default"]}),t.jsxs("span",{children:["Shelf: ",(h==null?void 0:h.selectedTrophyShelf)??"default"]})]})]})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(s=>{const c=s.unlockType?B[s.unlockType]:null,f=ot(s),K=!!(c&&f&&(h==null?void 0:h[c.field])===f);return t.jsxs(D,{className:P("p-4",!s.unlocked&&"opacity-70"),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx(N,{className:W,children:(c==null?void 0:c.label)??"Cosmetic"}),K?t.jsx(ue,{className:"size-4 text-[var(--success)]"}):null]}),t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:P("mx-auto mt-3 size-28 object-contain",!s.unlocked&&"grayscale")}),t.jsx("div",{className:`mt-3 font-display text-lg ${C}`,children:s.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:s.unlocked?s.summary:s.requirementText}),t.jsx(j,{type:"button",variant:K?"secondary":"primary",size:"sm",disabled:!s.unlocked||!c||!f||Y.isPending,className:"mt-4 w-full",onClick:()=>{!c||!f||Y.mutate({[c.field]:K?null:f})},children:K?"Unequip":s.unlocked?"Equip":"Locked"})]},s.id)})})]}):m==="streak"?t.jsxs("section",{className:"grid gap-4",children:[t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(J,{className:"size-5 text-[var(--tertiary)]"}),"Streak power states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Qe.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," day power"]})]},c))})]}),t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(ee,{className:`size-5 ${_}`}),"Absence pressure states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Je.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," days away"]})]},c))})]})]}):t.jsx("section",{className:"grid gap-5",children:te.map(s=>{const c=ne.filter(f=>f.category===s.id);return c.length===0?null:t.jsxs("section",{className:"grid gap-3",children:[t.jsx("div",{className:"flex items-end justify-between gap-3",children:t.jsxs("div",{children:[t.jsx("div",{className:`font-display text-xl ${C}`,children:s.label}),t.jsxs("div",{className:`text-sm ${_}`,children:[c.length," visible rewards"]})]})}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:c.map(f=>t.jsx(nt,{item:f,gamificationTheme:l,onSelect:E},f.id))})]},s.id)})}),k?t.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-[var(--ui-overlay)] p-4 backdrop-blur-sm",onClick:()=>E(null),children:t.jsxs("div",{className:"max-h-[calc(100vh-2rem)] w-full max-w-[34rem] overflow-y-auto rounded-[26px] border border-[var(--ui-border-subtle)] bg-[var(--card-gradient)] p-5 shadow-[var(--card-shadow)]",onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start",children:[t.jsx("img",{src:A(k.assetKey,512,l),alt:"",onError:T,className:"size-32 shrink-0 object-contain"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(N,{className:P("border",se(k.tier)),children:k.tier}),t.jsx(N,{className:W,children:k.kind})]}),t.jsx("div",{className:`mt-3 font-display text-2xl ${C}`,children:k.title}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.summary})]})]}),t.jsxs("div",{className:`mt-5 ${H}`,children:[t.jsx("div",{className:`text-sm font-semibold ${C}`,children:"Requirement"}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.requirementText}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:k.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[k.progressCurrent,"/",k.progressTarget]}),t.jsx("span",{children:k.unlocked?"earned":"locked"})]})]})]}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsx(j,{type:"button",variant:"secondary",onClick:()=>E(null),children:"Close"})})]})}):null]})}export{kt as RewardsPage};
1
+ import{r as S,j as t,aF as le,ds as ce,aI as J,aG as Z,dt as ee,b7 as de,bG as ue}from"./vendor-BwL6m4SE.js";import{j as me,i as he,k as pe}from"./state-Bpe5dF3T.js";import{d as ke,dX as ge,aq as fe,bb as ye,e as Ce,V as be,B as j,dY as A,k as N,C as D,c as P,P as re,cO as ve,dZ as xe,d_ as we}from"./index-izRKx6JK.js";import{P as Se}from"./page-hero-BLhM8FF3.js";import"./motion-DcgUnXhY.js";import"./ui-B9TWEtCx.js";import"./board-CuxQRKPJ.js";import"./forms-D1qJ3oOP.js";const U=[{id:"xp_levels",label:"XP and level",trophyCount:8,unlockCount:4},{id:"streaks",label:"Streak and comeback",trophyCount:14,unlockCount:10},{id:"tasks",label:"Tasks and focus runs",trophyCount:14,unlockCount:4},{id:"projects",label:"Projects, goals, and strategy",trophyCount:14,unlockCount:4},{id:"wiki",label:"Wiki, notes, and knowledge graph",trophyCount:16,unlockCount:6},{id:"psyche",label:"Psyche",trophyCount:18,unlockCount:10},{id:"habits",label:"Habits, Life Force, and health",trophyCount:8,unlockCount:8},{id:"agents",label:"Agents and collaboration",trophyCount:4,unlockCount:2}],je=[1,2,3,5,7,14,21,30,45,60,90,180,365,730],Ae=[1,2,3,5,7,10,14,21,30,60];function e(r,l){return{metric:r,threshold:l}}function n(...r){return{allOf:r}}function $(r){return r.toLowerCase().replace(/['’]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Te(r,l){const u=(r+1)/l;return u>.82?"platinum":u>.55?"gold":u>.25?"silver":"bronze"}function _e(r){return r==="platinum"?"legendary":r==="gold"?"hard":r==="silver"?"standard":"intro"}function Ne(r){return r==="platinum"?"legendary":r==="gold"?"epic":r==="silver"?"rare":"common"}function Pe(r){return`item-${r.kind}-${$(r.category)}-${$(r.title)}`}function a(r,l,u,d,i,m){return{category:r,kind:"trophy",title:l,summary:i,requirement:u,requirementText:d,reward:`${l} trophy on the Forge shelf`}}function o(r,l,u,d,i,m,p){return{category:r,kind:"unlock",title:l,summary:m,requirement:d,requirementText:i,reward:`${l} cosmetic`,unlockType:u,rewardPayload:p}}const Re=[a("xp_levels","The First Heat",e("nonManualXp",5e3),"Earn 5,000 non-manual XP.","The first real furnace of work is hot enough to be noticed."),a("xp_levels","Bellows Graduate",e("nonManualXp",1e4),"Earn 10,000 non-manual XP.","Your reward ledger is no longer a spark; it is a system."),a("xp_levels","Iron Apprentice",e("nonManualXp",2e4),"Earn 20,000 non-manual XP.","You have repeated the work enough that the anvil knows your hand."),a("xp_levels","Steel Temper",e("nonManualXp",5e4),"Earn 50,000 non-manual XP.","Pressure has started to make the metal cleaner instead of louder."),a("xp_levels","Crown of Coals",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A visible crown for an invisible mountain of completed work."),a("xp_levels","Obsidian Master",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","The Forge Smith stops testing your seriousness and starts respecting it."),a("xp_levels","Star-Forge Adept",e("nonManualXp",5e5),"Earn 500,000 non-manual XP.","Your XP trail burns like a constellation across the operating system."),a("xp_levels","Mythic Smith",e("nonManualXp",1e6),"Earn 1,000,000 non-manual XP.","A ridiculous trophy for a ridiculous amount of lived execution.")],Fe=[o("xp_levels","Obsidian Smith","mascot_skin",e("nonManualXp",8e3),"Earn 8,000 non-manual XP.","A dramatic black-iron Forge Smith skin.",{mascotSkin:"obsidian-smith"}),o("xp_levels","Molten Progress Bar","hud_treatment",e("nonManualXp",25e3),"Earn 25,000 non-manual XP.","A bright molten XP fill for the level ring.",{hudTreatment:"molten-progress"}),o("xp_levels","Apex Level Frame","icon_frame",e("nonManualXp",1e5),"Earn 100,000 non-manual XP.","A high-tier frame for level and trophy icons.",{iconFrame:"apex-level"}),o("xp_levels","Masterwork Glow","celebration_variant",e("nonManualXp",25e4),"Earn 250,000 non-manual XP.","A stronger forge-bell reveal for major unlocks.",{celebrationVariant:"masterwork-glow"})],Ee=[a("streaks","Spark Kept",e("longestStreakDays",1),"Play one qualifying day.","The first day is small, but the forge heard it."),a("streaks","Three-Day Furnace",e("longestStreakDays",3),"Reach a 3-day streak.","Three returns make the first shape of discipline."),a("streaks","Week-Fire",e("longestStreakDays",7),"Reach a 7-day streak.","Seven days changes the temperature of your life."),a("streaks","Twin-Week Bellows",e("longestStreakDays",14),"Reach a 14-day streak.","Two weeks of showing up makes the room expect you."),a("streaks","Cinder Discipline",e("longestStreakDays",21),"Reach a 21-day streak.","The fire is not accidental anymore."),a("streaks","Monthly Forge",e("longestStreakDays",30),"Reach a 30-day streak.","A full month of returns becomes a personal weather system."),a("streaks","Sixty-Day Flame",e("longestStreakDays",60),"Reach a 60-day streak.","The Smith grows stronger because you stopped disappearing."),a("streaks","Quarter-Anvil",e("longestStreakDays",90),"Reach a 90-day streak.","Ninety days is not motivation. It is architecture."),a("streaks","Half-Year Inferno",e("longestStreakDays",180),"Reach a 180-day streak.","The forge is now a season of your life."),a("streaks","Year of Steel",e("longestStreakDays",365),"Reach a 365-day streak.","A year of returns. The anvil has become a witness."),a("streaks","Comeback Hammer",e("comebackAfter7Count",1),"Return after 7+ missed days and complete a qualifying action.","You came back after the room went cold."),a("streaks","Repair Artist",e("comebackAfter7Count",3),"Complete 3 major comebacks.","Breaking the chain did not become breaking the story."),a("streaks","Rust Refuser",n(e("comebackAfter7Count",5),e("longestStreakDays",30)),"Complete 5 major comebacks and reach a 30-day streak.","You repeatedly turned absence into a new strike."),a("streaks","Relentless Return",n(e("comebackAfter7Count",8),e("longestStreakDays",90)),"Complete 8 major comebacks and reach a 90-day streak.","This trophy is for the part of you that keeps coming back.")],Ie=[o("streaks","Bronze Ember Flame","streak_effect",e("longestStreakDays",3),"Reach a 3-day streak.","A small ember around the streak HUD.",{streakEffect:"bronze-ember"}),o("streaks","Blue Forge-Fire","streak_effect",e("longestStreakDays",7),"Reach a 7-day streak.","A cool blue streak flame.",{streakEffect:"blue-forge-fire"}),o("streaks","Violet Arc Flame","streak_effect",e("longestStreakDays",21),"Reach a 21-day streak.","A sharper violet flame effect.",{streakEffect:"violet-arc"}),o("streaks","Molten Crown Fire","streak_effect",e("longestStreakDays",60),"Reach a 60-day streak.","A crown-like fire treatment for streaks.",{streakEffect:"molten-crown"}),o("streaks","Stern Pressure Pose","mascot_pose",e("comebackAfter7Count",1),"Complete a major comeback.","Unlocks the Smith's stern pressure pose.",{mascotPose:"stern-pressure"}),o("streaks","Comeback Pose","mascot_pose",e("comebackAfter7Count",2),"Complete 2 major comebacks.","Unlocks the Smith's comeback repair pose.",{mascotPose:"comeback"}),o("streaks","Awakening Forge Pose","mascot_pose",e("longestStreakDays",30),"Reach a 30-day streak.","Unlocks the forge awakening mascot pose.",{mascotPose:"awakening-forge"}),o("streaks","Yearfire Aura","streak_effect",e("longestStreakDays",365),"Reach a 365-day streak.","A huge aura for year-scale presence.",{streakEffect:"yearfire-aura"}),o("streaks","Old Foundry Shelf","trophy_shelf",e("longestStreakDays",90),"Reach a 90-day streak.","A warmer trophy shelf skin.",{trophyShelf:"old-foundry"}),o("streaks","Relentless Bell","celebration_variant",e("longestStreakDays",180),"Reach a 180-day streak.","A heavier celebration sound-and-spark treatment.",{celebrationVariant:"relentless-bell"})],Me=[a("tasks","First Strike",e("taskCompletionCount",25),"Complete 25 tasks.","A real task trail begins."),a("tasks","Clean Swing",n(e("taskCompletionCount",50),e("focusRunCount",10)),"Complete 50 tasks and 10 task runs.","Tasks and time-tracked execution start to converge."),a("tasks","Five Rivets",n(e("taskCompletionCount",75),e("taskCloseoutReportCount",5)),"Complete 75 tasks and 5 completion reports.","You are leaving proof behind, not just checkmarks."),a("tasks","Task Blade",n(e("taskCompletionCount",120),e("focusRunCount",25)),"Complete 120 tasks and 25 task runs.","A sharp blade forged out of repeated finishes."),a("tasks","Anvil Marathon",n(e("taskCompletionCount",300),e("focusRunCount",75)),"Complete 300 tasks and 75 task runs.","The long road achievement for serious execution."),a("tasks","Deep-Work Maul",e("creditedFocusMinutes",3e3),"Log 3,000 credited focus minutes.","The heavy hammer of deliberate time."),a("tasks","Planned Heat",e("plannedFocusRunCount",25),"Complete 25 planned task runs.","You planned the heat before striking the metal."),a("tasks","Closeout Scribe",e("taskCloseoutReportCount",25),"Write 25 task completion reports.","The Forge remembers what changed because you wrote it down."),a("tasks","Hundred-Hammer Road",e("taskCompletionCount",500),"Complete 500 tasks.","A road paved with finished work."),a("tasks","Timebox Knight",n(e("plannedFocusRunCount",75),e("creditedFocusMinutes",7500)),"Complete 75 planned runs and 7,500 focus minutes.","A trophy for time that obeyed the mission."),a("tasks","Backlog Breaker",e("taskCompletionCount",750),"Complete 750 tasks.","The backlog learned to fear your return."),a("tasks","Execution Monarch",n(e("taskCompletionCount",1e3),e("focusRunCount",200)),"Complete 1,000 tasks and 200 task runs.","A crown for turning vague intention into finished artifacts."),a("tasks","Forge Ledger Exact",e("taskCloseoutReportCount",100),"Write 100 task completion reports.","The most boring discipline becomes the most useful history."),a("tasks","The Hammer Does Not Blink",n(e("taskCompletionCount",1500),e("creditedFocusMinutes",15e3)),"Complete 1,500 tasks and 15,000 focus minutes.","For absurd consistency under real load.")],Ke=[o("tasks","Hammer Cursor","icon_frame",e("taskCompletionCount",75),"Complete 75 tasks.","A hammer-shaped action accent.",{iconFrame:"hammer-cursor"}),o("tasks","Focus Rail Glow","hud_treatment",e("focusRunCount",25),"Complete 25 task runs.","A task-run glow for compact HUDs.",{hudTreatment:"focus-rail-glow"}),o("tasks","Completion Burst","celebration_variant",e("taskCloseoutReportCount",25),"Write 25 completion reports.","A sharper task-completion burst.",{celebrationVariant:"completion-burst"}),o("tasks","Ember Knight","mascot_skin",e("taskCompletionCount",500),"Complete 500 tasks.","A molten-armored Forge Smith skin for execution mastery.",{mascotSkin:"ember-knight"})],$e=[a("projects","Aligned Spark",e("goalLinkedTaskCompletionCount",25),"Complete 25 goal-linked tasks.","Work starts pointing at something bigger."),a("projects","Goal Rivet",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",3)),"Complete 50 goal-linked tasks across 3 goals.","Several goals now have real rivets, not just titles."),a("projects","Strategist's Seal",n(e("goalLinkedTaskCompletionCount",50),e("distinctGoalsWithCompletions",5)),"Complete 50 goal-linked tasks across 5 goals.","A seal for strategy that survived contact with execution."),a("projects","Project Spine",n(e("projectLinkedTaskCompletionCount",100),e("activeProjectCount",5)),"Complete 100 project-linked tasks while maintaining 5 active projects.","The work has a spine across multiple initiatives."),a("projects","Strategy Weld",e("strategyCount",10),"Create 10 strategies.","You forged planning layers instead of improvising every day."),a("projects","Purpose Hammer",e("goalLinkedTaskCompletionCount",150),"Complete 150 goal-linked tasks.","The hammer keeps landing where your stated life points."),a("projects","Arc Builder",n(e("projectLinkedTaskCompletionCount",250),e("distinctGoalsWithCompletions",8)),"Complete 250 project-linked tasks across 8 goals.","Multiple arcs moved because you kept building."),a("projects","North-Star Foundry",n(e("goalLinkedTaskCompletionCount",300),e("strategyCount",20)),"Complete 300 goal-linked tasks and create 20 strategies.","The north star is no longer decorative."),a("projects","Project Finisher",e("projectCompletionCount",5),"Complete 5 projects.","Finished projects leave heavier evidence than active dreams."),a("projects","Life-Work Crown",n(e("projectCompletionCount",10),e("goalLinkedTaskCompletionCount",500)),"Complete 10 projects and 500 goal-linked tasks.","A crown for long arcs that actually closed."),a("projects","Portfolio Anvil",e("activeProjectCount",12),"Maintain 12 active projects.","A large operating portfolio, held without flattening."),a("projects","Tracer Bullet Guild",n(e("projectCompletionCount",15),e("strategyCount",35)),"Complete 15 projects and create 35 strategies.","Strategy and delivery joined hands repeatedly."),a("projects","Mountain Moved",e("goalLinkedTaskCompletionCount",1e3),"Complete 1,000 goal-linked tasks.","The trophy for moving a mountain one task at a time."),a("projects","The Work Had A Spine",n(e("projectCompletionCount",25),e("distinctGoalsWithCompletions",12)),"Complete 25 projects across 12 goals.","Your life map became execution history.")],Le=[o("projects","Goal Compass Frame","icon_frame",e("goalLinkedTaskCompletionCount",50),"Complete 50 goal-linked tasks.","A compass frame for aligned-work trophies.",{iconFrame:"goal-compass"}),o("projects","War-Room Iron Shelf","trophy_shelf",e("projectLinkedTaskCompletionCount",150),"Complete 150 project-linked tasks.","A darker tactical trophy shelf.",{trophyShelf:"war-room-iron"}),o("projects","North-Star HUD","hud_treatment",e("strategyCount",20),"Create 20 strategies.","A strategy-forward HUD treatment.",{hudTreatment:"north-star"}),o("projects","Foundry Compass Burst","celebration_variant",e("projectCompletionCount",10),"Complete 10 projects.","A compass-shaped major reveal.",{celebrationVariant:"foundry-compass"})],Ge=[a("wiki","First Inscription",e("wikiPageCount",50),"Create 50 wiki pages.","Knowledge has started to become an archive."),a("wiki","Memory Rivet",e("noteCount",100),"Create 100 notes.","The system remembers because you gave it material."),a("wiki","Archive Ember",n(e("wikiPageCount",150),e("wikiLinkCount",50)),"Create 150 wiki pages and 50 wiki links.","The archive starts connecting to itself."),a("wiki","Knowledge Anvil",n(e("wikiPageCount",250),e("wikiLinkCount",150)),"Create 250 wiki pages and 150 wiki links.","A serious anvil of memory and links."),a("wiki","Living Index",n(e("wikiPageWithSummaryCount",100),e("linkedWikiPageCount",100)),"Maintain 100 wiki pages with summaries and linked entities.","Pages now carry shape, summary, and relationships."),a("wiki","Black Library",n(e("wikiPageCount",500),e("wikiLinkCount",300)),"Create 500 wiki pages and 300 wiki links.","The great hard knowledge trophy."),a("wiki","Obsidian Index",n(e("wikiPageWithSummaryCount",250),e("wikiLinkCount",500)),"Maintain 250 summarized pages and 500 links.","The archive is no longer just big; it is navigable."),a("wiki","Graph Lantern",e("knowledgeGraphNodeCount",500),"Reach 500 Knowledge Graph nodes.","The graph has enough stars to navigate by."),a("wiki","Entity Weaver",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","Your memory connects to the operating system."),a("wiki","Codex Temper",n(e("wikiPageCount",750),e("wikiLinkCount",750)),"Create 750 wiki pages and 750 wiki links.","A codex tempered by breadth and connection."),a("wiki","Note Furnace",e("noteCount",500),"Create 500 notes.","Raw notes became a real furnace of evidence."),a("wiki","Archive Cartographer",n(e("wikiPageWithSummaryCount",400),e("linkedWikiPageCount",300)),"Maintain 400 summarized pages and 300 linked pages.","You mapped the archive enough that it can map you back."),a("wiki","The Shelf Breathes",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","The knowledge system feels alive at a glance."),a("wiki","Librarian of Coals",n(e("noteCount",1e3),e("wikiLinkCount",1e3)),"Create 1,000 notes and 1,000 wiki links.","A trophy for the long, quiet archive discipline."),a("wiki","Living Codex",n(e("wikiPageCount",1500),e("wikiPageWithSummaryCount",750),e("wikiLinkCount",1500)),"Create 1,500 pages, 750 summarized pages, and 1,500 links.","The living memory crown."),a("wiki","Memory Starfield",e("knowledgeGraphNodeCount",2e3),"Reach 2,000 Knowledge Graph nodes.","The graph becomes a sky.")],Oe=[o("wiki","Quiet Library Shelf","trophy_shelf",e("wikiPageCount",150),"Create 150 wiki pages.","A quiet library shelf skin.",{trophyShelf:"quiet-library"}),o("wiki","Rune Page Frame","icon_frame",e("wikiLinkCount",150),"Create 150 wiki links.","A runic frame for knowledge trophies.",{iconFrame:"rune-page"}),o("wiki","Scholar Glass HUD","hud_treatment",e("wikiPageWithSummaryCount",100),"Maintain 100 summarized wiki pages.","A glassy scholar HUD treatment.",{hudTreatment:"scholar-glass"}),o("wiki","Archive Sparks","celebration_variant",e("linkedWikiPageCount",200),"Link 200 wiki pages to other pages or entities.","A page-flare reveal variant.",{celebrationVariant:"archive-sparks"}),o("wiki","Astral Archive Shelf","trophy_shelf",e("knowledgeGraphNodeCount",1e3),"Reach 1,000 Knowledge Graph nodes.","A cosmic trophy shelf for memory work.",{trophyShelf:"astral-archive"}),o("wiki","Reading Smith Pose","mascot_pose",e("wikiPageWithSummaryCount",250),"Maintain 250 summarized wiki pages.","Unlocks the Forge Smith reading pose.",{mascotPose:"reading"})],De=[a("psyche","Named Spark",e("psycheValueCount",5),"Create 5 Psyche values.","You named the values the forge should obey."),a("psyche","Pattern Tongs",e("behaviorPatternCount",5),"Create 5 behavior patterns.","The recurring loops are now held with tongs."),a("psyche","Belief Crucible",e("beliefEntryCount",5),"Create 5 belief entries.","Beliefs entered the fire where they can be worked."),a("psyche","Mode Lantern",e("modeProfileCount",3),"Create 3 mode profiles.","The inner cast has names and lantern light."),a("psyche","Trigger Witness",e("triggerReportCount",3),"Create 3 trigger reports.","You turned moments of activation into evidence."),a("psyche","Mode Cartographer",n(e("modeProfileCount",8),e("linkedModeProfileCount",8)),"Create 8 mode profiles, each linked to a value, behavior, or pattern.","A map of modes, not a pile of labels."),a("psyche","Trigger Alchemist",n(e("triggerReportRichCount",30),e("triggerReportCompletedCount",20)),"Complete 30 rich trigger reports and mark 20 reports beyond draft.","Activation was turned into material for change."),a("psyche","Pattern Breaker",n(e("behaviorPatternCount",20),e("behaviorPatternWithReplacementCount",10)),"Create 20 patterns and link 10 to replacement responses.","The old loops now have counter-moves."),a("psyche","Belief Temperer",n(e("beliefEntryCount",25),e("beliefFlexibleAlternativeCount",25)),"Create 25 beliefs with flexible alternatives.","Rigid beliefs were heated until they could bend."),a("psyche","Value Blade",n(e("psycheValueCount",10),e("goalLinkedTaskCompletionCount",100)),"Create 10 values and complete 100 goal-linked tasks.","Values and work started cutting in the same direction."),a("psyche","Shadow Temper",n(e("modeProfileCount",12),e("triggerReportRichCount",50)),"Create 12 modes and 50 rich trigger reports.","Shadow material became usable steel."),a("psyche","Inner Forge",n(e("psycheValueCount",12),e("behaviorPatternCount",25),e("beliefFlexibleAlternativeCount",30)),"Create 12 values, 25 patterns, and 30 flexible beliefs.","A full inner forge takes shape."),a("psyche","Schema Bell",e("questionnaireRunCount",40),"Complete 40 questionnaire runs.","Structured self-observation rang the bell repeatedly."),a("psyche","Mode Guide",e("modeGuideSessionCount",5),"Complete 5 mode guide sessions.","Guided mode work became an actual practice."),a("psyche","Repair Script",e("behaviorCount",10),"Create 10 Psyche behaviors.","Behaviors now carry repair plans, not just names."),a("psyche","Flexible Self",e("beliefFlexibleAlternativeCount",50),"Create 50 beliefs with flexible alternatives.","A trophy for not letting old beliefs remain iron cages."),a("psyche","Trigger Cartography",e("triggerReportRichCount",100),"Create 100 rich trigger reports.","The map of activation became detailed enough to steer by."),a("psyche","The Inner Council",n(e("modeProfileCount",20),e("behaviorCount",20),e("beliefFlexibleAlternativeCount",75)),"Create 20 modes, 20 behaviors, and 75 flexible beliefs.","The inner system became a council instead of noise.")],He=[o("psyche","Scholar Smith","mascot_skin",e("psycheValueCount",7),"Create 7 Psyche values.","A wise, bookish Forge Smith skin.",{mascotSkin:"scholar-smith"}),o("psyche","Wise Smith Pose","mascot_pose",e("modeProfileCount",3),"Create 3 mode profiles.","Unlocks the wise mentor pose.",{mascotPose:"wise"}),o("psyche","Reflection Frame","icon_frame",e("beliefEntryCount",10),"Create 10 belief entries.","A reflective frame for Psyche trophies.",{iconFrame:"reflection"}),o("psyche","Mode Lens HUD","hud_treatment",e("modeProfileCount",8),"Create 8 mode profiles.","A HUD tuned to Psyche work.",{hudTreatment:"mode-lens"}),o("psyche","Shadow Smith","mascot_skin",e("triggerReportRichCount",25),"Create 25 rich trigger reports.","A darker Smith skin for shadow work.",{mascotSkin:"shadow-smith"}),o("psyche","Arcane Metallurgist","mascot_skin",e("beliefFlexibleAlternativeCount",25),"Create 25 beliefs with flexible alternatives.","A rune-lit Smith skin for deep reflection.",{mascotSkin:"arcane-metallurgist"}),o("psyche","Inner-Fire Halo","streak_effect",e("psycheValueCount",10),"Create 10 Psyche values.","A halo-like flame for reflective momentum.",{streakEffect:"inner-fire-halo"}),o("psyche","Mode Lantern Reveal","celebration_variant",e("modeProfileCount",12),"Create 12 mode profiles.","A lantern reveal for Psyche unlocks.",{celebrationVariant:"mode-lantern"}),o("psyche","Therapist's Shelf","trophy_shelf",e("triggerReportRichCount",50),"Create 50 rich trigger reports.","A quiet shelf for inner-work trophies.",{trophyShelf:"therapist-shelf"}),o("psyche","Prismatic Crucible","celebration_variant",e("beliefFlexibleAlternativeCount",50),"Create 50 flexible belief alternatives.","A prismatic reveal for belief work.",{celebrationVariant:"prismatic-crucible"})],ze=[a("habits","Ritual Spark",e("habitAlignedCount",25),"Record 25 aligned habit check-ins.","Your recurring commitments have started to leave marks."),a("habits","Routine Rivet",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","The habit rail is no longer decorative."),a("habits","Habit Heat",n(e("habitAlignedCount",150),e("habitStreakMax",14)),"Record 150 aligned check-ins and a 14-day habit streak.","One behavior got hot enough to shape you."),a("habits","Ritual Iron",e("habitAlignedCount",365),"Record 365 aligned habit check-ins.","The hard habit trophy."),a("habits","Recovery Shield",e("recoveryEventCount",50),"Earn 50 recovery rewards.","Recovery was treated as part of the work."),a("habits","Life-Force Alloy",e("lifeForceSnapshotCount",100),"Record 100 Life Force day snapshots.","Energy accounting became a usable alloy."),a("habits","Sleep Temper",e("healthSleepSessionCount",120),"Import 120 sleep sessions.","Sleep became evidence, not a guess."),a("habits","Vitality Forge",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","Body data and execution entered the same forge.")],Be=[o("habits","Recovery Blue Flame","streak_effect",e("recoveryEventCount",20),"Earn 20 recovery rewards.","A cooler recovery flame.",{streakEffect:"recovery-blue"}),o("habits","Ritual Check Glow","hud_treatment",e("habitAlignedCount",75),"Record 75 aligned habit check-ins.","A habit-check glow for the HUD.",{hudTreatment:"ritual-check"}),o("habits","Storm Forger","mascot_skin",e("workoutSessionCount",50),"Import 50 workouts.","A storm-lit Smith skin for movement arcs.",{mascotSkin:"storm-forger"}),o("habits","Clockwork Smith","mascot_skin",e("habitAlignedCount",150),"Record 150 aligned habit check-ins.","A clockwork skin for ritual precision.",{mascotSkin:"clockwork-smith"}),o("habits","Vital Flame","streak_effect",e("healthSleepSessionCount",90),"Import 90 sleep sessions.","A vital-sign flame around streak indicators.",{streakEffect:"vital-flame"}),o("habits","Life-Force Frame","icon_frame",e("lifeForceSnapshotCount",100),"Record 100 Life Force snapshots.","An AP-inspired frame for body trophies.",{iconFrame:"life-force"}),o("habits","Steady-State Aura","streak_effect",e("habitStreakMax",60),"Reach a 60-day habit streak.","An aura for long stable rituals.",{streakEffect:"steady-state"}),o("habits","Celestial Smith","mascot_skin",n(e("workoutSessionCount",100),e("healthSleepSessionCount",200)),"Import 100 workouts and 200 sleep sessions.","A celestial skin for body stewardship.",{mascotSkin:"celestial-smith"})],We=[a("agents","Companion Spark",e("agentActionCount",5),"Record 5 agent actions.","The first sign of a working human-agent council."),a("agents","Bot Bellows",e("agentCompletedActionCount",20),"Complete 20 agent actions.","Agents are not just present; they are moving work."),a("agents","Council Spark",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","The collaboration trophy for meaningful assisted work."),a("agents","Guild Forge",n(e("agentCompletedActionCount",100),e("collaborationRewardCount",100)),"Complete 100 agent actions and earn 100 collaboration rewards.","The Forge has become a small guild.")],Ue=[o("agents","Guild Badge Frame","icon_frame",e("agentCompletedActionCount",20),"Complete 20 agent actions.","A guild frame for agent trophies.",{iconFrame:"guild-badge"}),o("agents","Council Sparks Reveal","celebration_variant",e("collaborationRewardCount",50),"Earn 50 collaboration rewards.","A council-sparks reveal for collaboration.",{celebrationVariant:"council-sparks"})],Ye=[...Re,...Fe,...Ee,...Ie,...Me,...Ke,...$e,...Le,...Ge,...Oe,...De,...He,...ze,...Be,...We,...Ue];function Xe(){let r=0,l=0,u=0;const d=new Map;return Ye.map(i=>{const m=U.find(L=>L.id===i.category);if(!m)throw new Error(`Unknown gamification category ${i.category}`);const p=d.get(i.category)??{trophy:0,unlock:0},x=p[i.kind];p[i.kind]+=1,d.set(i.category,p);const R=i.kind==="trophy"?m.trophyCount:m.unlockCount,v=Te(x,R),F=`${i.kind}-${$(i.category)}-${$(i.title)}`,w=i.kind==="trophy"?l++:u++;return{id:F,kind:i.kind,category:i.category,tier:v,difficulty:_e(v),hidden:i.hidden??!1,title:i.title,summary:i.summary,requirement:i.requirement,requirementText:i.requirementText,reward:i.reward,unlockType:i.kind==="unlock"?i.unlockType??"icon_frame":null,rewardPayload:i.kind==="unlock"?i.rewardPayload??{}:{trophyId:F},assetKey:Pe(i),sheetKey:`${i.kind==="trophy"?"trophies":"unlocks"}-r${Math.floor(w/10)+1}-c${w%10+1}`,rarity:Ne(v),sortOrder:r++}})}const y=Xe();function qe(){if(y.length!==144)throw new Error(`GAMIFICATION_CATALOG must contain exactly 144 items; found ${y.length}.`);const r=y.filter(d=>d.kind==="trophy").length,l=y.filter(d=>d.kind==="unlock").length;if(r!==96||l!==48)throw new Error(`GAMIFICATION_CATALOG must contain 96 trophies and 48 unlocks; found ${r}/${l}.`);for(const d of U){const i=y.filter(p=>p.category===d.id&&p.kind==="trophy").length,m=y.filter(p=>p.category===d.id&&p.kind==="unlock").length;if(i!==d.trophyCount||m!==d.unlockCount)throw new Error(`${d.id} expected ${d.trophyCount}/${d.unlockCount}, found ${i}/${m}.`)}if(new Set(y.map(d=>d.assetKey)).size!==y.length)throw new Error("Every trophy and unlock must have a unique asset key.")}qe();const te=U.map(r=>({id:r.id,label:r.label})),Ve=Array.from({length:30},(r,l)=>`mascot-state-${String(l+1).padStart(3,"0")}`),Qe=je.map((r,l)=>[r,`mascot-state-${String(17+l).padStart(3,"0")}`]),Je=Ae.map((r,l)=>[r,`mascot-state-${String(10-l).padStart(3,"0")}`]),z=Ve;if(z.length!==30)throw new Error(`GAMIFICATION_MASCOT_KEYS must contain exactly 30 mascot/state keys; found ${z.length}.`);function Ze(r){switch(r.category){case"xp_levels":return"#f59e0b";case"streaks":return"#fb923c";case"tasks":return"#f97316";case"projects":return"#38bdf8";case"wiki":return"#a78bfa";case"psyche":return"#8b5cf6";case"habits":return"#4ade80";case"agents":return"#22d3ee";default:return"#f59e0b"}}function et(r){return["cinematic stylized blacksmith game icon",r.category.replace(/_/g," "),r.kind,r.title,"obsidian iron, ember gold, cool violet and cyan steel highlights, no text"].join(", ")}const tt=Object.fromEntries(y.map(r=>[r.assetKey,{key:r.assetKey,role:"item",itemKind:r.kind,alt:`${r.title} ${r.kind} icon.`,dominantColor:Ze(r),tierFrame:r.tier,sourcePath:`gamification/source/themes/dark-fantasy/items/${r.assetKey}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/items/${r.assetKey}-{size}.webp`,sheetKey:r.sheetKey,prompt:et(r)}])),at=Object.fromEntries(z.map(r=>{const l=Number(r.replace("mascot-state-","")),u=l<=10,d=l>=17;return[r,{key:r,role:d||u?"streak":"mascot",alt:u?"The Forge Smith in a safe cold-forge absence state.":"The Forge Smith mascot in a dramatic blacksmith game-art pose.",dominantColor:u?"#64748b":d?"#fb923c":"#38bdf8",tierFrame:"none",sourcePath:`gamification/source/themes/dark-fantasy/mascots/${r}.png`,spritePath:`gamification/sprites/themes/dark-fantasy/mascots/${r}-{size}.webp`,sheetKey:null,prompt:"dramatic Forge Smith blacksmith mascot, premium game art, no text, no watermark"}]}));({...tt,...at});function T(r){r.currentTarget.hidden=!0}const rt=["all","bronze","silver","gold","platinum"],st=[{id:"trophies",label:"Trophies"},{id:"unlocks",label:"Unlocks"},{id:"armory",label:"Mascot Armory"},{id:"streak",label:"Streak Forge"}],B={mascot_skin:{field:"selectedMascotSkin",payloadKey:"mascotSkin",label:"Mascot skin"},hud_treatment:{field:"selectedHudTreatment",payloadKey:"hudTreatment",label:"HUD treatment"},streak_effect:{field:"selectedStreakEffect",payloadKey:"streakEffect",label:"Streak flame"},trophy_shelf:{field:"selectedTrophyShelf",payloadKey:"trophyShelf",label:"Trophy shelf"},celebration_variant:{field:"selectedCelebrationVariant",payloadKey:"celebrationVariant",label:"Celebration"}};function se(r){switch(r){case"platinum":return"border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] bg-[var(--ui-accent-soft)] text-[var(--primary)]";case"gold":return"border-[color-mix(in_srgb,var(--warning)_32%,var(--ui-border-subtle)_68%)] bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]";case"silver":return"border-[var(--ui-border-subtle)] bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";default:return"border-[color-mix(in_srgb,var(--warning)_26%,var(--ui-border-subtle)_74%)] bg-[var(--ui-warning-soft)] text-[var(--warning)]"}}const ae="min-w-0 overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4",H="min-w-0 overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-4",C="text-[var(--ui-ink-strong)]",b="text-[var(--ui-ink-soft)]",_="text-[var(--ui-ink-faint)]",W="bg-[var(--ui-surface-3)] text-[var(--ui-ink-medium)]";function ot(r){const l=r.unlockType?B[r.unlockType]:null,u=l?r.rewardPayload[l.payloadKey]:null;return typeof u=="string"?u:null}function nt({item:r,gamificationTheme:l,onSelect:u}){return t.jsxs("button",{type:"button",onClick:()=>u(r),className:P("group relative min-h-[19rem] overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 text-left shadow-[var(--ui-shadow-soft)] transition hover:-translate-y-0.5 hover:border-[color-mix(in_srgb,var(--primary)_30%,var(--ui-border-subtle)_70%)] hover:bg-[var(--ui-surface-hover)]",!r.unlocked&&"opacity-78"),children:[t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsx(N,{className:P("border",se(r.tier)),children:r.tier}),t.jsx(N,{className:W,children:r.unlocked?"earned":"locked"})]}),t.jsx("div",{className:"mt-3 grid place-items-center",children:t.jsx("img",{src:A(r.assetKey,512,l),alt:"",onError:T,className:P("size-36 object-contain drop-shadow-[var(--ui-shadow-soft)] transition group-hover:scale-[1.03]",!r.unlocked&&"grayscale")})}),t.jsxs("div",{className:"mt-3 min-w-0",children:[t.jsx("div",{className:`font-display text-lg ${C}`,children:r.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:r.unlocked?r.summary:r.requirementText})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:r.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[r.progressCurrent,"/",r.progressTarget]}),t.jsxs("span",{children:[r.progressPercent,"%"]})]})]})]})}function kt(){var X,q,V,Q;const r=ke(),l=ge(),u=me(),d=fe(),i=Array.isArray(r.selectedUserIds)?r.selectedUserIds:[],[m,p]=S.useState("trophies"),[x,R]=S.useState("all"),[v,F]=S.useState("all"),[w,L]=S.useState("all"),[G,oe]=S.useState(""),[k,E]=S.useState(null),I=he({queryKey:["forge-gamification-catalog",...i],queryFn:()=>we(i)}),M=ye(i),Y=pe({mutationFn:s=>xe(s,i),onSuccess:async()=>{await Promise.all([u.invalidateQueries({queryKey:["forge-gamification-catalog"]}),u.invalidateQueries({queryKey:["forge-xp-metrics"]})]),d(ve.util.invalidateTags(["Gamification"]))}}),g=(X=I.data)==null?void 0:X.catalog,O=(g==null?void 0:g.items)??[],ne=S.useMemo(()=>{const s=G.trim().toLowerCase();return O.filter(c=>m==="trophies"&&c.kind!=="trophy"||m==="unlocks"&&c.kind!=="unlock"||(m==="armory"||m==="streak")&&c.kind!=="unlock"||m==="armory"&&!c.unlockType||m==="streak"&&c.unlockType!=="streak_effect"||x!=="all"&&c.category!==x||v!=="all"&&c.tier!==v||w==="unlocked"&&!c.unlocked||w==="locked"&&c.unlocked?!1:s?`${c.title} ${c.summary} ${c.requirementText} ${c.reward}`.toLowerCase().includes(s):!0)},[x,O,G,w,m,v]),h=(g==null?void 0:g.equipment)??((q=M.data)==null?void 0:q.metrics.equipment)??null,ie=O.filter(s=>s.kind==="unlock"&&s.unlockType&&B[s.unlockType]);return I.isError?t.jsx(Ce,{eyebrow:"Rewards",error:I.error,onRetry:()=>void I.refetch()}):t.jsxs("div",{className:"mx-auto grid w-full max-w-[1320px] gap-5",children:[t.jsx(Se,{title:"Trophy Hall",description:"Achievements are earned from real Forge behavior: tasks, runs, goals, wiki links, Psyche work, habits, Life Force, health, and collaboration.",badge:g?`${g.unlockedCount}/${g.totalCount} earned`:"Loading",actions:(V=M.data)!=null&&V.metrics?t.jsx(be,{metrics:M.data.metrics.profile}):null}),t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,0.42fr)]",children:[t.jsxs("div",{className:ae,children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(s=>t.jsxs(j,{type:"button",variant:m===s.id?"primary":"secondary",size:"sm",onClick:()=>p(s.id),children:[s.id==="trophies"?t.jsx(le,{className:"size-4"}):null,s.id==="armory"?t.jsx(ce,{className:"size-4"}):null,s.id==="streak"?t.jsx(J,{className:"size-4"}):null,s.id==="unlocks"?t.jsx(Z,{className:"size-4"}):null,s.label]},s.id))}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap items-center gap-2",children:[["all","unlocked","locked"].map(s=>t.jsxs(j,{type:"button",variant:w===s?"primary":"secondary",size:"sm",onClick:()=>L(s),children:[s==="locked"?t.jsx(ee,{className:"size-4"}):null,s]},s)),t.jsxs("label",{className:`ml-auto flex min-h-10 min-w-0 max-w-full items-center gap-2 rounded-full border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] px-3 text-sm ${b} sm:min-w-[16rem]`,children:[t.jsx(de,{className:`size-4 shrink-0 ${_}`}),t.jsx("input",{value:G,onChange:s=>oe(s.target.value),placeholder:"Search rewards",className:"min-w-0 flex-1 bg-transparent text-[var(--ui-ink-strong)] outline-none placeholder:text-[var(--ui-ink-faint)]"})]})]}),t.jsxs("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:[t.jsx(j,{type:"button",variant:x==="all"?"primary":"secondary",size:"sm",onClick:()=>R("all"),children:"all categories"}),te.map(s=>t.jsx(j,{type:"button",variant:x===s.id?"primary":"secondary",size:"sm",onClick:()=>R(s.id),children:s.label},s.id))]}),t.jsx("div",{className:"mt-4 flex min-w-0 flex-wrap gap-2",children:rt.map(s=>t.jsx(j,{type:"button",variant:v===s?"primary":"secondary",size:"sm",onClick:()=>F(s),children:s},s))})]}),t.jsxs("div",{className:ae,children:[t.jsxs("div",{className:`flex items-center gap-2 text-sm font-semibold ${C}`,children:[t.jsx(Z,{className:"size-4 text-[var(--tertiary)]"}),"Near completion"]}),((g==null?void 0:g.nextTargets)??[]).map(s=>t.jsxs("button",{type:"button",onClick:()=>E(s),className:"grid min-w-0 grid-cols-[2.75rem_minmax(0,1fr)_3rem] items-center gap-3 rounded-2xl border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] p-2 text-left transition hover:bg-[var(--ui-surface-hover)]",children:[t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:"size-11 object-contain"}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block truncate text-sm ${C}`,children:s.title}),t.jsx("span",{className:`block truncate text-[11px] ${_}`,children:s.requirementText})]}),t.jsxs("span",{className:`text-right text-xs ${b}`,children:[s.progressPercent,"%"]})]},s.id))]})]}),m==="armory"?t.jsxs("section",{className:"grid gap-3 lg:grid-cols-[minmax(18rem,0.42fr)_minmax(0,1fr)]",children:[t.jsxs("div",{className:"relative min-h-[24rem] overflow-hidden rounded-[24px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-4 shadow-[var(--ui-shadow-soft)]",children:[t.jsx("img",{src:A(((Q=M.data)==null?void 0:Q.metrics.mascot.spriteKey)??"mascot-state-014",512,l),alt:"Forge Smith mascot",onError:T,className:"absolute inset-x-0 bottom-0 mx-auto h-[23rem] object-contain"}),t.jsxs("div",{className:"relative z-10",children:[t.jsx(N,{className:"bg-[var(--ui-accent-soft)] text-[var(--tertiary)]",children:"Equipped"}),t.jsxs("div",{className:`mt-3 grid gap-1 text-sm ${b}`,children:[t.jsxs("span",{children:["Skin: ",(h==null?void 0:h.selectedMascotSkin)??"default"]}),t.jsxs("span",{children:["HUD: ",(h==null?void 0:h.selectedHudTreatment)??"default"]}),t.jsxs("span",{children:["Flame: ",(h==null?void 0:h.selectedStreakEffect)??"default"]}),t.jsxs("span",{children:["Shelf: ",(h==null?void 0:h.selectedTrophyShelf)??"default"]})]})]})]}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:ie.map(s=>{const c=s.unlockType?B[s.unlockType]:null,f=ot(s),K=!!(c&&f&&(h==null?void 0:h[c.field])===f);return t.jsxs(D,{className:P("p-4",!s.unlocked&&"opacity-70"),children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsx(N,{className:W,children:(c==null?void 0:c.label)??"Cosmetic"}),K?t.jsx(ue,{className:"size-4 text-[var(--success)]"}):null]}),t.jsx("img",{src:A(s.assetKey,256,l),alt:"",onError:T,className:P("mx-auto mt-3 size-28 object-contain",!s.unlocked&&"grayscale")}),t.jsx("div",{className:`mt-3 font-display text-lg ${C}`,children:s.title}),t.jsx("p",{className:`mt-2 line-clamp-2 text-sm leading-6 ${b}`,children:s.unlocked?s.summary:s.requirementText}),t.jsx(j,{type:"button",variant:K?"secondary":"primary",size:"sm",disabled:!s.unlocked||!c||!f||Y.isPending,className:"mt-4 w-full",onClick:()=>{!c||!f||Y.mutate({[c.field]:K?null:f})},children:K?"Unequip":s.unlocked?"Equip":"Locked"})]},s.id)})})]}):m==="streak"?t.jsxs("section",{className:"grid gap-4",children:[t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(J,{className:"size-5 text-[var(--tertiary)]"}),"Streak power states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Qe.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," day power"]})]},c))})]}),t.jsxs(D,{className:"p-4",children:[t.jsxs("div",{className:`flex items-center gap-2 font-display text-xl ${C}`,children:[t.jsx(ee,{className:`size-5 ${_}`}),"Absence pressure states"]}),t.jsx("div",{className:"mt-4 grid gap-3 sm:grid-cols-2 md:grid-cols-4 xl:grid-cols-5",children:Je.map(([s,c])=>t.jsxs("div",{className:H,children:[t.jsx("img",{src:A(c,256,l),alt:"",onError:T,className:"mx-auto size-28 object-contain"}),t.jsxs("div",{className:`mt-2 text-center text-sm ${b}`,children:[s," days away"]})]},c))})]})]}):t.jsx("section",{className:"grid gap-5",children:te.map(s=>{const c=ne.filter(f=>f.category===s.id);return c.length===0?null:t.jsxs("section",{className:"grid gap-3",children:[t.jsx("div",{className:"flex items-end justify-between gap-3",children:t.jsxs("div",{children:[t.jsx("div",{className:`font-display text-xl ${C}`,children:s.label}),t.jsxs("div",{className:`text-sm ${_}`,children:[c.length," visible rewards"]})]})}),t.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:c.map(f=>t.jsx(nt,{item:f,gamificationTheme:l,onSelect:E},f.id))})]},s.id)})}),k?t.jsx("div",{className:"fixed inset-0 z-50 grid place-items-center bg-[var(--ui-overlay)] p-4 backdrop-blur-sm",onClick:()=>E(null),children:t.jsxs("div",{className:"max-h-[calc(100vh-2rem)] w-full max-w-[34rem] overflow-y-auto rounded-[26px] border border-[var(--ui-border-subtle)] bg-[var(--card-gradient)] p-5 shadow-[var(--card-shadow)]",onClick:s=>s.stopPropagation(),children:[t.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:flex-row sm:items-start",children:[t.jsx("img",{src:A(k.assetKey,512,l),alt:"",onError:T,className:"size-32 shrink-0 object-contain"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(N,{className:P("border",se(k.tier)),children:k.tier}),t.jsx(N,{className:W,children:k.kind})]}),t.jsx("div",{className:`mt-3 font-display text-2xl ${C}`,children:k.title}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.summary})]})]}),t.jsxs("div",{className:`mt-5 ${H}`,children:[t.jsx("div",{className:`text-sm font-semibold ${C}`,children:"Requirement"}),t.jsx("p",{className:`mt-2 text-sm leading-6 ${b}`,children:k.requirementText}),t.jsxs("div",{className:"mt-4",children:[t.jsx(re,{value:k.progressPercent}),t.jsxs("div",{className:`mt-2 flex justify-between gap-3 text-[11px] uppercase tracking-[0.16em] ${_}`,children:[t.jsxs("span",{children:[k.progressCurrent,"/",k.progressTarget]}),t.jsx("span",{children:k.unlocked?"earned":"locked"})]})]})]}),t.jsx("div",{className:"mt-4 flex justify-end",children:t.jsx(j,{type:"button",variant:"secondary",onClick:()=>E(null),children:"Close"})})]})}):null]})}export{kt as RewardsPage};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-BwL6m4SE.js";import{C as J,I as c,B as z}from"./index-FpGANF9S.js";const F=[{value:"main_activity",label:"Main activity"},{value:"secondary_activity",label:"Secondary activity"},{value:"third_activity",label:"Third activity"},{value:"rest",label:"Rest"},{value:"holiday",label:"Holiday"},{value:"custom",label:"Custom"}],G=[{value:"busy",label:"Busy"},{value:"free",label:"Free"}],t={allowWorkBlockKinds:[],blockWorkBlockKinds:[],allowCalendarIds:[],blockCalendarIds:[],allowEventTypes:[],blockEventTypes:[],allowEventKeywords:[],blockEventKeywords:[],allowAvailability:[],blockAvailability:[]};function n(r){return r.join(", ")}function d(r){return r.split(",").map(v=>v.trim()).filter(Boolean)}function y({label:r,selected:v,onToggle:a,options:p}){return e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("div",{className:"flex min-w-0 flex-wrap gap-2",children:p.map(o=>{const b=v.includes(o.value);return e.jsx("button",{type:"button",onClick:()=>a(o.value),className:`rounded-full px-3 py-2 text-sm transition ${b?"bg-[var(--ui-accent-soft)] text-[var(--primary)] ring-1 ring-[color-mix(in_srgb,var(--primary)_24%,transparent)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"}`,children:o.label},o.value)})})]})}function Z({title:r,subtitle:v,initialRules:a,initialPlannedDurationSeconds:p,onSave:o,saveLabel:b="Save scheduling rules",allowPlannedDuration:w=!1}){const[k,A]=l.useState((a==null?void 0:a.allowWorkBlockKinds)??t.allowWorkBlockKinds),[g,T]=l.useState((a==null?void 0:a.blockWorkBlockKinds)??t.blockWorkBlockKinds),[i,S]=l.useState((a==null?void 0:a.allowAvailability)??t.allowAvailability),[x,I]=l.useState((a==null?void 0:a.blockAvailability)??t.blockAvailability),[h,W]=l.useState(n((a==null?void 0:a.allowCalendarIds)??t.allowCalendarIds)),[j,_]=l.useState(n((a==null?void 0:a.blockCalendarIds)??t.blockCalendarIds)),[f,M]=l.useState(n((a==null?void 0:a.allowEventTypes)??t.allowEventTypes)),[C,O]=l.useState(n((a==null?void 0:a.blockEventTypes)??t.blockEventTypes)),[E,L]=l.useState(n((a==null?void 0:a.allowEventKeywords)??t.allowEventKeywords)),[N,P]=l.useState(n((a==null?void 0:a.blockEventKeywords)??t.blockEventKeywords)),[B,H]=l.useState(p?String(Math.round(p/60)):"30"),[U,m]=l.useState(!1),Y=l.useMemo(()=>({allowWorkBlockKinds:k,blockWorkBlockKinds:g,allowCalendarIds:d(h),blockCalendarIds:d(j),allowEventTypes:d(f),blockEventTypes:d(C),allowEventKeywords:d(E),blockEventKeywords:d(N),allowAvailability:i,blockAvailability:x}),[i,h,E,f,k,x,j,N,C,g]),V=Object.values(Y).every(s=>s.length===0),u=(s,$,K)=>{$(s.includes(K)?s.filter(q=>q!==K):[...s,K])};return e.jsxs(J,{className:"grid min-w-0 gap-4 overflow-hidden border-[var(--ui-border-subtle)] !bg-[var(--ui-surface-1)]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:v})]}),w?e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Planned duration"}),e.jsx(c,{type:"number",min:15,step:15,value:B,onChange:s=>H(s.target.value),placeholder:"30"})]}):null,e.jsxs("div",{className:"grid min-w-0 gap-4 lg:grid-cols-2",children:[e.jsx(y,{label:"Allow work blocks",selected:k,onToggle:s=>u(k,A,s),options:F}),e.jsx(y,{label:"Block work blocks",selected:g,onToggle:s=>u(g,T,s),options:F}),e.jsx(y,{label:"Allow availability",selected:i,onToggle:s=>u(i,S,s),options:G}),e.jsx(y,{label:"Block availability",selected:x,onToggle:s=>u(x,I,s),options:G})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow calendar ids"}),e.jsx(c,{value:h,onChange:s=>W(s.target.value),placeholder:"calendar_123, primary"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block calendar ids"}),e.jsx(c,{value:j,onChange:s=>_(s.target.value),placeholder:"calendar_456"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event types"}),e.jsx(c,{value:f,onChange:s=>M(s.target.value),placeholder:"focus, personal"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event types"}),e.jsx(c,{value:C,onChange:s=>O(s.target.value),placeholder:"out-of-office, main-work"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event keywords"}),e.jsx(c,{value:E,onChange:s=>L(s.target.value),placeholder:"creative, writing"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event keywords"}),e.jsx(c,{value:N,onChange:s=>P(s.target.value),placeholder:"psychiatrist, clinic, rest"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(z,{pending:U,pendingLabel:"Saving",onClick:async()=>{m(!0);try{await o({schedulingRules:V?t:Y,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:b}),e.jsx(z,{variant:"secondary",onClick:async()=>{m(!0);try{A([]),T([]),S([]),I([]),W(""),_(""),M(""),O(""),L(""),P(""),await o({schedulingRules:null,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:"Clear custom rules"})]})]})}export{Z as S};
1
+ import{r as l,j as e}from"./vendor-BwL6m4SE.js";import{C as J,I as c,B as z}from"./index-izRKx6JK.js";const F=[{value:"main_activity",label:"Main activity"},{value:"secondary_activity",label:"Secondary activity"},{value:"third_activity",label:"Third activity"},{value:"rest",label:"Rest"},{value:"holiday",label:"Holiday"},{value:"custom",label:"Custom"}],G=[{value:"busy",label:"Busy"},{value:"free",label:"Free"}],t={allowWorkBlockKinds:[],blockWorkBlockKinds:[],allowCalendarIds:[],blockCalendarIds:[],allowEventTypes:[],blockEventTypes:[],allowEventKeywords:[],blockEventKeywords:[],allowAvailability:[],blockAvailability:[]};function n(r){return r.join(", ")}function d(r){return r.split(",").map(v=>v.trim()).filter(Boolean)}function y({label:r,selected:v,onToggle:a,options:p}){return e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("div",{className:"flex min-w-0 flex-wrap gap-2",children:p.map(o=>{const b=v.includes(o.value);return e.jsx("button",{type:"button",onClick:()=>a(o.value),className:`rounded-full px-3 py-2 text-sm transition ${b?"bg-[var(--ui-accent-soft)] text-[var(--primary)] ring-1 ring-[color-mix(in_srgb,var(--primary)_24%,transparent)]":"bg-[var(--ui-surface-2)] text-[var(--ui-ink-soft)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"}`,children:o.label},o.value)})})]})}function Z({title:r,subtitle:v,initialRules:a,initialPlannedDurationSeconds:p,onSave:o,saveLabel:b="Save scheduling rules",allowPlannedDuration:w=!1}){const[k,A]=l.useState((a==null?void 0:a.allowWorkBlockKinds)??t.allowWorkBlockKinds),[g,T]=l.useState((a==null?void 0:a.blockWorkBlockKinds)??t.blockWorkBlockKinds),[i,S]=l.useState((a==null?void 0:a.allowAvailability)??t.allowAvailability),[x,I]=l.useState((a==null?void 0:a.blockAvailability)??t.blockAvailability),[h,W]=l.useState(n((a==null?void 0:a.allowCalendarIds)??t.allowCalendarIds)),[j,_]=l.useState(n((a==null?void 0:a.blockCalendarIds)??t.blockCalendarIds)),[f,M]=l.useState(n((a==null?void 0:a.allowEventTypes)??t.allowEventTypes)),[C,O]=l.useState(n((a==null?void 0:a.blockEventTypes)??t.blockEventTypes)),[E,L]=l.useState(n((a==null?void 0:a.allowEventKeywords)??t.allowEventKeywords)),[N,P]=l.useState(n((a==null?void 0:a.blockEventKeywords)??t.blockEventKeywords)),[B,H]=l.useState(p?String(Math.round(p/60)):"30"),[U,m]=l.useState(!1),Y=l.useMemo(()=>({allowWorkBlockKinds:k,blockWorkBlockKinds:g,allowCalendarIds:d(h),blockCalendarIds:d(j),allowEventTypes:d(f),blockEventTypes:d(C),allowEventKeywords:d(E),blockEventKeywords:d(N),allowAvailability:i,blockAvailability:x}),[i,h,E,f,k,x,j,N,C,g]),V=Object.values(Y).every(s=>s.length===0),u=(s,$,K)=>{$(s.includes(K)?s.filter(q=>q!==K):[...s,K])};return e.jsxs(J,{className:"grid min-w-0 gap-4 overflow-hidden border-[var(--ui-border-subtle)] !bg-[var(--ui-surface-1)]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:r}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-[var(--ui-ink-soft)]",children:v})]}),w?e.jsxs("div",{className:"grid min-w-0 gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Planned duration"}),e.jsx(c,{type:"number",min:15,step:15,value:B,onChange:s=>H(s.target.value),placeholder:"30"})]}):null,e.jsxs("div",{className:"grid min-w-0 gap-4 lg:grid-cols-2",children:[e.jsx(y,{label:"Allow work blocks",selected:k,onToggle:s=>u(k,A,s),options:F}),e.jsx(y,{label:"Block work blocks",selected:g,onToggle:s=>u(g,T,s),options:F}),e.jsx(y,{label:"Allow availability",selected:i,onToggle:s=>u(i,S,s),options:G}),e.jsx(y,{label:"Block availability",selected:x,onToggle:s=>u(x,I,s),options:G})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow calendar ids"}),e.jsx(c,{value:h,onChange:s=>W(s.target.value),placeholder:"calendar_123, primary"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block calendar ids"}),e.jsx(c,{value:j,onChange:s=>_(s.target.value),placeholder:"calendar_456"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event types"}),e.jsx(c,{value:f,onChange:s=>M(s.target.value),placeholder:"focus, personal"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event types"}),e.jsx(c,{value:C,onChange:s=>O(s.target.value),placeholder:"out-of-office, main-work"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Allow event keywords"}),e.jsx(c,{value:E,onChange:s=>L(s.target.value),placeholder:"creative, writing"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Block event keywords"}),e.jsx(c,{value:N,onChange:s=>P(s.target.value),placeholder:"psychiatrist, clinic, rest"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(z,{pending:U,pendingLabel:"Saving",onClick:async()=>{m(!0);try{await o({schedulingRules:V?t:Y,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:b}),e.jsx(z,{variant:"secondary",onClick:async()=>{m(!0);try{A([]),T([]),S([]),I([]),W(""),_(""),M(""),O(""),L(""),P(""),await o({schedulingRules:null,plannedDurationSeconds:w?Math.max(15,Number(B||30))*60:void 0})}finally{m(!1)}},children:"Clear custom rules"})]})]})}export{Z as S};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-BwL6m4SE.js";import{c as l}from"./index-FpGANF9S.js";import{a as m,b as o}from"./schema-visuals-CvC9a3i6.js";function u({label:s,schemaType:a,compact:n=!1,showType:r=!1,className:t}){const i=o(a);return e.jsxs("span",{className:l("inline-flex max-w-full min-w-0 items-center gap-2 rounded-full border px-3 py-1.5 text-sm leading-tight shadow-[inset_0_1px_0_var(--ui-border-subtle)]",n?"min-h-8":"min-h-9",i.badgeTone,t),children:[r?e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-soft)]",children:m(a)}):null,e.jsx("span",{className:"min-w-0 break-words whitespace-normal",children:s})]})}export{u as S};
1
+ import{j as e}from"./vendor-BwL6m4SE.js";import{c as l}from"./index-izRKx6JK.js";import{a as m,b as o}from"./schema-visuals-CvC9a3i6.js";function u({label:s,schemaType:a,compact:n=!1,showType:r=!1,className:t}){const i=o(a);return e.jsxs("span",{className:l("inline-flex max-w-full min-w-0 items-center gap-2 rounded-full border px-3 py-1.5 text-sm leading-tight shadow-[inset_0_1px_0_var(--ui-border-subtle)]",n?"min-h-8":"min-h-9",i.badgeTone,t),children:[r?e.jsx("span",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-soft)]",children:m(a)}):null,e.jsx("span",{className:"min-w-0 break-words whitespace-normal",children:s})]})}export{u as S};
@@ -1 +1 @@
1
- import{cb as I,cc as f}from"./index-FpGANF9S.js";import{o as t,a as i,s as e,c as r,e as n,l,b as a,Z as d,n as k}from"./forms-D1qJ3oOP.js";const T=n(["en","fr"]),x=n(["dark-fantasy","dramatic-smithie","mind-locksmith"]),c=t({contentMarkdown:e().trim().min(1,"Note content is required"),author:e().trim()}),v=t({title:e().trim().min(1,"Title is required"),description:e().trim(),horizon:n(["quarter","year","lifetime"]),status:n(["active","paused","completed"]),userId:e().trim().nullable().optional(),targetPoints:r.number().int().min(25).max(1e4),themeColor:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Theme color must be a valid hex value"),tagIds:i(e()),notes:i(c)}),w=t({goalId:e().trim().min(1,"Life goal is required"),title:e().trim().min(1,"Title is required"),description:e().trim(),status:n(["active","paused","completed"]),workflowStatus:n(["backlog","focus","in_progress","blocked","done"]),userId:e().trim().nullable().optional(),assigneeUserIds:i(e().trim()),targetPoints:r.number().int().min(25).max(1e4),themeColor:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Theme color must be a valid hex value"),productRequirementsDocument:e().trim(),notes:i(c)}),C=t({profile:t({operatorName:e().trim().min(1,"Name is required"),operatorEmail:e().trim().min(1,"Email is required"),operatorTitle:e().trim().min(1,"Title is required")}),notifications:t({goalDriftAlerts:a(),dailyQuestReminders:a(),achievementCelebrations:a()}),execution:t({maxActiveTasks:r.number().int().min(1).max(8),timeAccountingMode:n(["split","parallel","primary_only"])}),themePreference:I,gamificationTheme:x.default("dramatic-smithie"),customTheme:f.nullable().optional(),localePreference:T,calendarProviders:t({google:t({clientId:e().trim().optional(),clientSecret:e().trim().optional(),storedClientId:e().optional(),storedClientSecret:e().optional(),appBaseUrl:e().optional(),redirectUri:e().optional(),allowedOrigins:i(e()).optional(),usesPkce:l(!0).optional(),requiresServerClientSecret:l(!1).optional(),oauthClientType:l("desktop_app").optional(),authMode:l("localhost_pkce").optional(),isConfigured:a().optional(),isReadyForPairing:a().optional(),isLocalOnly:l(!0).optional(),runtimeOrigin:e().optional(),setupMessage:e().optional()}).optional(),microsoft:t({clientId:e().trim(),tenantId:e().trim(),redirectUri:e().trim()}).optional()}).optional().superRefine((o,s)=>{var g,h;const m=o==null?void 0:o.google;if(!m)return;const u=m.clientId!==void 0,b=m.clientSecret!==void 0,p=(((g=m.clientId)==null?void 0:g.length)??0)>0,y=(((h=m.clientSecret)==null?void 0:h.length)??0)>0;if(u!==b){s.addIssue({code:d.custom,path:["google",u?"clientSecret":"clientId"],message:"Provide both the Google client ID and client secret together, or clear both together."});return}p!==y&&s.addIssue({code:d.custom,path:["google",p?"clientSecret":"clientId"],message:"Provide both the Google client ID and client secret together, or clear both together."})}),modelSettings:t({forgeAgent:t({basicChat:t({connectionId:e().trim().nullable().optional(),model:e().trim().optional()}).optional(),wiki:t({connectionId:e().trim().nullable().optional(),model:e().trim().optional()}).optional()}).optional()}).optional()}),P=t({label:e().trim().min(1,"Label is required"),agentLabel:e().trim().min(1,"Agent name is required"),agentType:e().trim().min(1,"Agent type is required"),description:e().trim(),trustLevel:n(["standard","trusted","autonomous"]),autonomyMode:n(["approval_required","scoped_write","autonomous"]),approvalMode:n(["approval_by_default","high_impact_only","none"]),scopes:i(e().trim().min(1)).min(1),bootstrapPolicy:t({mode:n(["disabled","active_only","scoped","full"]),goalsLimit:r.number().int().min(0).max(100),projectsLimit:r.number().int().min(0).max(100),tasksLimit:r.number().int().min(0).max(100),habitsLimit:r.number().int().min(0).max(100),strategiesLimit:r.number().int().min(0).max(100),peoplePageLimit:r.number().int().min(0).max(50),includePeoplePages:a()}),scopePolicy:t({userIds:i(e().trim().min(1)),projectIds:i(e().trim().min(1)),tagIds:i(e().trim().min(1))})}),L=t({originType:n(["system","user","agent"]),originAgentId:e().trim(),originLabel:e().trim(),entityType:e().trim(),entityId:e().trim(),timeframeLabel:e().trim(),title:e().trim().min(1,"Title is required"),summary:e().trim().min(1,"Summary is required"),recommendation:e().trim().min(1,"Recommendation is required"),rationale:e().trim(),confidence:r.number().min(0).max(1),ctaLabel:e().trim().min(1,"CTA label is required")}),M=t({title:e().trim().min(1,"Title is required"),description:e().trim(),level:n(["issue","task","subtask"]),owner:e().trim().min(1,"Owner is required"),userId:e().trim().nullable().optional(),assigneeUserIds:i(e().trim()),goalId:e().trim(),projectId:e().trim().min(1,"Project is required"),parentWorkItemId:e().trim().nullable().optional(),priority:n(["low","medium","high","critical"]),status:n(["backlog","focus","in_progress","blocked","done"]),effort:n(["light","deep","marathon"]),energy:n(["low","steady","high"]),dueDate:e().trim(),points:r.number().int().min(5).max(500),plannedDurationSeconds:r.number().int().min(60).max(7*86400).nullable().optional(),actionCostBand:n(["tiny","light","standard","heavy","brutal"]).optional(),aiInstructions:e().trim(),executionMode:n(["afk","hitl"]).nullable().optional(),acceptanceCriteria:i(e().trim()),blockerLinks:i(t({entityType:e().trim().min(1),entityId:e().trim().min(1),label:e().trim().optional()})),completionReport:t({modifiedFiles:i(e().trim()),workSummary:e().trim(),linkedGitRefIds:i(e().trim())}).nullable().optional(),gitRefs:i(t({id:e().trim().min(1).optional(),workItemId:e().trim().optional(),refType:n(["commit","branch","pull_request"]),provider:e().trim().default("git"),repository:e().trim().default(""),refValue:e().trim().min(1),url:e().trim().url().nullable().optional(),displayTitle:e().trim().default("")})).default([]),tagIds:i(e()),notes:i(c)}),A=t({title:e().trim().min(1,"Title is required"),description:e().trim(),status:n(["active","paused","archived"]),userId:e().trim().nullable().optional(),polarity:n(["positive","negative"]),frequency:n(["daily","weekly"]),targetCount:r.number().int().min(1).max(14),weekDays:i(k().int().min(0).max(6)).max(7),linkedGoalIds:i(e().trim().min(1)),linkedProjectIds:i(e().trim().min(1)),linkedTaskIds:i(e().trim().min(1)),linkedValueIds:i(e().trim().min(1)),linkedPatternIds:i(e().trim().min(1)),linkedBehaviorIds:i(e().trim().min(1)),linkedBeliefIds:i(e().trim().min(1)),linkedModeIds:i(e().trim().min(1)),linkedReportIds:i(e().trim().min(1)),linkedBehaviorId:e().trim(),rewardXp:r.number().int().min(1).max(100),penaltyXp:r.number().int().min(1).max(100),generatedHealthEventTemplate:t({enabled:a(),workoutType:e().trim(),title:e().trim(),durationMinutes:r.number().int().min(1).max(1440),xpReward:r.number().int().min(0).max(500),tags:i(e().trim()),links:i(t({entityType:e().trim().min(1),entityId:e().trim().min(1),relationshipType:e().trim().default("context")})),notesTemplate:e().trim()})}).superRefine((o,s)=>{o.frequency==="weekly"&&o.weekDays.length===0&&s.addIssue({code:d.custom,path:["weekDays"],message:"Pick at least one weekday"})}),_=t({entityType:n(["task","project"]),entityId:e().trim().min(1,"A target is required"),deltaMinutes:r.number().int().refine(o=>o!==0,"Minutes must not be zero"),note:e().trim()});t({name:e().trim().min(1,"Name is required"),kind:n(["value","category","execution"]),userId:e().trim().nullable().optional(),color:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Color must be a valid hex value"),description:e().trim()});export{P as a,L as c,v as g,A as h,w as p,M as q,C as s,_ as w};
1
+ import{cb as I,cc as f}from"./index-izRKx6JK.js";import{o as t,a as i,s as e,c as r,e as n,l,b as a,Z as d,n as k}from"./forms-D1qJ3oOP.js";const T=n(["en","fr"]),x=n(["dark-fantasy","dramatic-smithie","mind-locksmith"]),c=t({contentMarkdown:e().trim().min(1,"Note content is required"),author:e().trim()}),v=t({title:e().trim().min(1,"Title is required"),description:e().trim(),horizon:n(["quarter","year","lifetime"]),status:n(["active","paused","completed"]),userId:e().trim().nullable().optional(),targetPoints:r.number().int().min(25).max(1e4),themeColor:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Theme color must be a valid hex value"),tagIds:i(e()),notes:i(c)}),w=t({goalId:e().trim().min(1,"Life goal is required"),title:e().trim().min(1,"Title is required"),description:e().trim(),status:n(["active","paused","completed"]),workflowStatus:n(["backlog","focus","in_progress","blocked","done"]),userId:e().trim().nullable().optional(),assigneeUserIds:i(e().trim()),targetPoints:r.number().int().min(25).max(1e4),themeColor:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Theme color must be a valid hex value"),productRequirementsDocument:e().trim(),notes:i(c)}),C=t({profile:t({operatorName:e().trim().min(1,"Name is required"),operatorEmail:e().trim().min(1,"Email is required"),operatorTitle:e().trim().min(1,"Title is required")}),notifications:t({goalDriftAlerts:a(),dailyQuestReminders:a(),achievementCelebrations:a()}),execution:t({maxActiveTasks:r.number().int().min(1).max(8),timeAccountingMode:n(["split","parallel","primary_only"])}),themePreference:I,gamificationTheme:x.default("dramatic-smithie"),customTheme:f.nullable().optional(),localePreference:T,calendarProviders:t({google:t({clientId:e().trim().optional(),clientSecret:e().trim().optional(),storedClientId:e().optional(),storedClientSecret:e().optional(),appBaseUrl:e().optional(),redirectUri:e().optional(),allowedOrigins:i(e()).optional(),usesPkce:l(!0).optional(),requiresServerClientSecret:l(!1).optional(),oauthClientType:l("desktop_app").optional(),authMode:l("localhost_pkce").optional(),isConfigured:a().optional(),isReadyForPairing:a().optional(),isLocalOnly:l(!0).optional(),runtimeOrigin:e().optional(),setupMessage:e().optional()}).optional(),microsoft:t({clientId:e().trim(),tenantId:e().trim(),redirectUri:e().trim()}).optional()}).optional().superRefine((o,s)=>{var g,h;const m=o==null?void 0:o.google;if(!m)return;const u=m.clientId!==void 0,b=m.clientSecret!==void 0,p=(((g=m.clientId)==null?void 0:g.length)??0)>0,y=(((h=m.clientSecret)==null?void 0:h.length)??0)>0;if(u!==b){s.addIssue({code:d.custom,path:["google",u?"clientSecret":"clientId"],message:"Provide both the Google client ID and client secret together, or clear both together."});return}p!==y&&s.addIssue({code:d.custom,path:["google",p?"clientSecret":"clientId"],message:"Provide both the Google client ID and client secret together, or clear both together."})}),modelSettings:t({forgeAgent:t({basicChat:t({connectionId:e().trim().nullable().optional(),model:e().trim().optional()}).optional(),wiki:t({connectionId:e().trim().nullable().optional(),model:e().trim().optional()}).optional()}).optional()}).optional()}),P=t({label:e().trim().min(1,"Label is required"),agentLabel:e().trim().min(1,"Agent name is required"),agentType:e().trim().min(1,"Agent type is required"),description:e().trim(),trustLevel:n(["standard","trusted","autonomous"]),autonomyMode:n(["approval_required","scoped_write","autonomous"]),approvalMode:n(["approval_by_default","high_impact_only","none"]),scopes:i(e().trim().min(1)).min(1),bootstrapPolicy:t({mode:n(["disabled","active_only","scoped","full"]),goalsLimit:r.number().int().min(0).max(100),projectsLimit:r.number().int().min(0).max(100),tasksLimit:r.number().int().min(0).max(100),habitsLimit:r.number().int().min(0).max(100),strategiesLimit:r.number().int().min(0).max(100),peoplePageLimit:r.number().int().min(0).max(50),includePeoplePages:a()}),scopePolicy:t({userIds:i(e().trim().min(1)),projectIds:i(e().trim().min(1)),tagIds:i(e().trim().min(1))})}),L=t({originType:n(["system","user","agent"]),originAgentId:e().trim(),originLabel:e().trim(),entityType:e().trim(),entityId:e().trim(),timeframeLabel:e().trim(),title:e().trim().min(1,"Title is required"),summary:e().trim().min(1,"Summary is required"),recommendation:e().trim().min(1,"Recommendation is required"),rationale:e().trim(),confidence:r.number().min(0).max(1),ctaLabel:e().trim().min(1,"CTA label is required")}),M=t({title:e().trim().min(1,"Title is required"),description:e().trim(),level:n(["issue","task","subtask"]),owner:e().trim().min(1,"Owner is required"),userId:e().trim().nullable().optional(),assigneeUserIds:i(e().trim()),goalId:e().trim(),projectId:e().trim().min(1,"Project is required"),parentWorkItemId:e().trim().nullable().optional(),priority:n(["low","medium","high","critical"]),status:n(["backlog","focus","in_progress","blocked","done"]),effort:n(["light","deep","marathon"]),energy:n(["low","steady","high"]),dueDate:e().trim(),points:r.number().int().min(5).max(500),plannedDurationSeconds:r.number().int().min(60).max(7*86400).nullable().optional(),actionCostBand:n(["tiny","light","standard","heavy","brutal"]).optional(),aiInstructions:e().trim(),executionMode:n(["afk","hitl"]).nullable().optional(),acceptanceCriteria:i(e().trim()),blockerLinks:i(t({entityType:e().trim().min(1),entityId:e().trim().min(1),label:e().trim().optional()})),completionReport:t({modifiedFiles:i(e().trim()),workSummary:e().trim(),linkedGitRefIds:i(e().trim())}).nullable().optional(),gitRefs:i(t({id:e().trim().min(1).optional(),workItemId:e().trim().optional(),refType:n(["commit","branch","pull_request"]),provider:e().trim().default("git"),repository:e().trim().default(""),refValue:e().trim().min(1),url:e().trim().url().nullable().optional(),displayTitle:e().trim().default("")})).default([]),tagIds:i(e()),notes:i(c)}),A=t({title:e().trim().min(1,"Title is required"),description:e().trim(),status:n(["active","paused","archived"]),userId:e().trim().nullable().optional(),polarity:n(["positive","negative"]),frequency:n(["daily","weekly"]),targetCount:r.number().int().min(1).max(14),weekDays:i(k().int().min(0).max(6)).max(7),linkedGoalIds:i(e().trim().min(1)),linkedProjectIds:i(e().trim().min(1)),linkedTaskIds:i(e().trim().min(1)),linkedValueIds:i(e().trim().min(1)),linkedPatternIds:i(e().trim().min(1)),linkedBehaviorIds:i(e().trim().min(1)),linkedBeliefIds:i(e().trim().min(1)),linkedModeIds:i(e().trim().min(1)),linkedReportIds:i(e().trim().min(1)),linkedBehaviorId:e().trim(),rewardXp:r.number().int().min(1).max(100),penaltyXp:r.number().int().min(1).max(100),generatedHealthEventTemplate:t({enabled:a(),workoutType:e().trim(),title:e().trim(),durationMinutes:r.number().int().min(1).max(1440),xpReward:r.number().int().min(0).max(500),tags:i(e().trim()),links:i(t({entityType:e().trim().min(1),entityId:e().trim().min(1),relationshipType:e().trim().default("context")})),notesTemplate:e().trim()})}).superRefine((o,s)=>{o.frequency==="weekly"&&o.weekDays.length===0&&s.addIssue({code:d.custom,path:["weekDays"],message:"Pick at least one weekday"})}),_=t({entityType:n(["task","project"]),entityId:e().trim().min(1,"A target is required"),deltaMinutes:r.number().int().refine(o=>o!==0,"Minutes must not be zero"),note:e().trim()});t({name:e().trim().min(1,"Name is required"),kind:n(["value","category","execution"]),userId:e().trim().nullable().optional(),color:e().trim().regex(/^#[0-9a-fA-F]{6}$/,"Color must be a valid hex value"),description:e().trim()});export{P as a,L as c,v as g,A as h,w as p,M as q,C as s,_ as w};
@@ -1 +1 @@
1
- import{r as i,j as e,cs as g,bG as k}from"./vendor-BwL6m4SE.js";import{c as n}from"./index-FpGANF9S.js";function y({label:m,value:l,options:u,onChange:b,className:h,triggerClassName:p,menuClassName:w}){const[a,c]=i.useState(!1),x=i.useRef(null),v=i.useRef(null),f=i.useId(),t=i.useMemo(()=>u.find(r=>r.value===l)??u[0],[u,l]);return i.useEffect(()=>{if(!a)return;const r=d=>{var o;(o=x.current)!=null&&o.contains(d.target)||c(!1)},s=d=>{var o;d.key==="Escape"&&(c(!1),(o=v.current)==null||o.focus())};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",s),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",s)}},[a]),e.jsxs("div",{className:n("relative min-w-0 max-w-full",h),ref:x,children:[e.jsx("div",{className:"mb-1.5 text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:m}),e.jsxs("button",{ref:v,type:"button",className:n("flex min-h-11 w-full min-w-0 items-center justify-between gap-3 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2.5 text-left shadow-[var(--ui-shadow-soft)] transition hover:border-[var(--ui-border-strong)] hover:bg-[var(--ui-surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--primary)_45%,transparent)] sm:min-w-[15rem]",p),"aria-haspopup":"listbox","aria-expanded":a,"aria-controls":f,onClick:()=>c(r=>!r),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium text-[var(--ui-ink-strong)]",children:(t==null?void 0:t.label)??l}),t!=null&&t.description?e.jsx("div",{className:"truncate text-xs text-[var(--ui-ink-faint)]",children:t.description}):null]}),e.jsx(g,{className:n("size-4 shrink-0 text-[var(--ui-ink-faint)] transition",a&&"rotate-180 text-[var(--ui-ink-medium)]")})]}),a?e.jsx("div",{id:f,role:"listbox","aria-label":m,className:n("absolute left-0 top-[calc(100%+0.6rem)] z-30 w-full overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-modal)] p-2 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",w),children:e.jsx("div",{className:"grid gap-1",children:u.map(r=>{const s=r.value===l;return e.jsxs("button",{type:"button",role:"option","aria-selected":s,className:n("flex w-full items-start justify-between gap-3 rounded-[16px] px-3 py-2.5 text-left transition",s?"bg-[var(--ui-surface-active)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onClick:()=>{b(r.value),c(!1)},children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:r.label}),r.description?e.jsx("div",{className:"mt-0.5 text-xs text-[var(--ui-ink-faint)]",children:r.description}):null]}),e.jsx(k,{className:n("mt-0.5 size-4 shrink-0 transition",s?"text-[var(--ui-ink-strong)]":"opacity-0")})]},r.value)})})}):null]})}export{y as S};
1
+ import{r as i,j as e,cs as g,bG as k}from"./vendor-BwL6m4SE.js";import{c as n}from"./index-izRKx6JK.js";function y({label:m,value:l,options:u,onChange:b,className:h,triggerClassName:p,menuClassName:w}){const[a,c]=i.useState(!1),x=i.useRef(null),v=i.useRef(null),f=i.useId(),t=i.useMemo(()=>u.find(r=>r.value===l)??u[0],[u,l]);return i.useEffect(()=>{if(!a)return;const r=d=>{var o;(o=x.current)!=null&&o.contains(d.target)||c(!1)},s=d=>{var o;d.key==="Escape"&&(c(!1),(o=v.current)==null||o.focus())};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",s),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",s)}},[a]),e.jsxs("div",{className:n("relative min-w-0 max-w-full",h),ref:x,children:[e.jsx("div",{className:"mb-1.5 text-[11px] font-medium uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",children:m}),e.jsxs("button",{ref:v,type:"button",className:n("flex min-h-11 w-full min-w-0 items-center justify-between gap-3 rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] px-4 py-2.5 text-left shadow-[var(--ui-shadow-soft)] transition hover:border-[var(--ui-border-strong)] hover:bg-[var(--ui-surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--primary)_45%,transparent)] sm:min-w-[15rem]",p),"aria-haspopup":"listbox","aria-expanded":a,"aria-controls":f,onClick:()=>c(r=>!r),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium text-[var(--ui-ink-strong)]",children:(t==null?void 0:t.label)??l}),t!=null&&t.description?e.jsx("div",{className:"truncate text-xs text-[var(--ui-ink-faint)]",children:t.description}):null]}),e.jsx(g,{className:n("size-4 shrink-0 text-[var(--ui-ink-faint)] transition",a&&"rotate-180 text-[var(--ui-ink-medium)]")})]}),a?e.jsx("div",{id:f,role:"listbox","aria-label":m,className:n("absolute left-0 top-[calc(100%+0.6rem)] z-30 w-full overflow-hidden rounded-[22px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-modal)] p-2 shadow-[var(--ui-shadow-floating)] backdrop-blur-xl",w),children:e.jsx("div",{className:"grid gap-1",children:u.map(r=>{const s=r.value===l;return e.jsxs("button",{type:"button",role:"option","aria-selected":s,className:n("flex w-full items-start justify-between gap-3 rounded-[16px] px-3 py-2.5 text-left transition",s?"bg-[var(--ui-surface-active)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-medium)] hover:bg-[var(--ui-surface-hover)] hover:text-[var(--ui-ink-strong)]"),onClick:()=>{b(r.value),c(!1)},children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium",children:r.label}),r.description?e.jsx("div",{className:"mt-0.5 text-xs text-[var(--ui-ink-faint)]",children:r.description}):null]}),e.jsx(k,{className:n("mt-0.5 size-4 shrink-0 transition",s?"text-[var(--ui-ink-strong)]":"opacity-0")})]},r.value)})})}):null]})}export{y as S};