@roxyapi/ui 0.4.1 → 0.5.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 (216) hide show
  1. package/AGENTS.md +21 -0
  2. package/README.md +16 -0
  3. package/dist/cdn/components/ashtakavarga-grid.js +12 -12
  4. package/dist/cdn/components/ashtakavarga-grid.js.map +4 -4
  5. package/dist/cdn/components/biorhythm-chart.js +8 -8
  6. package/dist/cdn/components/biorhythm-chart.js.map +4 -4
  7. package/dist/cdn/components/choghadiya-grid.js +12 -12
  8. package/dist/cdn/components/choghadiya-grid.js.map +4 -4
  9. package/dist/cdn/components/compatibility-card.js +7 -7
  10. package/dist/cdn/components/compatibility-card.js.map +4 -4
  11. package/dist/cdn/components/dasha-timeline.js +8 -8
  12. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  13. package/dist/cdn/components/data.js +14 -14
  14. package/dist/cdn/components/data.js.map +4 -4
  15. package/dist/cdn/components/divisional-chart.js +29 -29
  16. package/dist/cdn/components/divisional-chart.js.map +4 -4
  17. package/dist/cdn/components/dosha-card.js +6 -6
  18. package/dist/cdn/components/dosha-card.js.map +4 -4
  19. package/dist/cdn/components/guna-milan.js +11 -11
  20. package/dist/cdn/components/guna-milan.js.map +4 -4
  21. package/dist/cdn/components/hexagram.js +9 -9
  22. package/dist/cdn/components/hexagram.js.map +4 -4
  23. package/dist/cdn/components/horoscope-card.js +18 -18
  24. package/dist/cdn/components/horoscope-card.js.map +4 -4
  25. package/dist/cdn/components/kp-chart.js +40 -40
  26. package/dist/cdn/components/kp-chart.js.map +4 -4
  27. package/dist/cdn/components/kp-planets-table.js +7 -7
  28. package/dist/cdn/components/kp-planets-table.js.map +4 -4
  29. package/dist/cdn/components/kp-ruling-planets.js +13 -13
  30. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  31. package/dist/cdn/components/moon-phase.js +11 -11
  32. package/dist/cdn/components/moon-phase.js.map +4 -4
  33. package/dist/cdn/components/nakshatra-card.js +16 -16
  34. package/dist/cdn/components/nakshatra-card.js.map +4 -4
  35. package/dist/cdn/components/natal-chart.js +14 -14
  36. package/dist/cdn/components/natal-chart.js.map +4 -4
  37. package/dist/cdn/components/numerology-card.js +8 -8
  38. package/dist/cdn/components/numerology-card.js.map +4 -4
  39. package/dist/cdn/components/panchang-table.js +9 -9
  40. package/dist/cdn/components/panchang-table.js.map +4 -4
  41. package/dist/cdn/components/shadbala-table.js +13 -13
  42. package/dist/cdn/components/shadbala-table.js.map +4 -4
  43. package/dist/cdn/components/synastry-chart.js +18 -18
  44. package/dist/cdn/components/synastry-chart.js.map +4 -4
  45. package/dist/cdn/components/tarot-card.js +21 -21
  46. package/dist/cdn/components/tarot-card.js.map +4 -4
  47. package/dist/cdn/components/tarot-spread.js +27 -27
  48. package/dist/cdn/components/tarot-spread.js.map +4 -4
  49. package/dist/cdn/components/transits-table.js +15 -15
  50. package/dist/cdn/components/transits-table.js.map +4 -4
  51. package/dist/cdn/components/vedic-kundli.js +36 -36
  52. package/dist/cdn/components/vedic-kundli.js.map +4 -4
  53. package/dist/cdn/components/vedic-planets-table.js +11 -11
  54. package/dist/cdn/components/vedic-planets-table.js.map +4 -4
  55. package/dist/cdn/components/western-planets-table.js +8 -8
  56. package/dist/cdn/components/western-planets-table.js.map +4 -4
  57. package/dist/cdn/components/yoga-list.js +6 -6
  58. package/dist/cdn/components/yoga-list.js.map +4 -4
  59. package/dist/cdn/roxy-ui.js +231 -231
  60. package/dist/cdn/roxy-ui.js.map +4 -4
  61. package/dist/components/ashtakavarga-grid.d.ts +1 -0
  62. package/dist/components/ashtakavarga-grid.d.ts.map +1 -1
  63. package/dist/components/ashtakavarga-grid.js +47 -1
  64. package/dist/components/ashtakavarga-grid.js.map +3 -3
  65. package/dist/components/biorhythm-chart.d.ts +1 -0
  66. package/dist/components/biorhythm-chart.d.ts.map +1 -1
  67. package/dist/components/biorhythm-chart.js +47 -1
  68. package/dist/components/biorhythm-chart.js.map +3 -3
  69. package/dist/components/choghadiya-grid.d.ts +1 -0
  70. package/dist/components/choghadiya-grid.d.ts.map +1 -1
  71. package/dist/components/choghadiya-grid.js +47 -1
  72. package/dist/components/choghadiya-grid.js.map +3 -3
  73. package/dist/components/compatibility-card.d.ts +1 -0
  74. package/dist/components/compatibility-card.d.ts.map +1 -1
  75. package/dist/components/compatibility-card.js +47 -1
  76. package/dist/components/compatibility-card.js.map +3 -3
  77. package/dist/components/dasha-timeline.d.ts +1 -0
  78. package/dist/components/dasha-timeline.d.ts.map +1 -1
  79. package/dist/components/dasha-timeline.js +47 -1
  80. package/dist/components/dasha-timeline.js.map +3 -3
  81. package/dist/components/data.d.ts +1 -0
  82. package/dist/components/data.d.ts.map +1 -1
  83. package/dist/components/data.js +47 -1
  84. package/dist/components/data.js.map +3 -3
  85. package/dist/components/divisional-chart.d.ts +1 -0
  86. package/dist/components/divisional-chart.d.ts.map +1 -1
  87. package/dist/components/divisional-chart.js +47 -1
  88. package/dist/components/divisional-chart.js.map +3 -3
  89. package/dist/components/dosha-card.d.ts +1 -0
  90. package/dist/components/dosha-card.d.ts.map +1 -1
  91. package/dist/components/dosha-card.js +47 -1
  92. package/dist/components/dosha-card.js.map +3 -3
  93. package/dist/components/guna-milan.d.ts +1 -0
  94. package/dist/components/guna-milan.d.ts.map +1 -1
  95. package/dist/components/guna-milan.js +47 -1
  96. package/dist/components/guna-milan.js.map +3 -3
  97. package/dist/components/hexagram.d.ts +1 -0
  98. package/dist/components/hexagram.d.ts.map +1 -1
  99. package/dist/components/hexagram.js +47 -1
  100. package/dist/components/hexagram.js.map +3 -3
  101. package/dist/components/horoscope-card.d.ts +1 -0
  102. package/dist/components/horoscope-card.d.ts.map +1 -1
  103. package/dist/components/horoscope-card.js +47 -1
  104. package/dist/components/horoscope-card.js.map +3 -3
  105. package/dist/components/kp-chart.d.ts +1 -0
  106. package/dist/components/kp-chart.d.ts.map +1 -1
  107. package/dist/components/kp-chart.js +47 -1
  108. package/dist/components/kp-chart.js.map +3 -3
  109. package/dist/components/kp-planets-table.d.ts +1 -0
  110. package/dist/components/kp-planets-table.d.ts.map +1 -1
  111. package/dist/components/kp-planets-table.js +47 -1
  112. package/dist/components/kp-planets-table.js.map +3 -3
  113. package/dist/components/kp-ruling-planets.d.ts +1 -0
  114. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  115. package/dist/components/kp-ruling-planets.js +47 -1
  116. package/dist/components/kp-ruling-planets.js.map +3 -3
  117. package/dist/components/moon-phase.d.ts +1 -0
  118. package/dist/components/moon-phase.d.ts.map +1 -1
  119. package/dist/components/moon-phase.js +47 -1
  120. package/dist/components/moon-phase.js.map +3 -3
  121. package/dist/components/nakshatra-card.d.ts +1 -0
  122. package/dist/components/nakshatra-card.d.ts.map +1 -1
  123. package/dist/components/nakshatra-card.js +47 -1
  124. package/dist/components/nakshatra-card.js.map +3 -3
  125. package/dist/components/natal-chart.d.ts +1 -0
  126. package/dist/components/natal-chart.d.ts.map +1 -1
  127. package/dist/components/natal-chart.js +47 -1
  128. package/dist/components/natal-chart.js.map +3 -3
  129. package/dist/components/numerology-card.d.ts +1 -0
  130. package/dist/components/numerology-card.d.ts.map +1 -1
  131. package/dist/components/numerology-card.js +47 -1
  132. package/dist/components/numerology-card.js.map +3 -3
  133. package/dist/components/panchang-table.d.ts +1 -0
  134. package/dist/components/panchang-table.d.ts.map +1 -1
  135. package/dist/components/panchang-table.js +47 -1
  136. package/dist/components/panchang-table.js.map +3 -3
  137. package/dist/components/shadbala-table.d.ts +1 -0
  138. package/dist/components/shadbala-table.d.ts.map +1 -1
  139. package/dist/components/shadbala-table.js +47 -1
  140. package/dist/components/shadbala-table.js.map +3 -3
  141. package/dist/components/synastry-chart.d.ts +1 -0
  142. package/dist/components/synastry-chart.d.ts.map +1 -1
  143. package/dist/components/synastry-chart.js +47 -1
  144. package/dist/components/synastry-chart.js.map +3 -3
  145. package/dist/components/tarot-card.d.ts +1 -0
  146. package/dist/components/tarot-card.d.ts.map +1 -1
  147. package/dist/components/tarot-card.js +47 -1
  148. package/dist/components/tarot-card.js.map +3 -3
  149. package/dist/components/tarot-spread.d.ts +1 -0
  150. package/dist/components/tarot-spread.d.ts.map +1 -1
  151. package/dist/components/tarot-spread.js +47 -1
  152. package/dist/components/tarot-spread.js.map +3 -3
  153. package/dist/components/transits-table.d.ts +1 -0
  154. package/dist/components/transits-table.d.ts.map +1 -1
  155. package/dist/components/transits-table.js +47 -1
  156. package/dist/components/transits-table.js.map +3 -3
  157. package/dist/components/vedic-kundli.d.ts +1 -0
  158. package/dist/components/vedic-kundli.d.ts.map +1 -1
  159. package/dist/components/vedic-kundli.js +47 -1
  160. package/dist/components/vedic-kundli.js.map +3 -3
  161. package/dist/components/vedic-planets-table.d.ts +1 -0
  162. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  163. package/dist/components/vedic-planets-table.js +47 -1
  164. package/dist/components/vedic-planets-table.js.map +3 -3
  165. package/dist/components/western-planets-table.d.ts +1 -0
  166. package/dist/components/western-planets-table.d.ts.map +1 -1
  167. package/dist/components/western-planets-table.js +47 -1
  168. package/dist/components/western-planets-table.js.map +3 -3
  169. package/dist/components/yoga-list.d.ts +1 -0
  170. package/dist/components/yoga-list.d.ts.map +1 -1
  171. package/dist/components/yoga-list.js +47 -1
  172. package/dist/components/yoga-list.js.map +3 -3
  173. package/dist/index.cjs +102 -29
  174. package/dist/index.cjs.map +3 -3
  175. package/dist/index.js +102 -29
  176. package/dist/index.js.map +3 -3
  177. package/dist/types/index.d.ts +1 -1
  178. package/dist/types/index.d.ts.map +1 -1
  179. package/dist/types/types.gen.d.ts +590 -202
  180. package/dist/types/types.gen.d.ts.map +1 -1
  181. package/dist/utils/markup-data.d.ts +57 -0
  182. package/dist/utils/markup-data.d.ts.map +1 -0
  183. package/dist/version.d.ts +1 -1
  184. package/package.json +1 -1
  185. package/src/components/ashtakavarga-grid.ts +9 -0
  186. package/src/components/biorhythm-chart.ts +9 -0
  187. package/src/components/choghadiya-grid.ts +9 -0
  188. package/src/components/compatibility-card.ts +9 -0
  189. package/src/components/dasha-timeline.ts +9 -0
  190. package/src/components/data.ts +9 -0
  191. package/src/components/divisional-chart.ts +9 -0
  192. package/src/components/dosha-card.ts +9 -0
  193. package/src/components/guna-milan.ts +9 -0
  194. package/src/components/hexagram.ts +9 -0
  195. package/src/components/horoscope-card.ts +9 -0
  196. package/src/components/kp-chart.ts +9 -0
  197. package/src/components/kp-planets-table.ts +9 -0
  198. package/src/components/kp-ruling-planets.ts +9 -0
  199. package/src/components/moon-phase.ts +9 -0
  200. package/src/components/nakshatra-card.ts +9 -0
  201. package/src/components/natal-chart.ts +9 -0
  202. package/src/components/numerology-card.ts +9 -0
  203. package/src/components/panchang-table.ts +9 -0
  204. package/src/components/shadbala-table.ts +9 -0
  205. package/src/components/synastry-chart.ts +9 -0
  206. package/src/components/tarot-card.ts +9 -0
  207. package/src/components/tarot-spread.ts +9 -0
  208. package/src/components/transits-table.ts +9 -0
  209. package/src/components/vedic-kundli.ts +9 -0
  210. package/src/components/vedic-planets-table.ts +9 -0
  211. package/src/components/western-planets-table.ts +9 -0
  212. package/src/components/yoga-list.ts +9 -0
  213. package/src/types/index.ts +1 -1
  214. package/src/types/types.gen.ts +602 -200
  215. package/src/utils/markup-data.ts +115 -0
  216. package/src/version.ts +1 -1
@@ -119,12 +119,58 @@ function formatNumber(value, dp = 1) {
119
119
  return value.toFixed(dp).replace(/\.?0+$/, "");
120
120
  }
121
121
 
122
+ // packages/ui/src/utils/markup-data.ts
123
+ var ROXY_DATA_CLASS = "roxy-data";
124
+ function isJsonScript(el) {
125
+ return el.nodeName === "SCRIPT" && el.getAttribute("type") === "application/json";
126
+ }
127
+ var MarkupDataController = class {
128
+ constructor(host) {
129
+ this.host = host;
130
+ host.addController(this);
131
+ }
132
+ hostConnected() {
133
+ if (this.host.data != null) return;
134
+ const parsed = this.read();
135
+ if (parsed === void 0) return;
136
+ this.host.data = parsed;
137
+ this.host.requestUpdate();
138
+ }
139
+ /**
140
+ * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
141
+ */
142
+ read() {
143
+ const inline = this.findInlineScript();
144
+ return inline ? this.parse(inline.textContent) : void 0;
145
+ }
146
+ /**
147
+ * 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.
148
+ */
149
+ findInlineScript() {
150
+ for (const child of Array.from(this.host.children)) {
151
+ if (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {
152
+ return child;
153
+ }
154
+ }
155
+ return null;
156
+ }
157
+ parse(text) {
158
+ if (!text?.trim()) return void 0;
159
+ try {
160
+ return JSON.parse(text);
161
+ } catch {
162
+ return void 0;
163
+ }
164
+ }
165
+ };
166
+
122
167
  // packages/ui/src/components/compatibility-card.ts
123
168
  var RoxyCompatibilityCard = class extends LitElement {
124
169
  constructor() {
125
- super(...arguments);
170
+ super();
126
171
  this.data = null;
127
172
  this.mode = "astrology";
173
+ new MarkupDataController(this);
128
174
  }
129
175
  getBreakdown() {
130
176
  const d = this.data;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/compatibility-card.ts", "../../src/utils/base-styles.ts", "../../src/utils/format.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tCalculateBioCompatibilityResponse,\n\tCalculateCompatibilityResponse,\n\tCalculateNumCompatibilityResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { formatNumber } from '../utils/format.js';\n\ntype CompatibilityData =\n\t| CalculateCompatibilityResponse\n\t| CalculateNumCompatibilityResponse\n\t| CalculateBioCompatibilityResponse;\n\n/**\n * Cross-domain compatibility card. Renders /astrology/compatibility-score,\n * /numerology/compatibility, or /biorhythm/compatibility responses.\n */\n@customElement('roxy-compatibility-card')\nexport class RoxyCompatibilityCard extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.card {\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\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: grid;\n\t\t\t\tgrid-template-columns: 1fr auto;\n\t\t\t\talign-items: center;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.head h2 {\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\ttext-transform: capitalize;\n\t\t\t}\n\n\t\t\t.score {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tfont-size: 2rem;\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\tline-height: 1;\n\t\t\t}\n\t\t\t.rating {\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\n\t\t\t.bar-row {\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.bar {\n\t\t\t\theight: 8px;\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}\n\t\t\t.bar > span {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground: var(--roxy-accent, #f59e0b);\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.bar-row > span:last-child {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\ttext-align: right;\n\t\t\t}\n\n\t\t\t.archetype {\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\n\t\t\t.lists {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.lists h3 {\n\t\t\t\tmargin: 0 0 var(--roxy-space-xs, 0.25rem);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.lists ul {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding-left: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: CompatibilityData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'astrology' | 'numerology' | 'biorhythm' = 'astrology';\n\n\tprivate getBreakdown(): Record<string, number> {\n\t\tconst d = this.data;\n\t\tif (!d) return {};\n\t\tif ('categories' in d && d.categories) {\n\t\t\tconst out: Record<string, number> = {};\n\t\t\tfor (const [k, v] of Object.entries(d.categories)) {\n\t\t\t\tif (typeof v === 'number' && Number.isFinite(v)) out[k] = v;\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn {};\n\t}\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 compatibility data</div>`;\n\n\t\tconst score = d.overallScore;\n\t\tconst breakdown = this.getBreakdown();\n\t\tconst rating =\n\t\t\t'rating' in d\n\t\t\t\t? (d as CalculateNumCompatibilityResponse).rating\n\t\t\t\t: undefined;\n\t\tconst archetype =\n\t\t\t'archetype' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).archetype\n\t\t\t\t: undefined;\n\t\tconst advice =\n\t\t\t'advice' in d\n\t\t\t\t? (d as CalculateNumCompatibilityResponse).advice\n\t\t\t\t: undefined;\n\t\tconst summary =\n\t\t\t'summary' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).summary\n\t\t\t\t: undefined;\n\t\tconst interpretation =\n\t\t\t'interpretation' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).interpretation\n\t\t\t\t: undefined;\n\t\tconst strengths = 'strengths' in d ? d.strengths : undefined;\n\t\tconst challenges = 'challenges' in d ? d.challenges : undefined;\n\t\tconst keyAspects =\n\t\t\t'keyAspects' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).keyAspects\n\t\t\t\t: undefined;\n\n\t\treturn html`<article\n\t\t\tclass=\"card\"\n\t\t\taria-label=${`Compatibility (${this.mode})`}\n\t\t>\n\t\t\t<div class=\"head\">\n\t\t\t\t<h2>${this.mode} compatibility</h2>\n\t\t\t\t<div>\n\t\t\t\t\t${\n\t\t\t\t\t\ttypeof score === 'number'\n\t\t\t\t\t\t\t? html`<div class=\"score\">${formatNumber(score, 0)}</div>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t\t${rating ? html`<div class=\"rating\">${rating}</div>` : nothing}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t${\n\t\t\t\tObject.keys(breakdown).length > 0\n\t\t\t\t\t? html`<div role=\"list\">\n\t\t\t\t\t\t${Object.entries(breakdown).map(\n\t\t\t\t\t\t\t([k, v]) => html`<div class=\"bar-row\" role=\"listitem\">\n\t\t\t\t\t\t\t\t<span style=\"text-transform: capitalize\">${k}</span>\n\t\t\t\t\t\t\t\t<span class=\"bar\"\n\t\t\t\t\t\t\t\t\t><span style=\"width: ${Math.max(0, Math.min(100, v))}%\"></span\n\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t<span>${formatNumber(v, 0)}</span>\n\t\t\t\t\t\t\t</div>`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tarchetype\n\t\t\t\t\t? html`<p>\n\t\t\t\t\t\t<span class=\"archetype\">${archetype.label}</span>\n\t\t\t\t\t\t${archetype.description ? html` \u00B7 ${archetype.description}` : nothing}\n\t\t\t\t\t</p>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${summary ? html`<p>${summary}</p>` : nothing}\n\t\t\t${interpretation && !summary ? html`<p>${interpretation}</p>` : nothing}\n\t\t\t${advice ? html`<p>${advice}</p>` : nothing}\n\t\t\t${\n\t\t\t\t(strengths?.length ?? 0) > 0 || (challenges?.length ?? 0) > 0\n\t\t\t\t\t? html`<div class=\"lists\">\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\tstrengths?.length\n\t\t\t\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t\t\t\t<h3>Strengths</h3>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t${strengths.map((s) => html`<li>${s}</li>`)}\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\tchallenges?.length\n\t\t\t\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t\t\t\t<h3>Challenges</h3>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t${challenges.map((s) => html`<li>${s}</li>`)}\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tkeyAspects?.length\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t<h3 style=\"margin: 0 0 0.25rem; font-size: var(--roxy-text-xs); color: var(--roxy-muted); text-transform: uppercase; letter-spacing: 0.06em;\">Key aspects</h3>\n\t\t\t\t\t\t<ul style=\"margin: 0; padding-left: 1rem; font-size: var(--roxy-text-sm);\">\n\t\t\t\t\t\t\t${keyAspects.slice(0, 6).map((a) => html`<li>${formatAspect(a)}</li>`)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</article>`;\n\t}\n}\n\ntype KeyAspect = CalculateCompatibilityResponse extends {\n\tkeyAspects: Array<infer T>;\n}\n\t? T\n\t: never;\n\nfunction formatAspect(a: KeyAspect): string {\n\tconst aspect = a.type.toLowerCase().replace(/_/g, '-');\n\tconst orb =\n\t\ttypeof a.orb === 'number' ? ` (orb ${formatNumber(a.orb, 1)}\u00B0)` : '';\n\tconst head = [a.planet1, aspect, a.planet2].filter(Boolean).join(' ');\n\treturn a.description ? `${head}${orb} \u00B7 ${a.description}` : `${head}${orb}`;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-compatibility-card': RoxyCompatibilityCard;\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 (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", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,YAAY,eAAe;AAC/C,SAAS,eAAe,gBAAgB;;;ACDxC,SAAS,WAAW;AAMb,IAAM,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;AA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/format.ts", "../../src/utils/markup-data.ts"],
4
+ "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tCalculateBioCompatibilityResponse,\n\tCalculateCompatibilityResponse,\n\tCalculateNumCompatibilityResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { formatNumber } from '../utils/format.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype CompatibilityData =\n\t| CalculateCompatibilityResponse\n\t| CalculateNumCompatibilityResponse\n\t| CalculateBioCompatibilityResponse;\n\n/**\n * Cross-domain compatibility card. Renders /astrology/compatibility-score,\n * /numerology/compatibility, or /biorhythm/compatibility responses.\n */\n@customElement('roxy-compatibility-card')\nexport class RoxyCompatibilityCard extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.card {\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\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: grid;\n\t\t\t\tgrid-template-columns: 1fr auto;\n\t\t\t\talign-items: center;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.head h2 {\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\ttext-transform: capitalize;\n\t\t\t}\n\n\t\t\t.score {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tfont-size: 2rem;\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\tline-height: 1;\n\t\t\t}\n\t\t\t.rating {\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\n\t\t\t.bar-row {\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.bar {\n\t\t\t\theight: 8px;\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}\n\t\t\t.bar > span {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground: var(--roxy-accent, #f59e0b);\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.bar-row > span:last-child {\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\ttext-align: right;\n\t\t\t}\n\n\t\t\t.archetype {\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\n\t\t\t.lists {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.lists h3 {\n\t\t\t\tmargin: 0 0 var(--roxy-space-xs, 0.25rem);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.lists ul {\n\t\t\t\tmargin: 0;\n\t\t\t\tpadding-left: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t`,\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: CompatibilityData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'astrology' | 'numerology' | 'biorhythm' = 'astrology';\n\n\tprivate getBreakdown(): Record<string, number> {\n\t\tconst d = this.data;\n\t\tif (!d) return {};\n\t\tif ('categories' in d && d.categories) {\n\t\t\tconst out: Record<string, number> = {};\n\t\t\tfor (const [k, v] of Object.entries(d.categories)) {\n\t\t\t\tif (typeof v === 'number' && Number.isFinite(v)) out[k] = v;\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn {};\n\t}\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 compatibility data</div>`;\n\n\t\tconst score = d.overallScore;\n\t\tconst breakdown = this.getBreakdown();\n\t\tconst rating =\n\t\t\t'rating' in d\n\t\t\t\t? (d as CalculateNumCompatibilityResponse).rating\n\t\t\t\t: undefined;\n\t\tconst archetype =\n\t\t\t'archetype' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).archetype\n\t\t\t\t: undefined;\n\t\tconst advice =\n\t\t\t'advice' in d\n\t\t\t\t? (d as CalculateNumCompatibilityResponse).advice\n\t\t\t\t: undefined;\n\t\tconst summary =\n\t\t\t'summary' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).summary\n\t\t\t\t: undefined;\n\t\tconst interpretation =\n\t\t\t'interpretation' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).interpretation\n\t\t\t\t: undefined;\n\t\tconst strengths = 'strengths' in d ? d.strengths : undefined;\n\t\tconst challenges = 'challenges' in d ? d.challenges : undefined;\n\t\tconst keyAspects =\n\t\t\t'keyAspects' in d\n\t\t\t\t? (d as CalculateCompatibilityResponse).keyAspects\n\t\t\t\t: undefined;\n\n\t\treturn html`<article\n\t\t\tclass=\"card\"\n\t\t\taria-label=${`Compatibility (${this.mode})`}\n\t\t>\n\t\t\t<div class=\"head\">\n\t\t\t\t<h2>${this.mode} compatibility</h2>\n\t\t\t\t<div>\n\t\t\t\t\t${\n\t\t\t\t\t\ttypeof score === 'number'\n\t\t\t\t\t\t\t? html`<div class=\"score\">${formatNumber(score, 0)}</div>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t\t${rating ? html`<div class=\"rating\">${rating}</div>` : nothing}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t${\n\t\t\t\tObject.keys(breakdown).length > 0\n\t\t\t\t\t? html`<div role=\"list\">\n\t\t\t\t\t\t${Object.entries(breakdown).map(\n\t\t\t\t\t\t\t([k, v]) => html`<div class=\"bar-row\" role=\"listitem\">\n\t\t\t\t\t\t\t\t<span style=\"text-transform: capitalize\">${k}</span>\n\t\t\t\t\t\t\t\t<span class=\"bar\"\n\t\t\t\t\t\t\t\t\t><span style=\"width: ${Math.max(0, Math.min(100, v))}%\"></span\n\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t\t<span>${formatNumber(v, 0)}</span>\n\t\t\t\t\t\t\t</div>`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tarchetype\n\t\t\t\t\t? html`<p>\n\t\t\t\t\t\t<span class=\"archetype\">${archetype.label}</span>\n\t\t\t\t\t\t${archetype.description ? html` \u00B7 ${archetype.description}` : nothing}\n\t\t\t\t\t</p>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${summary ? html`<p>${summary}</p>` : nothing}\n\t\t\t${interpretation && !summary ? html`<p>${interpretation}</p>` : nothing}\n\t\t\t${advice ? html`<p>${advice}</p>` : nothing}\n\t\t\t${\n\t\t\t\t(strengths?.length ?? 0) > 0 || (challenges?.length ?? 0) > 0\n\t\t\t\t\t? html`<div class=\"lists\">\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\tstrengths?.length\n\t\t\t\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t\t\t\t<h3>Strengths</h3>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t${strengths.map((s) => html`<li>${s}</li>`)}\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\tchallenges?.length\n\t\t\t\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t\t\t\t<h3>Challenges</h3>\n\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t${challenges.map((s) => html`<li>${s}</li>`)}\n\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t</div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tkeyAspects?.length\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t\t<h3 style=\"margin: 0 0 0.25rem; font-size: var(--roxy-text-xs); color: var(--roxy-muted); text-transform: uppercase; letter-spacing: 0.06em;\">Key aspects</h3>\n\t\t\t\t\t\t<ul style=\"margin: 0; padding-left: 1rem; font-size: var(--roxy-text-sm);\">\n\t\t\t\t\t\t\t${keyAspects.slice(0, 6).map((a) => html`<li>${formatAspect(a)}</li>`)}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</article>`;\n\t}\n}\n\ntype KeyAspect = CalculateCompatibilityResponse extends {\n\tkeyAspects: Array<infer T>;\n}\n\t? T\n\t: never;\n\nfunction formatAspect(a: KeyAspect): string {\n\tconst aspect = a.type.toLowerCase().replace(/_/g, '-');\n\tconst orb =\n\t\ttypeof a.orb === 'number' ? ` (orb ${formatNumber(a.orb, 1)}\u00B0)` : '';\n\tconst head = [a.planet1, aspect, a.planet2].filter(Boolean).join(' ');\n\treturn a.description ? `${head}${orb} \u00B7 ${a.description}` : `${head}${orb}`;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-compatibility-card': RoxyCompatibilityCard;\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 (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", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\n}\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//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YAAY,EAAE,QAAQ,MAAM,GAAG;AACrD,QAAM,MACL,OAAO,EAAE,QAAQ,WAAW,SAAS,aAAa,EAAE,KAAK,CAAC,CAAC,UAAO;AACnE,QAAM,OAAO,CAAC,EAAE,SAAS,QAAQ,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACpE,SAAO,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,SAAM,EAAE,WAAW,KAAK,GAAG,IAAI,GAAG,GAAG;AAC1E;",
6
6
  "names": ["css", "css"]
7
7
  }
@@ -8,6 +8,7 @@ type DashaData = GetCurrentDashaResponse | GetMajorDashasResponse | GetSubDashas
8
8
  */
9
9
  export declare class RoxyDashaTimeline extends LitElement {
10
10
  static styles: import("lit").CSSResult[];
11
+ constructor();
11
12
  data: DashaData | null;
12
13
  period: 'current' | 'major' | 'sub';
13
14
  render(): import("lit").TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"dasha-timeline.d.ts","sourceRoot":"","sources":["../../src/components/dasha-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAI3B,KAAK,SAAS,GACX,uBAAuB,GACvB,sBAAsB,GACtB,oBAAoB,CAAC;AAIxB;;;;GAIG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAChD,MAAM,CAAC,MAAM,4BAgIX;IAGF,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAG9B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,CAAa;IAEhD,MAAM;IA4CN,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,aAAa;IA6CrB,OAAO,CAAC,cAAc;IAMtB,sFAAsF;IACtF,OAAO,CAAC,SAAS;IASjB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,SAAS;CAgCjB;AAOD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD"}
1
+ {"version":3,"file":"dasha-timeline.d.ts","sourceRoot":"","sources":["../../src/components/dasha-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAErD,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAK3B,KAAK,SAAS,GACX,uBAAuB,GACvB,sBAAsB,GACtB,oBAAoB,CAAC;AAIxB;;;;GAIG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAChD,MAAM,CAAC,MAAM,4BAgIX;;IAWF,IAAI,EAAE,SAAS,GAAG,IAAI,CAAQ;IAG9B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,CAAa;IAEhD,MAAM;IA4CN,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,aAAa;IA6CrB,OAAO,CAAC,cAAc;IAMtB,sFAAsF;IACtF,OAAO,CAAC,SAAS;IASjB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,SAAS;CAgCjB;AAOD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAqB,EAAE,iBAAiB,CAAC;KACzC;CACD"}
@@ -119,12 +119,58 @@ function formatNumber(value, dp = 1) {
119
119
  return value.toFixed(dp).replace(/\.?0+$/, "");
120
120
  }
121
121
 
122
+ // packages/ui/src/utils/markup-data.ts
123
+ var ROXY_DATA_CLASS = "roxy-data";
124
+ function isJsonScript(el) {
125
+ return el.nodeName === "SCRIPT" && el.getAttribute("type") === "application/json";
126
+ }
127
+ var MarkupDataController = class {
128
+ constructor(host) {
129
+ this.host = host;
130
+ host.addController(this);
131
+ }
132
+ hostConnected() {
133
+ if (this.host.data != null) return;
134
+ const parsed = this.read();
135
+ if (parsed === void 0) return;
136
+ this.host.data = parsed;
137
+ this.host.requestUpdate();
138
+ }
139
+ /**
140
+ * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
141
+ */
142
+ read() {
143
+ const inline = this.findInlineScript();
144
+ return inline ? this.parse(inline.textContent) : void 0;
145
+ }
146
+ /**
147
+ * 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.
148
+ */
149
+ findInlineScript() {
150
+ for (const child of Array.from(this.host.children)) {
151
+ if (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {
152
+ return child;
153
+ }
154
+ }
155
+ return null;
156
+ }
157
+ parse(text) {
158
+ if (!text?.trim()) return void 0;
159
+ try {
160
+ return JSON.parse(text);
161
+ } catch {
162
+ return void 0;
163
+ }
164
+ }
165
+ };
166
+
122
167
  // packages/ui/src/components/dasha-timeline.ts
123
168
  var RoxyDashaTimeline = class extends LitElement {
124
169
  constructor() {
125
- super(...arguments);
170
+ super();
126
171
  this.data = null;
127
172
  this.period = "current";
173
+ new MarkupDataController(this);
128
174
  }
129
175
  render() {
130
176
  const d = this.data;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/dasha-timeline.ts", "../../src/utils/base-styles.ts", "../../src/utils/format.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCurrentDashaResponse,\n\tGetMajorDashasResponse,\n\tGetSubDashasResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { formatNumber } from '../utils/format.js';\n\ntype DashaData =\n\t| GetCurrentDashaResponse\n\t| GetMajorDashasResponse\n\t| GetSubDashasResponse;\n\ntype DashaPeriod = GetMajorDashasResponse['mahadashas'][number];\n\n/**\n * Dasha timeline. Renders /vedic-astrology/dasha/{current,major,sub/{...}}.\n * Default mode shows the active mahadasha + antardasha + pratyantardasha.\n * Switch to period=\"major\" for the full 120-year Vimshottari timeline.\n */\n@customElement('roxy-dasha-timeline')\nexport class RoxyDashaTimeline 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.nakshatra {\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}\n\n\t\t\t.current {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-md, 1rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\n\t\t\t}\n\t\t\t.current div span:first-child {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.current div strong {\n\t\t\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t}\n\n\t\t\t.balance {\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tborder-left: 2px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tpadding-left: var(--roxy-space-sm, 0.5rem);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.timeline {\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: 5rem 1fr 8rem;\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.bar.now strong {\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t}\n\t\t\t.now-badge {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmargin-left: 0.4em;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.bar-track {\n\t\t\t\tposition: relative;\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}\n\t\t\t.bar-fill {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground: var(--roxy-accent, #f59e0b);\n\t\t\t\topacity: 0.45;\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.bar-now .bar-fill {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t.bar-progress {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: -2px;\n\t\t\t\tbottom: -2px;\n\t\t\t\twidth: 2px;\n\t\t\t\tbackground: var(--roxy-accent-fg, #b45309);\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tbox-shadow: 0 0 0 2px\n\t\t\t\t\tcolor-mix(in srgb, var(--roxy-accent, #f59e0b) 35%, transparent);\n\t\t\t}\n\t\t\t.dates {\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\ttext-align: right;\n\t\t\t}\n\t\t\tdetails.interp {\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem) var(--roxy-space-md, 1rem);\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t}\n\t\t\tdetails.interp summary {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\tdetails.interp p {\n\t\t\t\tmargin: var(--roxy-space-sm, 0.5rem) 0 0;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: DashaData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tperiod: 'current' | 'major' | 'sub' = 'current';\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 dasha data</div>`;\n\n\t\tconst periods = this.collectPeriods(d);\n\t\tconst maxYears = periods.length\n\t\t\t? Math.max(...periods.map((p) => p.durationYears))\n\t\t\t: 0;\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Dasha timeline\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">\n\t\t\t\t\t${\n\t\t\t\t\t\tthis.period === 'major'\n\t\t\t\t\t\t\t? 'Vimshottari Mahadasha'\n\t\t\t\t\t\t\t: this.period === 'sub'\n\t\t\t\t\t\t\t\t? 'Antardasha'\n\t\t\t\t\t\t\t\t: 'Active dashas'\n\t\t\t\t\t}\n\t\t\t\t</h2>\n\t\t\t\t${\n\t\t\t\t\t'nakshatraName' in d && d.nakshatraName\n\t\t\t\t\t\t? html`<div class=\"nakshatra\">\n\t\t\t\t\t\tMoon nakshatra: ${d.nakshatraName}\n\t\t\t\t\t\t${'nakshatraLord' in d && d.nakshatraLord ? html`(lord ${d.nakshatraLord})` : nothing}\n\t\t\t\t\t</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</header>\n\n\t\t\t${this.renderBirthBalance(d)}\n\t\t\t${this.period === 'current' ? this.renderCurrent(d) : nothing}\n\t\t\t${\n\t\t\t\tperiods.length > 0\n\t\t\t\t\t? html`<div class=\"timeline\" role=\"list\">\n\t\t\t\t\t\t${periods.map((p) => this.renderBar(p, maxYears))}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${this.renderActiveInterpretation(periods)}\n\t\t</div>`;\n\t}\n\n\tprivate renderBirthBalance(d: DashaData) {\n\t\tif (!('birthDashaBalance' in d) || !d.birthDashaBalance) return nothing;\n\t\tconst b = d.birthDashaBalance;\n\t\tconst lord = 'nakshatraLord' in d && d.nakshatraLord ? d.nakshatraLord : '';\n\t\tconst yrs = b.years ?? 0;\n\t\tconst mo = b.months ?? 0;\n\t\tconst da = b.days ?? 0;\n\t\tconst parts: string[] = [];\n\t\tif (yrs) parts.push(`${yrs}y`);\n\t\tif (mo) parts.push(`${mo}m`);\n\t\tif (da) parts.push(`${da}d`);\n\t\tconst remaining = parts.length ? parts.join(' ') : '0d';\n\t\treturn html`<p class=\"balance\">\n\t\t\tBirth dasha balance: ${remaining} of\n\t\t\t${lord ? html`<strong>${lord}</strong>` : 'the opening mahadasha'} remained at birth.\n\t\t</p>`;\n\t}\n\n\tprivate renderActiveInterpretation(periods: DashaPeriod[]) {\n\t\tconst active = periods.find((p) => this.isCurrent(p));\n\t\tif (!active?.interpretation) return nothing;\n\t\treturn html`<details class=\"interp\">\n\t\t\t<summary>${active.planet} mahadasha interpretation</summary>\n\t\t\t<p>${active.interpretation}</p>\n\t\t</details>`;\n\t}\n\n\tprivate renderCurrent(d: DashaData) {\n\t\tif (!('mahadasha' in d)) return nothing;\n\t\treturn html`<div class=\"current\">\n\t\t\t${\n\t\t\t\t'mahadasha' in d && d.mahadasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Mahadasha</span>\n\t\t\t\t\t<strong>${d.mahadasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInMahadasha' in d && d.remainingInMahadasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInMahadasha.years + d.remainingInMahadasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\t'antardasha' in d && d.antardasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Antardasha</span>\n\t\t\t\t\t<strong>${d.antardasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInAntardasha' in d && d.remainingInAntardasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInAntardasha.years + d.remainingInAntardasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\t'pratyantardasha' in d && d.pratyantardasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Pratyantardasha</span>\n\t\t\t\t\t<strong>${d.pratyantardasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInPratyantardasha' in d && d.remainingInPratyantardasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInPratyantardasha.years + d.remainingInPratyantardasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</div>`;\n\t}\n\n\tprivate collectPeriods(d: DashaData): DashaPeriod[] {\n\t\tif ('mahadashas' in d && d.mahadashas?.length) return d.mahadashas;\n\t\tif ('antardashas' in d && d.antardashas?.length) return d.antardashas;\n\t\treturn [];\n\t}\n\n\t/** True when the current wall-clock time falls between the period's start and end. */\n\tprivate isCurrent(p: DashaPeriod): boolean {\n\t\tif (!p.startDate || !p.endDate) return false;\n\t\tconst now = Date.now();\n\t\tconst start = Date.parse(p.startDate);\n\t\tconst end = Date.parse(p.endDate);\n\t\tif (Number.isNaN(start) || Number.isNaN(end)) return false;\n\t\treturn now >= start && now < end;\n\t}\n\n\t/**\n\t * Fractional progress (0..1) through a period at the current time. Used to\n\t * draw a vertical \"now\" marker inside the active bar. Returns -1 outside the\n\t * period so the caller can skip the marker.\n\t */\n\tprivate progressIn(p: DashaPeriod): number {\n\t\tif (!p.startDate || !p.endDate) return -1;\n\t\tconst start = Date.parse(p.startDate);\n\t\tconst end = Date.parse(p.endDate);\n\t\tconst now = Date.now();\n\t\tif (\n\t\t\tNumber.isNaN(start) ||\n\t\t\tNumber.isNaN(end) ||\n\t\t\tnow < start ||\n\t\t\tnow >= end ||\n\t\t\tend <= start\n\t\t) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn (now - start) / (end - start);\n\t}\n\n\tprivate renderBar(p: DashaPeriod, max: number) {\n\t\tconst years = p.durationYears;\n\t\tconst width = max > 0 ? (years / max) * 100 : 0;\n\t\tconst current = this.isCurrent(p);\n\t\tconst progress = current ? this.progressIn(p) : -1;\n\t\tconst trackClass = current ? 'bar-track bar-now' : 'bar-track';\n\t\treturn html`<div\n\t\t\tclass=${current ? 'bar now' : 'bar'}\n\t\t\trole=\"listitem\"\n\t\t\taria-current=${current ? 'time' : 'false'}\n\t\t>\n\t\t\t<span>\n\t\t\t\t<strong>${p.planet}</strong>${current ? html`<span class=\"now-badge\">Now</span>` : nothing}\n\t\t\t</span>\n\t\t\t<span class=${trackClass}>\n\t\t\t\t<span class=\"bar-fill\" style=\"width: ${width}%\"></span>\n\t\t\t\t${\n\t\t\t\t\tprogress >= 0\n\t\t\t\t\t\t? html`<span\n\t\t\t\t\t\t\tclass=\"bar-progress\"\n\t\t\t\t\t\t\tstyle=\"left: ${progress * width}%\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t></span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t<span class=\"dates\">\n\t\t\t\t${p.startDate ? formatYear(p.startDate) : ''}\n\t\t\t\t${p.endDate ? html`- ${formatYear(p.endDate)}` : ''}\n\t\t\t</span>\n\t\t</div>`;\n\t}\n}\n\nfunction formatYear(s: string): string {\n\tconst m = s.match(/^(\\d{4})/);\n\treturn m ? m[1] : s;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-dasha-timeline': RoxyDashaTimeline;\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 (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", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,YAAY,eAAe;AAC/C,SAAS,eAAe,gBAAgB;;;ACDxC,SAAS,WAAW;AAMb,IAAM,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;AAAA;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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8HD;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAnIlB,kBAoIZ;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAtI7B,kBAuIZ;AAvIY,oBAAN;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB;AAqUb,SAAS,WAAW,GAAmB;AACtC,QAAM,IAAI,EAAE,MAAM,UAAU;AAC5B,SAAO,IAAI,EAAE,CAAC,IAAI;AACnB;",
3
+ "sources": ["../../src/components/dasha-timeline.ts", "../../src/utils/base-styles.ts", "../../src/utils/format.ts", "../../src/utils/markup-data.ts"],
4
+ "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCurrentDashaResponse,\n\tGetMajorDashasResponse,\n\tGetSubDashasResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { formatNumber } from '../utils/format.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype DashaData =\n\t| GetCurrentDashaResponse\n\t| GetMajorDashasResponse\n\t| GetSubDashasResponse;\n\ntype DashaPeriod = GetMajorDashasResponse['mahadashas'][number];\n\n/**\n * Dasha timeline. Renders /vedic-astrology/dasha/{current,major,sub/{...}}.\n * Default mode shows the active mahadasha + antardasha + pratyantardasha.\n * Switch to period=\"major\" for the full 120-year Vimshottari timeline.\n */\n@customElement('roxy-dasha-timeline')\nexport class RoxyDashaTimeline 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.nakshatra {\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}\n\n\t\t\t.current {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-md, 1rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\n\t\t\t}\n\t\t\t.current div span:first-child {\n\t\t\t\tdisplay: block;\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.current div strong {\n\t\t\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t}\n\n\t\t\t.balance {\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tborder-left: 2px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tpadding-left: var(--roxy-space-sm, 0.5rem);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.timeline {\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: 5rem 1fr 8rem;\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.bar.now strong {\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t}\n\t\t\t.now-badge {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tmargin-left: 0.4em;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-accent-fg, #b45309);\n\t\t\t\ttext-transform: uppercase;\n\t\t\t\tletter-spacing: 0.06em;\n\t\t\t}\n\t\t\t.bar-track {\n\t\t\t\tposition: relative;\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}\n\t\t\t.bar-fill {\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground: var(--roxy-accent, #f59e0b);\n\t\t\t\topacity: 0.45;\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.bar-now .bar-fill {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t\t.bar-progress {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: -2px;\n\t\t\t\tbottom: -2px;\n\t\t\t\twidth: 2px;\n\t\t\t\tbackground: var(--roxy-accent-fg, #b45309);\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tbox-shadow: 0 0 0 2px\n\t\t\t\t\tcolor-mix(in srgb, var(--roxy-accent, #f59e0b) 35%, transparent);\n\t\t\t}\n\t\t\t.dates {\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tfont-variant-numeric: tabular-nums;\n\t\t\t\ttext-align: right;\n\t\t\t}\n\t\t\tdetails.interp {\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem) var(--roxy-space-md, 1rem);\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t}\n\t\t\tdetails.interp summary {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t}\n\t\t\tdetails.interp p {\n\t\t\t\tmargin: var(--roxy-space-sm, 0.5rem) 0 0;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tcolor: var(--roxy-muted, #71717a);\n\t\t\t}\n\t\t`,\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: DashaData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tperiod: 'current' | 'major' | 'sub' = 'current';\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 dasha data</div>`;\n\n\t\tconst periods = this.collectPeriods(d);\n\t\tconst maxYears = periods.length\n\t\t\t? Math.max(...periods.map((p) => p.durationYears))\n\t\t\t: 0;\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Dasha timeline\">\n\t\t\t<header class=\"head\">\n\t\t\t\t<h2 class=\"title\">\n\t\t\t\t\t${\n\t\t\t\t\t\tthis.period === 'major'\n\t\t\t\t\t\t\t? 'Vimshottari Mahadasha'\n\t\t\t\t\t\t\t: this.period === 'sub'\n\t\t\t\t\t\t\t\t? 'Antardasha'\n\t\t\t\t\t\t\t\t: 'Active dashas'\n\t\t\t\t\t}\n\t\t\t\t</h2>\n\t\t\t\t${\n\t\t\t\t\t'nakshatraName' in d && d.nakshatraName\n\t\t\t\t\t\t? html`<div class=\"nakshatra\">\n\t\t\t\t\t\tMoon nakshatra: ${d.nakshatraName}\n\t\t\t\t\t\t${'nakshatraLord' in d && d.nakshatraLord ? html`(lord ${d.nakshatraLord})` : nothing}\n\t\t\t\t\t</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</header>\n\n\t\t\t${this.renderBirthBalance(d)}\n\t\t\t${this.period === 'current' ? this.renderCurrent(d) : nothing}\n\t\t\t${\n\t\t\t\tperiods.length > 0\n\t\t\t\t\t? html`<div class=\"timeline\" role=\"list\">\n\t\t\t\t\t\t${periods.map((p) => this.renderBar(p, maxYears))}\n\t\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${this.renderActiveInterpretation(periods)}\n\t\t</div>`;\n\t}\n\n\tprivate renderBirthBalance(d: DashaData) {\n\t\tif (!('birthDashaBalance' in d) || !d.birthDashaBalance) return nothing;\n\t\tconst b = d.birthDashaBalance;\n\t\tconst lord = 'nakshatraLord' in d && d.nakshatraLord ? d.nakshatraLord : '';\n\t\tconst yrs = b.years ?? 0;\n\t\tconst mo = b.months ?? 0;\n\t\tconst da = b.days ?? 0;\n\t\tconst parts: string[] = [];\n\t\tif (yrs) parts.push(`${yrs}y`);\n\t\tif (mo) parts.push(`${mo}m`);\n\t\tif (da) parts.push(`${da}d`);\n\t\tconst remaining = parts.length ? parts.join(' ') : '0d';\n\t\treturn html`<p class=\"balance\">\n\t\t\tBirth dasha balance: ${remaining} of\n\t\t\t${lord ? html`<strong>${lord}</strong>` : 'the opening mahadasha'} remained at birth.\n\t\t</p>`;\n\t}\n\n\tprivate renderActiveInterpretation(periods: DashaPeriod[]) {\n\t\tconst active = periods.find((p) => this.isCurrent(p));\n\t\tif (!active?.interpretation) return nothing;\n\t\treturn html`<details class=\"interp\">\n\t\t\t<summary>${active.planet} mahadasha interpretation</summary>\n\t\t\t<p>${active.interpretation}</p>\n\t\t</details>`;\n\t}\n\n\tprivate renderCurrent(d: DashaData) {\n\t\tif (!('mahadasha' in d)) return nothing;\n\t\treturn html`<div class=\"current\">\n\t\t\t${\n\t\t\t\t'mahadasha' in d && d.mahadasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Mahadasha</span>\n\t\t\t\t\t<strong>${d.mahadasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInMahadasha' in d && d.remainingInMahadasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInMahadasha.years + d.remainingInMahadasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\t'antardasha' in d && d.antardasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Antardasha</span>\n\t\t\t\t\t<strong>${d.antardasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInAntardasha' in d && d.remainingInAntardasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInAntardasha.years + d.remainingInAntardasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\t'pratyantardasha' in d && d.pratyantardasha\n\t\t\t\t\t? html`<div>\n\t\t\t\t\t<span>Pratyantardasha</span>\n\t\t\t\t\t<strong>${d.pratyantardasha.planet}</strong>\n\t\t\t\t\t${\n\t\t\t\t\t\t'remainingInPratyantardasha' in d && d.remainingInPratyantardasha\n\t\t\t\t\t\t\t? html`<small>${formatNumber(d.remainingInPratyantardasha.years + d.remainingInPratyantardasha.months / 12, 1)} years left</small>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}\n\t\t\t\t</div>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t</div>`;\n\t}\n\n\tprivate collectPeriods(d: DashaData): DashaPeriod[] {\n\t\tif ('mahadashas' in d && d.mahadashas?.length) return d.mahadashas;\n\t\tif ('antardashas' in d && d.antardashas?.length) return d.antardashas;\n\t\treturn [];\n\t}\n\n\t/** True when the current wall-clock time falls between the period's start and end. */\n\tprivate isCurrent(p: DashaPeriod): boolean {\n\t\tif (!p.startDate || !p.endDate) return false;\n\t\tconst now = Date.now();\n\t\tconst start = Date.parse(p.startDate);\n\t\tconst end = Date.parse(p.endDate);\n\t\tif (Number.isNaN(start) || Number.isNaN(end)) return false;\n\t\treturn now >= start && now < end;\n\t}\n\n\t/**\n\t * Fractional progress (0..1) through a period at the current time. Used to\n\t * draw a vertical \"now\" marker inside the active bar. Returns -1 outside the\n\t * period so the caller can skip the marker.\n\t */\n\tprivate progressIn(p: DashaPeriod): number {\n\t\tif (!p.startDate || !p.endDate) return -1;\n\t\tconst start = Date.parse(p.startDate);\n\t\tconst end = Date.parse(p.endDate);\n\t\tconst now = Date.now();\n\t\tif (\n\t\t\tNumber.isNaN(start) ||\n\t\t\tNumber.isNaN(end) ||\n\t\t\tnow < start ||\n\t\t\tnow >= end ||\n\t\t\tend <= start\n\t\t) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn (now - start) / (end - start);\n\t}\n\n\tprivate renderBar(p: DashaPeriod, max: number) {\n\t\tconst years = p.durationYears;\n\t\tconst width = max > 0 ? (years / max) * 100 : 0;\n\t\tconst current = this.isCurrent(p);\n\t\tconst progress = current ? this.progressIn(p) : -1;\n\t\tconst trackClass = current ? 'bar-track bar-now' : 'bar-track';\n\t\treturn html`<div\n\t\t\tclass=${current ? 'bar now' : 'bar'}\n\t\t\trole=\"listitem\"\n\t\t\taria-current=${current ? 'time' : 'false'}\n\t\t>\n\t\t\t<span>\n\t\t\t\t<strong>${p.planet}</strong>${current ? html`<span class=\"now-badge\">Now</span>` : nothing}\n\t\t\t</span>\n\t\t\t<span class=${trackClass}>\n\t\t\t\t<span class=\"bar-fill\" style=\"width: ${width}%\"></span>\n\t\t\t\t${\n\t\t\t\t\tprogress >= 0\n\t\t\t\t\t\t? html`<span\n\t\t\t\t\t\t\tclass=\"bar-progress\"\n\t\t\t\t\t\t\tstyle=\"left: ${progress * width}%\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t></span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t<span class=\"dates\">\n\t\t\t\t${p.startDate ? formatYear(p.startDate) : ''}\n\t\t\t\t${p.endDate ? html`- ${formatYear(p.endDate)}` : ''}\n\t\t\t</span>\n\t\t</div>`;\n\t}\n}\n\nfunction formatYear(s: string): string {\n\tconst m = s.match(/^(\\d{4})/);\n\treturn m ? m[1] : s;\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-dasha-timeline': RoxyDashaTimeline;\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 (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", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (/^\\d{4}-\\d{2}-\\d{2}$/.test(input)) return '';\n\tconst bareTime = /^\\d{2}:\\d{2}(:\\d{2})?$/.test(input);\n\tconst iso = bareTime ? `1970-01-01T${input}` : input;\n\tconst d = new Date(iso);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst d = new Date(\n\t\t/^\\d{4}-\\d{2}-\\d{2}$/.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toFixed(dp).replace(/\\.?0+$/, '');\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated\n * canonical name (`SEMI_SEXTILE` \u2192 `semi-sextile`). Accepts any aspect-shaped\n * object so both natal and synastry inter-aspect entries can share this.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '').toLowerCase().replace(/_/g, '-');\n}\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": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,YAAY,eAAe;AAC/C,SAAS,eAAe,gBAAgB;;;ACDxC,SAAS,WAAW;AAMb,IAAM,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqCnB,SAAS,aAAa,OAAgB,KAAK,GAAW;AAC5D,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,SAAO,MAAM,QAAQ,EAAE,EAAE,QAAQ,UAAU,EAAE;AAC9C;;;A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A;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;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;AA8HD;AAWA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA3IlB,kBA4IZ;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GA9I7B,kBA+IZ;AA/IY,oBAAN;AAAA,EADN,cAAc,qBAAqB;AAAA,GACvB;AA6Ub,SAAS,WAAW,GAAmB;AACtC,QAAM,IAAI,EAAE,MAAM,UAAU;AAC5B,SAAO,IAAI,EAAE,CAAC,IAAI;AACnB;",
6
6
  "names": ["css", "css"]
7
7
  }
@@ -19,6 +19,7 @@ type Json = string | number | boolean | null | Json[] | {
19
19
  };
20
20
  export declare class RoxyData extends LitElement {
21
21
  static styles: import("lit").CSSResult[];
22
+ constructor();
22
23
  data: Json;
23
24
  /**
24
25
  * Internal recursion depth. Nested <roxy-data> instances inherit this from
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/components/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1E;;;;;;;;;;;;;;GAcG;AAEH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAchF,qBACa,QAAS,SAAQ,UAAU;IACvC,MAAM,CAAC,MAAM,4BAiGX;IAGF,IAAI,EAAE,IAAI,CAAQ;IAElB;;;;OAIG;IAEH,KAAK,SAAK;IAEV,MAAM;IAeN,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,WAAW;IAqBnB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,WAAW;CAOnB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/components/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAM1E;;;;;;;;;;;;;;GAcG;AAEH,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAchF,qBACa,QAAS,SAAQ,UAAU;IACvC,MAAM,CAAC,MAAM,4BAiGX;;IAWF,IAAI,EAAE,IAAI,CAAQ;IAElB;;;;OAIG;IAEH,KAAK,SAAK;IAEV,MAAM;IAeN,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,WAAW;IAqBnB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,WAAW;CAOnB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,WAAW,EAAE,QAAQ,CAAC;KACtB;CACD"}
@@ -113,6 +113,51 @@ var baseStyles = css`
113
113
  }
114
114
  `;
115
115
 
116
+ // packages/ui/src/utils/markup-data.ts
117
+ var ROXY_DATA_CLASS = "roxy-data";
118
+ function isJsonScript(el) {
119
+ return el.nodeName === "SCRIPT" && el.getAttribute("type") === "application/json";
120
+ }
121
+ var MarkupDataController = class {
122
+ constructor(host) {
123
+ this.host = host;
124
+ host.addController(this);
125
+ }
126
+ hostConnected() {
127
+ if (this.host.data != null) return;
128
+ const parsed = this.read();
129
+ if (parsed === void 0) return;
130
+ this.host.data = parsed;
131
+ this.host.requestUpdate();
132
+ }
133
+ /**
134
+ * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.
135
+ */
136
+ read() {
137
+ const inline = this.findInlineScript();
138
+ return inline ? this.parse(inline.textContent) : void 0;
139
+ }
140
+ /**
141
+ * 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.
142
+ */
143
+ findInlineScript() {
144
+ for (const child of Array.from(this.host.children)) {
145
+ if (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {
146
+ return child;
147
+ }
148
+ }
149
+ return null;
150
+ }
151
+ parse(text) {
152
+ if (!text?.trim()) return void 0;
153
+ try {
154
+ return JSON.parse(text);
155
+ } catch {
156
+ return void 0;
157
+ }
158
+ }
159
+ };
160
+
116
161
  // packages/ui/src/utils/string.ts
117
162
  function humanize(s) {
118
163
  return s.replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^\w/, (c) => c.toUpperCase());
@@ -125,9 +170,10 @@ var SKIP_KEYS = ["imageUrl", "image"];
125
170
  var MAX_DEPTH = 6;
126
171
  var RoxyData = class extends LitElement {
127
172
  constructor() {
128
- super(...arguments);
173
+ super();
129
174
  this.data = null;
130
175
  this.depth = 0;
176
+ new MarkupDataController(this);
131
177
  }
132
178
  render() {
133
179
  if (this.data == null) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/components/data.ts", "../../src/utils/base-styles.ts", "../../src/utils/string.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { humanize } from '../utils/string.js';\n\n/**\n * Generic fallback renderer. Accepts ANY OpenAPI response shape and renders\n * it via field-name heuristics so future spec additions render reasonably\n * without hand-wired components.\n *\n * Heuristic order:\n * 1. Primitive (string, number, boolean) -> single line.\n * 2. Array of primitives -> chip list.\n * 3. Array of objects with shared keys -> table.\n * 4. Object with title-like field -> card with key/value rows.\n * 5. Otherwise -> definition list of all keys.\n *\n * When a schema declares an `x-roxy-ui` hint, a future dispatcher can opt\n * into a hand-tuned component instead of this fallback.\n */\n\ntype Json = string | number | boolean | null | Json[] | { [key: string]: Json };\n\nconst TITLE_KEYS = ['title', 'name', 'label', 'heading', 'overview', 'summary'];\nconst IMAGE_KEYS = ['imageUrl', 'image', 'icon', 'symbol'];\nconst SKIP_KEYS = ['imageUrl', 'image']; // rendered separately, not in body rows\n\n// Hard cap on recursion. Real RoxyAPI responses nest at most 5-6 deep; anything\n// deeper is either a circular reference (which would otherwise infinite-loop)\n// or a payload too rich for the generic fallback to render usefully. The\n// recursion is otherwise safe: <roxy-data> is registered globally by its\n// `@customElement` decorator on import, so the nested template resolves to\n// this same class without a separate import.\nconst MAX_DEPTH = 6;\n\n@customElement('roxy-data')\nexport class RoxyData extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.roxy-card {\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-md, 1rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\n\t\t\t}\n\n\t\t\t.roxy-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 0 var(--roxy-space-sm, 0.5rem) 0;\n\t\t\t\tcolor: var(--roxy-primary, #0f172a);\n\t\t\t\tletter-spacing: var(--roxy-tracking-tight);\n\t\t\t}\n\n\t\t\t.roxy-summary {\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tmargin: 0 0 var(--roxy-space-md, 1rem) 0;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\n\t\t\tdl.roxy-rows {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: minmax(8ch, max-content) 1fr;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem) var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\tdl.roxy-rows dt {\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\ttext-transform: capitalize;\n\t\t\t}\n\t\t\tdl.roxy-rows dd {\n\t\t\t\tmargin: 0;\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tword-break: break-word;\n\t\t\t}\n\n\t\t\tul.roxy-chips {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem);\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\tlist-style: none;\n\t\t\t}\n\t\t\tul.roxy-chips li {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-accent, #f59e0b) 14%, transparent);\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t\tpadding: 2px 8px;\n\t\t\t\tborder-radius: var(--roxy-radius-full, 9999px);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t}\n\n\t\t\ttable.roxy-table {\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\t\t\ttable.roxy-table th,\n\t\t\ttable.roxy-table td {\n\t\t\t\tborder-bottom: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem);\n\t\t\t\ttext-align: left;\n\t\t\t\ttext-transform: none;\n\t\t\t}\n\t\t\ttable.roxy-table th {\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: capitalize;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tletter-spacing: 0.04em;\n\t\t\t}\n\n\t\t\t.roxy-image {\n\t\t\t\tmax-width: 100%;\n\t\t\t\theight: auto;\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tmargin-bottom: var(--roxy-space-md, 1rem);\n\t\t\t}\n\n\t\t\t.roxy-section {\n\t\t\t\tmargin-bottom: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.roxy-section h4 {\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tmargin: 0 0 var(--roxy-space-xs, 0.25rem) 0;\n\t\t\t\ttext-transform: capitalize;\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: Json = null;\n\n\t/**\n\t * Internal recursion depth. Nested <roxy-data> instances inherit this from\n\t * the parent and increment to guard against circular references in the\n\t * input. Not part of the public API; do not set from consumer code.\n\t */\n\t@property({ attribute: false })\n\tdepth = 0;\n\n\trender() {\n\t\tif (this.data == null) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t\t}\n\t\tif (this.depth >= MAX_DEPTH) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">\u2026</div>`;\n\t\t}\n\t\treturn html`<div\n\t\t\tclass=\"roxy-card\"\n\t\t\taria-label=\"Generic data display\"\n\t\t>\n\t\t\t${this.renderValue(this.data)}\n\t\t</div>`;\n\t}\n\n\tprivate renderValue(value: Json): TemplateResult | typeof nothing {\n\t\tif (value === null || value === undefined) return nothing;\n\t\tif (typeof value === 'string') return html`<p>${value}</p>`;\n\t\tif (typeof value === 'number' || typeof value === 'boolean') {\n\t\t\treturn html`<p>${String(value)}</p>`;\n\t\t}\n\t\tif (Array.isArray(value)) return this.renderArray(value);\n\t\treturn this.renderObject(value as Record<string, Json>);\n\t}\n\n\tprivate renderArray(arr: Json[]): TemplateResult {\n\t\tif (arr.length === 0) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">Empty list</div>`;\n\t\t}\n\t\tconst allPrimitive = arr.every(\n\t\t\t(v) => v === null || ['string', 'number', 'boolean'].includes(typeof v),\n\t\t);\n\t\tif (allPrimitive) {\n\t\t\treturn html`<ul class=\"roxy-chips\">\n\t\t\t\t${arr.map((v) => html`<li>${String(v)}</li>`)}\n\t\t\t</ul>`;\n\t\t}\n\t\tconst allObjects = arr.every(\n\t\t\t(v) => v !== null && typeof v === 'object' && !Array.isArray(v),\n\t\t);\n\t\tif (allObjects) return this.renderTable(arr as Record<string, Json>[]);\n\t\treturn html`<ol>\n\t\t\t${arr.map((v) => html`<li>${this.renderValue(v)}</li>`)}\n\t\t</ol>`;\n\t}\n\n\tprivate renderTable(rows: Record<string, Json>[]): TemplateResult {\n\t\tconst keys = this.collectKeys(rows);\n\t\treturn html`<table class=\"roxy-table\" role=\"table\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t${keys.map((k) => html`<th>${humanize(k)}</th>`)}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t${rows.map(\n\t\t\t\t\t(row) => html`<tr>\n\t\t\t\t\t\t${keys.map((k) => html`<td>${this.formatPrimitive(row[k])}</td>`)}\n\t\t\t\t\t</tr>`,\n\t\t\t\t)}\n\t\t\t</tbody>\n\t\t</table>`;\n\t}\n\n\tprivate renderObject(obj: Record<string, Json>): TemplateResult {\n\t\tconst titleKey = TITLE_KEYS.find((k) => typeof obj[k] === 'string');\n\t\tconst imageKey = IMAGE_KEYS.find(\n\t\t\t(k) =>\n\t\t\t\ttypeof obj[k] === 'string' && (obj[k] as string).startsWith('http'),\n\t\t);\n\t\tconst summaryKey =\n\t\t\ttitleKey !== 'summary' && typeof obj.summary === 'string'\n\t\t\t\t? 'summary'\n\t\t\t\t: null;\n\t\tconst rows = Object.entries(obj).filter(\n\t\t\t([k, v]) =>\n\t\t\t\tk !== titleKey &&\n\t\t\t\tk !== summaryKey &&\n\t\t\t\t!SKIP_KEYS.includes(k) &&\n\t\t\t\tv !== null &&\n\t\t\t\tv !== undefined,\n\t\t);\n\n\t\treturn html`\n\t\t\t${\n\t\t\t\timageKey\n\t\t\t\t\t? html`<img\n\t\t\t\t\t\tclass=\"roxy-image\"\n\t\t\t\t\t\tsrc=${String(obj[imageKey])}\n\t\t\t\t\t\talt=${titleKey ? String(obj[titleKey]) : 'illustration'}\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${titleKey ? html`<h3 class=\"roxy-title\">${obj[titleKey]}</h3>` : nothing}\n\t\t\t${summaryKey ? html`<p class=\"roxy-summary\">${obj[summaryKey]}</p>` : nothing}\n\t\t\t${\n\t\t\t\trows.length > 0\n\t\t\t\t\t? html`<dl class=\"roxy-rows\">\n\t\t\t\t\t\t${rows.map(\n\t\t\t\t\t\t\t([k, v]) => html`\n\t\t\t\t\t\t\t\t<dt>${humanize(k)}</dt>\n\t\t\t\t\t\t\t\t<dd>${this.renderField(v)}</dd>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</dl>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t`;\n\t}\n\n\tprivate renderField(value: Json): TemplateResult | string {\n\t\tif (value === null || value === undefined) return '';\n\t\tif (typeof value === 'string') return value;\n\t\tif (typeof value === 'number' || typeof value === 'boolean')\n\t\t\treturn String(value);\n\t\tif (Array.isArray(value)) {\n\t\t\tconst allPrimitive = value.every((v) =>\n\t\t\t\t['string', 'number', 'boolean'].includes(typeof v),\n\t\t\t);\n\t\t\tif (allPrimitive) {\n\t\t\t\treturn html`<ul class=\"roxy-chips\">\n\t\t\t\t\t${value.map((v) => html`<li>${String(v)}</li>`)}\n\t\t\t\t</ul>`;\n\t\t\t}\n\t\t}\n\t\treturn html`<roxy-data .data=${value} .depth=${this.depth + 1}></roxy-data>`;\n\t}\n\n\tprivate formatPrimitive(value: Json | undefined): string {\n\t\tif (value === null || value === undefined) return '';\n\t\tif (typeof value === 'string') return value;\n\t\tif (typeof value === 'number' || typeof value === 'boolean')\n\t\t\treturn String(value);\n\t\tif (Array.isArray(value)) return value.map(String).join(', ');\n\t\treturn JSON.stringify(value);\n\t}\n\n\tprivate collectKeys(rows: Record<string, Json>[]): string[] {\n\t\tconst seen = new Set<string>();\n\t\tfor (const row of rows) {\n\t\t\tfor (const k of Object.keys(row)) seen.add(k);\n\t\t}\n\t\treturn Array.from(seen);\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-data': RoxyData;\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 (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", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,YAAY,eAAoC;AACpE,SAAS,eAAe,gBAAgB;;;ACDxC,SAA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+FD;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GApGlB,SAqGZ;AAQA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA5GlB,SA6GZ;AA7GY,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;",
3
+ "sources": ["../../src/components/data.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts", "../../src/utils/string.ts"],
4
+ "sourcesContent": ["import { css, html, LitElement, nothing, type TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\nimport { humanize } from '../utils/string.js';\n\n/**\n * Generic fallback renderer. Accepts ANY OpenAPI response shape and renders\n * it via field-name heuristics so future spec additions render reasonably\n * without hand-wired components.\n *\n * Heuristic order:\n * 1. Primitive (string, number, boolean) -> single line.\n * 2. Array of primitives -> chip list.\n * 3. Array of objects with shared keys -> table.\n * 4. Object with title-like field -> card with key/value rows.\n * 5. Otherwise -> definition list of all keys.\n *\n * When a schema declares an `x-roxy-ui` hint, a future dispatcher can opt\n * into a hand-tuned component instead of this fallback.\n */\n\ntype Json = string | number | boolean | null | Json[] | { [key: string]: Json };\n\nconst TITLE_KEYS = ['title', 'name', 'label', 'heading', 'overview', 'summary'];\nconst IMAGE_KEYS = ['imageUrl', 'image', 'icon', 'symbol'];\nconst SKIP_KEYS = ['imageUrl', 'image']; // rendered separately, not in body rows\n\n// Hard cap on recursion. Real RoxyAPI responses nest at most 5-6 deep; anything\n// deeper is either a circular reference (which would otherwise infinite-loop)\n// or a payload too rich for the generic fallback to render usefully. The\n// recursion is otherwise safe: <roxy-data> is registered globally by its\n// `@customElement` decorator on import, so the nested template resolves to\n// this same class without a separate import.\nconst MAX_DEPTH = 6;\n\n@customElement('roxy-data')\nexport class RoxyData extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.roxy-card {\n\t\t\t\tbackground: var(--roxy-bg, #fff);\n\t\t\t\tborder: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tpadding: var(--roxy-space-md, 1rem);\n\t\t\t\tbox-shadow: var(--roxy-shadow-sm);\n\t\t\t}\n\n\t\t\t.roxy-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 0 var(--roxy-space-sm, 0.5rem) 0;\n\t\t\t\tcolor: var(--roxy-primary, #0f172a);\n\t\t\t\tletter-spacing: var(--roxy-tracking-tight);\n\t\t\t}\n\n\t\t\t.roxy-summary {\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tmargin: 0 0 var(--roxy-space-md, 1rem) 0;\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t}\n\n\t\t\tdl.roxy-rows {\n\t\t\t\tmargin: 0;\n\t\t\t\tdisplay: grid;\n\t\t\t\tgrid-template-columns: minmax(8ch, max-content) 1fr;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem) var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\tdl.roxy-rows dt {\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\ttext-transform: capitalize;\n\t\t\t}\n\t\t\tdl.roxy-rows dd {\n\t\t\t\tmargin: 0;\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tword-break: break-word;\n\t\t\t}\n\n\t\t\tul.roxy-chips {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tgap: var(--roxy-space-xs, 0.25rem);\n\t\t\t\tpadding: 0;\n\t\t\t\tmargin: 0;\n\t\t\t\tlist-style: none;\n\t\t\t}\n\t\t\tul.roxy-chips li {\n\t\t\t\tbackground: color-mix(in srgb, var(--roxy-accent, #f59e0b) 14%, transparent);\n\t\t\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\t\t\tpadding: 2px 8px;\n\t\t\t\tborder-radius: var(--roxy-radius-full, 9999px);\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t}\n\n\t\t\ttable.roxy-table {\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\t\t\ttable.roxy-table th,\n\t\t\ttable.roxy-table td {\n\t\t\t\tborder-bottom: 1px solid var(--roxy-border, #e4e4e7);\n\t\t\t\tpadding: var(--roxy-space-sm, 0.5rem);\n\t\t\t\ttext-align: left;\n\t\t\t\ttext-transform: none;\n\t\t\t}\n\t\t\ttable.roxy-table th {\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: capitalize;\n\t\t\t\tfont-size: var(--roxy-text-xs, 0.75rem);\n\t\t\t\tletter-spacing: 0.04em;\n\t\t\t}\n\n\t\t\t.roxy-image {\n\t\t\t\tmax-width: 100%;\n\t\t\t\theight: auto;\n\t\t\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t\t\t\tmargin-bottom: var(--roxy-space-md, 1rem);\n\t\t\t}\n\n\t\t\t.roxy-section {\n\t\t\t\tmargin-bottom: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.roxy-section h4 {\n\t\t\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tcolor: var(--roxy-secondary, #475569);\n\t\t\t\tmargin: 0 0 var(--roxy-space-xs, 0.25rem) 0;\n\t\t\t\ttext-transform: capitalize;\n\t\t\t}\n\t\t`,\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: Json = null;\n\n\t/**\n\t * Internal recursion depth. Nested <roxy-data> instances inherit this from\n\t * the parent and increment to guard against circular references in the\n\t * input. Not part of the public API; do not set from consumer code.\n\t */\n\t@property({ attribute: false })\n\tdepth = 0;\n\n\trender() {\n\t\tif (this.data == null) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t\t}\n\t\tif (this.depth >= MAX_DEPTH) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">\u2026</div>`;\n\t\t}\n\t\treturn html`<div\n\t\t\tclass=\"roxy-card\"\n\t\t\taria-label=\"Generic data display\"\n\t\t>\n\t\t\t${this.renderValue(this.data)}\n\t\t</div>`;\n\t}\n\n\tprivate renderValue(value: Json): TemplateResult | typeof nothing {\n\t\tif (value === null || value === undefined) return nothing;\n\t\tif (typeof value === 'string') return html`<p>${value}</p>`;\n\t\tif (typeof value === 'number' || typeof value === 'boolean') {\n\t\t\treturn html`<p>${String(value)}</p>`;\n\t\t}\n\t\tif (Array.isArray(value)) return this.renderArray(value);\n\t\treturn this.renderObject(value as Record<string, Json>);\n\t}\n\n\tprivate renderArray(arr: Json[]): TemplateResult {\n\t\tif (arr.length === 0) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">Empty list</div>`;\n\t\t}\n\t\tconst allPrimitive = arr.every(\n\t\t\t(v) => v === null || ['string', 'number', 'boolean'].includes(typeof v),\n\t\t);\n\t\tif (allPrimitive) {\n\t\t\treturn html`<ul class=\"roxy-chips\">\n\t\t\t\t${arr.map((v) => html`<li>${String(v)}</li>`)}\n\t\t\t</ul>`;\n\t\t}\n\t\tconst allObjects = arr.every(\n\t\t\t(v) => v !== null && typeof v === 'object' && !Array.isArray(v),\n\t\t);\n\t\tif (allObjects) return this.renderTable(arr as Record<string, Json>[]);\n\t\treturn html`<ol>\n\t\t\t${arr.map((v) => html`<li>${this.renderValue(v)}</li>`)}\n\t\t</ol>`;\n\t}\n\n\tprivate renderTable(rows: Record<string, Json>[]): TemplateResult {\n\t\tconst keys = this.collectKeys(rows);\n\t\treturn html`<table class=\"roxy-table\" role=\"table\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t${keys.map((k) => html`<th>${humanize(k)}</th>`)}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t${rows.map(\n\t\t\t\t\t(row) => html`<tr>\n\t\t\t\t\t\t${keys.map((k) => html`<td>${this.formatPrimitive(row[k])}</td>`)}\n\t\t\t\t\t</tr>`,\n\t\t\t\t)}\n\t\t\t</tbody>\n\t\t</table>`;\n\t}\n\n\tprivate renderObject(obj: Record<string, Json>): TemplateResult {\n\t\tconst titleKey = TITLE_KEYS.find((k) => typeof obj[k] === 'string');\n\t\tconst imageKey = IMAGE_KEYS.find(\n\t\t\t(k) =>\n\t\t\t\ttypeof obj[k] === 'string' && (obj[k] as string).startsWith('http'),\n\t\t);\n\t\tconst summaryKey =\n\t\t\ttitleKey !== 'summary' && typeof obj.summary === 'string'\n\t\t\t\t? 'summary'\n\t\t\t\t: null;\n\t\tconst rows = Object.entries(obj).filter(\n\t\t\t([k, v]) =>\n\t\t\t\tk !== titleKey &&\n\t\t\t\tk !== summaryKey &&\n\t\t\t\t!SKIP_KEYS.includes(k) &&\n\t\t\t\tv !== null &&\n\t\t\t\tv !== undefined,\n\t\t);\n\n\t\treturn html`\n\t\t\t${\n\t\t\t\timageKey\n\t\t\t\t\t? html`<img\n\t\t\t\t\t\tclass=\"roxy-image\"\n\t\t\t\t\t\tsrc=${String(obj[imageKey])}\n\t\t\t\t\t\talt=${titleKey ? String(obj[titleKey]) : 'illustration'}\n\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t/>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${titleKey ? html`<h3 class=\"roxy-title\">${obj[titleKey]}</h3>` : nothing}\n\t\t\t${summaryKey ? html`<p class=\"roxy-summary\">${obj[summaryKey]}</p>` : nothing}\n\t\t\t${\n\t\t\t\trows.length > 0\n\t\t\t\t\t? html`<dl class=\"roxy-rows\">\n\t\t\t\t\t\t${rows.map(\n\t\t\t\t\t\t\t([k, v]) => html`\n\t\t\t\t\t\t\t\t<dt>${humanize(k)}</dt>\n\t\t\t\t\t\t\t\t<dd>${this.renderField(v)}</dd>\n\t\t\t\t\t\t\t`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t</dl>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t`;\n\t}\n\n\tprivate renderField(value: Json): TemplateResult | string {\n\t\tif (value === null || value === undefined) return '';\n\t\tif (typeof value === 'string') return value;\n\t\tif (typeof value === 'number' || typeof value === 'boolean')\n\t\t\treturn String(value);\n\t\tif (Array.isArray(value)) {\n\t\t\tconst allPrimitive = value.every((v) =>\n\t\t\t\t['string', 'number', 'boolean'].includes(typeof v),\n\t\t\t);\n\t\t\tif (allPrimitive) {\n\t\t\t\treturn html`<ul class=\"roxy-chips\">\n\t\t\t\t\t${value.map((v) => html`<li>${String(v)}</li>`)}\n\t\t\t\t</ul>`;\n\t\t\t}\n\t\t}\n\t\treturn html`<roxy-data .data=${value} .depth=${this.depth + 1}></roxy-data>`;\n\t}\n\n\tprivate formatPrimitive(value: Json | undefined): string {\n\t\tif (value === null || value === undefined) return '';\n\t\tif (typeof value === 'string') return value;\n\t\tif (typeof value === 'number' || typeof value === 'boolean')\n\t\t\treturn String(value);\n\t\tif (Array.isArray(value)) return value.map(String).join(', ');\n\t\treturn JSON.stringify(value);\n\t}\n\n\tprivate collectKeys(rows: Record<string, Json>[]): string[] {\n\t\tconst seen = new Set<string>();\n\t\tfor (const row of rows) {\n\t\t\tfor (const k of Object.keys(row)) seen.add(k);\n\t\t}\n\t\treturn Array.from(seen);\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-data': RoxyData;\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 (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", "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", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([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AAAA;AAAA;AAAA;AA+FD;AAWA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA5GlB,SA6GZ;AAQA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GApHlB,SAqHZ;AArHY,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;",
6
6
  "names": ["css", "css"]
7
7
  }
@@ -11,6 +11,7 @@ import { type ChartStyle } from '../utils/kundli-render.js';
11
11
  */
12
12
  export declare class RoxyDivisionalChart extends LitElement {
13
13
  static styles: import("lit").CSSResult[];
14
+ constructor();
14
15
  data: DivisionalChartResponse | null;
15
16
  chartStyle: ChartStyle;
16
17
  private setStyle;
@@ -1 +1 @@
1
- {"version":3,"file":"divisional-chart.d.ts","sourceRoot":"","sources":["../../src/components/divisional-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EACN,KAAK,UAAU,EAKf,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;GAOG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,4BAyCX;IAGF,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAQ;IAG5C,UAAU,EAAE,UAAU,CAAW;IAEjC,OAAO,CAAC,QAAQ,CAEd;IAEF,OAAO,CAAC,SAAS;IAOjB,MAAM;CAoDN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,uBAAuB,EAAE,mBAAmB,CAAC;KAC7C;CACD"}
1
+ {"version":3,"file":"divisional-chart.d.ts","sourceRoot":"","sources":["../../src/components/divisional-chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EACN,KAAK,UAAU,EAKf,MAAM,2BAA2B,CAAC;AAInC;;;;;;;GAOG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IAClD,MAAM,CAAC,MAAM,4BAyCX;;IAWF,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAQ;IAG5C,UAAU,EAAE,UAAU,CAAW;IAEjC,OAAO,CAAC,QAAQ,CAEd;IAEF,OAAO,CAAC,SAAS;IAOjB,MAAM;CAoDN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,uBAAuB,EAAE,mBAAmB,CAAC;KAC7C;CACD"}