@roxyapi/ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cdn/components/ashtakavarga-grid.js +3 -362
- package/dist/cdn/components/ashtakavarga-grid.js.map +2 -2
- package/dist/cdn/components/biorhythm-chart.js +2 -225
- package/dist/cdn/components/biorhythm-chart.js.map +2 -2
- package/dist/cdn/components/choghadiya-grid.js +2 -231
- package/dist/cdn/components/choghadiya-grid.js.map +2 -2
- package/dist/cdn/components/compatibility-card.js +2 -230
- package/dist/cdn/components/compatibility-card.js.map +2 -2
- package/dist/cdn/components/dasha-timeline.js +3 -283
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/data.js +3 -230
- package/dist/cdn/components/data.js.map +2 -2
- package/dist/cdn/components/divisional-chart.js +3 -356
- package/dist/cdn/components/divisional-chart.js.map +4 -4
- package/dist/cdn/components/dosha-card.js +2 -225
- package/dist/cdn/components/dosha-card.js.map +2 -2
- package/dist/cdn/components/endpoint-form.js +2 -243
- package/dist/cdn/components/endpoint-form.js.map +2 -2
- package/dist/cdn/components/guna-milan.js +2 -269
- package/dist/cdn/components/guna-milan.js.map +2 -2
- package/dist/cdn/components/hexagram.js +3 -247
- package/dist/cdn/components/hexagram.js.map +2 -2
- package/dist/cdn/components/horoscope-card.js +3 -281
- package/dist/cdn/components/horoscope-card.js.map +2 -2
- package/dist/cdn/components/kp-chart.js +2 -277
- package/dist/cdn/components/kp-chart.js.map +2 -2
- package/dist/cdn/components/kp-planets-table.js +2 -195
- package/dist/cdn/components/kp-planets-table.js.map +2 -2
- package/dist/cdn/components/kp-ruling-planets.js +2 -240
- package/dist/cdn/components/kp-ruling-planets.js.map +2 -2
- package/dist/cdn/components/location-search.js +2 -240
- package/dist/cdn/components/location-search.js.map +2 -2
- package/dist/cdn/components/moon-phase.js +3 -223
- package/dist/cdn/components/moon-phase.js.map +2 -2
- package/dist/cdn/components/nakshatra-card.js +2 -200
- package/dist/cdn/components/nakshatra-card.js.map +2 -2
- package/dist/cdn/components/natal-chart.js +3 -563
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +2 -232
- package/dist/cdn/components/numerology-card.js.map +2 -2
- package/dist/cdn/components/panchang-table.js +3 -220
- package/dist/cdn/components/panchang-table.js.map +2 -2
- package/dist/cdn/components/shadbala-table.js +3 -284
- package/dist/cdn/components/shadbala-table.js.map +2 -2
- package/dist/cdn/components/synastry-chart.js +2 -398
- package/dist/cdn/components/synastry-chart.js.map +2 -2
- package/dist/cdn/components/tarot-card.js +3 -261
- package/dist/cdn/components/tarot-card.js.map +2 -2
- package/dist/cdn/components/tarot-spread.js +2 -248
- package/dist/cdn/components/tarot-spread.js.map +2 -2
- package/dist/cdn/components/transits-table.js +3 -382
- package/dist/cdn/components/transits-table.js.map +4 -4
- package/dist/cdn/components/vedic-kundli.js +3 -305
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/vedic-planets-table.js +2 -202
- package/dist/cdn/components/vedic-planets-table.js.map +2 -2
- package/dist/cdn/components/western-planets-table.js +3 -192
- package/dist/cdn/components/western-planets-table.js.map +2 -2
- package/dist/cdn/components/yoga-list.js +2 -305
- package/dist/cdn/components/yoga-list.js.map +2 -2
- package/dist/cdn/roxy-ui.js +3 -5102
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/cdn/widgets.js +1 -114
- package/dist/components/ashtakavarga-grid.js +1 -577
- package/dist/components/ashtakavarga-grid.js.map +3 -3
- package/dist/components/biorhythm-chart.js +1 -378
- package/dist/components/biorhythm-chart.js.map +3 -3
- package/dist/components/choghadiya-grid.js +1 -397
- package/dist/components/choghadiya-grid.js.map +3 -3
- package/dist/components/compatibility-card.js +1 -359
- package/dist/components/compatibility-card.js.map +3 -3
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +1 -447
- package/dist/components/dasha-timeline.js.map +4 -4
- package/dist/components/data.js +1 -408
- package/dist/components/data.js.map +3 -3
- package/dist/components/divisional-chart.d.ts.map +1 -1
- package/dist/components/divisional-chart.js +1 -932
- package/dist/components/divisional-chart.js.map +4 -4
- package/dist/components/dosha-card.js +1 -339
- package/dist/components/dosha-card.js.map +3 -3
- package/dist/components/endpoint-form.js +1 -505
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/components/guna-milan.js +1 -420
- package/dist/components/guna-milan.js.map +3 -3
- package/dist/components/hexagram.js +1 -426
- package/dist/components/hexagram.js.map +3 -3
- package/dist/components/horoscope-card.js +1 -427
- package/dist/components/horoscope-card.js.map +3 -3
- package/dist/components/kp-chart.js +1 -441
- package/dist/components/kp-chart.js.map +3 -3
- package/dist/components/kp-planets-table.js +1 -292
- package/dist/components/kp-planets-table.js.map +3 -3
- package/dist/components/kp-ruling-planets.js +1 -334
- package/dist/components/kp-ruling-planets.js.map +3 -3
- package/dist/components/location-search.js +1 -461
- package/dist/components/location-search.js.map +3 -3
- package/dist/components/moon-phase.js +1 -373
- package/dist/components/moon-phase.js.map +3 -3
- package/dist/components/nakshatra-card.js +1 -290
- package/dist/components/nakshatra-card.js.map +3 -3
- package/dist/components/natal-chart.d.ts +0 -1
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +1 -1086
- package/dist/components/natal-chart.js.map +4 -4
- package/dist/components/numerology-card.js +1 -361
- package/dist/components/numerology-card.js.map +3 -3
- package/dist/components/panchang-table.js +1 -396
- package/dist/components/panchang-table.js.map +3 -3
- package/dist/components/shadbala-table.js +1 -459
- package/dist/components/shadbala-table.js.map +3 -3
- package/dist/components/synastry-chart.js +1 -704
- package/dist/components/synastry-chart.js.map +3 -3
- package/dist/components/tarot-card.js +1 -379
- package/dist/components/tarot-card.js.map +3 -3
- package/dist/components/tarot-spread.js +1 -356
- package/dist/components/tarot-spread.js.map +3 -3
- package/dist/components/transits-table.d.ts +2 -0
- package/dist/components/transits-table.d.ts.map +1 -1
- package/dist/components/transits-table.js +1 -594
- package/dist/components/transits-table.js.map +4 -4
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +1 -848
- package/dist/components/vedic-kundli.js.map +4 -4
- package/dist/components/vedic-planets-table.js +1 -414
- package/dist/components/vedic-planets-table.js.map +3 -3
- package/dist/components/western-planets-table.js +1 -409
- package/dist/components/western-planets-table.js.map +3 -3
- package/dist/components/yoga-list.js +1 -429
- package/dist/components/yoga-list.js.map +3 -3
- package/dist/index.cjs +1 -8726
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +1 -8706
- package/dist/index.js.map +4 -4
- package/dist/utils/disclosure.d.ts +16 -0
- package/dist/utils/disclosure.d.ts.map +1 -0
- package/dist/utils/kundli-render.d.ts.map +1 -1
- package/dist/utils/kundli-styles.d.ts.map +1 -1
- package/dist/utils/tablist.d.ts +44 -0
- package/dist/utils/tablist.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -1
- package/src/components/dasha-timeline.ts +10 -1
- package/src/components/divisional-chart.ts +2 -0
- package/src/components/natal-chart.ts +37 -62
- package/src/components/transits-table.ts +45 -18
- package/src/components/vedic-kundli.ts +2 -1
- package/src/utils/disclosure.ts +62 -0
- package/src/utils/kundli-render.ts +21 -35
- package/src/utils/kundli-styles.ts +0 -31
- package/src/utils/tablist.ts +124 -0
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/compatibility-card.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\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// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["css", "css"]
|
|
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`.card{background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);display:grid}.head{align-items:center;gap:var(--roxy-space-md,1rem);grid-template-columns:1fr auto;display:grid}.head h2{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);text-transform:capitalize;margin:0}.score{font-variant-numeric:tabular-nums;font-size:2rem;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);line-height:1}.rating{color:var(--roxy-secondary,#475569);font-size:var(--roxy-text-sm,.875rem)}.bar-row{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.bar{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:8px;overflow:hidden}.bar>span{background:var(--roxy-accent,#f59e0b);height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.bar-row>span:last-child{font-variant-numeric:tabular-nums;color:var(--roxy-muted,#71717a);text-align:right}.archetype{color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.lists{gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.lists h3{margin:0 0 var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.lists ul{padding-left:var(--roxy-space-md,1rem);margin:0}`,\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 class=\"card\" aria-label=\"${`Compatibility (${this.mode})`}\"><div class=\"head\"><h2>${this.mode} compatibility</h2><div>${\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} ${rating ? html`<div class=\"rating\">${rating}</div>` : nothing}</div></div>${\n\t\t\t\tObject.keys(breakdown).length > 0\n\t\t\t\t\t? html`<div role=\"list\">${Object.entries(breakdown).map(\n\t\t\t\t\t\t\t([k, v]) => html`<div class=\"bar-row\" role=\"listitem\"><span style=\"text-transform:capitalize\">${k}</span> <span class=\"bar\"><span style=\"width:${Math.max(0, Math.min(100, v))}%\"></span></span> <span>${formatNumber(v, 0)}</span></div>`,\n\t\t\t\t\t\t)}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tarchetype\n\t\t\t\t\t? html`<p><span class=\"archetype\">${archetype.label}</span> ${archetype.description ? html`\u00B7 ${archetype.description}` : nothing}</p>`\n\t\t\t\t\t: nothing\n\t\t\t} ${summary ? html`<p>${summary}</p>` : nothing} ${interpretation && !summary ? html`<p>${interpretation}</p>` : nothing} ${advice ? html`<p>${advice}</p>` : nothing} ${\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\tstrengths?.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Strengths</h3><ul>${strengths.map((s) => html`<li>${s}</li>`)}</ul></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\tchallenges?.length\n\t\t\t\t\t\t\t\t? html`<div><h3>Challenges</h3><ul>${challenges.map((s) => html`<li>${s}</li>`)}</ul></div>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t}</div>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tkeyAspects?.length\n\t\t\t\t\t? html`<div><h3 style=\"margin:0 0 .25rem;font-size:var(--roxy-text-xs);color:var(--roxy-muted);text-transform:uppercase;letter-spacing:.06em\">Key aspects</h3><ul style=\"margin:0;padding-left:1rem;font-size:var(--roxy-text-sm)\">${keyAspects.slice(0, 6).map((a) => html`<li>${formatAspect(a)}</li>`)}</ul></div>`\n\t\t\t\t\t: nothing\n\t\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`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\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": "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",
|
|
6
|
+
"names": ["css", "html", "LitElement", "nothing", "customElement", "property", "css", "baseStyles", "formatNumber", "value", "dp", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "RoxyCompatibilityCard", "LitElement", "MarkupDataController", "d", "out", "k", "v", "html", "score", "breakdown", "rating", "archetype", "advice", "summary", "interpretation", "strengths", "challenges", "keyAspects", "formatNumber", "nothing", "s", "a", "formatAspect", "baseStyles", "css", "__decorateClass", "property", "customElement", "aspect", "orb", "head"]
|
|
7
7
|
}
|
|
@@ -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;
|
|
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;AAM3B,KAAK,SAAS,GACX,uBAAuB,GACvB,sBAAsB,GACtB,oBAAoB,CAAC;AAIxB;;;;GAIG;AACH,qBACa,iBAAkB,SAAQ,UAAU;IAChD,MAAM,CAAC,MAAM,4BAqIX;;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;IAYlC,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,448 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
-
if (decorator = decorators[i])
|
|
7
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
-
if (kind && result) __defProp(target, key, result);
|
|
9
|
-
return result;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// packages/ui/src/components/dasha-timeline.ts
|
|
13
|
-
import { css as css2, html, LitElement, nothing } from "lit";
|
|
14
|
-
import { customElement, property } from "lit/decorators.js";
|
|
15
|
-
|
|
16
|
-
// packages/ui/src/utils/base-styles.ts
|
|
17
|
-
import { css } from "lit";
|
|
18
|
-
var baseStyles = css`
|
|
19
|
-
:host {
|
|
20
|
-
display: block;
|
|
21
|
-
container-type: inline-size;
|
|
22
|
-
font-family: var(
|
|
23
|
-
--roxy-font-sans,
|
|
24
|
-
system-ui,
|
|
25
|
-
-apple-system,
|
|
26
|
-
BlinkMacSystemFont,
|
|
27
|
-
'Segoe UI',
|
|
28
|
-
Roboto,
|
|
29
|
-
sans-serif
|
|
30
|
-
);
|
|
31
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
32
|
-
background: transparent;
|
|
33
|
-
font-size: var(--roxy-text-base, 1rem);
|
|
34
|
-
line-height: var(--roxy-leading-normal, 1.5);
|
|
35
|
-
animation: roxy-fade-in var(--roxy-motion-duration, 200ms)
|
|
36
|
-
var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
*,
|
|
40
|
-
*::before,
|
|
41
|
-
*::after {
|
|
42
|
-
box-sizing: border-box;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@keyframes roxy-fade-in {
|
|
46
|
-
from {
|
|
47
|
-
opacity: 0;
|
|
48
|
-
transform: translateY(2px);
|
|
49
|
-
}
|
|
50
|
-
to {
|
|
51
|
-
opacity: 1;
|
|
52
|
-
transform: translateY(0);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@media (prefers-reduced-motion: reduce) {
|
|
57
|
-
:host {
|
|
58
|
-
animation: none;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.roxy-skeleton {
|
|
63
|
-
background: linear-gradient(
|
|
64
|
-
90deg,
|
|
65
|
-
var(--roxy-border, #e4e4e7) 0%,
|
|
66
|
-
color-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,
|
|
67
|
-
var(--roxy-border, #e4e4e7) 100%
|
|
68
|
-
);
|
|
69
|
-
background-size: 200% 100%;
|
|
70
|
-
animation: roxy-shimmer 1.4s ease-in-out infinite;
|
|
71
|
-
border-radius: var(--roxy-radius-md, 8px);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@keyframes roxy-shimmer {
|
|
75
|
-
0% {
|
|
76
|
-
background-position: 200% 0;
|
|
77
|
-
}
|
|
78
|
-
100% {
|
|
79
|
-
background-position: -200% 0;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@media (prefers-reduced-motion: reduce) {
|
|
84
|
-
.roxy-skeleton {
|
|
85
|
-
animation: none;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.roxy-empty {
|
|
90
|
-
padding: var(--roxy-space-lg, 1.5rem);
|
|
91
|
-
color: var(--roxy-muted, #71717a);
|
|
92
|
-
text-align: center;
|
|
93
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
:host(:focus-within) .roxy-card {
|
|
97
|
-
outline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));
|
|
98
|
-
outline-offset: 2px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* Force the text-style variant on every Unicode glyph in the component.
|
|
102
|
-
* macOS and iOS substitute coloured emoji glyphs for the planetary and
|
|
103
|
-
* gender Unicode code points (Mars, Venus, Mercury, etc.) when the
|
|
104
|
-
* system colour-emoji font wins font selection. The text-style variant
|
|
105
|
-
* keeps glyphs monochrome so they inherit the surrounding fill colour
|
|
106
|
-
* and match the brand palette consistently across platforms.
|
|
107
|
-
*
|
|
108
|
-
* font-variant-emoji is part of CSS Fonts 4 (Safari 17+, Chrome 134+,
|
|
109
|
-
* Firefox 139+). On older browsers the rule is silently ignored.
|
|
110
|
-
*/
|
|
111
|
-
:host {
|
|
112
|
-
font-variant-emoji: text;
|
|
113
|
-
}
|
|
114
|
-
`;
|
|
115
|
-
|
|
116
|
-
// packages/ui/src/utils/format.ts
|
|
117
|
-
function formatNumber(value, dp = 1) {
|
|
118
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return "";
|
|
119
|
-
return value.toFixed(dp).replace(/\.?0+$/, "");
|
|
120
|
-
}
|
|
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
|
-
|
|
167
|
-
// packages/ui/src/components/dasha-timeline.ts
|
|
168
|
-
var RoxyDashaTimeline = class extends LitElement {
|
|
169
|
-
constructor() {
|
|
170
|
-
super();
|
|
171
|
-
this.data = null;
|
|
172
|
-
this.period = "current";
|
|
173
|
-
new MarkupDataController(this);
|
|
174
|
-
}
|
|
175
|
-
render() {
|
|
176
|
-
const d = this.data;
|
|
177
|
-
if (!d)
|
|
178
|
-
return html`<div class="roxy-empty" role="status">No dasha data</div>`;
|
|
179
|
-
const periods = this.collectPeriods(d);
|
|
180
|
-
const maxYears = periods.length ? Math.max(...periods.map((p) => p.durationYears)) : 0;
|
|
181
|
-
return html`<div class="wrap" aria-label="Dasha timeline">
|
|
182
|
-
<header class="head">
|
|
183
|
-
<h2 class="title">
|
|
184
|
-
${this.period === "major" ? "Vimshottari Mahadasha" : this.period === "sub" ? "Antardasha" : "Active dashas"}
|
|
185
|
-
</h2>
|
|
186
|
-
${"nakshatraName" in d && d.nakshatraName ? html`<div class="nakshatra">
|
|
187
|
-
Moon nakshatra: ${d.nakshatraName}
|
|
188
|
-
${"nakshatraLord" in d && d.nakshatraLord ? html`(lord ${d.nakshatraLord})` : nothing}
|
|
189
|
-
</div>` : nothing}
|
|
190
|
-
</header>
|
|
191
|
-
|
|
192
|
-
${this.renderBirthBalance(d)}
|
|
193
|
-
${this.period === "current" ? this.renderCurrent(d) : nothing}
|
|
194
|
-
${periods.length > 0 ? html`<div class="timeline" role="list">
|
|
195
|
-
${periods.map((p) => this.renderBar(p, maxYears))}
|
|
196
|
-
</div>` : nothing}
|
|
197
|
-
${this.renderActiveInterpretation(periods)}
|
|
198
|
-
</div>`;
|
|
199
|
-
}
|
|
200
|
-
renderBirthBalance(d) {
|
|
201
|
-
if (!("birthDashaBalance" in d) || !d.birthDashaBalance) return nothing;
|
|
202
|
-
const b = d.birthDashaBalance;
|
|
203
|
-
const lord = "nakshatraLord" in d && d.nakshatraLord ? d.nakshatraLord : "";
|
|
204
|
-
const yrs = b.years ?? 0;
|
|
205
|
-
const mo = b.months ?? 0;
|
|
206
|
-
const da = b.days ?? 0;
|
|
207
|
-
const parts = [];
|
|
208
|
-
if (yrs) parts.push(`${yrs}y`);
|
|
209
|
-
if (mo) parts.push(`${mo}m`);
|
|
210
|
-
if (da) parts.push(`${da}d`);
|
|
211
|
-
const remaining = parts.length ? parts.join(" ") : "0d";
|
|
212
|
-
return html`<p class="balance">
|
|
213
|
-
Birth dasha balance: ${remaining} of
|
|
214
|
-
${lord ? html`<strong>${lord}</strong>` : "the opening mahadasha"} remained at birth.
|
|
215
|
-
</p>`;
|
|
216
|
-
}
|
|
217
|
-
renderActiveInterpretation(periods) {
|
|
218
|
-
const active = periods.find((p) => this.isCurrent(p));
|
|
219
|
-
if (!active?.interpretation) return nothing;
|
|
220
|
-
return html`<details class="interp">
|
|
221
|
-
<summary>${active.planet} mahadasha interpretation</summary>
|
|
222
|
-
<p>${active.interpretation}</p>
|
|
223
|
-
</details>`;
|
|
224
|
-
}
|
|
225
|
-
renderCurrent(d) {
|
|
226
|
-
if (!("mahadasha" in d)) return nothing;
|
|
227
|
-
return html`<div class="current">
|
|
228
|
-
${"mahadasha" in d && d.mahadasha ? html`<div>
|
|
229
|
-
<span>Mahadasha</span>
|
|
230
|
-
<strong>${d.mahadasha.planet}</strong>
|
|
231
|
-
${"remainingInMahadasha" in d && d.remainingInMahadasha ? html`<small>${formatNumber(d.remainingInMahadasha.years + d.remainingInMahadasha.months / 12, 1)} years left</small>` : nothing}
|
|
232
|
-
</div>` : nothing}
|
|
233
|
-
${"antardasha" in d && d.antardasha ? html`<div>
|
|
234
|
-
<span>Antardasha</span>
|
|
235
|
-
<strong>${d.antardasha.planet}</strong>
|
|
236
|
-
${"remainingInAntardasha" in d && d.remainingInAntardasha ? html`<small>${formatNumber(d.remainingInAntardasha.years + d.remainingInAntardasha.months / 12, 1)} years left</small>` : nothing}
|
|
237
|
-
</div>` : nothing}
|
|
238
|
-
${"pratyantardasha" in d && d.pratyantardasha ? html`<div>
|
|
239
|
-
<span>Pratyantardasha</span>
|
|
240
|
-
<strong>${d.pratyantardasha.planet}</strong>
|
|
241
|
-
${"remainingInPratyantardasha" in d && d.remainingInPratyantardasha ? html`<small>${formatNumber(d.remainingInPratyantardasha.years + d.remainingInPratyantardasha.months / 12, 1)} years left</small>` : nothing}
|
|
242
|
-
</div>` : nothing}
|
|
243
|
-
</div>`;
|
|
244
|
-
}
|
|
245
|
-
collectPeriods(d) {
|
|
246
|
-
if ("mahadashas" in d && d.mahadashas?.length) return d.mahadashas;
|
|
247
|
-
if ("antardashas" in d && d.antardashas?.length) return d.antardashas;
|
|
248
|
-
return [];
|
|
249
|
-
}
|
|
250
|
-
/** True when the current wall-clock time falls between the period's start and end. */
|
|
251
|
-
isCurrent(p) {
|
|
252
|
-
if (!p.startDate || !p.endDate) return false;
|
|
253
|
-
const now = Date.now();
|
|
254
|
-
const start = Date.parse(p.startDate);
|
|
255
|
-
const end = Date.parse(p.endDate);
|
|
256
|
-
if (Number.isNaN(start) || Number.isNaN(end)) return false;
|
|
257
|
-
return now >= start && now < end;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Fractional progress (0..1) through a period at the current time. Used to
|
|
261
|
-
* draw a vertical "now" marker inside the active bar. Returns -1 outside the
|
|
262
|
-
* period so the caller can skip the marker.
|
|
263
|
-
*/
|
|
264
|
-
progressIn(p) {
|
|
265
|
-
if (!p.startDate || !p.endDate) return -1;
|
|
266
|
-
const start = Date.parse(p.startDate);
|
|
267
|
-
const end = Date.parse(p.endDate);
|
|
268
|
-
const now = Date.now();
|
|
269
|
-
if (Number.isNaN(start) || Number.isNaN(end) || now < start || now >= end || end <= start) {
|
|
270
|
-
return -1;
|
|
271
|
-
}
|
|
272
|
-
return (now - start) / (end - start);
|
|
273
|
-
}
|
|
274
|
-
renderBar(p, max) {
|
|
275
|
-
const years = p.durationYears;
|
|
276
|
-
const width = max > 0 ? years / max * 100 : 0;
|
|
277
|
-
const current = this.isCurrent(p);
|
|
278
|
-
const progress = current ? this.progressIn(p) : -1;
|
|
279
|
-
const trackClass = current ? "bar-track bar-now" : "bar-track";
|
|
280
|
-
return html`<div
|
|
281
|
-
class=${current ? "bar now" : "bar"}
|
|
282
|
-
role="listitem"
|
|
283
|
-
aria-current=${current ? "time" : "false"}
|
|
284
|
-
>
|
|
285
|
-
<span>
|
|
286
|
-
<strong>${p.planet}</strong>${current ? html`<span class="now-badge">Now</span>` : nothing}
|
|
287
|
-
</span>
|
|
288
|
-
<span class=${trackClass}>
|
|
289
|
-
<span class="bar-fill" style="width: ${width}%"></span>
|
|
290
|
-
${progress >= 0 ? html`<span
|
|
291
|
-
class="bar-progress"
|
|
292
|
-
style="left: ${progress * width}%"
|
|
293
|
-
aria-hidden="true"
|
|
294
|
-
></span>` : nothing}
|
|
295
|
-
</span>
|
|
296
|
-
<span class="dates">
|
|
297
|
-
${p.startDate ? formatYear(p.startDate) : ""}
|
|
298
|
-
${p.endDate ? html`- ${formatYear(p.endDate)}` : ""}
|
|
299
|
-
</span>
|
|
300
|
-
</div>`;
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
RoxyDashaTimeline.styles = [
|
|
304
|
-
baseStyles,
|
|
305
|
-
css2`
|
|
306
|
-
.wrap {
|
|
307
|
-
display: grid;
|
|
308
|
-
gap: var(--roxy-space-md, 1rem);
|
|
309
|
-
}
|
|
310
|
-
.head {
|
|
311
|
-
display: flex;
|
|
312
|
-
justify-content: space-between;
|
|
313
|
-
align-items: center;
|
|
314
|
-
flex-wrap: wrap;
|
|
315
|
-
gap: var(--roxy-space-sm, 0.5rem);
|
|
316
|
-
}
|
|
317
|
-
.title {
|
|
318
|
-
margin: 0;
|
|
319
|
-
font-size: var(--roxy-text-lg, 1.125rem);
|
|
320
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
321
|
-
}
|
|
322
|
-
.nakshatra {
|
|
323
|
-
color: var(--roxy-muted, #71717a);
|
|
324
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.current {
|
|
328
|
-
display: grid;
|
|
329
|
-
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
|
330
|
-
gap: var(--roxy-space-md, 1rem);
|
|
331
|
-
background: var(--roxy-bg, #fff);
|
|
332
|
-
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
333
|
-
border-radius: var(--roxy-radius-md, 8px);
|
|
334
|
-
padding: var(--roxy-space-md, 1rem);
|
|
335
|
-
box-shadow: var(--roxy-shadow-sm);
|
|
336
|
-
}
|
|
337
|
-
.current div span:first-child {
|
|
338
|
-
display: block;
|
|
339
|
-
color: var(--roxy-muted, #71717a);
|
|
340
|
-
font-size: var(--roxy-text-xs, 0.75rem);
|
|
341
|
-
text-transform: uppercase;
|
|
342
|
-
letter-spacing: 0.06em;
|
|
343
|
-
}
|
|
344
|
-
.current div strong {
|
|
345
|
-
font-size: var(--roxy-text-base, 1rem);
|
|
346
|
-
color: var(--roxy-fg, #0a0a0a);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.balance {
|
|
350
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
351
|
-
color: var(--roxy-muted, #71717a);
|
|
352
|
-
border-left: 2px solid var(--roxy-border, #e4e4e7);
|
|
353
|
-
padding-left: var(--roxy-space-sm, 0.5rem);
|
|
354
|
-
margin: 0;
|
|
355
|
-
}
|
|
356
|
-
.timeline {
|
|
357
|
-
display: grid;
|
|
358
|
-
gap: var(--roxy-space-xs, 0.25rem);
|
|
359
|
-
}
|
|
360
|
-
.bar {
|
|
361
|
-
display: grid;
|
|
362
|
-
grid-template-columns: 5rem 1fr 8rem;
|
|
363
|
-
gap: var(--roxy-space-sm, 0.5rem);
|
|
364
|
-
align-items: center;
|
|
365
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
366
|
-
}
|
|
367
|
-
.bar.now strong {
|
|
368
|
-
color: var(--roxy-accent-fg, #b45309);
|
|
369
|
-
}
|
|
370
|
-
.now-badge {
|
|
371
|
-
display: inline-block;
|
|
372
|
-
margin-left: 0.4em;
|
|
373
|
-
font-size: var(--roxy-text-xs, 0.75rem);
|
|
374
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
375
|
-
color: var(--roxy-accent-fg, #b45309);
|
|
376
|
-
text-transform: uppercase;
|
|
377
|
-
letter-spacing: 0.06em;
|
|
378
|
-
}
|
|
379
|
-
.bar-track {
|
|
380
|
-
position: relative;
|
|
381
|
-
height: 14px;
|
|
382
|
-
background: var(--roxy-border, #e4e4e7);
|
|
383
|
-
border-radius: var(--roxy-radius-full, 9999px);
|
|
384
|
-
overflow: hidden;
|
|
385
|
-
}
|
|
386
|
-
.bar-fill {
|
|
387
|
-
display: block;
|
|
388
|
-
height: 100%;
|
|
389
|
-
background: var(--roxy-accent, #f59e0b);
|
|
390
|
-
opacity: 0.45;
|
|
391
|
-
transition:
|
|
392
|
-
width var(--roxy-motion-duration, 200ms)
|
|
393
|
-
var(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
394
|
-
}
|
|
395
|
-
.bar-now .bar-fill {
|
|
396
|
-
opacity: 1;
|
|
397
|
-
}
|
|
398
|
-
.bar-progress {
|
|
399
|
-
position: absolute;
|
|
400
|
-
top: -2px;
|
|
401
|
-
bottom: -2px;
|
|
402
|
-
width: 2px;
|
|
403
|
-
background: var(--roxy-accent-fg, #b45309);
|
|
404
|
-
border-radius: 2px;
|
|
405
|
-
box-shadow: 0 0 0 2px
|
|
406
|
-
color-mix(in srgb, var(--roxy-accent, #f59e0b) 35%, transparent);
|
|
407
|
-
}
|
|
408
|
-
.dates {
|
|
409
|
-
color: var(--roxy-muted, #71717a);
|
|
410
|
-
font-size: var(--roxy-text-xs, 0.75rem);
|
|
411
|
-
font-variant-numeric: tabular-nums;
|
|
412
|
-
text-align: right;
|
|
413
|
-
}
|
|
414
|
-
details.interp {
|
|
415
|
-
border: 1px solid var(--roxy-border, #e4e4e7);
|
|
416
|
-
border-radius: var(--roxy-radius-md, 8px);
|
|
417
|
-
padding: var(--roxy-space-sm, 0.5rem) var(--roxy-space-md, 1rem);
|
|
418
|
-
background: var(--roxy-bg, #fff);
|
|
419
|
-
}
|
|
420
|
-
details.interp summary {
|
|
421
|
-
cursor: pointer;
|
|
422
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
423
|
-
font-weight: var(--roxy-weight-bold, 600);
|
|
424
|
-
}
|
|
425
|
-
details.interp p {
|
|
426
|
-
margin: var(--roxy-space-sm, 0.5rem) 0 0;
|
|
427
|
-
font-size: var(--roxy-text-sm, 0.875rem);
|
|
428
|
-
color: var(--roxy-muted, #71717a);
|
|
429
|
-
}
|
|
430
|
-
`
|
|
431
|
-
];
|
|
432
|
-
__decorateClass([
|
|
433
|
-
property({ attribute: false })
|
|
434
|
-
], RoxyDashaTimeline.prototype, "data", 2);
|
|
435
|
-
__decorateClass([
|
|
436
|
-
property({ type: String, reflect: true })
|
|
437
|
-
], RoxyDashaTimeline.prototype, "period", 2);
|
|
438
|
-
RoxyDashaTimeline = __decorateClass([
|
|
439
|
-
customElement("roxy-dasha-timeline")
|
|
440
|
-
], RoxyDashaTimeline);
|
|
441
|
-
function formatYear(s) {
|
|
442
|
-
const m = s.match(/^(\d{4})/);
|
|
443
|
-
return m ? m[1] : s;
|
|
444
|
-
}
|
|
445
|
-
export {
|
|
446
|
-
RoxyDashaTimeline
|
|
447
|
-
};
|
|
1
|
+
var $=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var p=(i,e,r,a)=>{for(var t=a>1?void 0:a?k(e,r):e,n=i.length-1,d;n>=0;n--)(d=i[n])&&(t=(a?d(e,r,t):d(t))||t);return a&&t&&$(e,r,t),t};import{css as I,html as s,LitElement as z,nothing as o}from"lit";import{customElement as A,property as g}from"lit/decorators.js";import{css as D}from"lit";var f=D`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;import{css as w,html as N}from"lit";function y(){return N`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var x=w`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;function h(i,e=1){return typeof i!="number"||!Number.isFinite(i)?"":i.toFixed(e).replace(/\.?0+$/,"")}var C="roxy-data";function S(i){return i.nodeName==="SCRIPT"&&i.getAttribute("type")==="application/json"}var u=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(S(e)&&e.classList.contains(C))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var c=class extends z{constructor(){super();this.data=null;this.period="current";new u(this)}render(){let r=this.data;if(!r)return s`<div class="roxy-empty" role="status">No dasha data</div>`;let a=this.collectPeriods(r),t=a.length?Math.max(...a.map(n=>n.durationYears)):0;return s`<div class="wrap" aria-label="Dasha timeline"><header class="head"><h2 class="title">${this.period==="major"?"Vimshottari Mahadasha":this.period==="sub"?"Antardasha":"Active dashas"}</h2>${"nakshatraName"in r&&r.nakshatraName?s`<div class="nakshatra">Moon nakshatra: ${r.nakshatraName} ${"nakshatraLord"in r&&r.nakshatraLord?s`(lord ${r.nakshatraLord})`:o}</div>`:o}</header>${this.renderBirthBalance(r)} ${this.period==="current"?this.renderCurrent(r):o} ${a.length>0?s`<div class="timeline" role="list">${a.map(n=>this.renderBar(n,t))}</div>`:o} ${this.renderActiveInterpretation(a)}</div>`}renderBirthBalance(r){if(!("birthDashaBalance"in r)||!r.birthDashaBalance)return o;let a=r.birthDashaBalance,t="nakshatraLord"in r&&r.nakshatraLord?r.nakshatraLord:"",n=a.years??0,d=a.months??0,l=a.days??0,m=[];n&&m.push(`${n}y`),d&&m.push(`${d}m`),l&&m.push(`${l}d`);let b=m.length?m.join(" "):"0d";return s`<p class="balance">Birth dasha balance: ${b} of ${t?s`<strong>${t}</strong>`:"the opening mahadasha"} remained at birth.</p>`}renderActiveInterpretation(r){let a=r.find(t=>this.isCurrent(t));return a?.interpretation?s`<details class="interp"><summary><span>${a.planet} mahadasha interpretation</span> ${y()}</summary><p>${a.interpretation}</p></details>`:o}renderCurrent(r){return"mahadasha"in r?s`<div class="current">${"mahadasha"in r&&r.mahadasha?s`<div><span>Mahadasha</span> <strong>${r.mahadasha.planet}</strong> ${"remainingInMahadasha"in r&&r.remainingInMahadasha?s`<small>${h(r.remainingInMahadasha.years+r.remainingInMahadasha.months/12,1)} years left</small>`:o}</div>`:o} ${"antardasha"in r&&r.antardasha?s`<div><span>Antardasha</span> <strong>${r.antardasha.planet}</strong> ${"remainingInAntardasha"in r&&r.remainingInAntardasha?s`<small>${h(r.remainingInAntardasha.years+r.remainingInAntardasha.months/12,1)} years left</small>`:o}</div>`:o} ${"pratyantardasha"in r&&r.pratyantardasha?s`<div><span>Pratyantardasha</span> <strong>${r.pratyantardasha.planet}</strong> ${"remainingInPratyantardasha"in r&&r.remainingInPratyantardasha?s`<small>${h(r.remainingInPratyantardasha.years+r.remainingInPratyantardasha.months/12,1)} years left</small>`:o}</div>`:o}</div>`:o}collectPeriods(r){return"mahadashas"in r&&r.mahadashas?.length?r.mahadashas:"antardashas"in r&&r.antardashas?.length?r.antardashas:[]}isCurrent(r){if(!r.startDate||!r.endDate)return!1;let a=Date.now(),t=Date.parse(r.startDate),n=Date.parse(r.endDate);return Number.isNaN(t)||Number.isNaN(n)?!1:a>=t&&a<n}progressIn(r){if(!r.startDate||!r.endDate)return-1;let a=Date.parse(r.startDate),t=Date.parse(r.endDate),n=Date.now();return Number.isNaN(a)||Number.isNaN(t)||n<a||n>=t||t<=a?-1:(n-a)/(t-a)}renderBar(r,a){let t=r.durationYears,n=a>0?t/a*100:0,d=this.isCurrent(r),l=d?this.progressIn(r):-1,m=d?"bar-track bar-now":"bar-track";return s`<div class="${d?"bar now":"bar"}" role="listitem" aria-current="${d?"time":"false"}"><span><strong>${r.planet}</strong>${d?s`<span class="now-badge">Now</span>`:o} </span><span class="${m}"><span class="bar-fill" style="width:${n}%"></span> ${l>=0?s`<span class="bar-progress" style="left:${l*n}%" aria-hidden="true"></span>`:o} </span><span class="dates">${r.startDate?v(r.startDate):""} ${r.endDate?s`- ${v(r.endDate)}`:""}</span></div>`}};c.styles=[f,x,I`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.nakshatra{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}.current{gap:var(--roxy-space-md,1rem);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);box-shadow:var(--roxy-shadow-sm);grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));display:grid}.current div span:first-child{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:block}.current div strong{font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a)}.balance{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);border-left:2px solid var(--roxy-border,#e4e4e7);padding-left:var(--roxy-space-sm,.5rem);margin:0}.timeline{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:5rem 1fr 8rem;align-items:center;display:grid}.bar.now strong{color:var(--roxy-accent-fg,#b45309)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.bar-track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.bar-fill{background:var(--roxy-accent,#f59e0b);opacity:.45;height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.bar-now .bar-fill{opacity:1}.bar-progress{background:var(--roxy-accent-fg,#b45309);width:2px;box-shadow:0 0 0 2px color-mix(in srgb, var(--roxy-accent,#f59e0b) 35%, transparent);border-radius:2px;position:absolute;top:-2px;bottom:-2px}.dates{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);font-variant-numeric:tabular-nums;text-align:right}details.interp{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);background:var(--roxy-bg,#fff)}details.interp summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);display:flex}details.interp p{margin:var(--roxy-space-sm,.5rem) 0 0;font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a)}`],p([g({attribute:!1})],c.prototype,"data",2),p([g({type:String,reflect:!0})],c.prototype,"period",2),c=p([A("roxy-dasha-timeline")],c);function v(i){let e=i.match(/^(\d{4})/);return e?e[1]:i}export{c as RoxyDashaTimeline};
|
|
448
2
|
//# sourceMappingURL=dasha-timeline.js.map
|