@roxyapi/ui 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/AGENTS.md +21 -0
  2. package/README.md +17 -1
  3. package/dist/cdn/components/ashtakavarga-grid.js +3 -362
  4. package/dist/cdn/components/ashtakavarga-grid.js.map +4 -4
  5. package/dist/cdn/components/biorhythm-chart.js +3 -226
  6. package/dist/cdn/components/biorhythm-chart.js.map +4 -4
  7. package/dist/cdn/components/choghadiya-grid.js +3 -232
  8. package/dist/cdn/components/choghadiya-grid.js.map +4 -4
  9. package/dist/cdn/components/compatibility-card.js +3 -231
  10. package/dist/cdn/components/compatibility-card.js.map +4 -4
  11. package/dist/cdn/components/dasha-timeline.js +3 -283
  12. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  13. package/dist/cdn/components/data.js +3 -230
  14. package/dist/cdn/components/data.js.map +4 -4
  15. package/dist/cdn/components/divisional-chart.js +3 -356
  16. package/dist/cdn/components/divisional-chart.js.map +4 -4
  17. package/dist/cdn/components/dosha-card.js +3 -226
  18. package/dist/cdn/components/dosha-card.js.map +4 -4
  19. package/dist/cdn/components/endpoint-form.js +2 -243
  20. package/dist/cdn/components/endpoint-form.js.map +2 -2
  21. package/dist/cdn/components/guna-milan.js +3 -270
  22. package/dist/cdn/components/guna-milan.js.map +4 -4
  23. package/dist/cdn/components/hexagram.js +3 -247
  24. package/dist/cdn/components/hexagram.js.map +4 -4
  25. package/dist/cdn/components/horoscope-card.js +3 -281
  26. package/dist/cdn/components/horoscope-card.js.map +4 -4
  27. package/dist/cdn/components/kp-chart.js +3 -278
  28. package/dist/cdn/components/kp-chart.js.map +4 -4
  29. package/dist/cdn/components/kp-planets-table.js +3 -196
  30. package/dist/cdn/components/kp-planets-table.js.map +4 -4
  31. package/dist/cdn/components/kp-ruling-planets.js +3 -241
  32. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  33. package/dist/cdn/components/location-search.js +2 -240
  34. package/dist/cdn/components/location-search.js.map +2 -2
  35. package/dist/cdn/components/moon-phase.js +3 -223
  36. package/dist/cdn/components/moon-phase.js.map +4 -4
  37. package/dist/cdn/components/nakshatra-card.js +3 -201
  38. package/dist/cdn/components/nakshatra-card.js.map +4 -4
  39. package/dist/cdn/components/natal-chart.js +3 -563
  40. package/dist/cdn/components/natal-chart.js.map +4 -4
  41. package/dist/cdn/components/numerology-card.js +3 -233
  42. package/dist/cdn/components/numerology-card.js.map +4 -4
  43. package/dist/cdn/components/panchang-table.js +3 -220
  44. package/dist/cdn/components/panchang-table.js.map +4 -4
  45. package/dist/cdn/components/shadbala-table.js +3 -284
  46. package/dist/cdn/components/shadbala-table.js.map +4 -4
  47. package/dist/cdn/components/synastry-chart.js +3 -399
  48. package/dist/cdn/components/synastry-chart.js.map +4 -4
  49. package/dist/cdn/components/tarot-card.js +3 -261
  50. package/dist/cdn/components/tarot-card.js.map +4 -4
  51. package/dist/cdn/components/tarot-spread.js +3 -249
  52. package/dist/cdn/components/tarot-spread.js.map +4 -4
  53. package/dist/cdn/components/transits-table.js +3 -382
  54. package/dist/cdn/components/transits-table.js.map +4 -4
  55. package/dist/cdn/components/vedic-kundli.js +3 -305
  56. package/dist/cdn/components/vedic-kundli.js.map +4 -4
  57. package/dist/cdn/components/vedic-planets-table.js +3 -203
  58. package/dist/cdn/components/vedic-planets-table.js.map +4 -4
  59. package/dist/cdn/components/western-planets-table.js +3 -192
  60. package/dist/cdn/components/western-planets-table.js.map +4 -4
  61. package/dist/cdn/components/yoga-list.js +3 -306
  62. package/dist/cdn/components/yoga-list.js.map +4 -4
  63. package/dist/cdn/roxy-ui.js +3 -5102
  64. package/dist/cdn/roxy-ui.js.map +4 -4
  65. package/dist/cdn/widgets.js +1 -114
  66. package/dist/components/ashtakavarga-grid.d.ts +1 -0
  67. package/dist/components/ashtakavarga-grid.d.ts.map +1 -1
  68. package/dist/components/ashtakavarga-grid.js +1 -531
  69. package/dist/components/ashtakavarga-grid.js.map +4 -4
  70. package/dist/components/biorhythm-chart.d.ts +1 -0
  71. package/dist/components/biorhythm-chart.d.ts.map +1 -1
  72. package/dist/components/biorhythm-chart.js +1 -332
  73. package/dist/components/biorhythm-chart.js.map +4 -4
  74. package/dist/components/choghadiya-grid.d.ts +1 -0
  75. package/dist/components/choghadiya-grid.d.ts.map +1 -1
  76. package/dist/components/choghadiya-grid.js +1 -351
  77. package/dist/components/choghadiya-grid.js.map +4 -4
  78. package/dist/components/compatibility-card.d.ts +1 -0
  79. package/dist/components/compatibility-card.d.ts.map +1 -1
  80. package/dist/components/compatibility-card.js +1 -313
  81. package/dist/components/compatibility-card.js.map +4 -4
  82. package/dist/components/dasha-timeline.d.ts +1 -0
  83. package/dist/components/dasha-timeline.d.ts.map +1 -1
  84. package/dist/components/dasha-timeline.js +1 -401
  85. package/dist/components/dasha-timeline.js.map +4 -4
  86. package/dist/components/data.d.ts +1 -0
  87. package/dist/components/data.d.ts.map +1 -1
  88. package/dist/components/data.js +1 -362
  89. package/dist/components/data.js.map +4 -4
  90. package/dist/components/divisional-chart.d.ts +1 -0
  91. package/dist/components/divisional-chart.d.ts.map +1 -1
  92. package/dist/components/divisional-chart.js +1 -886
  93. package/dist/components/divisional-chart.js.map +4 -4
  94. package/dist/components/dosha-card.d.ts +1 -0
  95. package/dist/components/dosha-card.d.ts.map +1 -1
  96. package/dist/components/dosha-card.js +1 -293
  97. package/dist/components/dosha-card.js.map +4 -4
  98. package/dist/components/endpoint-form.js +1 -505
  99. package/dist/components/endpoint-form.js.map +3 -3
  100. package/dist/components/guna-milan.d.ts +1 -0
  101. package/dist/components/guna-milan.d.ts.map +1 -1
  102. package/dist/components/guna-milan.js +1 -374
  103. package/dist/components/guna-milan.js.map +4 -4
  104. package/dist/components/hexagram.d.ts +1 -0
  105. package/dist/components/hexagram.d.ts.map +1 -1
  106. package/dist/components/hexagram.js +1 -380
  107. package/dist/components/hexagram.js.map +4 -4
  108. package/dist/components/horoscope-card.d.ts +1 -0
  109. package/dist/components/horoscope-card.d.ts.map +1 -1
  110. package/dist/components/horoscope-card.js +1 -381
  111. package/dist/components/horoscope-card.js.map +4 -4
  112. package/dist/components/kp-chart.d.ts +1 -0
  113. package/dist/components/kp-chart.d.ts.map +1 -1
  114. package/dist/components/kp-chart.js +1 -395
  115. package/dist/components/kp-chart.js.map +4 -4
  116. package/dist/components/kp-planets-table.d.ts +1 -0
  117. package/dist/components/kp-planets-table.d.ts.map +1 -1
  118. package/dist/components/kp-planets-table.js +1 -246
  119. package/dist/components/kp-planets-table.js.map +4 -4
  120. package/dist/components/kp-ruling-planets.d.ts +1 -0
  121. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  122. package/dist/components/kp-ruling-planets.js +1 -288
  123. package/dist/components/kp-ruling-planets.js.map +4 -4
  124. package/dist/components/location-search.js +1 -461
  125. package/dist/components/location-search.js.map +3 -3
  126. package/dist/components/moon-phase.d.ts +1 -0
  127. package/dist/components/moon-phase.d.ts.map +1 -1
  128. package/dist/components/moon-phase.js +1 -327
  129. package/dist/components/moon-phase.js.map +4 -4
  130. package/dist/components/nakshatra-card.d.ts +1 -0
  131. package/dist/components/nakshatra-card.d.ts.map +1 -1
  132. package/dist/components/nakshatra-card.js +1 -244
  133. package/dist/components/nakshatra-card.js.map +4 -4
  134. package/dist/components/natal-chart.d.ts +1 -1
  135. package/dist/components/natal-chart.d.ts.map +1 -1
  136. package/dist/components/natal-chart.js +1 -1040
  137. package/dist/components/natal-chart.js.map +4 -4
  138. package/dist/components/numerology-card.d.ts +1 -0
  139. package/dist/components/numerology-card.d.ts.map +1 -1
  140. package/dist/components/numerology-card.js +1 -315
  141. package/dist/components/numerology-card.js.map +4 -4
  142. package/dist/components/panchang-table.d.ts +1 -0
  143. package/dist/components/panchang-table.d.ts.map +1 -1
  144. package/dist/components/panchang-table.js +1 -350
  145. package/dist/components/panchang-table.js.map +4 -4
  146. package/dist/components/shadbala-table.d.ts +1 -0
  147. package/dist/components/shadbala-table.d.ts.map +1 -1
  148. package/dist/components/shadbala-table.js +1 -413
  149. package/dist/components/shadbala-table.js.map +4 -4
  150. package/dist/components/synastry-chart.d.ts +1 -0
  151. package/dist/components/synastry-chart.d.ts.map +1 -1
  152. package/dist/components/synastry-chart.js +1 -658
  153. package/dist/components/synastry-chart.js.map +4 -4
  154. package/dist/components/tarot-card.d.ts +1 -0
  155. package/dist/components/tarot-card.d.ts.map +1 -1
  156. package/dist/components/tarot-card.js +1 -333
  157. package/dist/components/tarot-card.js.map +4 -4
  158. package/dist/components/tarot-spread.d.ts +1 -0
  159. package/dist/components/tarot-spread.d.ts.map +1 -1
  160. package/dist/components/tarot-spread.js +1 -310
  161. package/dist/components/tarot-spread.js.map +4 -4
  162. package/dist/components/transits-table.d.ts +3 -0
  163. package/dist/components/transits-table.d.ts.map +1 -1
  164. package/dist/components/transits-table.js +1 -548
  165. package/dist/components/transits-table.js.map +4 -4
  166. package/dist/components/vedic-kundli.d.ts +1 -0
  167. package/dist/components/vedic-kundli.d.ts.map +1 -1
  168. package/dist/components/vedic-kundli.js +1 -802
  169. package/dist/components/vedic-kundli.js.map +4 -4
  170. package/dist/components/vedic-planets-table.d.ts +1 -0
  171. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  172. package/dist/components/vedic-planets-table.js +1 -368
  173. package/dist/components/vedic-planets-table.js.map +4 -4
  174. package/dist/components/western-planets-table.d.ts +1 -0
  175. package/dist/components/western-planets-table.d.ts.map +1 -1
  176. package/dist/components/western-planets-table.js +1 -363
  177. package/dist/components/western-planets-table.js.map +4 -4
  178. package/dist/components/yoga-list.d.ts +1 -0
  179. package/dist/components/yoga-list.d.ts.map +1 -1
  180. package/dist/components/yoga-list.js +1 -383
  181. package/dist/components/yoga-list.js.map +4 -4
  182. package/dist/index.cjs +1 -8653
  183. package/dist/index.cjs.map +4 -4
  184. package/dist/index.js +1 -8633
  185. package/dist/index.js.map +4 -4
  186. package/dist/types/index.d.ts +1 -1
  187. package/dist/types/index.d.ts.map +1 -1
  188. package/dist/types/types.gen.d.ts +590 -202
  189. package/dist/types/types.gen.d.ts.map +1 -1
  190. package/dist/utils/disclosure.d.ts +16 -0
  191. package/dist/utils/disclosure.d.ts.map +1 -0
  192. package/dist/utils/kundli-render.d.ts.map +1 -1
  193. package/dist/utils/kundli-styles.d.ts.map +1 -1
  194. package/dist/utils/markup-data.d.ts +57 -0
  195. package/dist/utils/markup-data.d.ts.map +1 -0
  196. package/dist/utils/tablist.d.ts +44 -0
  197. package/dist/utils/tablist.d.ts.map +1 -0
  198. package/dist/version.d.ts +1 -1
  199. package/package.json +3 -1
  200. package/src/components/ashtakavarga-grid.ts +9 -0
  201. package/src/components/biorhythm-chart.ts +9 -0
  202. package/src/components/choghadiya-grid.ts +9 -0
  203. package/src/components/compatibility-card.ts +9 -0
  204. package/src/components/dasha-timeline.ts +19 -1
  205. package/src/components/data.ts +9 -0
  206. package/src/components/divisional-chart.ts +11 -0
  207. package/src/components/dosha-card.ts +9 -0
  208. package/src/components/guna-milan.ts +9 -0
  209. package/src/components/hexagram.ts +9 -0
  210. package/src/components/horoscope-card.ts +9 -0
  211. package/src/components/kp-chart.ts +9 -0
  212. package/src/components/kp-planets-table.ts +9 -0
  213. package/src/components/kp-ruling-planets.ts +9 -0
  214. package/src/components/moon-phase.ts +9 -0
  215. package/src/components/nakshatra-card.ts +9 -0
  216. package/src/components/natal-chart.ts +46 -62
  217. package/src/components/numerology-card.ts +9 -0
  218. package/src/components/panchang-table.ts +9 -0
  219. package/src/components/shadbala-table.ts +9 -0
  220. package/src/components/synastry-chart.ts +9 -0
  221. package/src/components/tarot-card.ts +9 -0
  222. package/src/components/tarot-spread.ts +9 -0
  223. package/src/components/transits-table.ts +54 -18
  224. package/src/components/vedic-kundli.ts +11 -1
  225. package/src/components/vedic-planets-table.ts +9 -0
  226. package/src/components/western-planets-table.ts +9 -0
  227. package/src/components/yoga-list.ts +9 -0
  228. package/src/types/index.ts +1 -1
  229. package/src/types/types.gen.ts +602 -200
  230. package/src/utils/disclosure.ts +62 -0
  231. package/src/utils/kundli-render.ts +21 -35
  232. package/src/utils/kundli-styles.ts +0 -31
  233. package/src/utils/markup-data.ts +115 -0
  234. package/src/utils/tablist.ts +124 -0
  235. package/src/version.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/ashtakavarga-grid.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'pinda';\n\nconst TAB_LABELS: Record<Tab, string> = {\n\tsarva: 'Sarvashtakavarga',\n\tbhinna: 'Bhinnashtakavarga',\n\tpinda: 'Shodhya Pinda',\n};\n\nconst TABS: Tab[] = ['sarva', 'bhinna', 'pinda'];\n\n/**\n * Ashtakavarga grid with three tabbed views: Sarvashtakavarga, Bhinnashtakavarga,\n * and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\n\t\t\t.head {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: baseline;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t\tflex-wrap: wrap;\n\t\t\t}\n\n\t\t\t.title {\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t.subtitle {\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\n\t\t\t/* Tabs */\n\t\t\t.tablist {\n\t\t\t\tdisplay: flex;\n\t\t\t\tgap: 2px;\n\t\t\t\tborder-bottom: 2px solid var(--roxy-border, #e4e4e7);\n\t\t\t}\n\n\t\t\t.tab {\n\t\t\t\tpadding: var(--roxy-space-xs, 0.25rem) var(--roxy-space-md, 1rem);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tbackground: none;\n\t\t\t\tborder: none;\n\t\t\t\tborder-bottom: 2px solid transparent;\n\t\t\t\tmargin-bottom: -2px;\n\t\t\t\tcursor: pointer;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-family: inherit;\n\t\t\t\ttransition: color var(--roxy-motion-duration, 200ms) var(--roxy-motion-easing, ease);\n\t\t\t}\n\n\t\t\t.tab[aria-selected='true'] {\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\tborder-bottom-color: var(--roxy-accent, #f59e0b);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\n\t\t\t.tab:hover:not([aria-selected='true']) {\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t}\n\n\t\t\t/* Tables */\n\t\t\t.overflow-scroll {\n\t\t\t\toverflow-x: auto;\n\t\t\t\t-webkit-overflow-scrolling: touch;\n\t\t\t}\n\n\t\t\ttable {\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-collapse: collapse;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\n\t\t\tth,\n\t\t\ttd {\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem);\n\t\t\t\tborder-bottom: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\ttext-align: center;\n\t\t\t}\n\n\t\t\tth {\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\n\t\t\ttd:first-child,\n\t\t\tth:first-child {\n\t\t\t\ttext-align: left;\n\t\t\t}\n\n\t\t\t.glyph {\n\t\t\t\tfont-size: 1.1em;\n\t\t\t\tmargin-right: 3px;\n\t\t\t\tline-height: 1;\n\t\t\t}\n\n\t\t\t.planet-cell {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tgap: 4px;\n\t\t\t\twhite-space: nowrap;\n\t\t\t}\n\n\t\t\t.total-row td {\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tborder-top: 2px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-bottom: none;\n\t\t\t}\n\n\t\t\t/* Heat cells. Single base hue (var --roxy-heat) mixed with\n\t\t\t * transparent at increasing percentages produces seven readable\n\t\t\t * tiers in both light and dark themes. Text colour stays\n\t\t\t * var(--roxy-fg) so it inverts with the host theme without\n\t\t\t * per-tier overrides. */\n\t\t\t.heat-cell {\n\t\t\t\tborder-radius: var(--roxy-radius-sm, 4px);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmin-width: 2rem;\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tcolor: var(--roxy-fg, currentColor);\n\t\t\t}\n\n\t\t\t.heat-1 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 6%, transparent); }\n\t\t\t.heat-2 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 14%, transparent); }\n\t\t\t.heat-3 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 26%, transparent); }\n\t\t\t.heat-4 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 40%, transparent); }\n\t\t\t.heat-5 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 55%, transparent); }\n\t\t\t.heat-6 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 72%, transparent); }\n\t\t\t.heat-7 { background: color-mix(in srgb, var(--roxy-heat, #ef4444) 90%, transparent); }\n\n\t\t\t/* Bhinna grid: planet header column narrower */\n\t\t\t.bhinna-table th:first-child,\n\t\t\t.bhinna-table td:first-child {\n\t\t\t\tmin-width: 5rem;\n\t\t\t}\n\n\t\t\t/* Tight cells below 480px so the 14-column bhinna grid stops\n\t\t\t * overflowing the viewport. The wrapper keeps overflow-x:auto as\n\t\t\t * a fallback for very long content. */\n\t\t\t@container (max-width: 480px) {\n\t\t\t\t.bhinna-table th,\n\t\t\t\t.bhinna-table td {\n\t\t\t\t\tpadding: 0.3rem 0.35rem;\n\t\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\t}\n\t\t\t\t.bhinna-table th:first-child,\n\t\t\t\t.bhinna-table td:first-child {\n\t\t\t\t\tmin-width: 3.5rem;\n\t\t\t\t}\n\t\t\t\t.heat-cell {\n\t\t\t\t\tmin-width: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Visual cue that the bhinna table is scrollable below the breakpoint:\n\t\t\t * a soft gradient at the right edge so users see there is more to scroll. */\n\t\t\t.overflow-scroll {\n\t\t\t\tmask-image: linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\tblack 0.5rem,\n\t\t\t\t\tblack calc(100% - 1rem),\n\t\t\t\t\ttransparent 100%\n\t\t\t\t);\n\t\t\t\t-webkit-mask-image: linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\ttransparent 0,\n\t\t\t\t\tblack 0.5rem,\n\t\t\t\t\tblack calc(100% - 1rem),\n\t\t\t\t\ttransparent 100%\n\t\t\t\t);\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: AshtakavargaResponse | null = null;\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\trender() {\n\t\tif (!this.data) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t\t}\n\n\t\tconst signs = this.data.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\">\n\t\t\t<div class=\"head\">\n\t\t\t\t<h2 class=\"title\">Ashtakavarga</h2>\n\t\t\t\t${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclass=\"tablist\"\n\t\t\t\trole=\"tablist\"\n\t\t\t\taria-label=\"Ashtakavarga views\"\n\t\t\t\t@keydown=${this.onTabKeyDown}\n\t\t\t>\n\t\t\t\t${TABS.map(\n\t\t\t\t\t(tab) => html`<button\n\t\t\t\t\t\tclass=\"tab\"\n\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\tid=\"tab-${tab}\"\n\t\t\t\t\t\taria-selected=${this.activeTab === tab ? 'true' : 'false'}\n\t\t\t\t\t\taria-controls=\"panel-${tab}\"\n\t\t\t\t\t\ttabindex=${this.activeTab === tab ? '0' : '-1'}\n\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\tthis.activeTab = tab;\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t${TAB_LABELS[tab]}\n\t\t\t\t\t</button>`,\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tid=\"panel-${this.activeTab}\"\n\t\t\t\trole=\"tabpanel\"\n\t\t\t\taria-labelledby=\"tab-${this.activeTab}\"\n\t\t\t>\n\t\t\t\t${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>`;\n\t}\n\n\tprivate onTabKeyDown(e: KeyboardEvent) {\n\t\tconst idx = TABS.indexOf(this.activeTab);\n\t\tif (e.key === 'ArrowRight') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx + 1) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t} else if (e.key === 'ArrowLeft') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx - 1 + TABS.length) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t}\n\t}\n\n\tprivate focusActiveTab() {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst btn = this.shadowRoot?.querySelector<HTMLButtonElement>(\n\t\t\t\t`#tab-${this.activeTab}`,\n\t\t\t);\n\t\t\tbtn?.focus();\n\t\t});\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (sum of 0/1 contributions\n\t * from each of the 8 reference points). Bucket directly by raw count.\n\t */\n\tprivate bhinnaHeat(count: number): string {\n\t\tif (count <= 1) return 'heat-1';\n\t\tif (count <= 2) return 'heat-2';\n\t\tif (count <= 3) return 'heat-3';\n\t\tif (count <= 4) return 'heat-4';\n\t\tif (count <= 5) return 'heat-5';\n\t\tif (count <= 6) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across all 7 planets, range\n\t * roughly 0..56 with typical values 20..40. Bucketed per classical\n\t * interpretation: 25 below par, 25..30 average, 30..40 strong, 40+ very\n\t * strong. Bucket spans intentionally widen at the extremes so a single\n\t * outlier sign reads as exceptional.\n\t */\n\tprivate sarvaHeat(count: number): string {\n\t\tif (count <= 18) return 'heat-1';\n\t\tif (count <= 23) return 'heat-2';\n\t\tif (count <= 28) return 'heat-3';\n\t\tif (count <= 32) return 'heat-4';\n\t\tif (count <= 37) return 'heat-5';\n\t\tif (count <= 42) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\tprivate renderSarva(signs: AshtakavargaResponse['signs']) {\n\t\tconst sav = this.data!.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\">\n\t\t\t<table aria-label=\"Sarvashtakavarga bindu counts per sign\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"col\">Sign</th>\n\t\t\t\t\t\t<th scope=\"col\">Bindus</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t${signs.map((sign, i) => {\n\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\tconst hc = this.sarvaHeat(count);\n\t\t\t\t\t\treturn html`<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<div class=\"planet-cell\">\n\t\t\t\t\t\t\t\t\t<span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span>\n\t\t\t\t\t\t\t\t\t${sign}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"${`heat-cell ${hc}`}\">${count}</td>\n\t\t\t\t\t\t</tr>`;\n\t\t\t\t\t})}\n\t\t\t\t</tbody>\n\t\t\t\t<tfoot>\n\t\t\t\t\t<tr class=\"total-row\">\n\t\t\t\t\t\t<td>Total</td>\n\t\t\t\t\t\t<td>${sav.total}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tfoot>\n\t\t\t</table>\n\t\t</div>`;\n\t}\n\n\tprivate renderBhinna(signs: AshtakavargaResponse['signs']) {\n\t\tconst bhinna = this.data!.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\">\n\t\t\t<table class=\"bhinna-table\" aria-label=\"Bhinnashtakavarga planet-by-sign grid\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"col\">Planet</th>\n\t\t\t\t\t\t${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=${s}>${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<th scope=\"col\">Total</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t${bhinna.map(\n\t\t\t\t\t\t(row) => html`<tr>\n\t\t\t\t\t\t<td>${row.planet}</td>\n\t\t\t\t\t\t${row.bindus.map((count) => {\n\t\t\t\t\t\t\tconst hc = this.bhinnaHeat(count);\n\t\t\t\t\t\t\treturn html`<td class=\"${`heat-cell ${hc}`}\">${count}</td>`;\n\t\t\t\t\t\t})}\n\t\t\t\t\t\t<td>${row.total}</td>\n\t\t\t\t\t</tr>`,\n\t\t\t\t\t)}\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data!.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\">\n\t\t\t<table aria-label=\"Shodhya Pinda planet strength scores\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"col\">Planet</th>\n\t\t\t\t\t\t<th scope=\"col\">Rashi Pinda</th>\n\t\t\t\t\t\t<th scope=\"col\">Graha Pinda</th>\n\t\t\t\t\t\t<th scope=\"col\">Shodhya Pinda</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr>\n\t\t\t\t\t\t\t<td>${row.planet}</td>\n\t\t\t\t\t\t\t<td>${row.rashiPinda}</td>\n\t\t\t\t\t\t\t<td>${row.grahaPinda}</td>\n\t\t\t\t\t\t\t<td>${row.shodhyaPinda}</td>\n\t\t\t\t\t\t</tr>`,\n\t\t\t\t\t)}\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n\n\t/* Force the text-style variant on every Unicode glyph in the component.\n\t * macOS and iOS substitute coloured emoji glyphs for the planetary and\n\t * gender Unicode code points (Mars, Venus, Mercury, etc.) when the\n\t * system colour-emoji font wins font selection. The text-style variant\n\t * keeps glyphs monochrome so they inherit the surrounding fill colour\n\t * and match the brand palette consistently across platforms.\n\t *\n\t * font-variant-emoji is part of CSS Fonts 4 (Safari 17+, Chrome 134+,\n\t * Firefox 139+). On older browsers the rule is silently ignored.\n\t */\n\t:host {\n\t\tfont-variant-emoji: text;\n\t}\n`;\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,YAAY,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;;;AC+CxC,IAAM,aAAqC;AAAA,EACjD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0KD;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA/KlB,qBAgLZ;AAGA;AAAA,EADC,MAAM;AAAA,GAlLK,qBAmLZ;AAnLY,uBAAN;AAAA,EADN,cAAc,wBAAwB;AAAA,GAC1B;",
6
- "names": ["css", "css"]
3
+ "sources": ["../../src/components/ashtakavarga-grid.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts"],
4
+ "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'pinda';\n\nconst TAB_LABELS: Record<Tab, string> = {\n\tsarva: 'Sarvashtakavarga',\n\tbhinna: 'Bhinnashtakavarga',\n\tpinda: 'Shodhya Pinda',\n};\n\nconst TABS: Tab[] = ['sarva', 'bhinna', 'pinda'];\n\n/**\n * Ashtakavarga grid with three tabbed views: Sarvashtakavarga, Bhinnashtakavarga,\n * and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.tab[aria-selected=true]{color:var(--roxy-accent-fg,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.overflow-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.heat-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.heat-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 6%, transparent)}.heat-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 14%, transparent)}.heat-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 26%, transparent)}.heat-4{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 40%, transparent)}.heat-5{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 55%, transparent)}.heat-6{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 72%, transparent)}.heat-7{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 90%, transparent)}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.heat-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: AshtakavargaResponse | null = null;\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\trender() {\n\t\tif (!this.data) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t\t}\n\n\t\tconst signs = this.data.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\"><div class=\"head\"><h2 class=\"title\">Ashtakavarga</h2>${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div><div class=\"tablist\" role=\"tablist\" aria-label=\"Ashtakavarga views\" @keydown=\"${this.onTabKeyDown}\">${TABS.map(\n\t\t\t\t\t(tab) => html`<button class=\"tab\" role=\"tab\" id=\"tab-${tab}\" aria-selected=\"${this.activeTab === tab ? 'true' : 'false'}\" aria-controls=\"panel-${tab}\" tabindex=\"${this.activeTab === tab ? '0' : '-1'}\" @click=\"${() => {\n\t\t\t\t\t\t\tthis.activeTab = tab;\n\t\t\t\t\t\t}}\">${TAB_LABELS[tab]}</button>`,\n\t\t\t\t)}</div><div id=\"panel-${this.activeTab}\" role=\"tabpanel\" aria-labelledby=\"tab-${this.activeTab}\">${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}</div></div>`;\n\t}\n\n\tprivate onTabKeyDown(e: KeyboardEvent) {\n\t\tconst idx = TABS.indexOf(this.activeTab);\n\t\tif (e.key === 'ArrowRight') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx + 1) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t} else if (e.key === 'ArrowLeft') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx - 1 + TABS.length) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t}\n\t}\n\n\tprivate focusActiveTab() {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst btn = this.shadowRoot?.querySelector<HTMLButtonElement>(\n\t\t\t\t`#tab-${this.activeTab}`,\n\t\t\t);\n\t\t\tbtn?.focus();\n\t\t});\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (sum of 0/1 contributions\n\t * from each of the 8 reference points). Bucket directly by raw count.\n\t */\n\tprivate bhinnaHeat(count: number): string {\n\t\tif (count <= 1) return 'heat-1';\n\t\tif (count <= 2) return 'heat-2';\n\t\tif (count <= 3) return 'heat-3';\n\t\tif (count <= 4) return 'heat-4';\n\t\tif (count <= 5) return 'heat-5';\n\t\tif (count <= 6) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across all 7 planets, range\n\t * roughly 0..56 with typical values 20..40. Bucketed per classical\n\t * interpretation: 25 below par, 25..30 average, 30..40 strong, 40+ very\n\t * strong. Bucket spans intentionally widen at the extremes so a single\n\t * outlier sign reads as exceptional.\n\t */\n\tprivate sarvaHeat(count: number): string {\n\t\tif (count <= 18) return 'heat-1';\n\t\tif (count <= 23) return 'heat-2';\n\t\tif (count <= 28) return 'heat-3';\n\t\tif (count <= 32) return 'heat-4';\n\t\tif (count <= 37) return 'heat-5';\n\t\tif (count <= 42) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\tprivate renderSarva(signs: AshtakavargaResponse['signs']) {\n\t\tconst sav = this.data!.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Sarvashtakavarga bindu counts per sign\"><thead><tr><th scope=\"col\">Sign</th><th scope=\"col\">Bindus</th></tr></thead><tbody>${signs.map((sign, i) => {\n\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\tconst hc = this.sarvaHeat(count);\n\t\t\t\t\t\treturn html`<tr><td><div class=\"planet-cell\"><span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span> ${sign}</div></td><td class=\"${`heat-cell ${hc}`}\">${count}</td></tr>`;\n\t\t\t\t\t})}</tbody><tfoot><tr class=\"total-row\"><td>Total</td><td>${sav.total}</td></tr></tfoot></table></div>`;\n\t}\n\n\tprivate renderBhinna(signs: AshtakavargaResponse['signs']) {\n\t\tconst bhinna = this.data!.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table class=\"bhinna-table\" aria-label=\"Bhinnashtakavarga planet-by-sign grid\"><thead><tr><th scope=\"col\">Planet</th>${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=\"${s}\">${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}<th scope=\"col\">Total</th></tr></thead><tbody>${bhinna.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td>${row.bindus.map((count) => {\n\t\t\t\t\t\t\tconst hc = this.bhinnaHeat(count);\n\t\t\t\t\t\t\treturn html`<td class=\"${`heat-cell ${hc}`}\">${count}</td>`;\n\t\t\t\t\t\t})}<td>${row.total}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data!.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Shodhya Pinda planet strength scores\"><thead><tr><th scope=\"col\">Planet</th><th scope=\"col\">Rashi Pinda</th><th scope=\"col\">Graha Pinda</th><th scope=\"col\">Shodhya Pinda</th></tr></thead><tbody>${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td><td>${row.rashiPinda}</td><td>${row.grahaPinda}</td><td>${row.shodhyaPinda}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
+ "mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,cAAAC,EAAY,WAAAC,MAAe,MAC/C,OAAS,iBAAAC,EAAe,YAAAC,EAAU,SAAAC,MAAa,oBC+CxC,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAiBO,IAAMC,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EAOaC,EAAaD,E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,EAAQC,EAAI,OAAO,CAAC,GAAK,EACzBE,EAAK,KAAK,UAAUH,CAAK,EAC/B,OAAON,4EAA+EU,EAAWF,CAAI,GAAK,EAAE,WAAWA,CAAI,yBAAyB,aAAaC,CAAE,EAAE,KAAKH,CAAK,YAChL,CAAC,CAAC,0DAA0DC,EAAI,KAAK,mCANvDP,qDAOlB,CAEQ,aAAaC,EAAsC,CAC1D,IAAMU,EAAS,KAAK,KAAM,kBAC1B,OAAKA,GAAQ,OAGNX,sJAAyJC,EAAM,IAChKW,GACAZ,2BAA8BY,CAAC,KAAKF,EAAWE,CAAC,GAAKA,EAAE,MAAM,EAAG,CAAC,CAAC,OACpE,CAAC,iDAAiDD,EAAO,IACxDE,GAAQb,YAAea,EAAI,MAAM,QAAQA,EAAI,OAAO,IAAKP,GAAU,CACnE,IAAMG,EAAK,KAAK,WAAWH,CAAK,EAChC,OAAON,eAAkB,aAAaS,CAAE,EAAE,KAAKH,CAAK,OACrD,CAAC,CAAC,OAAOO,EAAI,KAAK,YACnB,CAAC,yBAVIb,sDAWT,CAEQ,aAAc,CACrB,IAAMc,EAAQ,KAAK,KAAM,aACzB,OAAKA,GAAO,OAGLd,sPAAyPc,EAAM,IACjQD,GAAQb,YAAea,EAAI,MAAM,YAAYA,EAAI,UAAU,YAAYA,EAAI,UAAU,YAAYA,EAAI,YAAY,YACnH,CAAC,yBAJIb,kDAKT,CACD,EArIaH,EACL,OAAS,CACfkB,EACAC,y1FACD,EAWAC,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GAdlBrB,EAeZ,oBAGAoB,EAAA,CADCE,EAAM,GAjBKtB,EAkBZ,yBAlBYA,EAANoB,EAAA,CADNG,EAAc,wBAAwB,GAC1BvB",
6
+ "names": ["css", "html", "LitElement", "nothing", "customElement", "property", "state", "SIGN_GLYPH", "SIGNS_ORDER", "RASHI_KEYS", "s", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "TAB_LABELS", "TABS", "RoxyAshtakavargaGrid", "LitElement", "MarkupDataController", "html", "signs", "nothing", "tab", "e", "idx", "count", "sav", "sign", "hc", "SIGN_GLYPH", "bhinna", "s", "row", "pinda", "baseStyles", "css", "__decorateClass", "property", "state", "customElement"]
7
7
  }
@@ -6,6 +6,7 @@ type BiorhythmData = GetDailyBiorhythmResponse | GetForecastResponse | GetCritic
6
6
  */
7
7
  export declare class RoxyBiorhythmChart extends LitElement {
8
8
  static styles: import("lit").CSSResult[];
9
+ constructor();
9
10
  data: BiorhythmData | null;
10
11
  mode: 'daily' | 'forecast' | 'critical-days';
11
12
  render(): import("lit").TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"biorhythm-chart.d.ts","sourceRoot":"","sources":["../../src/components/biorhythm-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAgB,MAAM,KAAK,CAAC;AAE1D,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,KAAK,aAAa,GACf,yBAAyB,GACzB,mBAAmB,GACnB,uBAAuB,CAAC;AAe3B;;GAEG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BA+EX;IAGF,IAAI,EAAE,aAAa,GAAG,IAAI,CAAQ;IAGlC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,eAAe,CAAW;IAEvD,MAAM;IAcN,OAAO,CAAC,WAAW;IAqCnB,OAAO,CAAC,cAAc;IAqDtB,OAAO,CAAC,cAAc;CAetB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,sBAAsB,EAAE,kBAAkB,CAAC;KAC3C;CACD"}
1
+ {"version":3,"file":"biorhythm-chart.d.ts","sourceRoot":"","sources":["../../src/components/biorhythm-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAgB,MAAM,KAAK,CAAC;AAE1D,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,aAAa,GACf,yBAAyB,GACzB,mBAAmB,GACnB,uBAAuB,CAAC;AAe3B;;GAEG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BA+EX;;IAWF,IAAI,EAAE,aAAa,GAAG,IAAI,CAAQ;IAGlC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,eAAe,CAAW;IAEvD,MAAM;IAcN,OAAO,CAAC,WAAW;IAqCnB,OAAO,CAAC,cAAc;IAqDtB,OAAO,CAAC,cAAc;CAetB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,sBAAsB,EAAE,kBAAkB,CAAC;KAC3C;CACD"}
@@ -1,333 +1,2 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
10
- };
11
-
12
- // packages/ui/src/components/biorhythm-chart.ts
13
- import { css as css2, html, LitElement, nothing, svg } from "lit";
14
- import { customElement, property } from "lit/decorators.js";
15
-
16
- // packages/ui/src/utils/base-styles.ts
17
- import { css } from "lit";
18
- var baseStyles = css`
19
- :host {
20
- display: block;
21
- container-type: inline-size;
22
- font-family: var(
23
- --roxy-font-sans,
24
- system-ui,
25
- -apple-system,
26
- BlinkMacSystemFont,
27
- 'Segoe UI',
28
- Roboto,
29
- sans-serif
30
- );
31
- color: var(--roxy-fg, #0a0a0a);
32
- background: transparent;
33
- font-size: var(--roxy-text-base, 1rem);
34
- line-height: var(--roxy-leading-normal, 1.5);
35
- animation: roxy-fade-in var(--roxy-motion-duration, 200ms)
36
- var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;
37
- }
38
-
39
- *,
40
- *::before,
41
- *::after {
42
- box-sizing: border-box;
43
- }
44
-
45
- @keyframes roxy-fade-in {
46
- from {
47
- opacity: 0;
48
- transform: translateY(2px);
49
- }
50
- to {
51
- opacity: 1;
52
- transform: translateY(0);
53
- }
54
- }
55
-
56
- @media (prefers-reduced-motion: reduce) {
57
- :host {
58
- animation: none;
59
- }
60
- }
61
-
62
- .roxy-skeleton {
63
- background: linear-gradient(
64
- 90deg,
65
- var(--roxy-border, #e4e4e7) 0%,
66
- color-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,
67
- var(--roxy-border, #e4e4e7) 100%
68
- );
69
- background-size: 200% 100%;
70
- animation: roxy-shimmer 1.4s ease-in-out infinite;
71
- border-radius: var(--roxy-radius-md, 8px);
72
- }
73
-
74
- @keyframes roxy-shimmer {
75
- 0% {
76
- background-position: 200% 0;
77
- }
78
- 100% {
79
- background-position: -200% 0;
80
- }
81
- }
82
-
83
- @media (prefers-reduced-motion: reduce) {
84
- .roxy-skeleton {
85
- animation: none;
86
- }
87
- }
88
-
89
- .roxy-empty {
90
- padding: var(--roxy-space-lg, 1.5rem);
91
- color: var(--roxy-muted, #71717a);
92
- text-align: center;
93
- font-size: var(--roxy-text-sm, 0.875rem);
94
- }
95
-
96
- :host(:focus-within) .roxy-card {
97
- outline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));
98
- outline-offset: 2px;
99
- }
100
-
101
- /* Force the text-style variant on every Unicode glyph in the component.
102
- * macOS and iOS substitute coloured emoji glyphs for the planetary and
103
- * gender Unicode code points (Mars, Venus, Mercury, etc.) when the
104
- * system colour-emoji font wins font selection. The text-style variant
105
- * keeps glyphs monochrome so they inherit the surrounding fill colour
106
- * and match the brand palette consistently across platforms.
107
- *
108
- * font-variant-emoji is part of CSS Fonts 4 (Safari 17+, Chrome 134+,
109
- * Firefox 139+). On older browsers the rule is silently ignored.
110
- */
111
- :host {
112
- font-variant-emoji: text;
113
- }
114
- `;
115
-
116
- // packages/ui/src/components/biorhythm-chart.ts
117
- var CYCLE_COLOR = {
118
- physical: "#dc2626",
119
- emotional: "#0284c7",
120
- intellectual: "#16a34a",
121
- intuitive: "#a855f7",
122
- aesthetic: "#f59e0b",
123
- awareness: "#ec4899",
124
- spiritual: "#14b8a6",
125
- passion: "#ef4444",
126
- mastery: "#6366f1",
127
- wisdom: "#475569"
128
- };
129
- var RoxyBiorhythmChart = class extends LitElement {
130
- constructor() {
131
- super(...arguments);
132
- this.data = null;
133
- this.mode = "daily";
134
- }
135
- render() {
136
- const d = this.data;
137
- if (!d)
138
- return html`<div class="roxy-empty" role="status">No biorhythm data</div>`;
139
- if (this.mode === "critical-days" && "criticalDays" in d) {
140
- return this.renderCritical(d);
141
- }
142
- if (this.mode === "forecast" && "days" in d) {
143
- return this.renderForecast(d);
144
- }
145
- return this.renderDaily(d);
146
- }
147
- renderDaily(d) {
148
- const raw = d.quickRead ?? {};
149
- const entries = Object.entries(raw).map(([cycle, value]) => {
150
- const v = typeof value === "number" ? value : 0;
151
- const normalized = Math.abs(v) > 1 ? v / 100 : v;
152
- return [cycle, normalized];
153
- });
154
- return html`<section class="wrap" aria-label="Daily biorhythm">
155
- <header class="head">
156
- <h2 class="title">Biorhythm</h2>
157
- ${typeof d.energyRating === "number" ? html`<span class="energy">Energy ${d.energyRating}/10</span>` : nothing}
158
- </header>
159
- <div class="bars" role="list">
160
- ${entries.map(([cycle, v]) => {
161
- const pct = (v + 1) / 2 * 100;
162
- const color = CYCLE_COLOR[cycle] ?? "var(--roxy-accent, #f59e0b)";
163
- return html`<div class="bar" role="listitem">
164
- <span style="text-transform: capitalize">${cycle}</span>
165
- <span class="track">
166
- <span
167
- class="fill"
168
- style="width: ${pct}%; background: ${color}"
169
- ></span>
170
- </span>
171
- <span class="value">${Math.round(v * 100)}%</span>
172
- </div>`;
173
- })}
174
- </div>
175
- ${d.dailyMessage ? html`<p class="advice">${d.dailyMessage}</p>` : nothing}
176
- ${d.advice ? html`<p class="advice">${d.advice}</p>` : nothing}
177
- </section>`;
178
- }
179
- renderForecast(d) {
180
- const days = d.days ?? [];
181
- if (days.length === 0)
182
- return html`<div class="roxy-empty" role="status">No forecast</div>`;
183
- const w = 600;
184
- const h = 160;
185
- const xStep = w / Math.max(days.length - 1, 1);
186
- const cycleKeys = [
187
- "physical",
188
- "emotional",
189
- "intellectual",
190
- "intuitive"
191
- ];
192
- return html`<section class="wrap" aria-label="Biorhythm forecast">
193
- <header class="head">
194
- <h2 class="title">Forecast</h2>
195
- <span class="energy">${d.startDate} - ${d.endDate}</span>
196
- </header>
197
- <svg
198
- viewBox="0 0 ${w} ${h}"
199
- role="img"
200
- aria-label="Biorhythm cycle lines across the forecast window"
201
- >
202
- <title>Biorhythm forecast</title>
203
- <line
204
- x1="0"
205
- y1=${h / 2}
206
- x2=${w}
207
- y2=${h / 2}
208
- stroke="var(--roxy-border, #e4e4e7)"
209
- stroke-width="1"
210
- />
211
- ${cycleKeys.map((cycle) => {
212
- const points = days.map((day, i) => {
213
- const v = day[cycle] ?? 0;
214
- const x = i * xStep;
215
- const y = h / 2 - v / 100 * (h / 2 - 8);
216
- return `${x.toFixed(2)},${y.toFixed(2)}`;
217
- }).join(" ");
218
- const color = CYCLE_COLOR[cycle] ?? "#475569";
219
- return svg`<polyline points=${points} fill="none" stroke=${color} stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />`;
220
- })}
221
- </svg>
222
- ${d.summary?.periodAdvice ? html`<p class="advice">${d.summary.periodAdvice}</p>` : nothing}
223
- </section>`;
224
- }
225
- renderCritical(d) {
226
- return html`<section class="wrap" aria-label="Critical days">
227
- <header class="head">
228
- <h2 class="title">Critical days</h2>
229
- <span class="energy">${d.totalCriticalDays} total</span>
230
- </header>
231
- <div>
232
- ${d.criticalDays.map(
233
- (day) => html`<span class="crit"
234
- >${day.date} · ${day.cycle} ${day.severity}</span
235
- >`
236
- )}
237
- </div>
238
- </section>`;
239
- }
240
- };
241
- RoxyBiorhythmChart.styles = [
242
- baseStyles,
243
- css2`
244
- .wrap {
245
- display: grid;
246
- gap: var(--roxy-space-md, 1rem);
247
- }
248
- .head {
249
- display: flex;
250
- justify-content: space-between;
251
- align-items: center;
252
- flex-wrap: wrap;
253
- gap: var(--roxy-space-sm, 0.5rem);
254
- }
255
- .title {
256
- margin: 0;
257
- font-size: var(--roxy-text-lg, 1.125rem);
258
- font-weight: var(--roxy-weight-bold, 600);
259
- }
260
- .energy {
261
- font-variant-numeric: tabular-nums;
262
- color: var(--roxy-accent-fg, #b45309);
263
- font-weight: var(--roxy-weight-bold, 600);
264
- }
265
- .bars {
266
- display: grid;
267
- gap: var(--roxy-space-xs, 0.25rem);
268
- }
269
- .bar {
270
- display: grid;
271
- grid-template-columns: 8rem 1fr 3.5rem;
272
- gap: var(--roxy-space-sm, 0.5rem);
273
- align-items: center;
274
- font-size: var(--roxy-text-sm, 0.875rem);
275
- }
276
- .track {
277
- height: 14px;
278
- background: var(--roxy-border, #e4e4e7);
279
- border-radius: var(--roxy-radius-full, 9999px);
280
- overflow: hidden;
281
- position: relative;
282
- }
283
- .fill {
284
- display: block;
285
- height: 100%;
286
- transition:
287
- width var(--roxy-motion-duration, 200ms)
288
- var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));
289
- }
290
- .value {
291
- font-variant-numeric: tabular-nums;
292
- text-align: right;
293
- color: var(--roxy-muted, #71717a);
294
- }
295
- .advice {
296
- color: var(--roxy-fg, #0a0a0a);
297
- }
298
- .alert {
299
- background: color-mix(in srgb, var(--roxy-warning, #ea580c) 12%, transparent);
300
- border: 1px solid color-mix(in srgb, var(--roxy-warning, #ea580c) 32%, transparent);
301
- border-radius: var(--roxy-radius-md, 8px);
302
- padding: var(--roxy-space-sm, 0.5rem);
303
- font-size: var(--roxy-text-sm, 0.875rem);
304
- margin: 0;
305
- }
306
- svg {
307
- display: block;
308
- width: 100%;
309
- height: auto;
310
- }
311
- .crit {
312
- background: color-mix(in srgb, var(--roxy-danger, #dc2626) 12%, transparent);
313
- border-radius: var(--roxy-radius-sm, 4px);
314
- padding: 4px 8px;
315
- font-size: var(--roxy-text-xs, 0.75rem);
316
- display: inline-block;
317
- margin: 2px;
318
- }
319
- `
320
- ];
321
- __decorateClass([
322
- property({ attribute: false })
323
- ], RoxyBiorhythmChart.prototype, "data", 2);
324
- __decorateClass([
325
- property({ type: String, reflect: true })
326
- ], RoxyBiorhythmChart.prototype, "mode", 2);
327
- RoxyBiorhythmChart = __decorateClass([
328
- customElement("roxy-biorhythm-chart")
329
- ], RoxyBiorhythmChart);
330
- export {
331
- RoxyBiorhythmChart
332
- };
1
+ var D=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var p=(n,r,e,t)=>{for(var s=t>1?void 0:t?R(r,e):r,a=n.length-1,i;a>=0;a--)(i=n[a])&&(s=(t?i(r,e,s):i(s))||s);return t&&s&&D(r,e,s),s};import{css as G,html as o,LitElement as F,nothing as m,svg as T}from"lit";import{customElement as M,property as h}from"lit/decorators.js";import{css as C}from"lit";var u=C`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var z="roxy-data";function S(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var y=class{constructor(r){this.host=r,r.addController(this)}hostConnected(){if(this.host.data!=null)return;let r=this.read();r!==void 0&&(this.host.data=r,this.host.requestUpdate())}read(){let r=this.findInlineScript();return r?this.parse(r.textContent):void 0}findInlineScript(){for(let r of Array.from(this.host.children))if(S(r)&&r.classList.contains(z))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var x={physical:"#dc2626",emotional:"#0284c7",intellectual:"#16a34a",intuitive:"#a855f7",aesthetic:"#f59e0b",awareness:"#ec4899",spiritual:"#14b8a6",passion:"#ef4444",mastery:"#6366f1",wisdom:"#475569"},c=class extends F{constructor(){super();this.data=null;this.mode="daily";new y(this)}render(){let e=this.data;return e?this.mode==="critical-days"&&"criticalDays"in e?this.renderCritical(e):this.mode==="forecast"&&"days"in e?this.renderForecast(e):this.renderDaily(e):o`<div class="roxy-empty" role="status">No biorhythm data</div>`}renderDaily(e){let t=e.quickRead??{},s=Object.entries(t).map(([a,i])=>{let l=typeof i=="number"?i:0,d=Math.abs(l)>1?l/100:l;return[a,d]});return o`<section class="wrap" aria-label="Daily biorhythm"><header class="head"><h2 class="title">Biorhythm</h2>${typeof e.energyRating=="number"?o`<span class="energy">Energy ${e.energyRating}/10</span>`:m}</header><div class="bars" role="list">${s.map(([a,i])=>{let l=(i+1)/2*100,d=x[a]??"var(--roxy-accent, #f59e0b)";return o`<div class="bar" role="listitem"><span style="text-transform:capitalize">${a}</span> <span class="track"><span class="fill" style="width:${l}%;background:${d}"></span> </span><span class="value">${Math.round(i*100)}%</span></div>`})}</div>${e.dailyMessage?o`<p class="advice">${e.dailyMessage}</p>`:m} ${e.advice?o`<p class="advice">${e.advice}</p>`:m}</section>`}renderForecast(e){let t=e.days??[];if(t.length===0)return o`<div class="roxy-empty" role="status">No forecast</div>`;let s=600,a=160,i=s/Math.max(t.length-1,1),l=["physical","emotional","intellectual","intuitive"];return o`<section class="wrap" aria-label="Biorhythm forecast"><header class="head"><h2 class="title">Forecast</h2><span class="energy">${e.startDate} - ${e.endDate}</span></header><svg viewBox="0 0 ${s} ${a}" role="img" aria-label="Biorhythm cycle lines across the forecast window"><title>Biorhythm forecast</title><line x1="0" y1="${a/2}" x2="${s}" y2="${a/2}" stroke="var(--roxy-border, #e4e4e7)" stroke-width="1"/>${l.map(d=>{let f=t.map((g,b)=>{let w=g[d]??0,$=b*i,k=a/2-w/100*(a/2-8);return`${$.toFixed(2)},${k.toFixed(2)}`}).join(" "),v=x[d]??"#475569";return T`<polyline points="${f}" fill="none" stroke="${v}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">`})}</svg> ${e.summary?.periodAdvice?o`<p class="advice">${e.summary.periodAdvice}</p>`:m}</section>`}renderCritical(e){return o`<section class="wrap" aria-label="Critical days"><header class="head"><h2 class="title">Critical days</h2><span class="energy">${e.totalCriticalDays} total</span></header><div>${e.criticalDays.map(t=>o`<span class="crit">${t.date} · ${t.cycle} ${t.severity}</span>`)}</div></section>`}};c.styles=[u,G`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`],p([h({attribute:!1})],c.prototype,"data",2),p([h({type:String,reflect:!0})],c.prototype,"mode",2),c=p([M("roxy-biorhythm-chart")],c);export{c as RoxyBiorhythmChart};
333
2
  //# sourceMappingURL=biorhythm-chart.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/biorhythm-chart.ts", "../../src/utils/base-styles.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.head {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: space-between;\n\t\t\t\talign-items: center;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tgap: var(--roxy-space-sm, 0.5rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tmargin: 0;\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\t.energy {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\t.bars {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem);\n\t\t\t}\n\t\t\t.bar {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: 8rem 1fr 3.5rem;\n\t\t\t\tgap: var(--roxy-space-sm, 0.5rem);\n\t\t\t\talign-items: center;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\t\t\t.track {\n\t\t\t\theight: 14px;\n\t\t\t\tbackground: var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-full, 9999px);\n\t\t\t\toverflow: hidden;\n\t\t\t\tposition: relative;\n\t\t\t}\n\t\t\t.fill {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\ttransition:\n\t\t\t\t\twidth var(--roxy-motion-duration, 200ms)\n\t\t\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));\n\t\t\t}\n\t\t\t.value {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\ttext-align: right;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t}\n\t\t\t.advice {\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t}\n\t\t\t.alert {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-warning, #ea580c) 12%, transparent);\n\t\t\t\tborder: 1px solid color-mix(in srgb, var(--roxy-warning, #ea580c) 32%, transparent);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: auto;\n\t\t\t}\n\t\t\t.crit {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-danger, #dc2626) 12%, transparent);\n\t\t\t\tborder-radius: var(--roxy-radius-sm, 4px);\n\t\t\t\tpadding: 4px 8px;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmargin: 2px;\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Biorhythm</h2>\n\t\t\t\t${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</header>\n\t\t\t<div class=\"bars\" role=\"list\">\n\t\t\t\t${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\">\n\t\t\t\t\t\t<span style=\"text-transform: capitalize\">${cycle}</span>\n\t\t\t\t\t\t<span class=\"track\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"fill\"\n\t\t\t\t\t\t\t\tstyle=\"width: ${pct}%; background: ${color}\"\n\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"value\">${Math.round(v * 100)}%</span>\n\t\t\t\t\t</div>`;\n\t\t\t\t})}\n\t\t\t</div>\n\t\t\t${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing}\n\t\t\t${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}\n\t\t</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Forecast</h2>\n\t\t\t\t<span class=\"energy\">${d.startDate} - ${d.endDate}</span>\n\t\t\t</header>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 ${w} ${h}\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Biorhythm cycle lines across the forecast window\"\n\t\t\t>\n\t\t\t\t<title>Biorhythm forecast</title>\n\t\t\t\t<line\n\t\t\t\t\tx1=\"0\"\n\t\t\t\t\ty1=${h / 2}\n\t\t\t\t\tx2=${w}\n\t\t\t\t\ty2=${h / 2}\n\t\t\t\t\tstroke=\"var(--roxy-border, #e4e4e7)\"\n\t\t\t\t\tstroke-width=\"1\"\n\t\t\t\t/>\n\t\t\t\t${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=${points} fill=\"none\" stroke=${color} stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />`;\n\t\t\t\t})}\n\t\t\t</svg>\n\t\t\t${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">Critical days</h2>\n\t\t\t\t<span class=\"energy\">${d.totalCriticalDays} total</span>\n\t\t\t</header>\n\t\t\t<div>\n\t\t\t\t${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\"\n\t\t\t\t\t\t>${day.date} \u00B7 ${day.cycle} ${day.severity}</span\n\t\t\t\t\t>`,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n\n\t/* Force the text-style variant on every Unicode glyph in the component.\n\t * macOS and iOS substitute coloured emoji glyphs for the planetary and\n\t * gender Unicode code points (Mars, Venus, Mercury, etc.) when the\n\t * system colour-emoji font wins font selection. The text-style variant\n\t * keeps glyphs monochrome so they inherit the surrounding fill colour\n\t * and match the brand palette consistently across platforms.\n\t *\n\t * font-variant-emoji is part of CSS Fonts 4 (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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6ED;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAlFlB,mBAmFZ;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GArF7B,mBAsFZ;AAtFY,qBAAN;AAAA,EADN,cAAc,sBAAsB;AAAA,GACxB;",
6
- "names": ["css", "css"]
3
+ "sources": ["../../src/components/biorhythm-chart.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts"],
4
+ "sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\"><header class=\"head\"><h2 class=\"title\">Biorhythm</h2>${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header><div class=\"bars\" role=\"list\">${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\"><span style=\"text-transform:capitalize\">${cycle}</span> <span class=\"track\"><span class=\"fill\" style=\"width:${pct}%;background:${color}\"></span> </span><span class=\"value\">${Math.round(v * 100)}%</span></div>`;\n\t\t\t\t})}</div>${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing} ${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\"><header class=\"head\"><h2 class=\"title\">Forecast</h2><span class=\"energy\">${d.startDate} - ${d.endDate}</span></header><svg viewBox=\"0 0 ${w} ${h}\" role=\"img\" aria-label=\"Biorhythm cycle lines across the forecast window\"><title>Biorhythm forecast</title><line x1=\"0\" y1=\"${h / 2}\" x2=\"${w}\" y2=\"${h / 2}\" stroke=\"var(--roxy-border, #e4e4e7)\" stroke-width=\"1\"/>${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=\"${points}\" fill=\"none\" stroke=\"${color}\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">`;\n\t\t\t\t})}</svg> ${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\"><header class=\"head\"><h2 class=\"title\">Critical days</h2><span class=\"energy\">${d.totalCriticalDays} total</span></header><div>${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\">${day.date} \u00B7 ${day.cycle} ${day.severity}</span>`,\n\t\t\t\t)}</div></section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
+ "mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,cAAAC,EAAY,WAAAC,EAAS,OAAAC,MAAW,MACpD,OAAS,iBAAAC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AMZ,EAAIW,EAAIb,CAAK,GAAK,EAClBe,EAAID,EAAIJ,EACRM,EAAIP,EAAI,EAAKP,EAAI,KAAQO,EAAI,EAAI,GACvC,MAAO,GAAGM,EAAE,QAAQ,CAAC,CAAC,IAAIC,EAAE,QAAQ,CAAC,CAAC,EACvC,CAAC,EACA,KAAK,GAAG,EACJV,EAAQd,EAAYQ,CAAK,GAAK,UACpC,OAAOiB,sBAAwBL,CAAM,yBAAyBN,CAAK,sEACpE,CAAC,CAAC,UACFV,EAAE,SAAS,aACRC,sBAAyBD,EAAE,QAAQ,YAAY,OAC/CQ,CACJ,YACF,CAEQ,eAAeR,EAA4B,CAClD,OAAOC,mIAAsID,EAAE,iBAAiB,8BAA8BA,EAAE,aAAa,IACzMiB,GAAQhB,uBAA0BgB,EAAI,IAAI,MAAMA,EAAI,KAAK,IAAIA,EAAI,QAAQ,SAC3E,CAAC,kBACJ,CACD,EAxFapB,EACL,OAAS,CACfyB,EACAC,i+CACD,EAWAC,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GAdlB5B,EAeZ,oBAGA2B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAjB7B5B,EAkBZ,oBAlBYA,EAAN2B,EAAA,CADNE,EAAc,sBAAsB,GACxB7B",
6
+ "names": ["css", "html", "LitElement", "nothing", "svg", "customElement", "property", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "CYCLE_COLOR", "RoxyBiorhythmChart", "LitElement", "MarkupDataController", "d", "html", "raw", "entries", "cycle", "value", "v", "normalized", "nothing", "pct", "color", "days", "w", "h", "xStep", "cycleKeys", "points", "day", "i", "x", "y", "svg", "baseStyles", "css", "__decorateClass", "property", "customElement"]
7
7
  }
@@ -7,6 +7,7 @@ import type { GetChoghadiyaResponse } from '../types/index.js';
7
7
  */
8
8
  export declare class RoxyChoghadiyaGrid extends LitElement {
9
9
  static styles: import("lit").CSSResult[];
10
+ constructor();
10
11
  data: GetChoghadiyaResponse | null;
11
12
  /**
12
13
  * True when the current wall-clock time falls inside this period. Both
@@ -1 +1 @@
1
- {"version":3,"file":"choghadiya-grid.d.ts","sourceRoot":"","sources":["../../src/components/choghadiya-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAoB/D;;;;GAIG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BAsGX;IAGF,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAQ;IAE1C;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,UAAU;IA0BlB,MAAM;CAqCN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,sBAAsB,EAAE,kBAAkB,CAAC;KAC3C;CACD"}
1
+ {"version":3,"file":"choghadiya-grid.d.ts","sourceRoot":"","sources":["../../src/components/choghadiya-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAqB/D;;;;GAIG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAM,4BAsGX;;IAWF,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAQ;IAE1C;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,UAAU;IA0BlB,MAAM;CAqCN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,sBAAsB,EAAE,kBAAkB,CAAC;KAC3C;CACD"}