@roxyapi/ui 0.25.0 → 0.26.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/AGENTS.md +3 -1
- package/README.md +9 -1
- package/components-catalog.json +125 -125
- package/dist/cdn/components/endpoint-form.js +1 -1
- package/dist/cdn/components/endpoint-form.js.map +1 -1
- package/dist/cdn/components/natal-chart.js.map +2 -2
- package/dist/cdn/components/relocation-wheel.js.map +2 -2
- package/dist/cdn/components/transit-wheel.js +12 -12
- package/dist/cdn/components/transit-wheel.js.map +3 -3
- package/dist/cdn/locales/de.js +1 -1
- package/dist/cdn/locales/de.js.map +2 -2
- package/dist/cdn/locales/es.js +1 -1
- package/dist/cdn/locales/es.js.map +2 -2
- package/dist/cdn/locales/fr.js +1 -1
- package/dist/cdn/locales/fr.js.map +2 -2
- package/dist/cdn/locales/hi.js +1 -1
- package/dist/cdn/locales/hi.js.map +2 -2
- package/dist/cdn/locales/pt.js +1 -1
- package/dist/cdn/locales/pt.js.map +2 -2
- package/dist/cdn/locales/ru.js +1 -1
- package/dist/cdn/locales/ru.js.map +2 -2
- package/dist/cdn/locales/tr.js +1 -1
- package/dist/cdn/locales/tr.js.map +2 -2
- package/dist/cdn/roxy-ui.js +17 -17
- package/dist/cdn/roxy-ui.js.map +3 -3
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +1 -1
- package/dist/components/natal-chart.d.ts +4 -0
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js.map +2 -2
- package/dist/components/relocation-wheel.js.map +2 -2
- package/dist/components/transit-wheel.d.ts +79 -37
- package/dist/components/transit-wheel.d.ts.map +1 -1
- package/dist/components/transit-wheel.js +11 -11
- package/dist/components/transit-wheel.js.map +3 -3
- package/dist/i18n/chrome-strings.d.ts +1 -1
- package/dist/i18n/chrome-strings.d.ts.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +5 -5
- package/dist/index.js.map +3 -3
- package/dist/locales/de.d.ts.map +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/de.js.map +2 -2
- package/dist/locales/es.d.ts.map +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/es.js.map +2 -2
- package/dist/locales/fr.d.ts.map +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/fr.js.map +2 -2
- package/dist/locales/hi.d.ts.map +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/hi.js.map +2 -2
- package/dist/locales/pt.d.ts.map +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/pt.js.map +2 -2
- package/dist/locales/ru.d.ts.map +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/ru.js.map +2 -2
- package/dist/locales/tr.d.ts.map +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/tr.js.map +2 -2
- package/dist/types/types.gen.d.ts +46 -0
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/natal-chart.ts +11 -1
- package/src/components/transit-wheel.ts +115 -49
- package/src/i18n/chrome-strings.ts +1 -0
- package/src/locales/de.ts +1 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +1 -0
- package/src/locales/hi.ts +1 -0
- package/src/locales/pt.ts +1 -0
- package/src/locales/ru.ts +1 -0
- package/src/locales/tr.ts +1 -0
- package/src/types/types.gen.ts +46 -0
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/transit-wheel.ts", "../../src/utils/string.ts", "../../src/tokens/index.ts", "../../src/utils/base-element.ts", "../../src/i18n/lang.ts", "../../src/i18n/registry.ts", "../../src/i18n/locale-controller.ts", "../../src/utils/base-styles.ts", "../../src/utils/key-guard.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/interp-accordion.ts", "../../src/utils/disclosure.ts", "../../src/utils/markup-data.ts", "../../src/utils/degree.ts", "../../src/utils/format.ts", "../../src/utils/localized.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { planetGlyph, SIGNS_ORDER, signGlyph } from '../tokens/index.js';\nimport type {\n\tCalculateTransitAspectsResponse,\n\tNatalChartResponse,\n} from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\tarcMidpoint,\n\tarcSeparation,\n\tfanOut,\n\tlongitudeToSignPosition,\n\tnormalizeLongitude,\n\toppositePoint,\n\tpolarToCartesian,\n} from '../utils/degree.js';\nimport { disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatAspectName,\n\tformatDateTime,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport {\n\ttype InterpSection,\n\tinterpAccordionStyles,\n} from '../utils/interp-accordion.js';\nimport { display } from '../utils/localized.js';\nimport { capitalize } from '../utils/string.js';\n\ntype Body = CalculateTransitAspectsResponse['transitPlanets'][number];\ntype TransitAspect = CalculateTransitAspectsResponse['aspects'][number];\ntype TransitSummary = CalculateTransitAspectsResponse['summary'];\n\n/**\n * Radii, outermost first. Every one is explicit rather than derived from its\n * neighbour, because the two rings of glyphs and their two bands of degree\n * labels have to interleave without touching, and an offset-from-the-last-ring\n * scheme hides which pair is actually the tight one.\n */\nconst SIZE = 400;\nconst CENTER = SIZE / 2;\n/** ASC/DSC label. Inside the rim by more than half the label width, or the axis text clips on the viewBox edge. */\nconst AXIS_LABEL_R = 184;\n/** Outer rim of the zodiac band. */\nconst OUTER_R = 170;\n/** Sign glyphs, and the inner edge of the band that holds them. */\nconst SIGN_R = 154;\nconst BAND_R = 140;\n/** Transiting bodies: the OUTER ring, which is how a bi-wheel is read. Degree labels sit outward, into the free space under the sign band. */\nconst TRANSIT_R = 124;\nconst TRANSIT_DEG_R = 135;\n/** Natal bodies: the INNER ring, the chart being transited. Degree labels sit inward, so the two bands of numbers never meet. */\nconst NATAL_R = 94;\nconst NATAL_DEG_R = 83;\n/** Aspect lines run between the rings: out of the transit ring, in to the natal one. */\nconst TRANSIT_LINE_R = 112;\nconst NATAL_LINE_R = 104;\n/** Innermost circle, closing the wheel under the natal degree labels. */\nconst HUB_R = 70;\n/** House sector numbers, inside the hub: the only band on this wheel with nothing else in it. Drawn ONLY from cusps the page supplied. */\nconst HOUSE_NUM_R = 58;\n/**\n * Widths a fanned cluster has to clear. The glyph is the wider mark but sits on\n * the larger radius, and the degree label is narrower on a smaller one, so which\n * of the two actually binds depends on the ring and neither can be assumed.\n */\nconst GLYPH_WIDTH = 13;\nconst DEG_LABEL_WIDTH = 15;\n/** Leader line: a tick at the body's true longitude, and the foot of the line beside the displaced glyph. Both offsets are measured from the ring, signed so the leader always runs into the gap between the two rings. */\nconst LEADER_TICK = 8;\nconst LEADER_FOOT = 4;\n\n/**\n * Glyph for an API body, or the name a reader sees when the library has none: the SVG ring position is the sole identifier for that body, so a miss must stay visibly wrong rather than a plausible fabricated abbreviation.\n *\n * Two arguments because the two halves answer to different languages. `name` is the canonical English value the glyph table is keyed on and must stay English; `label` is what is left ON SCREEN when that lookup misses, so it is the localized one.\n */\nconst glyphFor = (name: string, label: string): string =>\n\tplanetGlyph(name) ?? label;\n\n/** `12\u00B034'` from a raw ecliptic longitude, the form a practitioner reads off a wheel. */\nconst degLabel = (longitude: number): string => {\n\tconst sp = longitudeToSignPosition(longitude);\n\treturn `${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'`;\n};\n\n/**\n * Round a 0-100 score for display. Not `formatNumber(v, 0)`, which strips\n * trailing zeros from the formatted string and would render a strength of 100\n * as \"1\". Same local helper, and the same reason, as `roxy-aspects-table`.\n */\nconst score = (v: unknown): string =>\n\ttypeof v === 'number' && Number.isFinite(v) ? String(Math.round(v)) : '';\n\n/** Bodies keyed by their canonical ENGLISH name, so an aspect or a table row can find a longitude without rescanning the array. The API keeps `name` English in every language for exactly this, and keying on `nameLocalized` would resolve nothing on a translated page. */\nconst byName = (list: Body[]): Map<string, Body> => {\n\tconst m = new Map<string, Body>();\n\tfor (const p of list) m.set(capitalize(p.name), p);\n\treturn m;\n};\n\n/**\n * Natal and transit bi-wheel: the natal chart on the inner ring, the transiting\n * bodies on the outer ring, and a line for every transit-to-natal aspect the\n * response returns. Pass `data` from /astrology/transit-aspects.\n *\n * @remarks\n * **Nothing astrological is computed here.** Every aspect line is drawn from an\n * entry in the response `aspects` array; the only arithmetic is placing a\n * longitude on a circle. `planet1` is the TRANSITING body and `planet2` the\n * NATAL one, which was settled empirically rather than from the field\n * description because reading them the other way round still draws a\n * plausible-looking wheel: against a live response every one of the 70 returned\n * orbs reconciles with the transit-to-natal separation, and only 4 with the\n * reverse.\n *\n * **The response carries real houses, and it did not always.** Every body comes\n * back with a `house` read against the NATAL cusps (a transiting body reports the\n * natal house it is currently passing through) plus a top-level `houseSystem`.\n * Verified live on 2026-08-08: the fourteen natal house numbers reconcile body\n * for body with /astrology/natal-chart for the same birth data, and requesting\n * `whole-sign` moves them. An earlier revision of the API did return `1` for\n * every body, and the comment saying so outlived the fix and went on justifying a\n * missing House column for months. The numbers are rendered, in their own\n * columns, labelled with the system the response names.\n *\n * **What is still absent is the GEOMETRY, and that is why the default wheel has\n * no house ring.** The response carries no ascendant and no cusp longitudes, so a\n * house number is a placement with no sector to draw it in. Equal sectors derived\n * from {@link RoxyTransitWheel.ascendant} and labelled with a quadrant system\n * would replace one false statement with a worse one, so the default wheel fixes\n * 0 degrees Aries on the left horizon, says so in the legend and in the SVG\n * description rather than leaving a reader to discover it, and draws no house\n * divisions at all. A host that holds the real cusps (from /astrology/natal-chart,\n * which returns all twelve) passes {@link RoxyTransitWheel.houses} and gets the\n * sector ring. Both props are supplied data placed on a circle, never a cusp this\n * component worked out.\n */\n@customElement('roxy-transit-wheel')\nexport class RoxyTransitWheel extends RoxyDataElement<CalculateTransitAspectsResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tinterpAccordionStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);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);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;max-width:var(--roxy-chart-max-width,560px);aspect-ratio:1;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.natal-glyph{fill:var(--roxy-accent-ink,#b45309);font-size:13px;font-weight:600;font-family:var(--roxy-font-sans)}.transit-glyph{fill:var(--roxy-info,#0284c7);font-size:13px;font-weight:600;font-family:var(--roxy-font-sans)}.leader{stroke:currentColor;stroke-width:.6px;opacity:.6}.leader.natal-glyph{stroke:var(--roxy-accent-ink,#b45309)}.leader.transit-glyph{stroke:var(--roxy-info,#0284c7)}.planet-deg{fill:var(--roxy-muted,#71717a);font-size:7px;font-family:var(--roxy-font-sans)}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}@container (width<=480px){.sign-glyph,.natal-glyph,.transit-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.house-cusp{stroke:var(--roxy-secondary,#475569);stroke-width:1px;stroke-dasharray:3 3}.house-num{fill:var(--roxy-secondary,#475569);font-size:9px;font-family:var(--roxy-font-sans)}.axis-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1.5px}.axis-label{fill:var(--roxy-accent-ink,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.aspect{stroke-width:.8px;fill:none;opacity:.55}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-ink,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.4}.swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.swatch--natal{background:var(--roxy-accent-ink,#b45309)}.swatch--transit{background:var(--roxy-info,#0284c7)}.swatch--harmonious{background:var(--roxy-success,#16a34a)}.swatch--challenging{background:var(--roxy-danger,#dc2626)}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.summary-pills{gap:var(--roxy-space-sm,.5rem);margin-bottom:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.pill{padding:2px var(--roxy-space-sm,.5rem);border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);border:1px solid;align-items:center;gap:4px;display:inline-flex}.pill--muted{color:var(--roxy-fg,#0a0a0a);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent)}.pill--success{color:var(--roxy-success-fg,#166534);background:color-mix(in srgb, var(--roxy-success,#16a34a) 10%, transparent)}.pill--danger{color:var(--roxy-danger-fg,#991b1b);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent)}.strongest{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);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;align-items:center;gap:.4rem;display:flex}.strongest .label{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;font-weight:var(--roxy-weight-bold,600)}.strongest .meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);font-variant-numeric:tabular-nums;margin-left:auto}.glyph{font-size:1.1em;line-height:1}.nature-badge{font-size:var(--roxy-text-xs,.75rem);text-transform:capitalize;border-radius:9999px;padding:1px 8px;font-weight:600;display:inline-block}.nature-badge.harmonious{background:color-mix(in srgb, var(--roxy-success,#16a34a) 12%, transparent);color:var(--roxy-success-fg,#166534)}.nature-badge.challenging{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);color:var(--roxy-danger-fg,#991b1b)}.nature-badge.neutral{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:left;white-space:nowrap}thead th{color:var(--roxy-muted,#71717a);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}th{font-weight:var(--roxy-weight-bold,600)}td{font-variant-numeric:tabular-nums}.retro-badge{color:var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600);margin-left:.25rem}.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}`,\n\t];\n\n\t/** Heading above the wheel. The default is translated; a heading the page sets is passed through the catalogue too, so a host that supplies its own English wording still gets it localized when one is registered for it. */\n\t@property({ type: String })\n\theading = 'Transits';\n\n\t/**\n\t * Natal Ascendant as an ecliptic longitude in degrees (0-360), supplied by the\n\t * page from a chart endpoint that returns one.\n\t *\n\t * @remarks\n\t * /astrology/transit-aspects returns no ascendant, so this is the only way the\n\t * wheel can sit on a real horizon. Setting it ROTATES the wheel so the given\n\t * longitude falls on the left horizon and draws the ASC/DSC axis. It draws no\n\t * house divisions, because a rotation is not a cusp; that is what\n\t * {@link RoxyTransitWheel.houses} is for. Leave both unset for the honest\n\t * default: 0 degrees Aries on the left.\n\t */\n\t@property({ type: Number })\n\tascendant?: number;\n\n\t/**\n\t * The twelve natal house cusps, supplied by the page. Takes the\n\t * /astrology/natal-chart `houses` array verbatim, or twelve bare cusp\n\t * longitudes in house order.\n\t *\n\t * @remarks\n\t * /astrology/transit-aspects numbers every body by house but returns no cusp\n\t * longitudes, so this is the only way the wheel can draw the sectors those\n\t * numbers refer to. Supplying it draws the twelve cusp lines and their numbers\n\t * and, unless {@link RoxyTransitWheel.ascendant} also arrives, rotates the\n\t * first cusp onto the left horizon.\n\t *\n\t * Both accepted shapes exist because the natural source is a natal-chart\n\t * response a host already holds, and passing `chart.houses` straight through\n\t * has to work; twelve numbers is the terser form for a host that stored only\n\t * the longitudes. Anything that does not resolve to houses 1 to 12 with finite\n\t * longitudes is ignored outright rather than half drawn, which is the same\n\t * degrade-honestly rule the rest of this component follows: a partial house\n\t * ring is a claim about placements the wheel cannot support.\n\t */\n\t@property({ type: Array })\n\thouses?: NatalChartResponse['houses'] | number[];\n\n\t/** True when the page supplied a usable ascendant, so the ASC/DSC axis is a value the host gave rather than one derived from a cusp. */\n\tprivate get ascendantGiven(): boolean {\n\t\treturn (\n\t\t\ttypeof this.ascendant === 'number' && Number.isFinite(this.ascendant)\n\t\t);\n\t}\n\n\t/**\n\t * The supplied cusps, normalized to houses 1 to 12 in order, or null.\n\t *\n\t * @remarks\n\t * Sorted by house number rather than trusted in array order, and rejected\n\t * whole unless the twelve numbers are exactly 1 to 12 with finite longitudes.\n\t * A cusp set that fails either check is not a house division, and drawing part\n\t * of one would put a sector boundary where the host never claimed there was\n\t * one.\n\t */\n\tprivate get cusps(): Array<{ number: number; longitude: number }> | null {\n\t\tconst raw = this.houses;\n\t\tif (!Array.isArray(raw) || raw.length !== 12) return null;\n\t\tconst out = raw\n\t\t\t.map((h, i) =>\n\t\t\t\ttypeof h === 'number'\n\t\t\t\t\t? { number: i + 1, longitude: h }\n\t\t\t\t\t: { number: Number(h?.number), longitude: Number(h?.longitude) },\n\t\t\t)\n\t\t\t.sort((a, b) => a.number - b.number);\n\t\tconst complete = out.every(\n\t\t\t(c, i) => c.number === i + 1 && Number.isFinite(c.longitude),\n\t\t);\n\t\treturn complete ? out : null;\n\t}\n\n\t/**\n\t * Ecliptic longitude to SVG angle. 0 degrees is at 3 o'clock and positive\n\t * angles run clockwise on screen, so subtracting the longitude makes the\n\t * zodiac run counterclockwise, which is how a chart wheel is read. The 180\n\t * offset puts the reference point on the left horizon: the supplied Ascendant\n\t * first, else the supplied first house cusp, else 0 Aries.\n\t *\n\t * The Ascendant wins because the two are not the same longitude under every\n\t * system: whole-sign puts cusp 1 at 0 degrees of the rising sign, which can be\n\t * most of a sign away from the Ascendant itself.\n\t */\n\tprivate toAngle(longitude: number): number {\n\t\tconst origin = this.ascendantGiven\n\t\t\t? (this.ascendant as number)\n\t\t\t: (this.cusps?.[0]?.longitude ?? 0);\n\t\treturn 180 + origin - longitude;\n\t}\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No transit data')}</div>`;\n\t}\n\n\tprotected renderData(d: CalculateTransitAspectsResponse) {\n\t\tconst natal = d.natalPlanets ?? [];\n\t\tconst transit = d.transitPlanets ?? [];\n\t\tconst aspects = d.aspects ?? [];\n\t\tconst when = formatDateTime(this.effectiveLang(), d.transitDate);\n\t\t// Label then number, at every count and in every language: the catalogue\n\t\t// carries no plural rules, so \"1 aspects\" is the alternative in English and\n\t\t// three wrong endings are the alternative in Russian.\n\t\tconst count =\n\t\t\taspects.length > 0\n\t\t\t\t? this.t('Aspects to the natal chart: {{count}}', {\n\t\t\t\t\t\tcount: aspects.length,\n\t\t\t\t\t})\n\t\t\t\t: '';\n\t\t// The House columns and the house-system chip both stand on the SAME fact:\n\t\t// that a body came back with a house. Derived once from the payload rather\n\t\t// than assumed from the type, so a host feeding an older captured response\n\t\t// loses the columns instead of printing a column of blanks under a system\n\t\t// name.\n\t\tconst houses = [...natal, ...transit].some((p) => Number.isFinite(p.house));\n\n\t\treturn html`<div class=\"wrap\" part=\"card\" aria-label=\"${this.t('Natal and transit bi-wheel')}\"><div class=\"head\" part=\"header\"><h2 class=\"title\">${this.t(this.heading)}</h2>${\n\t\t\t\t\twhen || count\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${[when, count].filter(Boolean).join(' \u00B7 ')}</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${this.renderWheel(natal, transit, aspects)} ${this.renderLegend(natal, transit, aspects, houses ? d.houseSystem : undefined)} ${this.renderSummary(d.summary)} ${this.renderPositions(natal, transit, houses)} ${this.renderReadings(aspects)}</div>`;\n\t}\n\n\t/**\n\t * What sits on the left horizon, in words. Rendered as a legend chip AND as a\n\t * sentence of the SVG description, from this one getter, so the drawing and\n\t * its accessible text cannot end up claiming different orientations.\n\t */\n\tprivate get orientationCaption(): string {\n\t\tif (this.ascendantGiven) return this.t('Ascendant on the left horizon');\n\t\tif (this.cusps) return this.t('First house cusp on the left horizon');\n\t\treturn this.t('Sign wheel, 0\u00B0 Aries on the left');\n\t}\n\n\t/** Whether the twelve sectors on the wheel are real cusps, in words. Same dual use as {@link RoxyTransitWheel.orientationCaption}. */\n\tprivate get cuspCaption(): string {\n\t\treturn this.cusps\n\t\t\t? this.t('House cusps supplied by the page')\n\t\t\t: this.t('No house cusps');\n\t}\n\n\tprivate renderWheel(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t) {\n\t\treturn html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" part=\"chart\" role=\"img\" aria-label=\"${this.t('Bi-wheel with natal bodies on the inner ring and transiting bodies on the outer ring')}\"><title>${this.t('Natal and transit bi-wheel')}</title><desc>${this.t('Twelve zodiac sign segments around a circular wheel. Natal bodies sit at their ecliptic longitudes on the inner ring and transiting bodies on the outer ring, and each line joins a transiting body to the natal body it aspects.')} ${this.orientationCaption}. ${this.cuspCaption}.</desc><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${BAND_R}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${TRANSIT_LINE_R}\" stroke-width=\"0.6\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${HUB_R}\" stroke-width=\"0.5\"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouses()} ${this.renderAspectLines(natal, transit, aspects)} ${this.renderRing(natal, NATAL_R, NATAL_DEG_R, 'natal-glyph', this.t('Natal'), 1)} ${this.renderRing(transit, TRANSIT_R, TRANSIT_DEG_R, 'transit-glyph', this.t('Transiting'), -1)} ${this.renderAxis()}</svg>`;\n\t}\n\n\t/** A short mark every 5 degrees and a longer one on each sign cusp, so the band reads as a degree scale rather than a bare ring. */\n\tprivate renderTicks() {\n\t\tconst ticks = [];\n\t\tfor (let deg = 0; deg < 360; deg += 5) {\n\t\t\tconst angle = this.toAngle(deg);\n\t\t\tconst isMajor = deg % 30 === 0;\n\t\t\tconst a = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tisMajor ? BAND_R : OUTER_R - 5,\n\t\t\t\tangle,\n\t\t\t);\n\t\t\tconst b = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tticks.push(\n\t\t\t\tsvg`<line class=${isMajor ? 'tick tick-major' : 'tick'} x1=${a.x} y1=${a.y} x2=${b.x} y2=${b.y} stroke-width=${isMajor ? 1 : 0.5} />`,\n\t\t\t);\n\t\t}\n\t\treturn ticks;\n\t}\n\n\t/** Twelve sign boundaries, drawn from the inner ring outward. Solid, and always exactly 30 degrees apart: house cusps are the dashed lines from {@link RoxyTransitWheel.renderHouses} and only exist when the page supplied them. */\n\tprivate renderSpokes() {\n\t\treturn SIGNS_ORDER.map((_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HUB_R, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\treturn svg`<line class=\"wheel-line\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} stroke-width=\"0.6\" />`;\n\t\t});\n\t}\n\n\t/**\n\t * The twelve house sectors, drawn ONLY from cusps the page supplied.\n\t *\n\t * @remarks\n\t * Dashed and inset to the sign band, because the solid spokes beside them are\n\t * sign boundaries and a reader who cannot tell the two apart cannot reconcile\n\t * the chart against another calculator. Each number sits at the arc midpoint\n\t * of its own sector, so an unequal house carries its label inside itself; the\n\t * hub is the one band on this wheel with nothing else in it.\n\t *\n\t * Nothing here is derived. With no cusps supplied this renders nothing at all\n\t * rather than twelve equal sectors from the Ascendant, which would be a\n\t * different chart wearing the same label.\n\t *\n\t * **Known and accepted: a fanned glyph can sit one sector off.** {@link fanOut}\n\t * displaces a crowded glyph in ANGLE, so a body a degree inside a cusp can be\n\t * drawn just past it; measured on a real Capricorn stellium, the natal Sun\n\t * glyph landed in the ninth sector while the body is in the eighth. The leader\n\t * runs back to a tick at the true longitude and the House column is the\n\t * authoritative number, which is the same trade professional chart software\n\t * makes. Do not \"fix\" it by clamping a glyph to its sector: that would move the\n\t * mark AND still not be the position.\n\t */\n\tprivate renderHouses() {\n\t\tconst cusps = this.cusps;\n\t\tif (!cusps) return nothing;\n\t\treturn cusps.map((cusp, i) => {\n\t\t\tconst next = cusps[(i + 1) % 12];\n\t\t\tconst angle = this.toAngle(cusp.longitude);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HUB_R, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, BAND_R, angle);\n\t\t\tconst label = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tHOUSE_NUM_R,\n\t\t\t\tthis.toAngle(\n\t\t\t\t\tarcMidpoint(cusp.longitude, next?.longitude ?? cusp.longitude + 30),\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn svg`<g>\n\t\t\t\t<line class=\"house-cusp\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} />\n\t\t\t\t<text class=\"house-num\" x=${label.x} y=${label.y} text-anchor=\"middle\" dominant-baseline=\"central\">${cusp.number}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((sign, i) => {\n\t\t\tconst pos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tSIGN_R,\n\t\t\t\tthis.toAngle(i * 30 + 15),\n\t\t\t);\n\t\t\treturn svg`<text class=\"sign-glyph\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signGlyph(sign)}</text>`;\n\t\t});\n\t}\n\n\t/**\n\t * One ring of bodies, fanned apart only as far as legibility demands.\n\t *\n\t * @remarks\n\t * A real transit chart stacks four bodies inside a couple of degrees often\n\t * enough that drawing every glyph at its exact angle makes the inner ring\n\t * unreadable, degree labels printed over each other included. {@link fanOut}\n\t * pushes a crowded member forward and a thin leader line runs from the glyph\n\t * back to a tick at its TRUE longitude, so the drawing never claims a position\n\t * the response did not give. The separation is derived from the radius, so the\n\t * inner ring automatically asks for more degrees of arc than the outer one for\n\t * the same glyph.\n\t *\n\t * `leaderSign` points that tick outward from the natal ring and inward from\n\t * the transit ring, i.e. always into the gap between the two, so a leader is\n\t * never mistaken for one of the aspect lines crossing the middle.\n\t */\n\tprivate renderRing(\n\t\tbodies: Body[],\n\t\tradius: number,\n\t\tdegRadius: number,\n\t\tcls: string,\n\t\tkind: string,\n\t\tleaderSign: 1 | -1,\n\t) {\n\t\tconst separation = Math.max(\n\t\t\tarcSeparation(GLYPH_WIDTH, radius),\n\t\t\tarcSeparation(DEG_LABEL_WIDTH, degRadius),\n\t\t);\n\t\treturn fanOut(bodies, (p) => p.longitude, separation).map(\n\t\t\t({ item: p, longitude, displayLongitude }) => {\n\t\t\t\tconst angle = this.toAngle(displayLongitude);\n\t\t\t\tconst pos = polarToCartesian(CENTER, CENTER, radius, angle);\n\t\t\t\tconst degPos = polarToCartesian(CENTER, CENTER, degRadius, angle);\n\t\t\t\tconst retro = p.isRetrograde === true;\n\t\t\t\t// Whole degrees on the wheel and the full degree-and-minute in the\n\t\t\t\t// tooltip and the positions table, matching `roxy-synastry-chart`, the\n\t\t\t\t// other two-ring wheel here. A `12\u00B034'` label is roughly twice as wide as\n\t\t\t\t// `12\u00B0`, and on a ring this size two of them collide in a cluster the\n\t\t\t\t// fan-out has already separated the GLYPHS of, so the extra precision\n\t\t\t\t// costs the legibility of the position it is trying to state.\n\t\t\t\tconst label = `${longitudeToSignPosition(longitude).degree}\u00B0`;\n\t\t\t\tconst body = display(p, 'name');\n\t\t\t\tconst tooltip = `${kind} ${body}${retro ? ` ${this.t('retrograde')}` : ''} - ${degLabel(longitude)} ${display(p, 'sign')}`;\n\t\t\t\tconst displaced = Math.abs(displayLongitude - longitude) > 0.5;\n\t\t\t\tconst tick = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tradius + leaderSign * LEADER_TICK,\n\t\t\t\t\tthis.toAngle(longitude),\n\t\t\t\t);\n\t\t\t\tconst foot = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tradius + leaderSign * LEADER_FOOT,\n\t\t\t\t\tangle,\n\t\t\t\t);\n\t\t\t\treturn svg`<g>\n\t\t\t\t${\n\t\t\t\t\tdisplaced\n\t\t\t\t\t\t? svg`<line class=${`leader ${cls}`} x1=${tick.x} y1=${tick.y} x2=${foot.x} y2=${foot.y} />`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t\t<text class=${cls} x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\"><title>${tooltip}</title>${glyphFor(p.name, body)}</text>\n\t\t\t\t<text class=\"planet-deg\" x=${degPos.x} y=${degPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${label}${retro ? svg`<tspan class=\"retro\"> \u211E</tspan>` : nothing}</text>\n\t\t\t</g>`;\n\t\t\t},\n\t\t);\n\t}\n\n\t/** One line per returned aspect, from the transiting body on the outer ring to the natal body on the inner one. */\n\tprivate renderAspectLines(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t) {\n\t\tconst natalBy = byName(natal);\n\t\tconst transitBy = byName(transit);\n\t\treturn aspects.map((a) => {\n\t\t\tconst t = transitBy.get(capitalize(a.planet1));\n\t\t\tconst n = natalBy.get(capitalize(a.planet2));\n\t\t\tif (\n\t\t\t\t!t ||\n\t\t\t\t!n ||\n\t\t\t\t!Number.isFinite(t.longitude) ||\n\t\t\t\t!Number.isFinite(n.longitude)\n\t\t\t)\n\t\t\t\treturn nothing;\n\t\t\tconst from = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tTRANSIT_LINE_R,\n\t\t\t\tthis.toAngle(t.longitude),\n\t\t\t);\n\t\t\tconst to = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tNATAL_LINE_R,\n\t\t\t\tthis.toAngle(n.longitude),\n\t\t\t);\n\t\t\tconst name = normalizeAspect(a);\n\t\t\tconst orb = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=${`aspect ${ASPECT_CLASS[name] ?? 'aspect-other'}`} x1=${from.x} y1=${from.y} x2=${to.x} y2=${to.y}><title>${this.t('Transiting')} ${display(a, 'planet1')} ${display(a, 'type', name)} ${this.t('Natal')} ${display(a, 'planet2')}${orb ? ` (${this.t('orb')} ${orb}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n\n\t/**\n\t * ASC and DSC ticks, drawn ONLY when the page supplied an ascendant. Nothing\n\t * is derived: the descendant is the exact opposite point of the value given.\n\t *\n\t * Gated on the ascendant alone, never on the cusps. Under whole-sign the first\n\t * cusp is 0 degrees of the rising sign rather than the Ascendant, so labelling\n\t * it ASC would be wrong on exactly the charts a traditional reader casts.\n\t */\n\tprivate renderAxis() {\n\t\tif (!this.ascendantGiven) return nothing;\n\t\tconst asc = normalizeLongitude(this.ascendant as number);\n\t\treturn [asc, oppositePoint(asc)].map((lon, i) => {\n\t\t\tconst angle = this.toAngle(lon);\n\t\t\tconst inner = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tconst outer = polarToCartesian(CENTER, CENTER, AXIS_LABEL_R, angle);\n\t\t\treturn svg`<g>\n\t\t\t\t<line class=\"axis-tick\" x1=${inner.x} y1=${inner.y} x2=${outer.x} y2=${outer.y} />\n\t\t\t\t<text class=\"axis-label\" x=${outer.x} y=${outer.y} text-anchor=\"middle\" dominant-baseline=\"central\">${i === 0 ? 'ASC' : 'DSC'}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\t/**\n\t * The key to the wheel, and the one place the orientation is stated in words.\n\t * A reader who cannot tell whether the divisions are signs or houses cannot\n\t * reconcile the chart against another calculator, so the caption is\n\t * provenance rather than decoration.\n\t *\n\t * `houseSystem` labels the house NUMBERS in the table, which is the only thing\n\t * the response can vouch for, and the cusp chip separately says where the\n\t * drawn sectors came from. Two statements, each true on its own, rather than\n\t * one chip implying the ring and the numbers share a source.\n\t */\n\tprivate renderLegend(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t\thouseSystem: string | undefined,\n\t) {\n\t\treturn html`<div class=\"legend\" part=\"legend\"><span><span class=\"swatch swatch--natal\"></span>${this.t('{{count}} natal bodies', { count: natal.length })}</span> <span><span class=\"swatch swatch--transit\"></span>${this.t('{{count}} transiting bodies', { count: transit.length })}</span> ${\n\t\t\t\taspects.length > 0\n\t\t\t\t\t? html`<span><span class=\"swatch swatch--harmonious\"></span>${this.t('Harmonious')}</span> <span><span class=\"swatch swatch--challenging\"></span>${this.t('Challenging')}</span>`\n\t\t\t\t\t: nothing\n\t\t\t} ${houseSystem ? html`<span>${this.t('{{system}} houses', { system: houseSystem })}</span>` : nothing} <span>${this.orientationCaption}</span> <span>${this.cuspCaption}</span></div>`;\n\t}\n\n\t/** Transit weather: the counts and the tightest contact. All of it is data, so all of it survives hide-readings. */\n\tprivate renderSummary(s: TransitSummary | undefined) {\n\t\tif (!s) return nothing;\n\t\tconst byType = Object.entries(s.byType ?? {}).sort((a, b) => b[1] - a[1]);\n\t\treturn html`<div part=\"details\"><div class=\"summary-pills\" role=\"region\" aria-label=\"${this.t('Transit aspect summary')}\">${typeof s.total === 'number' ? html`<span class=\"pill pill--muted\">${this.t('Total')}: ${s.total}</span>` : nothing} <span class=\"pill pill--success\">${this.t('Harmonious')}: ${s.harmonious}</span> <span class=\"pill pill--danger\">${this.t('Challenging')}: ${s.challenging}</span> <span class=\"pill pill--muted\">${this.t('Neutral')}: ${s.neutral}</span> ${byType.map(\n\t\t\t\t\t// English in every language, and nothing to do about it here: `byType`\n\t\t\t\t\t// is an object KEYED by the canonical aspect name, so the response\n\t\t\t\t\t// carries no localized partner for these the way `aspects[]` does.\n\t\t\t\t\t([type, count]) =>\n\t\t\t\t\t\thtml`<span class=\"pill pill--muted\">${formatAspectName({ type })}: ${count}</span>`,\n\t\t\t\t)}</div>${s.strongest ? this.renderStrongest(s.strongest) : nothing}</div>`;\n\t}\n\n\t/** The tightest transit by orb: the one contact most likely to be felt, lifted out so it is not buried among seventy others. */\n\tprivate renderStrongest(s: NonNullable<TransitSummary['strongest']>) {\n\t\tconst transiting = display(s, 'planet1');\n\t\tconst natal = display(s, 'planet2');\n\t\treturn html`<div class=\"strongest\" part=\"details strongest\"><span class=\"label\">${this.t('Strongest')}</span> <span aria-hidden=\"true\" class=\"glyph\">${glyphFor(s.planet1, transiting)}</span>${this.t('Transiting')} ${transiting} <span class=\"nature-badge ${(s.interpretation ?? 'neutral').toLowerCase()}\">${display(s, 'type', formatAspectName(s))}</span> <span aria-hidden=\"true\" class=\"glyph\">${glyphFor(s.planet2, natal)}</span>${this.t('Natal')} ${natal} <span class=\"meta\">${s.isApplying ? this.t('Applying') : this.t('Separating')} \u00B7 ${this.t('orb')} ${formatNumber(s.orb, 2)}\u00B0 \u00B7 ${this.t('strength')} ${score(s.strength)}</span></div>`;\n\t}\n\n\t/**\n\t * Both rings as exact positions, so every degree the wheel abbreviates to a\n\t * glyph stays readable and nothing the response carries is dropped.\n\t *\n\t * @remarks\n\t * The House columns are where the response's house numbers land, because the\n\t * wheel has no sectors to put them in unless the page supplied cusps. Both\n\t * columns are read against the NATAL cusps: the transiting one is the natal\n\t * house that body is currently passing through, which is the whole point of a\n\t * transit report and is why the two are not the same fact under one heading.\n\t * `showHouses` comes from the payload rather than the type, so a response\n\t * without them loses the columns instead of printing a column of blanks.\n\t */\n\tprivate renderPositions(natal: Body[], transit: Body[], showHouses: boolean) {\n\t\tif (natal.length === 0 && transit.length === 0) return nothing;\n\t\tconst natalBy = byName(natal);\n\t\tconst transitBy = byName(transit);\n\t\tconst rows = natal.length > 0 ? natal : transit;\n\t\tconst cell = (p: Body | undefined) =>\n\t\t\tp\n\t\t\t\t? html`${signGlyph(p.sign) ?? ''} ${degLabel(p.longitude)} ${display(p, 'sign')}${p.isRetrograde ? html`<span class=\"retro-badge\" aria-label=\"${this.t('retrograde')}\">\u211E</span>` : nothing}`\n\t\t\t\t: nothing;\n\t\tconst houseCell = (p: Body | undefined) =>\n\t\t\tshowHouses\n\t\t\t\t? html`<td>${p && Number.isFinite(p.house) ? p.house : nothing}</td>`\n\t\t\t\t: nothing;\n\t\t// tabindex + role: the House columns pushed this table past the card, so it\n\t\t// genuinely scrolls now, and a scrollable region with no focusable content\n\t\t// of its own is unreachable by keyboard. Same pattern as `hd-connection`,\n\t\t// except the name is borrowed from the caption rather than written again:\n\t\t// one translated sentence, and it cannot drift from what the table holds.\n\t\treturn html`<div class=\"scroll\" part=\"table\" tabindex=\"0\" role=\"region\" aria-labelledby=\"transit-positions\"><table><caption id=\"transit-positions\" class=\"roxy-sr-only\">${this.t('Every body with its natal position and its position on the transit date, each as a zodiac sign and a degree.')} ${showHouses ? this.t('Both house numbers are read against the natal house cusps.') : nothing}</caption><thead><tr><th scope=\"col\">${this.t('Body')}</th><th scope=\"col\"><span class=\"swatch swatch--natal\" aria-hidden=\"true\"></span>${this.t('Natal')}</th>${showHouses ? html`<th scope=\"col\">${this.t('Natal house')}</th>` : nothing}<th scope=\"col\"><span class=\"swatch swatch--transit\" aria-hidden=\"true\"></span>${this.t('Transiting')}</th>${showHouses ? html`<th scope=\"col\">${this.t('Transiting house')}</th>` : nothing}</tr></thead><tbody>${rows.map((p) => {\n\t\t\t\t\t\tconst key = capitalize(p.name);\n\t\t\t\t\t\tconst body = display(p, 'name');\n\t\t\t\t\t\treturn html`<tr><th scope=\"row\"><span aria-hidden=\"true\" class=\"glyph\">${glyphFor(p.name, body)}</span> ${body}</th><td>${cell(natalBy.get(key))}</td>${houseCell(natalBy.get(key))}<td>${cell(transitBy.get(key))}</td>${houseCell(transitBy.get(key))}</tr>`;\n\t\t\t\t\t})}</tbody></table></div>`;\n\t}\n\n\t/**\n\t * The written transit readings, routed through the base so one `hide-readings`\n\t * attribute drops every one of them from the markup. The aspect itself (both\n\t * bodies, the type, applying or separating, orb and strength) is data and\n\t * stays on the wheel, in the summary and in the positions table regardless.\n\t */\n\tprivate renderReadings(aspects: TransitAspect[]) {\n\t\tconst sections: InterpSection[] = aspects\n\t\t\t.filter((a) => a.transitInterpretation?.summary)\n\t\t\t.map((a) => {\n\t\t\t\tconst t = a.transitInterpretation as NonNullable<\n\t\t\t\t\tTransitAspect['transitInterpretation']\n\t\t\t\t>;\n\t\t\t\tconst transiting = display(a, 'planet1');\n\t\t\t\tconst natal = display(a, 'planet2');\n\t\t\t\treturn {\n\t\t\t\t\tlabel: `${glyphFor(a.planet1, transiting)} ${transiting} ${display(a, 'type', formatAspectName(a))} ${glyphFor(a.planet2, natal)} ${natal}`,\n\t\t\t\t\taside: `${this.t('orb')} ${formatNumber(a.orb, 2)}\u00B0 \u00B7 ${this.t('strength')} ${score(a.strength)}`,\n\t\t\t\t\tbody: t.summary,\n\t\t\t\t\textra: html`${t.impact ? html`<p><strong>${this.t('Impact')}:</strong> ${t.impact}</p>` : nothing} ${t.timing ? html`<p><strong>${this.t('Timing')}:</strong> ${t.timing}</p>` : nothing} ${t.guidance ? html`<p><strong>${this.t('Guidance')}:</strong> ${t.guidance}</p>` : nothing} ${\n\t\t\t\t\t\tt.keywords?.length\n\t\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${t.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}`,\n\t\t\t\t};\n\t\t\t});\n\t\treturn this.renderInterpretation(\n\t\t\tsections,\n\t\t\t'transit-aspect-readings',\n\t\t\tthis.t('Transit readings'),\n\t\t);\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-transit-wheel': RoxyTransitWheel;\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 * - `lookupKey`: the ONE normalizer every lookup table in this library is keyed\n * and read by (`tokens/index.ts` glyphs and abbreviations, `i18n/` chrome\n * strings).\n * - `capitalize`: title-cases the first character, lowercases the rest. A\n * DISPLAY helper only; it is not a lookup key (see `lookupKey`).\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\n/**\n * Fold a name to the canonical key its lookup table is stored under: lower case, every run of spaces, underscores and hyphens collapsed to one space, trimmed.\n *\n * @remarks\n * This exists because a GUESSED key spelling is a defect class this repo has now shipped twice. The glyph tables were keyed off whatever {@link capitalize} happened to produce (`North node`), while the API returns `North Node`, so every call site that reached the table without first calling `capitalize` missed and fell through to a fabricated abbreviation. Aspects hit the same wall from the other side: `/aspects` returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`.\n *\n * One normalizer, applied when a table is DEFINED and again when it is READ, removes the whole class: no call site has to remember a convention, and no table has to guess a spelling. Use it for every new table keyed by an API-supplied name.\n *\n * @example\n * ```ts\n * lookupKey('North Node'); // 'north node'\n * lookupKey('SEMI_SEXTILE'); // 'semi sextile'\n * lookupKey('semi-sextile'); // 'semi sextile'\n * ```\n */\nexport function lookupKey(s: string): string {\n\treturn s\n\t\t.toLowerCase()\n\t\t.replace(/[\\s_-]+/g, ' ')\n\t\t.trim();\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 (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n *\n * @remarks\n * **Every table here is keyed by {@link lookupKey} and read ONLY through the accessor beside it.** The raw records are deliberately not exported: a component that indexes a record directly has to guess the key convention, and a guessed spelling is what shipped `No North Node R`, `So South Node R` and `Bl Black Moon Lilith` into a live customer's natal chart. The API returns `North Node` with a space; the table was keyed `North node`, the spelling {@link capitalize} happens to produce, so every call site that forgot to call `capitalize` first missed the table.\n *\n * **A miss returns `undefined`, never a manufactured abbreviation.** The old `?? name.slice(0, 2)` fallback is what made the defect survive review: a failed lookup renders as a plausible two-letter code that reads exactly like an intentional abbreviation, so nothing about the output says \"this is broken\". A caller that can omit the glyph should omit it (`?? ''`); a caller that must show something falls back to the FULL name, which is visibly wrong at the size these slots are drawn.\n *\n * `tests/tokens.test.ts` resolves every body, sign and aspect name the committed spec can emit against these tables, so a vocabulary the API gains cannot ship unglyphed.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Look one name up in a normalized table. The single read path for every map in this file. */\nconst resolve = (\n\ttable: Record<string, string>,\n\tname: string | undefined | null,\n): string | undefined => (name ? table[lookupKey(name)] : undefined);\n\nconst PLANET_GLYPH: Record<string, string> = {\n\tsun: '\u2609',\n\tmoon: '\u263D',\n\tmercury: '\u263F',\n\tvenus: '\u2640',\n\tearth: '\u2641',\n\tmars: '\u2642',\n\tjupiter: '\u2643',\n\tsaturn: '\u2644',\n\turanus: '\u2645',\n\tneptune: '\u2646',\n\tpluto: '\u2647',\n\trahu: '\u260A',\n\tketu: '\u260B',\n\tascendant: 'Asc',\n\tlagna: 'La',\n\t'north node': '\u260A',\n\t'south node': '\u260B',\n\tchiron: '\u26B7',\n\tlilith: '\u26B8',\n\t'black moon lilith': '\u26B8',\n};\n\n/** Astrological glyph for a planet or point, or `undefined` when the library has none for it. */\nexport const planetGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_GLYPH, name);\n\nconst PLANET_ABBR: Record<string, string> = {\n\tsun: 'Su',\n\tmoon: 'Mo',\n\tmercury: 'Me',\n\tvenus: 'Ve',\n\tmars: 'Ma',\n\tjupiter: 'Ju',\n\tsaturn: 'Sa',\n\turanus: 'Ur',\n\tneptune: 'Ne',\n\tpluto: 'Pl',\n\trahu: 'Ra',\n\tketu: 'Ke',\n\tascendant: 'Asc',\n\tlagna: 'La',\n};\n\n/** Two-letter graha code for the tight cells of a North/South Indian kundli, or `undefined`. */\nexport const planetAbbr = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_ABBR, name);\n\nconst SIGN_GLYPH: Record<string, string> = {\n\taries: '\u2648',\n\ttaurus: '\u2649',\n\tgemini: '\u264A',\n\tcancer: '\u264B',\n\tleo: '\u264C',\n\tvirgo: '\u264D',\n\tlibra: '\u264E',\n\tscorpio: '\u264F',\n\tsagittarius: '\u2650',\n\tcapricorn: '\u2651',\n\taquarius: '\u2652',\n\tpisces: '\u2653',\n};\n\n/** Zodiac glyph for a sign name in any case, or `undefined`. */\nexport const signGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(SIGN_GLYPH, name);\n\nconst SIGN_ABBR: Record<string, string> = {\n\taries: 'Ar',\n\ttaurus: 'Ta',\n\tgemini: 'Ge',\n\tcancer: 'Cn',\n\tleo: 'Le',\n\tvirgo: 'Vi',\n\tlibra: 'Li',\n\tscorpio: 'Sc',\n\tsagittarius: 'Sg',\n\tcapricorn: 'Cp',\n\taquarius: 'Aq',\n\tpisces: 'Pi',\n};\n\n/** Two-letter rashi code for kundli cells and grid headers, or `undefined`. */\nexport const signAbbr = (name: string | undefined | null): string | undefined =>\n\tresolve(SIGN_ABBR, name);\n\n/** The twelve signs in zodiacal order. Display values, not lookup keys: read them through {@link signGlyph} / {@link signAbbr}. */\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Glyph per aspect. Used by the natal, transit and synastry aspect tables.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nconst ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\t'semi sextile': '\u26BA',\n\tsemisquare: '\u2220',\n\t'semi square': '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Aspect glyph for any of the separator forms the endpoints use (`SEMI_SEXTILE`, `SEMI SEXTILE`, `semi-sextile`), or `undefined`. */\nexport const aspectSymbol = (\n\tname: string | undefined | null,\n): string | undefined => resolve(ASPECT_SYMBOL, name);\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nconst TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n};\n\n/** Trigram glyph for a trigram name in any case, or `undefined`. */\nexport const trigramGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(TRIGRAM_GLYPH, name);\n\n/** Moon phase emoji set. Used by the moon phase card. */\nconst MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n\n/**\n * Emoji for a lunar phase, or `undefined`.\n *\n * @remarks\n * The live API suffixes most phase names (`Waxing Gibbous Moon`) and calls the third quarter `Third Quarter Moon`, while only new and full moon carry the suffix in the table. Both reconciliations live here rather than in the card, so any component reading a phase name resolves the same eight phases from the same four spellings.\n */\nexport const moonPhaseEmoji = (\n\tname: string | undefined | null,\n): string | undefined => {\n\tif (!name) return undefined;\n\tconst key = lookupKey(name);\n\tconst bare = key.replace(/ moon$/, '');\n\tconst alias = bare === 'third quarter' ? 'last quarter' : bare;\n\treturn MOON_PHASE_EMOJI[key] ?? MOON_PHASE_EMOJI[alias];\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\tnothing,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { resolveLang } from '../i18n/lang.js';\nimport { LocaleController } from '../i18n/locale-controller.js';\nimport { translate } from '../i18n/registry.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport {\n\ttype InterpSection,\n\trenderInterpAccordion,\n} from './interp-accordion.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * Two things every subclass inherits for the host page to shape the render from outside the shadow root, with no JavaScript: the `hide-readings` attribute ({@link RoxyDataElement.hideReadings}), and the `part` names on the base's own branches (`form`, `loading`, `error`, `edit-bar`, `attribution`). A component adds `part` to its own structural blocks; the vocabulary is in `docs/authoring.md`.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/**\n\t * Render the chart and the data, and omit the written interpretation. Off by default, so a component that does not set it is byte-identical to before.\n\t *\n\t * @remarks\n\t * The suppressed content is the prose an endpoint returns ABOUT the result: the interpretation accordion, the interpretive paragraphs, and the keyword chips that belong to them. Everything a practitioner reads the numbers off stays: wheels, tables, grids, legends, pills, counts and dates. The reading is dropped from the DOM rather than hidden with CSS, so a page that publishes the chart alone never ships the prose it is not showing.\n\t *\n\t * Set it when the page supplies its own words, which is the common case for a practitioner site that wants the graphic under its own writing.\n\t */\n\t@property({ type: Boolean, attribute: 'hide-readings', reflect: true })\n\thideReadings = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\t// Re-render if a chrome-string catalogue lands after this element upgraded.\n\t\tnew LocaleController(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\t/**\n\t * The chrome string for this element's language, keyed by its own English source text.\n\t *\n\t * @remarks\n\t * Pass the English copy, never a key. With no catalogue registered the source string is returned unchanged, so an English page pays nothing and a language we do not ship degrades to English rather than to a visible key.\n\t *\n\t * Chrome only. A value the API returned (a planet, a sign, an aspect, a house system) is NOT translated here: it is rendered as the response carries it, so the words on the chart and the words in the response can never disagree.\n\t *\n\t * @example\n\t * ```ts\n\t * this.t('Aspect grid'); // 'Cuadricula de aspectos' under lang=\"es\"\n\t * this.t('{{count}} planets', { count: 12 }); // '12 planetas'\n\t * ```\n\t */\n\tprotected t(source: string, vars?: Record<string, string | number>): string {\n\t\treturn translate(this.effectiveLang(), source, vars);\n\t}\n\n\t/** {@link RoxyDataElement.t} as a value, bound once, for a shared render helper that has no host of its own and therefore cannot resolve a page language (`utils/hd-reading.ts`). Named `translator` and not `translate` because `HTMLElement.translate` is a real DOM property and shadowing it with a protected member makes every `@customElement` decorator in the library fail to typecheck. */\n\tprotected readonly translator = (\n\t\tsource: string,\n\t\tvars?: Record<string, string | number>,\n\t): string => this.t(source, vars);\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * The interpretation accordion, gated by {@link RoxyDataElement.hideReadings}. Every component that shows a written reading routes through here instead of calling {@link renderInterpAccordion} directly.\n\t *\n\t * @remarks\n\t * The gate lives on the base rather than in each component because the property does, and a plain render function cannot read component state. One call site per accordion, one place that decides whether prose renders, and the section it emits carries the same `readings` part in every component.\n\t *\n\t * Prose that is NOT in an accordion (a summary paragraph, a per-item interpretation) is still the component's own to gate, since only the component knows which of its blocks are readings.\n\t */\n\tprotected renderInterpretation(\n\t\tsections: InterpSection[],\n\t\tname: string,\n\t\theading?: string,\n\t): unknown {\n\t\tif (this.hideReadings) return nothing;\n\t\t// The default heading is localized HERE rather than in the accordion:\n\t\t// that is a plain render function with no host, so it cannot read a\n\t\t// language, and this is the one call site every component routes through.\n\t\treturn renderInterpAccordion(sections, name, heading ?? this.t('Reading'));\n\t}\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\" part=\"edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">${this.t('Edit query')}</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\" part=\"attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">${this.t('Spiritual data by RoxyAPI')}</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form part=\"form\" data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/**\n\t * Site-owner language for this element: the `lang` attribute, the nearest ancestor carrying one, or the document. Protected so a component that composes another can forward it (a child inside this shadow root cannot reach the host page on its own).\n\t *\n\t * Full tag, region included. The truncation to what `?lang=` accepts happens where the request is built, in `<roxy-endpoint-form>`.\n\t */\n\tprotected effectiveLang(): string | undefined {\n\t\treturn resolveLang(this);\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No data')}</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"${this.t('Loading')}\" part=\"loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\" part=\"error\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "/**\n * Where a component's language comes from, and what is safe to send to the API.\n *\n * @remarks\n * Two different answers, and conflating them is the whole reason this file is separate from the catalogue:\n *\n * - {@link resolveLang} answers \"what language is this PAGE in\", and keeps the full tag, because `es-AR` is a legitimate thing for a catalogue to want to differ on.\n * - {@link apiLang} answers \"what may go on the query string\", which is a narrower question with a hard edge: `?lang=es-AR` is a 400, `?lang=es` is a 200.\n *\n * The full tag is not a nicety the catalogue happens to tolerate: `utils/format.ts` hands it to `Intl`, which reads the region and writes `15 de ene de 1990` for `es-AR` where it writes `15 ene 1990` for `es`. Passing the API answer to a formatter demotes every regional visitor to the base language and nothing fails, so the two values are never interchangeable.\n */\n\nimport { API_LANGUAGES } from '../generated/api-languages.js';\n\n/**\n * The site-owner language for an element, resolved through the four-link chain the revamp design specifies.\n *\n * @remarks\n * 1. the element's own `lang` attribute (the explicit per-embed override),\n * 2. the nearest ancestor carrying `lang`, so one wrapper localizes a whole section,\n * 3. `document.documentElement.lang`, which is what makes this work on a real CMS with no markup change at all: WordPress emits `<html lang=\"es-AR\">` on every page of a Spanish site,\n * 4. nothing, which the callers read as English.\n *\n * Only link 1 used to be implemented, so a component on a fully Spanish page rendered English chrome and there was no way to fix it except hand-editing every embed.\n *\n * `navigator.language` is deliberately NOT in the chain. It is the VISITOR's preference, not the site's: it fragments the API cache across every locale a visitor might carry and silently serves two people different content from the same URL.\n *\n * Link 2 uses `closest`, which stops at a shadow boundary. A component composed INSIDE another component's shadow root therefore cannot see the host page, which is why every composing component forwards `lang` to its children explicitly.\n */\nexport function resolveLang(el: HTMLElement): string | undefined {\n\t// Native accessor, never a Lit @property: declaring one would shadow\n\t// HTMLElement.lang and break the platform attribute for every consumer.\n\tif (el.lang) return el.lang;\n\tif (typeof document === 'undefined') return undefined;\n\tconst inherited = el.closest?.('[lang]')?.getAttribute('lang');\n\tif (inherited) return inherited;\n\treturn document.documentElement.lang || undefined;\n}\n\n/**\n * The value safe to put on `?lang=`, or `undefined` to leave the request on the API default.\n *\n * @remarks\n * Two narrowings, both of which are load-bearing the moment {@link resolveLang} starts reading `<html lang>`:\n *\n * - **The region is dropped.** A regional tag is a 400, so a Spanish WordPress site would go from English-but-working to broken the day the language chain was completed. `es-AR`, `es-419` and `ES` all send `es`.\n * - **An unsupported language is omitted, not sent.** The chain now surfaces whatever the host page carries, including languages the API does not translate, and an unlisted tag is the same 400. Omitting it degrades to English, which is the behaviour those pages already had.\n */\nexport function apiLang(el: HTMLElement): string | undefined {\n\tconst tag = resolveLang(el);\n\tif (!tag) return undefined;\n\tconst base = tag.toLowerCase().split('-')[0] as string;\n\treturn API_LANGUAGES.includes(base) ? base : undefined;\n}\n", "/**\n * The chrome-string catalogue: one resolver reading one registry, so a translation can arrive from anywhere without a component changing.\n *\n * @remarks\n * **The key IS the canonical English string**, folded through {@link lookupKey}. There is no invented key vocabulary to keep in sync with the copy, which is the same rule the glyph tables in `tokens/index.ts` follow (they key off the exact value the API returns). Two consequences that are the whole point:\n *\n * - **English costs zero bytes.** A miss returns the source string, so the English build ships no catalogue at all, and a site that never loads a locale payload is byte-identical to one built before this file existed.\n * - **A missing translation degrades to English, never to a key.** The failure mode of a keyed catalogue is a raw `natal.tabs.wheel` rendered at a customer; here the worst case is the English word.\n *\n * **The registry lives on `globalThis`, not in module scope, because it has to.** Every `dist/cdn/components/*.js` is a self-contained IIFE with its own copy of this module, so a `Map` here would be invisible to the second component on the page. One global object, written by the locale payload and read by every bundle, is what makes `dist/cdn/locales/es.js` a single download that translates all of them.\n *\n * Load order is not guaranteed on a real host (WordPress enqueues scripts in an order the plugin does not fully control, and a payload may be deferred), so {@link onLocaleChange} lets an element that has already rendered in English re-render when its catalogue lands.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Shared mutable state, addressed by a name rather than a module binding so every bundle on the page reaches the same object. */\ninterface LocaleRegistry {\n\t/** Language tag (lower case) to catalogue, keyed by {@link lookupKey} of the English source string. */\n\tcatalogs: Record<string, Record<string, string>>;\n\t/** Elements waiting to re-render when a catalogue arrives. */\n\tlisteners: Set<() => void>;\n}\n\nconst GLOBAL_KEY = '__ROXY_UI_I18N__';\n\nfunction registry(): LocaleRegistry {\n\tconst holder = globalThis as unknown as Record<string, LocaleRegistry>;\n\tconst existing = holder[GLOBAL_KEY];\n\tif (existing) return existing;\n\tconst created: LocaleRegistry = { catalogs: {}, listeners: new Set() };\n\tholder[GLOBAL_KEY] = created;\n\treturn created;\n}\n\n/**\n * Publish a catalogue for a language tag and wake every mounted element.\n *\n * @remarks\n * The catalogue is authored keyed by the English source string, exactly as it appears at the call site, and normalized here. That keeps the source file readable and diffable against the component that renders it, while the runtime lookup stays a single property read.\n *\n * This is the ONLY way into the registry, so a catalogue can later come from a static file, a server response, or a host page inlining a script tag, without a component knowing the difference.\n */\nexport function registerLocale(\n\tlang: string,\n\tcatalog: Record<string, string>,\n): void {\n\tconst reg = registry();\n\tconst normalized: Record<string, string> = {};\n\tfor (const [source, translated] of Object.entries(catalog)) {\n\t\tnormalized[lookupKey(source)] = translated;\n\t}\n\treg.catalogs[lang.toLowerCase()] = normalized;\n\tfor (const listener of reg.listeners) listener();\n}\n\n/**\n * Replace `{{name}}` placeholders. Copied from the API-side translator so both sides of the product interpolate identically; an unknown placeholder is left verbatim rather than blanked, so a typo in a catalogue is visible instead of silently eating the value.\n */\nexport function interpolate(\n\ttemplate: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!vars) return template;\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (match, key: string) =>\n\t\tkey in vars ? String(vars[key] ?? '') : match,\n\t);\n}\n\n/**\n * The chrome string for `lang`, falling back to the English `source` it is keyed by.\n *\n * @remarks\n * A regional tag resolves against its base language, so `es-AR` and `es-419` both read the `es` catalogue and a site does not have to know which tags we happen to ship. An exact regional catalogue still wins if one is ever registered.\n */\nexport function translate(\n\tlang: string | undefined,\n\tsource: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!lang) return interpolate(source, vars);\n\tconst { catalogs } = registry();\n\tconst tag = lang.toLowerCase();\n\tconst catalog = catalogs[tag] ?? catalogs[tag.split('-')[0] as string];\n\treturn interpolate(catalog?.[lookupKey(source)] ?? source, vars);\n}\n\n/** Subscribe to catalogue arrivals. Returns the unsubscribe, so an element can drop it on disconnect. */\nexport function onLocaleChange(listener: () => void): () => void {\n\tconst { listeners } = registry();\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { onLocaleChange } from './registry.js';\n\n/**\n * Re-renders its host when a chrome-string catalogue arrives.\n *\n * @remarks\n * Without this the catalogue would have to be on the page BEFORE the elements upgrade, which is not something a component can require of a real host. WordPress orders enqueued scripts by dependency and a site owner can add `defer` to any of them; a CDN embed is two independent `<script src>` tags. Any of those can land the locale payload after the first paint, and the visible result would be a chart that renders in English on a Spanish page for no reason the site owner can see or fix.\n *\n * Mirrors `MarkupDataController`: constructed in {@link RoxyDataElement}'s constructor, subscribes on connect, drops the subscription on disconnect. Registration is idempotent and a re-register of the same language simply re-renders, so a payload loaded twice is harmless.\n */\nexport class LocaleController implements ReactiveController {\n\tprivate readonly host: ReactiveControllerHost;\n\tprivate unsubscribe?: () => void;\n\n\tconstructor(host: ReactiveControllerHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected(): void {\n\t\tthis.unsubscribe = onLocaleChange(() => this.host.requestUpdate());\n\t}\n\n\thostDisconnected(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\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}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@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-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n *\n * **Call it through `RoxyDataElement.renderInterpretation`, never directly.** That method is where `hide-readings` is honoured, so a direct call renders prose a host asked to be left out. The section it emits carries `part=\"section readings\"` and each row `part=\"reading\"`, which is what makes the readings of EVERY component addressable under one name from outside the shadow root.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{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);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\" part=\"section readings\"><h3>${heading}</h3>${shown.map(\n\t\t\t(\n\t\t\t\ts,\n\t\t\t\ti,\n\t\t\t) => html`<details class=\"interp-card\" part=\"reading\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<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>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`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}}`;\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 * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\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 * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tlet d = Math.floor(deg);\n\tlet m = Math.round((deg - d) * 60);\n\tif (m === 60) {\n\t\tm = 0;\n\t\td += 1;\n\t}\n\treturn `${d}\u00B0${String(m).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** A body placed on a wheel: where it really is, and where its glyph had to be drawn to stay legible. */\nexport interface FannedPoint<T> {\n\titem: T;\n\t/** The true ecliptic longitude. Where a leader line points, and the only value a reader should take as the position. */\n\tlongitude: number;\n\t/** Where the glyph is drawn, pushed forward only as far as it takes to clear its neighbour. Equal to {@link FannedPoint.longitude} whenever nothing was in the way. */\n\tdisplayLongitude: number;\n}\n\n/**\n * Spread a cluster of bodies apart along a wheel so every glyph stays readable,\n * without moving any of them off its real position in the data.\n *\n * @remarks\n * Conjunctions inside a few degrees are the norm, not the exception: a\n * Sun-Mercury-Venus cluster or a stack of outer planets will pile four glyphs on\n * top of each other and print their degree labels over one another. Sorting by\n * longitude and pushing each later member forward until it clears\n * `minSeparation` is the conventional fix in professional chart software, and it\n * is why {@link FannedPoint} carries BOTH longitudes: the caller draws the glyph\n * at the display value and a leader line back to the true one, so nothing about\n * the drawing claims a position the response did not give.\n *\n * `minSeparation` is an ANGLE, so it depends on the radius the caller is drawing\n * at: the same glyph needs more degrees of arc on a small ring than a large one.\n *\n * If a cluster runs past 360 degrees the whole set slides back by the overshoot,\n * which keeps the stack anchored near its real longitudes instead of wrapping\n * one member around to the far side of the wheel.\n */\nexport function fanOut<T>(\n\titems: readonly T[],\n\tlongitudeOf: (item: T) => number,\n\tminSeparation: number,\n): FannedPoint<T>[] {\n\tconst placed: FannedPoint<T>[] = items\n\t\t.filter((item) => Number.isFinite(longitudeOf(item)))\n\t\t.map((item) => {\n\t\t\tconst longitude = normalizeLongitude(longitudeOf(item));\n\t\t\treturn { item, longitude, displayLongitude: longitude };\n\t\t})\n\t\t.sort((a, b) => a.longitude - b.longitude);\n\n\tfor (let i = 1; i < placed.length; i++) {\n\t\tconst prev = placed[i - 1];\n\t\tconst cur = placed[i];\n\t\tif (!prev || !cur) continue;\n\t\tconst wanted = prev.displayLongitude + minSeparation;\n\t\tif (cur.displayLongitude < wanted) cur.displayLongitude = wanted;\n\t}\n\n\tconst last = placed[placed.length - 1];\n\tif (last && last.displayLongitude > 360) {\n\t\tconst shift = last.displayLongitude - 360;\n\t\tfor (const p of placed) p.displayLongitude -= shift;\n\t}\n\treturn placed;\n}\n\n/**\n * Degrees of arc a mark of `width` user units occupies at `radius`, which is the\n * separation {@link fanOut} needs to keep two of them from touching. One\n * expression instead of a magic number per ring, so an inner ring automatically\n * asks for more degrees than an outer one.\n */\nexport function arcSeparation(width: number, radius: number): number {\n\treturn radius > 0 ? (width / radius) * (180 / Math.PI) : 0;\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\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 * @remarks\n * **This file is the ONLY place in the library that may call `Intl` or a `toLocale*` method, and every helper that does takes the locale as its first argument, required.** Both halves are enforced by a source scan in `tests/i18n.test.ts`.\n *\n * The locale is the DISPLAY locale, the full tag `resolveLang` returns, region included. It is NOT the value that goes on `?lang=`: that one is truncated to a supported two-letter code because the API rejects anything else, and handing THAT to Intl would render every Argentine visitor's dates in Castilian conventions. `es-AR` is exactly the tag Intl wants.\n *\n * It is required rather than optional because the defect it replaces was an omission: `toLocaleDateString(undefined, ...)` means \"the locale of whoever is looking\", so a Spanish page rendered `Carta natal` above `Jan 15, 1990, 2:30 PM`, and two visitors to the same page saw two different strings. An optional parameter defaults straight back to that. A missing argument is now a typecheck failure at every call site.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/** Canonical form per tag seen, so a page carrying an unparseable `lang` does not throw once per rendered date. */\nconst CANONICAL: Map<string, string> = new Map();\n\n/**\n * The locale list to hand Intl: the page's tag first, English behind it.\n *\n * @remarks\n * Two failure modes, both reachable from a `lang` attribute a site owner typed by hand and neither of which may reach a visitor:\n *\n * - **A structurally invalid tag throws.** `lang=\"english\"` or `lang=\"en_US\"` makes every `toLocale*` call raise a RangeError, which inside a render is a blank component rather than a wrong date. Canonicalizing behind a try/catch degrades it to English instead.\n * - **A valid-but-unknown tag falls back to the RUNTIME default**, which is the viewer's browser again, so the bug reappears for exactly the pages least likely to notice. Naming `en` as the second entry makes the fallback the page's, not the visitor's.\n *\n * No language signal at all resolves to English for the same reason the chrome catalogue does: a page that never declares a language is English as far as this library is concerned, and English chrome over German dates is the inconsistency this whole file exists to remove. `navigator.language` is deliberately absent from the chain here as it is in `resolveLang`: it is the VISITOR's preference, not the site's.\n */\nfunction intlLocales(locale: string | undefined): string[] {\n\tif (!locale) return ['en'];\n\tconst cached = CANONICAL.get(locale);\n\tif (cached) return [cached, 'en'];\n\tlet canonical = 'en';\n\ttry {\n\t\tcanonical = Intl.getCanonicalLocales(locale)[0] ?? 'en';\n\t} catch {\n\t\tcanonical = 'en';\n\t}\n\tCANONICAL.set(locale, canonical);\n\treturn [canonical, 'en'];\n}\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still writes them in the PAGE locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n *\n * Deliberately NOT exported. It used to be, so a component needing a shape these helpers did not offer could pin its own wall clock and call Intl itself, which is how `dasha-timeline` came to hardcode `toLocaleString('en', ...)` and pin every boundary date to English. A shape that is missing is added here, beside the locale handling, not reimplemented in a component.\n */\nfunction resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\n/**\n * The clock, in the page locale: `2:30 PM` in English, `14:30` in German.\n *\n * @remarks\n * The hour cycle is the locale's, never ours. It used to be pinned `hour12: true`, which put an AM/PM clock on every page in Europe and Latin America while the embedded form beside it labelled its own input \"formato de 24 horas\". CLDR already knows which convention each locale reads, including the ones that surprise you (`es` is 24-hour, `es-AR` is 12-hour with `p. m.`), so asserting a cycle here is asserting we know better than the locale data.\n */\nexport function formatTime(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(intlLocales(locale), {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tlocale: string | undefined,\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(locale, t.start);\n\tconst end = formatTime(locale, t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(\n\tlocale: string | undefined,\n\tstart: unknown,\n\tend: unknown,\n): string {\n\tconst a = formatDate(locale, start);\n\tconst b = formatDate(locale, end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/** How much of a timestamp a label shows. `time` is the whole date plus the clock. */\nexport type DateGrain = 'year' | 'month' | 'day' | 'time';\n\n/**\n * A timestamp at a chosen granularity, for an axis or a bar end where the full date would not fit.\n *\n * @remarks\n * Every grain below `year` carries the year, because a period routinely straddles new year and a label reading `28 Dec - 3 Jan` says nothing about which side moved. `year` is sliced off the string rather than formatted, since a bare four-digit year is the same in every locale this library ships and running it through Intl would introduce era and numbering-system differences into an axis tick.\n */\nexport function formatDateGrain(\n\tlocale: string | undefined,\n\tinput: unknown,\n\tgrain: DateGrain,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (grain === 'year') {\n\t\tconst m = input.match(/^(\\d{4})/);\n\t\treturn m?.[1] ?? input;\n\t}\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleString(intlLocales(locale), {\n\t\tday: grain === 'month' ? undefined : 'numeric',\n\t\tmonth: 'short',\n\t\tyear: 'numeric',\n\t\thour: grain === 'time' ? 'numeric' : undefined,\n\t\tminute: grain === 'time' ? '2-digit' : undefined,\n\t\ttimeZone,\n\t});\n}\n\n/**\n * Month name from a 1-based month number: `January`, `enero`, `janvier`.\n *\n * @remarks\n * Two components carried a byte-identical array of twelve English month names, which is both a duplicated table and a table of something the platform already knows in every language. Anchored to a UTC noon so no timezone can roll the date into the neighbouring month.\n */\nexport function monthName(locale: string | undefined, month: unknown): string {\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(2000, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * A whole number with the page locale's digit grouping: `12,345` in English, `12.345` in Spanish.\n *\n * @remarks\n * Rounds rather than truncating, so a caller testing the magnitude (`Math.round(km) === 0`) and this label agree about which side of a boundary a value fell.\n */\nexport function formatInteger(\n\tlocale: string | undefined,\n\tvalue: unknown,\n): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toLocaleString(intlLocales(locale), {\n\t\tmaximumFractionDigits: 0,\n\t});\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * Guard on the decimal point, and never strip from the integer side. A naive `.replace(/\\.?0+$/, '')` over the whole string eats zeros off the INTEGER whenever there is no decimal point, so at `dp = 0` it turns `100` into `1`, `90` into `9` and `0` into the empty string.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\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 canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums, and every one of them needs a human form that {@link humanize} cannot derive: KP is an initialism that must stay uppercase, and `raman` is a person, B.V. Raman, not a word. Anything unmapped degrades to a humanized slug rather than rendering the enum. That fallback is a safety net, not a licence to skip the map, since a humanized slug reads as a bare surname where a full name belongs. A test fails if the committed spec gains a frame this map lacks.\n */\nexport const AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n\traman: 'B.V. Raman',\n\n\tcustom: 'Custom',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('en', '1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('en', '1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('de', '1990-01-15T14:30:00'); // '15. Jan. 1990, 14:30'\n * formatDateTime('en', '1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(\n\tlocale: string | undefined,\n\tinput: unknown,\n\ttime?: unknown,\n): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(locale, merged);\n\tconst clock = formatTime(locale, merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n\n/**\n * The Sanskrit form of a name, but only when it actually differs from the English one.\n *\n * @remarks\n * Several endpoints pair an English `name` with a `sanskritName` that is sometimes the SAME string, because the tradition and the translation coincide (a nakshatra is `Ashwini` either way). Rendering the pair unconditionally then prints `Ashwini (Ashwini)`. That guard is the whole reason this exists: it is one comparison, it is easy to leave out, and leaving it out is invisible until a reader hits a name where the two agree.\n *\n * Presentation deliberately stays with the caller, since the same fact is drawn as a parenthetical in a table cell and as a middot-separated span on a chart heading.\n */\nexport function distinctSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string | undefined {\n\tif (typeof sanskritName !== 'string' || !sanskritName) return undefined;\n\treturn sanskritName === name ? undefined : sanskritName;\n}\n\n/**\n * `English (Sanskrit)` for a value that carries both, falling back to whichever one exists.\n *\n * @example\n * ```ts\n * formatWithSanskrit('Tuesday', 'Mangalavara'); // 'Tuesday (Mangalavara)'\n * formatWithSanskrit('Ashwini', 'Ashwini'); // 'Ashwini'\n * ```\n */\nexport function formatWithSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string {\n\tconst english = typeof name === 'string' ? name : '';\n\tconst sanskrit = distinctSanskrit(english, sanskritName);\n\tif (!english) return sanskrit ?? '';\n\treturn sanskrit ? `${english} (${sanskrit})` : english;\n}\n", "/**\n * The value a READER sees, for a response field the API returns twice.\n *\n * @remarks\n * Several endpoints now echo a display translation beside the canonical value: `nameLocalized` next to `name`, `signLocalized` next to `sign`, `typeLocalized` next to `type`. **The canonical field is deliberately always English, whatever `?lang=` says, so it stays safe to compare against in code**, and the localized one is deliberately absent from an English response.\n *\n * That split is the whole contract, and inverting it breaks charts silently rather than loudly: `planetGlyph`, `signGlyph`, `aspectSymbol`, `ASPECT_CLASS`, `SIGNS_ORDER.indexOf`, every `Map` key and every CSS class fragment is keyed on the English name, so pointing one of them at `nameLocalized` resolves to nothing on a translated page and to the same value on an English one, which is exactly the shape of defect that passes every gate (lesson 24). **The lookup stays on the canonical value; only the printed text node, the `title` and the `aria-label` move.**\n *\n * These two helpers exist so that rule lives in one place rather than as a `??` at every call site, and so an English response, where the localized field simply is not there, degrades by construction instead of by remembering. Both take the KEY of the canonical field and derive its partner, so a mistyped key or a field that is not a display string is a compile error rather than a silent empty string.\n */\n\n/** The one naming convention every helper here derives from. Ratified by the API and spreading to more operations, so it is matched as a convention and never as a list of field names. */\nconst LOCALIZED = 'Localized';\n\n/** A response row carrying a canonical English `K` plus the optional localized partner the API writes beside it. */\nexport type Localizable<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string>\n>;\n\n/** The same pairing where the value is a LIST of names, e.g. `retrogradePlanets`. */\nexport type LocalizableList<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string[]>\n>;\n\n/**\n * The text to print for `key`: the localized value when the response carried one, else the English one.\n *\n * @param english - What to print in the English case INSTEAD of the raw field, for a canonical value that is an API enum with a display form of its own (`type` is `SEMI_SEXTILE` on the wire and `Semi-sextile` on screen). Omit it wherever the canonical value is already the readable one.\n *\n * @example\n * ```ts\n * display(planet, 'name'); // 'Sol' on ?lang=es, 'Sun' on English\n * planetGlyph(planet.name) ?? display(planet, 'name'); // the lookup stays English, the fallback TEXT does not\n * display(aspect, 'type', formatAspectName(aspect)); // 'Tr\u00EDgono', else 'Trine' and never 'TRINE'\n * ```\n */\nexport function display<\n\tT extends Localizable<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K, english?: string): string {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tif (typeof localized === 'string' && localized !== '') return localized;\n\tif (english !== undefined) return english;\n\tconst canonical = rec?.[key];\n\treturn typeof canonical === 'string' ? canonical : '';\n}\n\n/**\n * A list field as `{ value, label }` pairs: the English `value` every lookup is keyed on, and the `label` a reader sees.\n *\n * @remarks\n * The localized array is INDEX-ALIGNED with the canonical one, which is the only thing that makes the pairing possible, so it is zipped by position and neither side is ever sorted, filtered or deduped on its own. A list that is short or absent falls back per item, so a partial translation still resolves every glyph.\n */\nexport function displayList<\n\tT extends LocalizableList<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K): Array<{ value: string; label: string }> {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst canonical = rec?.[key];\n\tif (!Array.isArray(canonical)) return [];\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tconst labels = Array.isArray(localized) ? localized : [];\n\treturn canonical.map((value, i) => {\n\t\tconst label = labels[i];\n\t\treturn {\n\t\t\tvalue: String(value),\n\t\t\tlabel: typeof label === 'string' && label !== '' ? label : String(value),\n\t\t};\n\t});\n}\n\n/**\n * Fold every `XLocalized` field into its `X` partner: the reader's value under the canonical NAME, and the duplicate key gone.\n *\n * @remarks\n * For a renderer that has no idea what its fields MEAN and derives its columns from `Object.keys(row)`, which is how `<roxy-data>` started drawing `Planet | Planet Localized | Longitude | Sign | Sign Localized` the day the API began sending both. Two extra columns, headed in English, carrying the same fact twice, on a page whose owner changed nothing. That is a regression rather than a missing feature, so it is repaired at the key layer every render path already funnels through rather than at each of them.\n *\n * Three rules, and each has a way of going wrong:\n *\n * - **A `*Localized` key with no canonical partner stays put.** Suppressing on the name alone deletes data the response carries and nothing else is rendering.\n * - **The canonical key keeps its POSITION**, so a translated response and an English one lay out identically, column for column.\n * - **A row with nothing to fold is returned as the same object**, so the English path is not merely equivalent but untouched.\n *\n * The English value is dropped rather than shown beside its translation because the two are the same fact, and the caller here is generic: it cannot know that `sign` is the value a lookup would be keyed on. A component that needs both halves reads them itself with {@link display}.\n */\nexport function foldLocalized<V>(row: Record<string, V>): Record<string, V> {\n\tlet folded: Record<string, V> | undefined;\n\tfor (const key of Object.keys(row)) {\n\t\tif (!key.endsWith(LOCALIZED)) continue;\n\t\tconst base = key.slice(0, -LOCALIZED.length);\n\t\tif (base === '' || !(base in row)) continue;\n\t\tfolded ??= { ...row };\n\t\tconst value = row[key];\n\t\tif (value !== undefined && value !== null && value !== '')\n\t\t\tfolded[base] = value;\n\t\tdelete folded[key];\n\t}\n\treturn folded ?? row;\n}\n"],
|
|
5
|
-
"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resolve", "table", "name", "lookupKey", "PLANET_GLYPH", "planetGlyph", "SIGN_GLYPH", "signGlyph", "name", "resolve", "SIGNS_ORDER", "html", "LitElement", "nothing", "property", "state", "ifDefined", "resolveLang", "el", "inherited", "GLOBAL_KEY", "registry", "holder", "existing", "created", "interpolate", "template", "vars", "match", "key", "translate", "lang", "source", "catalogs", "registry", "tag", "catalog", "lookupKey", "onLocaleChange", "listener", "listeners", "LocaleController", "host", "onLocaleChange", "css", "baseStyles", "KEY_REFUSED_MESSAGE", "keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "css", "html", "nothing", "css", "html", "chevron", "disclosureStyles", "interpAccordionStyles", "css", "renderInterpAccordion", "sections", "name", "heading", "shown", "s", "nothing", "html", "i", "chevron", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "source", "vars", "e", "detail", "buildRequest", "MarkupDataController", "LocaleController", "FetchController", "baseStyles", "translate", "changed", "html", "sections", "name", "heading", "nothing", "renderInterpAccordion", "data", "body", "ifDefined", "resolveLang", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "normalizeLongitude", "lon", "wrapped", "longitudeToSignPosition", "longitude", "signIndex", "within", "degree", "minuteFloat", "minute", "second", "SIGNS_ORDER", "oppositePoint", "longitude", "normalizeLongitude", "arcMidpoint", "start", "end", "s", "span", "fanOut", "items", "longitudeOf", "minSeparation", "placed", "item", "a", "b", "i", "prev", "cur", "wanted", "last", "shift", "p", "arcSeparation", "width", "radius", "polarToCartesian", "cx", "cy", "angleDeg", "angleRad", "DATE_ONLY", "BARE_TIME", "NAIVE_DATETIME", "CANONICAL", "intlLocales", "locale", "cached", "canonical", "resolveDisplayDate", "input", "naive", "formatTime", "d", "timeZone", "formatDate", "formatNumber", "value", "dp", "fixed", "ASPECT_CLASS", "normalizeAspect", "a", "formatAspectName", "capitalize", "formatDateTime", "locale", "input", "time", "merged", "DATE_ONLY", "BARE_TIME", "date", "formatDate", "clock", "formatTime", "LOCALIZED", "display", "row", "key", "english", "rec", "localized", "canonical", "SIZE", "CENTER", "AXIS_LABEL_R", "OUTER_R", "SIGN_R", "BAND_R", "TRANSIT_R", "TRANSIT_DEG_R", "NATAL_R", "NATAL_DEG_R", "TRANSIT_LINE_R", "NATAL_LINE_R", "HUB_R", "HOUSE_NUM_R", "GLYPH_WIDTH", "DEG_LABEL_WIDTH", "LEADER_TICK", "LEADER_FOOT", "glyphFor", "name", "label", "planetGlyph", "degLabel", "longitude", "sp", "longitudeToSignPosition", "score", "v", "byName", "list", "m", "p", "capitalize", "RoxyTransitWheel", "RoxyDataElement", "raw", "out", "h", "i", "a", "b", "c", "html", "d", "natal", "transit", "aspects", "when", "formatDateTime", "count", "houses", "nothing", "ticks", "deg", "angle", "isMajor", "polarToCartesian", "svg", "SIGNS_ORDER", "_", "start", "end", "cusps", "cusp", "next", "arcMidpoint", "sign", "pos", "signGlyph", "bodies", "radius", "degRadius", "cls", "kind", "leaderSign", "separation", "arcSeparation", "fanOut", "displayLongitude", "degPos", "retro", "body", "display", "tooltip", "displaced", "tick", "foot", "natalBy", "transitBy", "t", "n", "from", "to", "normalizeAspect", "orb", "formatNumber", "ASPECT_CLASS", "asc", "normalizeLongitude", "oppositePoint", "lon", "inner", "outer", "houseSystem", "s", "byType", "type", "formatAspectName", "transiting", "showHouses", "rows", "cell", "houseCell", "key", "sections", "k", "baseStyles", "disclosureStyles", "interpAccordionStyles", "css", "__decorateClass", "property", "customElement"]
|
|
4
|
+
"sourcesContent": ["import { css, html, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { planetGlyph, SIGNS_ORDER, signGlyph } from '../tokens/index.js';\nimport type {\n\tCalculateTransitAspectsResponse,\n\tNatalChartResponse,\n} from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\tarcMidpoint,\n\tarcSeparation,\n\tfanOut,\n\tlongitudeToSignPosition,\n\tnormalizeLongitude,\n\toppositePoint,\n\tpolarToCartesian,\n} from '../utils/degree.js';\nimport { disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tASPECT_CLASS,\n\tformatAspectName,\n\tformatDateTime,\n\tformatNumber,\n\tnormalizeAspect,\n} from '../utils/format.js';\nimport {\n\ttype InterpSection,\n\tinterpAccordionStyles,\n} from '../utils/interp-accordion.js';\nimport { display } from '../utils/localized.js';\nimport { capitalize } from '../utils/string.js';\n\ntype Body = CalculateTransitAspectsResponse['transitPlanets'][number];\ntype TransitAspect = CalculateTransitAspectsResponse['aspects'][number];\ntype TransitSummary = CalculateTransitAspectsResponse['summary'];\n\n/**\n * The transit-aspects response plus the natal frame it now carries.\n *\n * @remarks\n * `/astrology/transit-aspects` returns `houses` and `ascendant` field for field identical to the\n * natal-chart ones, which is what lets the prop and the payload share one code path below. They are\n * declared here as OPTIONAL rather than read straight off the generated response type because\n * `specs/openapi.json` is refreshed from live only after the API deploys, so the type does not name\n * them yet and this component must compile against both the old spec and the new one. Once the spec\n * refresh lands the intersection is a no-op and this alias can go.\n */\ntype TransitAspectsPayload = CalculateTransitAspectsResponse &\n\tPartial<Pick<NatalChartResponse, 'houses' | 'ascendant'>>;\n\n/**\n * Radii, outermost first. Every one is explicit rather than derived from its\n * neighbour, because the two rings of glyphs and their two bands of degree\n * labels have to interleave without touching, and an offset-from-the-last-ring\n * scheme hides which pair is actually the tight one.\n */\nconst SIZE = 400;\nconst CENTER = SIZE / 2;\n/** ASC/DSC label. Inside the rim by more than half the label width, or the axis text clips on the viewBox edge. */\nconst AXIS_LABEL_R = 184;\n/** Outer rim of the zodiac band. */\nconst OUTER_R = 170;\n/** Sign glyphs, and the inner edge of the band that holds them. */\nconst SIGN_R = 154;\nconst BAND_R = 140;\n/** Transiting bodies: the OUTER ring, which is how a bi-wheel is read. Degree labels sit outward, into the free space under the sign band. */\nconst TRANSIT_R = 124;\nconst TRANSIT_DEG_R = 135;\n/** Natal bodies: the INNER ring, the chart being transited. Degree labels sit inward, so the two bands of numbers never meet. */\nconst NATAL_R = 94;\nconst NATAL_DEG_R = 83;\n/** Aspect lines run between the rings: out of the transit ring, in to the natal one. */\nconst TRANSIT_LINE_R = 112;\nconst NATAL_LINE_R = 104;\n/** Innermost circle, closing the wheel under the natal degree labels. */\nconst HUB_R = 70;\n/** House sector numbers, inside the hub: the only band on this wheel with nothing else in it. Drawn ONLY from real cusps, the response ones or a page override. */\nconst HOUSE_NUM_R = 58;\n/**\n * Widths a fanned cluster has to clear. The glyph is the wider mark but sits on\n * the larger radius, and the degree label is narrower on a smaller one, so which\n * of the two actually binds depends on the ring and neither can be assumed.\n */\nconst GLYPH_WIDTH = 13;\nconst DEG_LABEL_WIDTH = 15;\n/** Leader line: a tick at the body's true longitude, and the foot of the line beside the displaced glyph. Both offsets are measured from the ring, signed so the leader always runs into the gap between the two rings. */\nconst LEADER_TICK = 8;\nconst LEADER_FOOT = 4;\n\n/**\n * Glyph for an API body, or the name a reader sees when the library has none: the SVG ring position is the sole identifier for that body, so a miss must stay visibly wrong rather than a plausible fabricated abbreviation.\n *\n * Two arguments because the two halves answer to different languages. `name` is the canonical English value the glyph table is keyed on and must stay English; `label` is what is left ON SCREEN when that lookup misses, so it is the localized one.\n */\nconst glyphFor = (name: string, label: string): string =>\n\tplanetGlyph(name) ?? label;\n\n/** `12\u00B034'` from a raw ecliptic longitude, the form a practitioner reads off a wheel. */\nconst degLabel = (longitude: number): string => {\n\tconst sp = longitudeToSignPosition(longitude);\n\treturn `${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}'`;\n};\n\n/**\n * Round a 0-100 score for display. Not `formatNumber(v, 0)`, which strips\n * trailing zeros from the formatted string and would render a strength of 100\n * as \"1\". Same local helper, and the same reason, as `roxy-aspects-table`.\n */\nconst score = (v: unknown): string =>\n\ttypeof v === 'number' && Number.isFinite(v) ? String(Math.round(v)) : '';\n\n/** Bodies keyed by their canonical ENGLISH name, so an aspect or a table row can find a longitude without rescanning the array. The API keeps `name` English in every language for exactly this, and keying on `nameLocalized` would resolve nothing on a translated page. */\nconst byName = (list: Body[]): Map<string, Body> => {\n\tconst m = new Map<string, Body>();\n\tfor (const p of list) m.set(capitalize(p.name), p);\n\treturn m;\n};\n\n/**\n * Natal and transit bi-wheel: the natal chart on the inner ring, the transiting\n * bodies on the outer ring, and a line for every transit-to-natal aspect the\n * response returns. Pass `data` from /astrology/transit-aspects.\n *\n * @remarks\n * **Nothing astrological is computed here.** Every aspect line is drawn from an\n * entry in the response `aspects` array; the only arithmetic is placing a\n * longitude on a circle. `planet1` is the TRANSITING body and `planet2` the\n * NATAL one, which was settled empirically rather than from the field\n * description because reading them the other way round still draws a\n * plausible-looking wheel: against a live response every one of the 70 returned\n * orbs reconciles with the transit-to-natal separation, and only 4 with the\n * reverse.\n *\n * **The response carries real houses, and it did not always.** Every body comes\n * back with a `house` read against the NATAL cusps (a transiting body reports the\n * natal house it is currently passing through) plus a top-level `houseSystem`.\n * Verified live on 2026-08-08: the fourteen natal house numbers reconcile body\n * for body with /astrology/natal-chart for the same birth data, and requesting\n * `whole-sign` moves them. An earlier revision of the API did return `1` for\n * every body, and the comment saying so outlived the fix and went on justifying a\n * missing House column for months. The numbers are rendered, in their own\n * columns, labelled with the system the response names.\n *\n * **The GEOMETRY arrived next, and the wheel now draws itself.** The response also\n * carries the twelve natal cusps as `houses` and the natal `ascendant`, the same\n * twelve the house numbers above were read against, so the sector ring and the\n * real horizon come out of the one call the page already made. That closed the\n * house-less bi-wheel every embed drew through WordPress, /embed and the CDN\n * widgets, none of which can compose a second call. {@link RoxyTransitWheel.houses}\n * and {@link RoxyTransitWheel.ascendant} remain as OVERRIDES and keep winning\n * where a page sets them, which is what a stored response predating the fields,\n * or a trimming proxy, needs.\n *\n * **Nothing is ever derived, whichever source it came from.** A payload with\n * neither field still fixes 0 degrees Aries on the left horizon, says so in the\n * legend and in the SVG description rather than leaving a reader to discover it,\n * and draws no house divisions at all. Equal sectors derived from an Ascendant\n * and labelled with a quadrant system would replace one false statement with a\n * worse one. Every cusp on this wheel is a longitude some source stated, placed\n * on a circle, never one this component worked out.\n */\n@customElement('roxy-transit-wheel')\nexport class RoxyTransitWheel extends RoxyDataElement<CalculateTransitAspectsResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tinterpAccordionStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);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);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;max-width:var(--roxy-chart-max-width,560px);aspect-ratio:1;height:auto;margin:0 auto;display:block}.wheel-line{fill:none;stroke:var(--roxy-border,#e4e4e7)}.sign-glyph{fill:var(--roxy-secondary,#475569);font-size:14px;font-family:var(--roxy-font-sans)}.natal-glyph{fill:var(--roxy-accent-ink,#b45309);font-size:13px;font-weight:600;font-family:var(--roxy-font-sans)}.transit-glyph{fill:var(--roxy-info,#0284c7);font-size:13px;font-weight:600;font-family:var(--roxy-font-sans)}.leader{stroke:currentColor;stroke-width:.6px;opacity:.6}.leader.natal-glyph{stroke:var(--roxy-accent-ink,#b45309)}.leader.transit-glyph{stroke:var(--roxy-info,#0284c7)}.planet-deg{fill:var(--roxy-muted,#71717a);font-size:7px;font-family:var(--roxy-font-sans)}.planet-deg .retro{fill:var(--roxy-danger,#dc2626)}@container (width<=480px){.sign-glyph,.natal-glyph,.transit-glyph{font-size:18px}.planet-deg{font-size:10px}.house-num{font-size:12px}}.tick{stroke:var(--roxy-border,#e4e4e7)}.tick-major{stroke:var(--roxy-secondary,#475569)}.house-cusp{stroke:var(--roxy-secondary,#475569);stroke-width:1px;stroke-dasharray:3 3}.house-num{fill:var(--roxy-secondary,#475569);font-size:9px;font-family:var(--roxy-font-sans)}.axis-tick{stroke:var(--roxy-accent-ink,#b45309);stroke-width:1.5px}.axis-label{fill:var(--roxy-accent-ink,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.04em}.aspect{stroke-width:.8px;fill:none;opacity:.55}.aspect-trine,.aspect-sextile{stroke:var(--roxy-success,#16a34a)}.aspect-square,.aspect-opposition{stroke:var(--roxy-danger,#dc2626)}.aspect-conjunction{stroke:var(--roxy-accent-ink,#b45309)}.aspect-other{stroke:var(--roxy-muted,#71717a);opacity:.4}.swatch{vertical-align:middle;border-radius:50%;width:8px;height:8px;margin-right:4px;display:inline-block}.swatch--natal{background:var(--roxy-accent-ink,#b45309)}.swatch--transit{background:var(--roxy-info,#0284c7)}.swatch--harmonious{background:var(--roxy-success,#16a34a)}.swatch--challenging{background:var(--roxy-danger,#dc2626)}.legend{font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.summary-pills{gap:var(--roxy-space-sm,.5rem);margin-bottom:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.pill{padding:2px var(--roxy-space-sm,.5rem);border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);border:1px solid;align-items:center;gap:4px;display:inline-flex}.pill--muted{color:var(--roxy-fg,#0a0a0a);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent)}.pill--success{color:var(--roxy-success-fg,#166534);background:color-mix(in srgb, var(--roxy-success,#16a34a) 10%, transparent)}.pill--danger{color:var(--roxy-danger-fg,#991b1b);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent)}.strongest{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);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;align-items:center;gap:.4rem;display:flex}.strongest .label{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;font-weight:var(--roxy-weight-bold,600)}.strongest .meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);font-variant-numeric:tabular-nums;margin-left:auto}.glyph{font-size:1.1em;line-height:1}.nature-badge{font-size:var(--roxy-text-xs,.75rem);text-transform:capitalize;border-radius:9999px;padding:1px 8px;font-weight:600;display:inline-block}.nature-badge.harmonious{background:color-mix(in srgb, var(--roxy-success,#16a34a) 12%, transparent);color:var(--roxy-success-fg,#166534)}.nature-badge.challenging{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);color:var(--roxy-danger-fg,#991b1b)}.nature-badge.neutral{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent);color:var(--roxy-fg,#0a0a0a)}.scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:left;white-space:nowrap}thead th{color:var(--roxy-muted,#71717a);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}th{font-weight:var(--roxy-weight-bold,600)}td{font-variant-numeric:tabular-nums}.retro-badge{color:var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600);margin-left:.25rem}.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}`,\n\t];\n\n\t/** Heading above the wheel. The default is translated; a heading the page sets is passed through the catalogue too, so a host that supplies its own English wording still gets it localized when one is registered for it. */\n\t@property({ type: String })\n\theading = 'Transits';\n\n\t/**\n\t * Natal Ascendant as an ecliptic longitude in degrees (0-360), to override the\n\t * one the response carries.\n\t *\n\t * @remarks\n\t * Leave it unset on a live /astrology/transit-aspects response: that endpoint\n\t * returns the natal `ascendant` and the wheel reads it, so the horizon is\n\t * right with no page wiring at all. Set it only to orient the wheel on a\n\t * DIFFERENT horizon than the response describes, or to give one to a payload\n\t * that carries none. Either way it ROTATES the wheel so the given longitude\n\t * falls on the left horizon and draws the ASC/DSC axis. It draws no house\n\t * divisions, because a rotation is not a cusp; that is what\n\t * {@link RoxyTransitWheel.houses} is for. With neither the prop nor a payload\n\t * ascendant the wheel falls back to the honest default: 0 degrees Aries on\n\t * the left.\n\t */\n\t@property({ type: Number })\n\tascendant?: number;\n\n\t/**\n\t * The twelve natal house cusps, to override the ones the response carries.\n\t * Takes the /astrology/natal-chart `houses` array verbatim, or twelve bare\n\t * cusp longitudes in house order.\n\t *\n\t * @remarks\n\t * Leave it unset on a live /astrology/transit-aspects response: that endpoint\n\t * returns the same twelve natal cusps its house numbers are read against, so\n\t * the sector ring draws itself. Set it to draw a different cusp set than the\n\t * response carries, or to give one to a payload that carries none (a stored\n\t * response predating the field, or a proxy that trims it). Supplying either\n\t * source draws the twelve cusp lines and their numbers and, unless an\n\t * ascendant is also available, rotates the first cusp onto the left horizon.\n\t *\n\t * Both accepted shapes exist because the natural source is a natal-chart\n\t * response a host already holds, and passing `chart.houses` straight through\n\t * has to work; twelve numbers is the terser form for a host that stored only\n\t * the longitudes. Anything that does not resolve to houses 1 to 12 with finite\n\t * longitudes is ignored outright rather than half drawn, which is the same\n\t * degrade-honestly rule the rest of this component follows: a partial house\n\t * ring is a claim about placements the wheel cannot support.\n\t */\n\t@property({ type: Array })\n\thouses?: NatalChartResponse['houses'] | number[];\n\n\t/** The response widened to the natal frame it carries. One cast, so nothing below repeats it. */\n\tprivate get payload(): TransitAspectsPayload | undefined {\n\t\treturn this.data as TransitAspectsPayload | undefined;\n\t}\n\n\t/**\n\t * The Ascendant longitude the wheel orients on, or undefined.\n\t *\n\t * @remarks\n\t * The PROP wins over the payload wherever both exist: a page that passes one\n\t * has said something the response cannot know, and silently preferring the\n\t * response would make the prop dead on exactly the responses that carry the\n\t * field.\n\t */\n\tprivate get effectiveAscendant(): number | undefined {\n\t\tfor (const value of [this.ascendant, this.payload?.ascendant?.longitude]) {\n\t\t\tif (typeof value === 'number' && Number.isFinite(value)) return value;\n\t\t}\n\t\treturn undefined;\n\t}\n\n\t/** True when an ascendant is available at all, so the ASC/DSC axis is a real horizon rather than one derived from a cusp. */\n\tprivate get ascendantGiven(): boolean {\n\t\treturn this.effectiveAscendant !== undefined;\n\t}\n\n\t/** True when the sector ring came from the page rather than from the response, so the legend can say which. */\n\tprivate get cuspsFromPage(): boolean {\n\t\treturn Array.isArray(this.houses);\n\t}\n\n\t/**\n\t * The cusps to draw, normalized to houses 1 to 12 in order, or null. The prop\n\t * first, then the ones the response carries, on the same precedence rule as\n\t * {@link RoxyTransitWheel.effectiveAscendant}.\n\t *\n\t * @remarks\n\t * Sorted by house number rather than trusted in array order, and rejected\n\t * whole unless the twelve numbers are exactly 1 to 12 with finite longitudes.\n\t * A cusp set that fails either check is not a house division, and drawing part\n\t * of one would put a sector boundary where the host never claimed there was\n\t * one. A malformed PROP is rejected outright rather than falling through to\n\t * the payload: the page overrode the response on purpose, and quietly drawing\n\t * the response cusps under a bad override would be a different chart than\n\t * either source asked for.\n\t */\n\tprivate get cusps(): Array<{ number: number; longitude: number }> | null {\n\t\tconst raw = this.houses ?? this.payload?.houses;\n\t\tif (!Array.isArray(raw) || raw.length !== 12) return null;\n\t\tconst out = raw\n\t\t\t.map((h, i) =>\n\t\t\t\ttypeof h === 'number'\n\t\t\t\t\t? { number: i + 1, longitude: h }\n\t\t\t\t\t: { number: Number(h?.number), longitude: Number(h?.longitude) },\n\t\t\t)\n\t\t\t.sort((a, b) => a.number - b.number);\n\t\tconst complete = out.every(\n\t\t\t(c, i) => c.number === i + 1 && Number.isFinite(c.longitude),\n\t\t);\n\t\treturn complete ? out : null;\n\t}\n\n\t/**\n\t * Ecliptic longitude to SVG angle. 0 degrees is at 3 o'clock and positive\n\t * angles run clockwise on screen, so subtracting the longitude makes the\n\t * zodiac run counterclockwise, which is how a chart wheel is read. The 180\n\t * offset puts the reference point on the left horizon: the supplied Ascendant\n\t * first, else the supplied first house cusp, else 0 Aries.\n\t *\n\t * The Ascendant wins because the two are not the same longitude under every\n\t * system: whole-sign puts cusp 1 at 0 degrees of the rising sign, which can be\n\t * most of a sign away from the Ascendant itself.\n\t */\n\tprivate toAngle(longitude: number): number {\n\t\tconst origin = this.effectiveAscendant ?? this.cusps?.[0]?.longitude ?? 0;\n\t\treturn 180 + origin - longitude;\n\t}\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No transit data')}</div>`;\n\t}\n\n\tprotected renderData(d: CalculateTransitAspectsResponse) {\n\t\tconst natal = d.natalPlanets ?? [];\n\t\tconst transit = d.transitPlanets ?? [];\n\t\tconst aspects = d.aspects ?? [];\n\t\tconst when = formatDateTime(this.effectiveLang(), d.transitDate);\n\t\t// Label then number, at every count and in every language: the catalogue\n\t\t// carries no plural rules, so \"1 aspects\" is the alternative in English and\n\t\t// three wrong endings are the alternative in Russian.\n\t\tconst count =\n\t\t\taspects.length > 0\n\t\t\t\t? this.t('Aspects to the natal chart: {{count}}', {\n\t\t\t\t\t\tcount: aspects.length,\n\t\t\t\t\t})\n\t\t\t\t: '';\n\t\t// The House columns and the house-system chip both stand on the SAME fact:\n\t\t// that a body came back with a house. Derived once from the payload rather\n\t\t// than assumed from the type, so a host feeding an older captured response\n\t\t// loses the columns instead of printing a column of blanks under a system\n\t\t// name.\n\t\tconst houses = [...natal, ...transit].some((p) => Number.isFinite(p.house));\n\n\t\treturn html`<div class=\"wrap\" part=\"card\" aria-label=\"${this.t('Natal and transit bi-wheel')}\"><div class=\"head\" part=\"header\"><h2 class=\"title\">${this.t(this.heading)}</h2>${\n\t\t\t\t\twhen || count\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${[when, count].filter(Boolean).join(' \u00B7 ')}</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${this.renderWheel(natal, transit, aspects)} ${this.renderLegend(natal, transit, aspects, houses ? d.houseSystem : undefined)} ${this.renderSummary(d.summary)} ${this.renderPositions(natal, transit, houses)} ${this.renderReadings(aspects)}</div>`;\n\t}\n\n\t/**\n\t * What sits on the left horizon, in words. Rendered as a legend chip AND as a\n\t * sentence of the SVG description, from this one getter, so the drawing and\n\t * its accessible text cannot end up claiming different orientations.\n\t */\n\tprivate get orientationCaption(): string {\n\t\tif (this.ascendantGiven) return this.t('Ascendant on the left horizon');\n\t\tif (this.cusps) return this.t('First house cusp on the left horizon');\n\t\treturn this.t('Sign wheel, 0\u00B0 Aries on the left');\n\t}\n\n\t/**\n\t * Whether the twelve sectors on the wheel are real cusps, in words, and where\n\t * they came from. Same dual use as {@link RoxyTransitWheel.orientationCaption}.\n\t *\n\t * @remarks\n\t * The source is named because the caption is provenance: a reader\n\t * reconciling this wheel against another calculator needs to know whether the\n\t * cusps are the ones the endpoint computed the house numbers against, or a set\n\t * the page substituted for them.\n\t */\n\tprivate get cuspCaption(): string {\n\t\tif (!this.cusps) return this.t('No house cusps');\n\t\treturn this.cuspsFromPage\n\t\t\t? this.t('House cusps supplied by the page')\n\t\t\t: this.t('House cusps from the response');\n\t}\n\n\tprivate renderWheel(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t) {\n\t\treturn html`<svg viewBox=\"0 0 ${SIZE} ${SIZE}\" part=\"chart\" role=\"img\" aria-label=\"${this.t('Bi-wheel with natal bodies on the inner ring and transiting bodies on the outer ring')}\"><title>${this.t('Natal and transit bi-wheel')}</title><desc>${this.t('Twelve zodiac sign segments around a circular wheel. Natal bodies sit at their ecliptic longitudes on the inner ring and transiting bodies on the outer ring, and each line joins a transiting body to the natal body it aspects.')} ${this.orientationCaption}. ${this.cuspCaption}.</desc><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${OUTER_R}\" stroke-width=\"1.5\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${BAND_R}\" stroke-width=\"0.8\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${TRANSIT_LINE_R}\" stroke-width=\"0.6\"/><circle class=\"wheel-line\" cx=\"${CENTER}\" cy=\"${CENTER}\" r=\"${HUB_R}\" stroke-width=\"0.5\"/>${this.renderTicks()} ${this.renderSpokes()} ${this.renderSigns()} ${this.renderHouses()} ${this.renderAspectLines(natal, transit, aspects)} ${this.renderRing(natal, NATAL_R, NATAL_DEG_R, 'natal-glyph', this.t('Natal'), 1)} ${this.renderRing(transit, TRANSIT_R, TRANSIT_DEG_R, 'transit-glyph', this.t('Transiting'), -1)} ${this.renderAxis()}</svg>`;\n\t}\n\n\t/** A short mark every 5 degrees and a longer one on each sign cusp, so the band reads as a degree scale rather than a bare ring. */\n\tprivate renderTicks() {\n\t\tconst ticks = [];\n\t\tfor (let deg = 0; deg < 360; deg += 5) {\n\t\t\tconst angle = this.toAngle(deg);\n\t\t\tconst isMajor = deg % 30 === 0;\n\t\t\tconst a = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tisMajor ? BAND_R : OUTER_R - 5,\n\t\t\t\tangle,\n\t\t\t);\n\t\t\tconst b = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tticks.push(\n\t\t\t\tsvg`<line class=${isMajor ? 'tick tick-major' : 'tick'} x1=${a.x} y1=${a.y} x2=${b.x} y2=${b.y} stroke-width=${isMajor ? 1 : 0.5} />`,\n\t\t\t);\n\t\t}\n\t\treturn ticks;\n\t}\n\n\t/** Twelve sign boundaries, drawn from the inner ring outward. Solid, and always exactly 30 degrees apart: house cusps are the dashed lines from {@link RoxyTransitWheel.renderHouses} and only exist when a cusp set is available. */\n\tprivate renderSpokes() {\n\t\treturn SIGNS_ORDER.map((_, i) => {\n\t\t\tconst angle = this.toAngle(i * 30);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HUB_R, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\treturn svg`<line class=\"wheel-line\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} stroke-width=\"0.6\" />`;\n\t\t});\n\t}\n\n\t/**\n\t * The twelve house sectors, drawn ONLY from cusps some source stated: the ones\n\t * the response carries, or the {@link RoxyTransitWheel.houses} override.\n\t *\n\t * @remarks\n\t * Dashed and inset to the sign band, because the solid spokes beside them are\n\t * sign boundaries and a reader who cannot tell the two apart cannot reconcile\n\t * the chart against another calculator. Each number sits at the arc midpoint\n\t * of its own sector, so an unequal house carries its label inside itself; the\n\t * hub is the one band on this wheel with nothing else in it.\n\t *\n\t * Nothing here is derived. With no cusps available this renders nothing at all\n\t * rather than twelve equal sectors from the Ascendant, which would be a\n\t * different chart wearing the same label.\n\t *\n\t * **Known and accepted: a fanned glyph can sit one sector off.** {@link fanOut}\n\t * displaces a crowded glyph in ANGLE, so a body a degree inside a cusp can be\n\t * drawn just past it; measured on a real Capricorn stellium, the natal Sun\n\t * glyph landed in the ninth sector while the body is in the eighth. The leader\n\t * runs back to a tick at the true longitude and the House column is the\n\t * authoritative number, which is the same trade professional chart software\n\t * makes. Do not \"fix\" it by clamping a glyph to its sector: that would move the\n\t * mark AND still not be the position.\n\t */\n\tprivate renderHouses() {\n\t\tconst cusps = this.cusps;\n\t\tif (!cusps) return nothing;\n\t\treturn cusps.map((cusp, i) => {\n\t\t\tconst next = cusps[(i + 1) % 12];\n\t\t\tconst angle = this.toAngle(cusp.longitude);\n\t\t\tconst start = polarToCartesian(CENTER, CENTER, HUB_R, angle);\n\t\t\tconst end = polarToCartesian(CENTER, CENTER, BAND_R, angle);\n\t\t\tconst label = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tHOUSE_NUM_R,\n\t\t\t\tthis.toAngle(\n\t\t\t\t\tarcMidpoint(cusp.longitude, next?.longitude ?? cusp.longitude + 30),\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn svg`<g>\n\t\t\t\t<line class=\"house-cusp\" x1=${start.x} y1=${start.y} x2=${end.x} y2=${end.y} />\n\t\t\t\t<text class=\"house-num\" x=${label.x} y=${label.y} text-anchor=\"middle\" dominant-baseline=\"central\">${cusp.number}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\tprivate renderSigns() {\n\t\treturn SIGNS_ORDER.map((sign, i) => {\n\t\t\tconst pos = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tSIGN_R,\n\t\t\t\tthis.toAngle(i * 30 + 15),\n\t\t\t);\n\t\t\treturn svg`<text class=\"sign-glyph\" x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signGlyph(sign)}</text>`;\n\t\t});\n\t}\n\n\t/**\n\t * One ring of bodies, fanned apart only as far as legibility demands.\n\t *\n\t * @remarks\n\t * A real transit chart stacks four bodies inside a couple of degrees often\n\t * enough that drawing every glyph at its exact angle makes the inner ring\n\t * unreadable, degree labels printed over each other included. {@link fanOut}\n\t * pushes a crowded member forward and a thin leader line runs from the glyph\n\t * back to a tick at its TRUE longitude, so the drawing never claims a position\n\t * the response did not give. The separation is derived from the radius, so the\n\t * inner ring automatically asks for more degrees of arc than the outer one for\n\t * the same glyph.\n\t *\n\t * `leaderSign` points that tick outward from the natal ring and inward from\n\t * the transit ring, i.e. always into the gap between the two, so a leader is\n\t * never mistaken for one of the aspect lines crossing the middle.\n\t */\n\tprivate renderRing(\n\t\tbodies: Body[],\n\t\tradius: number,\n\t\tdegRadius: number,\n\t\tcls: string,\n\t\tkind: string,\n\t\tleaderSign: 1 | -1,\n\t) {\n\t\tconst separation = Math.max(\n\t\t\tarcSeparation(GLYPH_WIDTH, radius),\n\t\t\tarcSeparation(DEG_LABEL_WIDTH, degRadius),\n\t\t);\n\t\treturn fanOut(bodies, (p) => p.longitude, separation).map(\n\t\t\t({ item: p, longitude, displayLongitude }) => {\n\t\t\t\tconst angle = this.toAngle(displayLongitude);\n\t\t\t\tconst pos = polarToCartesian(CENTER, CENTER, radius, angle);\n\t\t\t\tconst degPos = polarToCartesian(CENTER, CENTER, degRadius, angle);\n\t\t\t\tconst retro = p.isRetrograde === true;\n\t\t\t\t// Whole degrees on the wheel and the full degree-and-minute in the\n\t\t\t\t// tooltip and the positions table, matching `roxy-synastry-chart`, the\n\t\t\t\t// other two-ring wheel here. A `12\u00B034'` label is roughly twice as wide as\n\t\t\t\t// `12\u00B0`, and on a ring this size two of them collide in a cluster the\n\t\t\t\t// fan-out has already separated the GLYPHS of, so the extra precision\n\t\t\t\t// costs the legibility of the position it is trying to state.\n\t\t\t\tconst label = `${longitudeToSignPosition(longitude).degree}\u00B0`;\n\t\t\t\tconst body = display(p, 'name');\n\t\t\t\tconst tooltip = `${kind} ${body}${retro ? ` ${this.t('retrograde')}` : ''} - ${degLabel(longitude)} ${display(p, 'sign')}`;\n\t\t\t\tconst displaced = Math.abs(displayLongitude - longitude) > 0.5;\n\t\t\t\tconst tick = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tradius + leaderSign * LEADER_TICK,\n\t\t\t\t\tthis.toAngle(longitude),\n\t\t\t\t);\n\t\t\t\tconst foot = polarToCartesian(\n\t\t\t\t\tCENTER,\n\t\t\t\t\tCENTER,\n\t\t\t\t\tradius + leaderSign * LEADER_FOOT,\n\t\t\t\t\tangle,\n\t\t\t\t);\n\t\t\t\treturn svg`<g>\n\t\t\t\t${\n\t\t\t\t\tdisplaced\n\t\t\t\t\t\t? svg`<line class=${`leader ${cls}`} x1=${tick.x} y1=${tick.y} x2=${foot.x} y2=${foot.y} />`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}\n\t\t\t\t<text class=${cls} x=${pos.x} y=${pos.y} text-anchor=\"middle\" dominant-baseline=\"central\"><title>${tooltip}</title>${glyphFor(p.name, body)}</text>\n\t\t\t\t<text class=\"planet-deg\" x=${degPos.x} y=${degPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${label}${retro ? svg`<tspan class=\"retro\"> \u211E</tspan>` : nothing}</text>\n\t\t\t</g>`;\n\t\t\t},\n\t\t);\n\t}\n\n\t/** One line per returned aspect, from the transiting body on the outer ring to the natal body on the inner one. */\n\tprivate renderAspectLines(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t) {\n\t\tconst natalBy = byName(natal);\n\t\tconst transitBy = byName(transit);\n\t\treturn aspects.map((a) => {\n\t\t\tconst t = transitBy.get(capitalize(a.planet1));\n\t\t\tconst n = natalBy.get(capitalize(a.planet2));\n\t\t\tif (\n\t\t\t\t!t ||\n\t\t\t\t!n ||\n\t\t\t\t!Number.isFinite(t.longitude) ||\n\t\t\t\t!Number.isFinite(n.longitude)\n\t\t\t)\n\t\t\t\treturn nothing;\n\t\t\tconst from = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tTRANSIT_LINE_R,\n\t\t\t\tthis.toAngle(t.longitude),\n\t\t\t);\n\t\t\tconst to = polarToCartesian(\n\t\t\t\tCENTER,\n\t\t\t\tCENTER,\n\t\t\t\tNATAL_LINE_R,\n\t\t\t\tthis.toAngle(n.longitude),\n\t\t\t);\n\t\t\tconst name = normalizeAspect(a);\n\t\t\tconst orb = formatNumber(a.orb, 1);\n\t\t\treturn svg`<line class=${`aspect ${ASPECT_CLASS[name] ?? 'aspect-other'}`} x1=${from.x} y1=${from.y} x2=${to.x} y2=${to.y}><title>${this.t('Transiting')} ${display(a, 'planet1')} ${display(a, 'type', name)} ${this.t('Natal')} ${display(a, 'planet2')}${orb ? ` (${this.t('orb')} ${orb}\u00B0)` : ''}</title></line>`;\n\t\t});\n\t}\n\n\t/**\n\t * ASC and DSC ticks, drawn ONLY when an ascendant is available, from the prop\n\t * or from the response. Nothing is derived: the descendant is the exact\n\t * opposite point of that value.\n\t *\n\t * Gated on the ascendant alone, never on the cusps. Under whole-sign the first\n\t * cusp is 0 degrees of the rising sign rather than the Ascendant, so labelling\n\t * it ASC would be wrong on exactly the charts a traditional reader casts.\n\t */\n\tprivate renderAxis() {\n\t\tconst given = this.effectiveAscendant;\n\t\tif (given === undefined) return nothing;\n\t\tconst asc = normalizeLongitude(given);\n\t\treturn [asc, oppositePoint(asc)].map((lon, i) => {\n\t\t\tconst angle = this.toAngle(lon);\n\t\t\tconst inner = polarToCartesian(CENTER, CENTER, OUTER_R, angle);\n\t\t\tconst outer = polarToCartesian(CENTER, CENTER, AXIS_LABEL_R, angle);\n\t\t\treturn svg`<g>\n\t\t\t\t<line class=\"axis-tick\" x1=${inner.x} y1=${inner.y} x2=${outer.x} y2=${outer.y} />\n\t\t\t\t<text class=\"axis-label\" x=${outer.x} y=${outer.y} text-anchor=\"middle\" dominant-baseline=\"central\">${i === 0 ? 'ASC' : 'DSC'}</text>\n\t\t\t</g>`;\n\t\t});\n\t}\n\n\t/**\n\t * The key to the wheel, and the one place the orientation is stated in words.\n\t * A reader who cannot tell whether the divisions are signs or houses cannot\n\t * reconcile the chart against another calculator, so the caption is\n\t * provenance rather than decoration.\n\t *\n\t * `houseSystem` labels the house NUMBERS in the table, which is the only thing\n\t * the response can vouch for, and the cusp chip separately says where the\n\t * drawn sectors came from. Two statements, each true on its own, rather than\n\t * one chip implying the ring and the numbers share a source.\n\t */\n\tprivate renderLegend(\n\t\tnatal: Body[],\n\t\ttransit: Body[],\n\t\taspects: TransitAspect[],\n\t\thouseSystem: string | undefined,\n\t) {\n\t\treturn html`<div class=\"legend\" part=\"legend\"><span><span class=\"swatch swatch--natal\"></span>${this.t('{{count}} natal bodies', { count: natal.length })}</span> <span><span class=\"swatch swatch--transit\"></span>${this.t('{{count}} transiting bodies', { count: transit.length })}</span> ${\n\t\t\t\taspects.length > 0\n\t\t\t\t\t? html`<span><span class=\"swatch swatch--harmonious\"></span>${this.t('Harmonious')}</span> <span><span class=\"swatch swatch--challenging\"></span>${this.t('Challenging')}</span>`\n\t\t\t\t\t: nothing\n\t\t\t} ${houseSystem ? html`<span>${this.t('{{system}} houses', { system: houseSystem })}</span>` : nothing} <span>${this.orientationCaption}</span> <span>${this.cuspCaption}</span></div>`;\n\t}\n\n\t/** Transit weather: the counts and the tightest contact. All of it is data, so all of it survives hide-readings. */\n\tprivate renderSummary(s: TransitSummary | undefined) {\n\t\tif (!s) return nothing;\n\t\tconst byType = Object.entries(s.byType ?? {}).sort((a, b) => b[1] - a[1]);\n\t\treturn html`<div part=\"details\"><div class=\"summary-pills\" role=\"region\" aria-label=\"${this.t('Transit aspect summary')}\">${typeof s.total === 'number' ? html`<span class=\"pill pill--muted\">${this.t('Total')}: ${s.total}</span>` : nothing} <span class=\"pill pill--success\">${this.t('Harmonious')}: ${s.harmonious}</span> <span class=\"pill pill--danger\">${this.t('Challenging')}: ${s.challenging}</span> <span class=\"pill pill--muted\">${this.t('Neutral')}: ${s.neutral}</span> ${byType.map(\n\t\t\t\t\t// English in every language, and nothing to do about it here: `byType`\n\t\t\t\t\t// is an object KEYED by the canonical aspect name, so the response\n\t\t\t\t\t// carries no localized partner for these the way `aspects[]` does.\n\t\t\t\t\t([type, count]) =>\n\t\t\t\t\t\thtml`<span class=\"pill pill--muted\">${formatAspectName({ type })}: ${count}</span>`,\n\t\t\t\t)}</div>${s.strongest ? this.renderStrongest(s.strongest) : nothing}</div>`;\n\t}\n\n\t/** The tightest transit by orb: the one contact most likely to be felt, lifted out so it is not buried among seventy others. */\n\tprivate renderStrongest(s: NonNullable<TransitSummary['strongest']>) {\n\t\tconst transiting = display(s, 'planet1');\n\t\tconst natal = display(s, 'planet2');\n\t\treturn html`<div class=\"strongest\" part=\"details strongest\"><span class=\"label\">${this.t('Strongest')}</span> <span aria-hidden=\"true\" class=\"glyph\">${glyphFor(s.planet1, transiting)}</span>${this.t('Transiting')} ${transiting} <span class=\"nature-badge ${(s.interpretation ?? 'neutral').toLowerCase()}\">${display(s, 'type', formatAspectName(s))}</span> <span aria-hidden=\"true\" class=\"glyph\">${glyphFor(s.planet2, natal)}</span>${this.t('Natal')} ${natal} <span class=\"meta\">${s.isApplying ? this.t('Applying') : this.t('Separating')} \u00B7 ${this.t('orb')} ${formatNumber(s.orb, 2)}\u00B0 \u00B7 ${this.t('strength')} ${score(s.strength)}</span></div>`;\n\t}\n\n\t/**\n\t * Both rings as exact positions, so every degree the wheel abbreviates to a\n\t * glyph stays readable and nothing the response carries is dropped.\n\t *\n\t * @remarks\n\t * The House columns are where the response's house numbers land, because the\n\t * wheel has no sectors to put them in unless a cusp set is available. Both\n\t * columns are read against the NATAL cusps: the transiting one is the natal\n\t * house that body is currently passing through, which is the whole point of a\n\t * transit report and is why the two are not the same fact under one heading.\n\t * `showHouses` comes from the payload rather than the type, so a response\n\t * without them loses the columns instead of printing a column of blanks.\n\t */\n\tprivate renderPositions(natal: Body[], transit: Body[], showHouses: boolean) {\n\t\tif (natal.length === 0 && transit.length === 0) return nothing;\n\t\tconst natalBy = byName(natal);\n\t\tconst transitBy = byName(transit);\n\t\tconst rows = natal.length > 0 ? natal : transit;\n\t\tconst cell = (p: Body | undefined) =>\n\t\t\tp\n\t\t\t\t? html`${signGlyph(p.sign) ?? ''} ${degLabel(p.longitude)} ${display(p, 'sign')}${p.isRetrograde ? html`<span class=\"retro-badge\" aria-label=\"${this.t('retrograde')}\">\u211E</span>` : nothing}`\n\t\t\t\t: nothing;\n\t\tconst houseCell = (p: Body | undefined) =>\n\t\t\tshowHouses\n\t\t\t\t? html`<td>${p && Number.isFinite(p.house) ? p.house : nothing}</td>`\n\t\t\t\t: nothing;\n\t\t// tabindex + role: the House columns pushed this table past the card, so it\n\t\t// genuinely scrolls now, and a scrollable region with no focusable content\n\t\t// of its own is unreachable by keyboard. Same pattern as `hd-connection`,\n\t\t// except the name is borrowed from the caption rather than written again:\n\t\t// one translated sentence, and it cannot drift from what the table holds.\n\t\treturn html`<div class=\"scroll\" part=\"table\" tabindex=\"0\" role=\"region\" aria-labelledby=\"transit-positions\"><table><caption id=\"transit-positions\" class=\"roxy-sr-only\">${this.t('Every body with its natal position and its position on the transit date, each as a zodiac sign and a degree.')} ${showHouses ? this.t('Both house numbers are read against the natal house cusps.') : nothing}</caption><thead><tr><th scope=\"col\">${this.t('Body')}</th><th scope=\"col\"><span class=\"swatch swatch--natal\" aria-hidden=\"true\"></span>${this.t('Natal')}</th>${showHouses ? html`<th scope=\"col\">${this.t('Natal house')}</th>` : nothing}<th scope=\"col\"><span class=\"swatch swatch--transit\" aria-hidden=\"true\"></span>${this.t('Transiting')}</th>${showHouses ? html`<th scope=\"col\">${this.t('Transiting house')}</th>` : nothing}</tr></thead><tbody>${rows.map((p) => {\n\t\t\t\t\t\tconst key = capitalize(p.name);\n\t\t\t\t\t\tconst body = display(p, 'name');\n\t\t\t\t\t\treturn html`<tr><th scope=\"row\"><span aria-hidden=\"true\" class=\"glyph\">${glyphFor(p.name, body)}</span> ${body}</th><td>${cell(natalBy.get(key))}</td>${houseCell(natalBy.get(key))}<td>${cell(transitBy.get(key))}</td>${houseCell(transitBy.get(key))}</tr>`;\n\t\t\t\t\t})}</tbody></table></div>`;\n\t}\n\n\t/**\n\t * The written transit readings, routed through the base so one `hide-readings`\n\t * attribute drops every one of them from the markup. The aspect itself (both\n\t * bodies, the type, applying or separating, orb and strength) is data and\n\t * stays on the wheel, in the summary and in the positions table regardless.\n\t */\n\tprivate renderReadings(aspects: TransitAspect[]) {\n\t\tconst sections: InterpSection[] = aspects\n\t\t\t.filter((a) => a.transitInterpretation?.summary)\n\t\t\t.map((a) => {\n\t\t\t\tconst t = a.transitInterpretation as NonNullable<\n\t\t\t\t\tTransitAspect['transitInterpretation']\n\t\t\t\t>;\n\t\t\t\tconst transiting = display(a, 'planet1');\n\t\t\t\tconst natal = display(a, 'planet2');\n\t\t\t\treturn {\n\t\t\t\t\tlabel: `${glyphFor(a.planet1, transiting)} ${transiting} ${display(a, 'type', formatAspectName(a))} ${glyphFor(a.planet2, natal)} ${natal}`,\n\t\t\t\t\taside: `${this.t('orb')} ${formatNumber(a.orb, 2)}\u00B0 \u00B7 ${this.t('strength')} ${score(a.strength)}`,\n\t\t\t\t\tbody: t.summary,\n\t\t\t\t\textra: html`${t.impact ? html`<p><strong>${this.t('Impact')}:</strong> ${t.impact}</p>` : nothing} ${t.timing ? html`<p><strong>${this.t('Timing')}:</strong> ${t.timing}</p>` : nothing} ${t.guidance ? html`<p><strong>${this.t('Guidance')}:</strong> ${t.guidance}</p>` : nothing} ${\n\t\t\t\t\t\tt.keywords?.length\n\t\t\t\t\t\t\t? html`<div class=\"interp-keywords\">${t.keywords.map((k) => html`<span class=\"kw\">${k}</span>`)}</div>`\n\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t}`,\n\t\t\t\t};\n\t\t\t});\n\t\treturn this.renderInterpretation(\n\t\t\tsections,\n\t\t\t'transit-aspect-readings',\n\t\t\tthis.t('Transit readings'),\n\t\t);\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-transit-wheel': RoxyTransitWheel;\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 * - `lookupKey`: the ONE normalizer every lookup table in this library is keyed\n * and read by (`tokens/index.ts` glyphs and abbreviations, `i18n/` chrome\n * strings).\n * - `capitalize`: title-cases the first character, lowercases the rest. A\n * DISPLAY helper only; it is not a lookup key (see `lookupKey`).\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\n/**\n * Fold a name to the canonical key its lookup table is stored under: lower case, every run of spaces, underscores and hyphens collapsed to one space, trimmed.\n *\n * @remarks\n * This exists because a GUESSED key spelling is a defect class this repo has now shipped twice. The glyph tables were keyed off whatever {@link capitalize} happened to produce (`North node`), while the API returns `North Node`, so every call site that reached the table without first calling `capitalize` missed and fell through to a fabricated abbreviation. Aspects hit the same wall from the other side: `/aspects` returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`.\n *\n * One normalizer, applied when a table is DEFINED and again when it is READ, removes the whole class: no call site has to remember a convention, and no table has to guess a spelling. Use it for every new table keyed by an API-supplied name.\n *\n * @example\n * ```ts\n * lookupKey('North Node'); // 'north node'\n * lookupKey('SEMI_SEXTILE'); // 'semi sextile'\n * lookupKey('semi-sextile'); // 'semi sextile'\n * ```\n */\nexport function lookupKey(s: string): string {\n\treturn s\n\t\t.toLowerCase()\n\t\t.replace(/[\\s_-]+/g, ' ')\n\t\t.trim();\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 (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n *\n * @remarks\n * **Every table here is keyed by {@link lookupKey} and read ONLY through the accessor beside it.** The raw records are deliberately not exported: a component that indexes a record directly has to guess the key convention, and a guessed spelling is what shipped `No North Node R`, `So South Node R` and `Bl Black Moon Lilith` into a live customer's natal chart. The API returns `North Node` with a space; the table was keyed `North node`, the spelling {@link capitalize} happens to produce, so every call site that forgot to call `capitalize` first missed the table.\n *\n * **A miss returns `undefined`, never a manufactured abbreviation.** The old `?? name.slice(0, 2)` fallback is what made the defect survive review: a failed lookup renders as a plausible two-letter code that reads exactly like an intentional abbreviation, so nothing about the output says \"this is broken\". A caller that can omit the glyph should omit it (`?? ''`); a caller that must show something falls back to the FULL name, which is visibly wrong at the size these slots are drawn.\n *\n * `tests/tokens.test.ts` resolves every body, sign and aspect name the committed spec can emit against these tables, so a vocabulary the API gains cannot ship unglyphed.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Look one name up in a normalized table. The single read path for every map in this file. */\nconst resolve = (\n\ttable: Record<string, string>,\n\tname: string | undefined | null,\n): string | undefined => (name ? table[lookupKey(name)] : undefined);\n\nconst PLANET_GLYPH: Record<string, string> = {\n\tsun: '\u2609',\n\tmoon: '\u263D',\n\tmercury: '\u263F',\n\tvenus: '\u2640',\n\tearth: '\u2641',\n\tmars: '\u2642',\n\tjupiter: '\u2643',\n\tsaturn: '\u2644',\n\turanus: '\u2645',\n\tneptune: '\u2646',\n\tpluto: '\u2647',\n\trahu: '\u260A',\n\tketu: '\u260B',\n\tascendant: 'Asc',\n\tlagna: 'La',\n\t'north node': '\u260A',\n\t'south node': '\u260B',\n\tchiron: '\u26B7',\n\tlilith: '\u26B8',\n\t'black moon lilith': '\u26B8',\n};\n\n/** Astrological glyph for a planet or point, or `undefined` when the library has none for it. */\nexport const planetGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_GLYPH, name);\n\nconst PLANET_ABBR: Record<string, string> = {\n\tsun: 'Su',\n\tmoon: 'Mo',\n\tmercury: 'Me',\n\tvenus: 'Ve',\n\tmars: 'Ma',\n\tjupiter: 'Ju',\n\tsaturn: 'Sa',\n\turanus: 'Ur',\n\tneptune: 'Ne',\n\tpluto: 'Pl',\n\trahu: 'Ra',\n\tketu: 'Ke',\n\tascendant: 'Asc',\n\tlagna: 'La',\n};\n\n/** Two-letter graha code for the tight cells of a North/South Indian kundli, or `undefined`. */\nexport const planetAbbr = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_ABBR, name);\n\nconst SIGN_GLYPH: Record<string, string> = {\n\taries: '\u2648',\n\ttaurus: '\u2649',\n\tgemini: '\u264A',\n\tcancer: '\u264B',\n\tleo: '\u264C',\n\tvirgo: '\u264D',\n\tlibra: '\u264E',\n\tscorpio: '\u264F',\n\tsagittarius: '\u2650',\n\tcapricorn: '\u2651',\n\taquarius: '\u2652',\n\tpisces: '\u2653',\n};\n\n/** Zodiac glyph for a sign name in any case, or `undefined`. */\nexport const signGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(SIGN_GLYPH, name);\n\nconst SIGN_ABBR: Record<string, string> = {\n\taries: 'Ar',\n\ttaurus: 'Ta',\n\tgemini: 'Ge',\n\tcancer: 'Cn',\n\tleo: 'Le',\n\tvirgo: 'Vi',\n\tlibra: 'Li',\n\tscorpio: 'Sc',\n\tsagittarius: 'Sg',\n\tcapricorn: 'Cp',\n\taquarius: 'Aq',\n\tpisces: 'Pi',\n};\n\n/** Two-letter rashi code for kundli cells and grid headers, or `undefined`. */\nexport const signAbbr = (name: string | undefined | null): string | undefined =>\n\tresolve(SIGN_ABBR, name);\n\n/** The twelve signs in zodiacal order. Display values, not lookup keys: read them through {@link signGlyph} / {@link signAbbr}. */\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Glyph per aspect. Used by the natal, transit and synastry aspect tables.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nconst ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\t'semi sextile': '\u26BA',\n\tsemisquare: '\u2220',\n\t'semi square': '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Aspect glyph for any of the separator forms the endpoints use (`SEMI_SEXTILE`, `SEMI SEXTILE`, `semi-sextile`), or `undefined`. */\nexport const aspectSymbol = (\n\tname: string | undefined | null,\n): string | undefined => resolve(ASPECT_SYMBOL, name);\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nconst TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n};\n\n/** Trigram glyph for a trigram name in any case, or `undefined`. */\nexport const trigramGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(TRIGRAM_GLYPH, name);\n\n/** Moon phase emoji set. Used by the moon phase card. */\nconst MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n\n/**\n * Emoji for a lunar phase, or `undefined`.\n *\n * @remarks\n * The live API suffixes most phase names (`Waxing Gibbous Moon`) and calls the third quarter `Third Quarter Moon`, while only new and full moon carry the suffix in the table. Both reconciliations live here rather than in the card, so any component reading a phase name resolves the same eight phases from the same four spellings.\n */\nexport const moonPhaseEmoji = (\n\tname: string | undefined | null,\n): string | undefined => {\n\tif (!name) return undefined;\n\tconst key = lookupKey(name);\n\tconst bare = key.replace(/ moon$/, '');\n\tconst alias = bare === 'third quarter' ? 'last quarter' : bare;\n\treturn MOON_PHASE_EMOJI[key] ?? MOON_PHASE_EMOJI[alias];\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\tnothing,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { resolveLang } from '../i18n/lang.js';\nimport { LocaleController } from '../i18n/locale-controller.js';\nimport { translate } from '../i18n/registry.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport {\n\ttype InterpSection,\n\trenderInterpAccordion,\n} from './interp-accordion.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * Two things every subclass inherits for the host page to shape the render from outside the shadow root, with no JavaScript: the `hide-readings` attribute ({@link RoxyDataElement.hideReadings}), and the `part` names on the base's own branches (`form`, `loading`, `error`, `edit-bar`, `attribution`). A component adds `part` to its own structural blocks; the vocabulary is in `docs/authoring.md`.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/**\n\t * Render the chart and the data, and omit the written interpretation. Off by default, so a component that does not set it is byte-identical to before.\n\t *\n\t * @remarks\n\t * The suppressed content is the prose an endpoint returns ABOUT the result: the interpretation accordion, the interpretive paragraphs, and the keyword chips that belong to them. Everything a practitioner reads the numbers off stays: wheels, tables, grids, legends, pills, counts and dates. The reading is dropped from the DOM rather than hidden with CSS, so a page that publishes the chart alone never ships the prose it is not showing.\n\t *\n\t * Set it when the page supplies its own words, which is the common case for a practitioner site that wants the graphic under its own writing.\n\t */\n\t@property({ type: Boolean, attribute: 'hide-readings', reflect: true })\n\thideReadings = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\t// Re-render if a chrome-string catalogue lands after this element upgraded.\n\t\tnew LocaleController(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\t/**\n\t * The chrome string for this element's language, keyed by its own English source text.\n\t *\n\t * @remarks\n\t * Pass the English copy, never a key. With no catalogue registered the source string is returned unchanged, so an English page pays nothing and a language we do not ship degrades to English rather than to a visible key.\n\t *\n\t * Chrome only. A value the API returned (a planet, a sign, an aspect, a house system) is NOT translated here: it is rendered as the response carries it, so the words on the chart and the words in the response can never disagree.\n\t *\n\t * @example\n\t * ```ts\n\t * this.t('Aspect grid'); // 'Cuadricula de aspectos' under lang=\"es\"\n\t * this.t('{{count}} planets', { count: 12 }); // '12 planetas'\n\t * ```\n\t */\n\tprotected t(source: string, vars?: Record<string, string | number>): string {\n\t\treturn translate(this.effectiveLang(), source, vars);\n\t}\n\n\t/** {@link RoxyDataElement.t} as a value, bound once, for a shared render helper that has no host of its own and therefore cannot resolve a page language (`utils/hd-reading.ts`). Named `translator` and not `translate` because `HTMLElement.translate` is a real DOM property and shadowing it with a protected member makes every `@customElement` decorator in the library fail to typecheck. */\n\tprotected readonly translator = (\n\t\tsource: string,\n\t\tvars?: Record<string, string | number>,\n\t): string => this.t(source, vars);\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * The interpretation accordion, gated by {@link RoxyDataElement.hideReadings}. Every component that shows a written reading routes through here instead of calling {@link renderInterpAccordion} directly.\n\t *\n\t * @remarks\n\t * The gate lives on the base rather than in each component because the property does, and a plain render function cannot read component state. One call site per accordion, one place that decides whether prose renders, and the section it emits carries the same `readings` part in every component.\n\t *\n\t * Prose that is NOT in an accordion (a summary paragraph, a per-item interpretation) is still the component's own to gate, since only the component knows which of its blocks are readings.\n\t */\n\tprotected renderInterpretation(\n\t\tsections: InterpSection[],\n\t\tname: string,\n\t\theading?: string,\n\t): unknown {\n\t\tif (this.hideReadings) return nothing;\n\t\t// The default heading is localized HERE rather than in the accordion:\n\t\t// that is a plain render function with no host, so it cannot read a\n\t\t// language, and this is the one call site every component routes through.\n\t\treturn renderInterpAccordion(sections, name, heading ?? this.t('Reading'));\n\t}\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\" part=\"edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">${this.t('Edit query')}</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\" part=\"attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">${this.t('Spiritual data by RoxyAPI')}</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form part=\"form\" data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/**\n\t * Site-owner language for this element: the `lang` attribute, the nearest ancestor carrying one, or the document. Protected so a component that composes another can forward it (a child inside this shadow root cannot reach the host page on its own).\n\t *\n\t * Full tag, region included. The truncation to what `?lang=` accepts happens where the request is built, in `<roxy-endpoint-form>`.\n\t */\n\tprotected effectiveLang(): string | undefined {\n\t\treturn resolveLang(this);\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No data')}</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"${this.t('Loading')}\" part=\"loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\" part=\"error\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "/**\n * Where a component's language comes from, and what is safe to send to the API.\n *\n * @remarks\n * Two different answers, and conflating them is the whole reason this file is separate from the catalogue:\n *\n * - {@link resolveLang} answers \"what language is this PAGE in\", and keeps the full tag, because `es-AR` is a legitimate thing for a catalogue to want to differ on.\n * - {@link apiLang} answers \"what may go on the query string\", which is a narrower question with a hard edge: `?lang=es-AR` is a 400, `?lang=es` is a 200.\n *\n * The full tag is not a nicety the catalogue happens to tolerate: `utils/format.ts` hands it to `Intl`, which reads the region and writes `15 de ene de 1990` for `es-AR` where it writes `15 ene 1990` for `es`. Passing the API answer to a formatter demotes every regional visitor to the base language and nothing fails, so the two values are never interchangeable.\n */\n\nimport { API_LANGUAGES } from '../generated/api-languages.js';\n\n/**\n * The site-owner language for an element, resolved through the four-link chain the revamp design specifies.\n *\n * @remarks\n * 1. the element's own `lang` attribute (the explicit per-embed override),\n * 2. the nearest ancestor carrying `lang`, so one wrapper localizes a whole section,\n * 3. `document.documentElement.lang`, which is what makes this work on a real CMS with no markup change at all: WordPress emits `<html lang=\"es-AR\">` on every page of a Spanish site,\n * 4. nothing, which the callers read as English.\n *\n * Only link 1 used to be implemented, so a component on a fully Spanish page rendered English chrome and there was no way to fix it except hand-editing every embed.\n *\n * `navigator.language` is deliberately NOT in the chain. It is the VISITOR's preference, not the site's: it fragments the API cache across every locale a visitor might carry and silently serves two people different content from the same URL.\n *\n * Link 2 uses `closest`, which stops at a shadow boundary. A component composed INSIDE another component's shadow root therefore cannot see the host page, which is why every composing component forwards `lang` to its children explicitly.\n */\nexport function resolveLang(el: HTMLElement): string | undefined {\n\t// Native accessor, never a Lit @property: declaring one would shadow\n\t// HTMLElement.lang and break the platform attribute for every consumer.\n\tif (el.lang) return el.lang;\n\tif (typeof document === 'undefined') return undefined;\n\tconst inherited = el.closest?.('[lang]')?.getAttribute('lang');\n\tif (inherited) return inherited;\n\treturn document.documentElement.lang || undefined;\n}\n\n/**\n * The value safe to put on `?lang=`, or `undefined` to leave the request on the API default.\n *\n * @remarks\n * Two narrowings, both of which are load-bearing the moment {@link resolveLang} starts reading `<html lang>`:\n *\n * - **The region is dropped.** A regional tag is a 400, so a Spanish WordPress site would go from English-but-working to broken the day the language chain was completed. `es-AR`, `es-419` and `ES` all send `es`.\n * - **An unsupported language is omitted, not sent.** The chain now surfaces whatever the host page carries, including languages the API does not translate, and an unlisted tag is the same 400. Omitting it degrades to English, which is the behaviour those pages already had.\n */\nexport function apiLang(el: HTMLElement): string | undefined {\n\tconst tag = resolveLang(el);\n\tif (!tag) return undefined;\n\tconst base = tag.toLowerCase().split('-')[0] as string;\n\treturn API_LANGUAGES.includes(base) ? base : undefined;\n}\n", "/**\n * The chrome-string catalogue: one resolver reading one registry, so a translation can arrive from anywhere without a component changing.\n *\n * @remarks\n * **The key IS the canonical English string**, folded through {@link lookupKey}. There is no invented key vocabulary to keep in sync with the copy, which is the same rule the glyph tables in `tokens/index.ts` follow (they key off the exact value the API returns). Two consequences that are the whole point:\n *\n * - **English costs zero bytes.** A miss returns the source string, so the English build ships no catalogue at all, and a site that never loads a locale payload is byte-identical to one built before this file existed.\n * - **A missing translation degrades to English, never to a key.** The failure mode of a keyed catalogue is a raw `natal.tabs.wheel` rendered at a customer; here the worst case is the English word.\n *\n * **The registry lives on `globalThis`, not in module scope, because it has to.** Every `dist/cdn/components/*.js` is a self-contained IIFE with its own copy of this module, so a `Map` here would be invisible to the second component on the page. One global object, written by the locale payload and read by every bundle, is what makes `dist/cdn/locales/es.js` a single download that translates all of them.\n *\n * Load order is not guaranteed on a real host (WordPress enqueues scripts in an order the plugin does not fully control, and a payload may be deferred), so {@link onLocaleChange} lets an element that has already rendered in English re-render when its catalogue lands.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Shared mutable state, addressed by a name rather than a module binding so every bundle on the page reaches the same object. */\ninterface LocaleRegistry {\n\t/** Language tag (lower case) to catalogue, keyed by {@link lookupKey} of the English source string. */\n\tcatalogs: Record<string, Record<string, string>>;\n\t/** Elements waiting to re-render when a catalogue arrives. */\n\tlisteners: Set<() => void>;\n}\n\nconst GLOBAL_KEY = '__ROXY_UI_I18N__';\n\nfunction registry(): LocaleRegistry {\n\tconst holder = globalThis as unknown as Record<string, LocaleRegistry>;\n\tconst existing = holder[GLOBAL_KEY];\n\tif (existing) return existing;\n\tconst created: LocaleRegistry = { catalogs: {}, listeners: new Set() };\n\tholder[GLOBAL_KEY] = created;\n\treturn created;\n}\n\n/**\n * Publish a catalogue for a language tag and wake every mounted element.\n *\n * @remarks\n * The catalogue is authored keyed by the English source string, exactly as it appears at the call site, and normalized here. That keeps the source file readable and diffable against the component that renders it, while the runtime lookup stays a single property read.\n *\n * This is the ONLY way into the registry, so a catalogue can later come from a static file, a server response, or a host page inlining a script tag, without a component knowing the difference.\n */\nexport function registerLocale(\n\tlang: string,\n\tcatalog: Record<string, string>,\n): void {\n\tconst reg = registry();\n\tconst normalized: Record<string, string> = {};\n\tfor (const [source, translated] of Object.entries(catalog)) {\n\t\tnormalized[lookupKey(source)] = translated;\n\t}\n\treg.catalogs[lang.toLowerCase()] = normalized;\n\tfor (const listener of reg.listeners) listener();\n}\n\n/**\n * Replace `{{name}}` placeholders. Copied from the API-side translator so both sides of the product interpolate identically; an unknown placeholder is left verbatim rather than blanked, so a typo in a catalogue is visible instead of silently eating the value.\n */\nexport function interpolate(\n\ttemplate: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!vars) return template;\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (match, key: string) =>\n\t\tkey in vars ? String(vars[key] ?? '') : match,\n\t);\n}\n\n/**\n * The chrome string for `lang`, falling back to the English `source` it is keyed by.\n *\n * @remarks\n * A regional tag resolves against its base language, so `es-AR` and `es-419` both read the `es` catalogue and a site does not have to know which tags we happen to ship. An exact regional catalogue still wins if one is ever registered.\n */\nexport function translate(\n\tlang: string | undefined,\n\tsource: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!lang) return interpolate(source, vars);\n\tconst { catalogs } = registry();\n\tconst tag = lang.toLowerCase();\n\tconst catalog = catalogs[tag] ?? catalogs[tag.split('-')[0] as string];\n\treturn interpolate(catalog?.[lookupKey(source)] ?? source, vars);\n}\n\n/** Subscribe to catalogue arrivals. Returns the unsubscribe, so an element can drop it on disconnect. */\nexport function onLocaleChange(listener: () => void): () => void {\n\tconst { listeners } = registry();\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { onLocaleChange } from './registry.js';\n\n/**\n * Re-renders its host when a chrome-string catalogue arrives.\n *\n * @remarks\n * Without this the catalogue would have to be on the page BEFORE the elements upgrade, which is not something a component can require of a real host. WordPress orders enqueued scripts by dependency and a site owner can add `defer` to any of them; a CDN embed is two independent `<script src>` tags. Any of those can land the locale payload after the first paint, and the visible result would be a chart that renders in English on a Spanish page for no reason the site owner can see or fix.\n *\n * Mirrors `MarkupDataController`: constructed in {@link RoxyDataElement}'s constructor, subscribes on connect, drops the subscription on disconnect. Registration is idempotent and a re-register of the same language simply re-renders, so a payload loaded twice is harmless.\n */\nexport class LocaleController implements ReactiveController {\n\tprivate readonly host: ReactiveControllerHost;\n\tprivate unsubscribe?: () => void;\n\n\tconstructor(host: ReactiveControllerHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected(): void {\n\t\tthis.unsubscribe = onLocaleChange(() => this.host.requestUpdate());\n\t}\n\n\thostDisconnected(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\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}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@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-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n *\n * **Call it through `RoxyDataElement.renderInterpretation`, never directly.** That method is where `hide-readings` is honoured, so a direct call renders prose a host asked to be left out. The section it emits carries `part=\"section readings\"` and each row `part=\"reading\"`, which is what makes the readings of EVERY component addressable under one name from outside the shadow root.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{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);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\" part=\"section readings\"><h3>${heading}</h3>${shown.map(\n\t\t\t(\n\t\t\t\ts,\n\t\t\t\ti,\n\t\t\t) => html`<details class=\"interp-card\" part=\"reading\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<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>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`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}}`;\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 * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\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 * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tlet d = Math.floor(deg);\n\tlet m = Math.round((deg - d) * 60);\n\tif (m === 60) {\n\t\tm = 0;\n\t\td += 1;\n\t}\n\treturn `${d}\u00B0${String(m).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** A body placed on a wheel: where it really is, and where its glyph had to be drawn to stay legible. */\nexport interface FannedPoint<T> {\n\titem: T;\n\t/** The true ecliptic longitude. Where a leader line points, and the only value a reader should take as the position. */\n\tlongitude: number;\n\t/** Where the glyph is drawn, pushed forward only as far as it takes to clear its neighbour. Equal to {@link FannedPoint.longitude} whenever nothing was in the way. */\n\tdisplayLongitude: number;\n}\n\n/**\n * Spread a cluster of bodies apart along a wheel so every glyph stays readable,\n * without moving any of them off its real position in the data.\n *\n * @remarks\n * Conjunctions inside a few degrees are the norm, not the exception: a\n * Sun-Mercury-Venus cluster or a stack of outer planets will pile four glyphs on\n * top of each other and print their degree labels over one another. Sorting by\n * longitude and pushing each later member forward until it clears\n * `minSeparation` is the conventional fix in professional chart software, and it\n * is why {@link FannedPoint} carries BOTH longitudes: the caller draws the glyph\n * at the display value and a leader line back to the true one, so nothing about\n * the drawing claims a position the response did not give.\n *\n * `minSeparation` is an ANGLE, so it depends on the radius the caller is drawing\n * at: the same glyph needs more degrees of arc on a small ring than a large one.\n *\n * If a cluster runs past 360 degrees the whole set slides back by the overshoot,\n * which keeps the stack anchored near its real longitudes instead of wrapping\n * one member around to the far side of the wheel.\n */\nexport function fanOut<T>(\n\titems: readonly T[],\n\tlongitudeOf: (item: T) => number,\n\tminSeparation: number,\n): FannedPoint<T>[] {\n\tconst placed: FannedPoint<T>[] = items\n\t\t.filter((item) => Number.isFinite(longitudeOf(item)))\n\t\t.map((item) => {\n\t\t\tconst longitude = normalizeLongitude(longitudeOf(item));\n\t\t\treturn { item, longitude, displayLongitude: longitude };\n\t\t})\n\t\t.sort((a, b) => a.longitude - b.longitude);\n\n\tfor (let i = 1; i < placed.length; i++) {\n\t\tconst prev = placed[i - 1];\n\t\tconst cur = placed[i];\n\t\tif (!prev || !cur) continue;\n\t\tconst wanted = prev.displayLongitude + minSeparation;\n\t\tif (cur.displayLongitude < wanted) cur.displayLongitude = wanted;\n\t}\n\n\tconst last = placed[placed.length - 1];\n\tif (last && last.displayLongitude > 360) {\n\t\tconst shift = last.displayLongitude - 360;\n\t\tfor (const p of placed) p.displayLongitude -= shift;\n\t}\n\treturn placed;\n}\n\n/**\n * Degrees of arc a mark of `width` user units occupies at `radius`, which is the\n * separation {@link fanOut} needs to keep two of them from touching. One\n * expression instead of a magic number per ring, so an inner ring automatically\n * asks for more degrees than an outer one.\n */\nexport function arcSeparation(width: number, radius: number): number {\n\treturn radius > 0 ? (width / radius) * (180 / Math.PI) : 0;\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\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 * @remarks\n * **This file is the ONLY place in the library that may call `Intl` or a `toLocale*` method, and every helper that does takes the locale as its first argument, required.** Both halves are enforced by a source scan in `tests/i18n.test.ts`.\n *\n * The locale is the DISPLAY locale, the full tag `resolveLang` returns, region included. It is NOT the value that goes on `?lang=`: that one is truncated to a supported two-letter code because the API rejects anything else, and handing THAT to Intl would render every Argentine visitor's dates in Castilian conventions. `es-AR` is exactly the tag Intl wants.\n *\n * It is required rather than optional because the defect it replaces was an omission: `toLocaleDateString(undefined, ...)` means \"the locale of whoever is looking\", so a Spanish page rendered `Carta natal` above `Jan 15, 1990, 2:30 PM`, and two visitors to the same page saw two different strings. An optional parameter defaults straight back to that. A missing argument is now a typecheck failure at every call site.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/** Canonical form per tag seen, so a page carrying an unparseable `lang` does not throw once per rendered date. */\nconst CANONICAL: Map<string, string> = new Map();\n\n/**\n * The locale list to hand Intl: the page's tag first, English behind it.\n *\n * @remarks\n * Two failure modes, both reachable from a `lang` attribute a site owner typed by hand and neither of which may reach a visitor:\n *\n * - **A structurally invalid tag throws.** `lang=\"english\"` or `lang=\"en_US\"` makes every `toLocale*` call raise a RangeError, which inside a render is a blank component rather than a wrong date. Canonicalizing behind a try/catch degrades it to English instead.\n * - **A valid-but-unknown tag falls back to the RUNTIME default**, which is the viewer's browser again, so the bug reappears for exactly the pages least likely to notice. Naming `en` as the second entry makes the fallback the page's, not the visitor's.\n *\n * No language signal at all resolves to English for the same reason the chrome catalogue does: a page that never declares a language is English as far as this library is concerned, and English chrome over German dates is the inconsistency this whole file exists to remove. `navigator.language` is deliberately absent from the chain here as it is in `resolveLang`: it is the VISITOR's preference, not the site's.\n */\nfunction intlLocales(locale: string | undefined): string[] {\n\tif (!locale) return ['en'];\n\tconst cached = CANONICAL.get(locale);\n\tif (cached) return [cached, 'en'];\n\tlet canonical = 'en';\n\ttry {\n\t\tcanonical = Intl.getCanonicalLocales(locale)[0] ?? 'en';\n\t} catch {\n\t\tcanonical = 'en';\n\t}\n\tCANONICAL.set(locale, canonical);\n\treturn [canonical, 'en'];\n}\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still writes them in the PAGE locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n *\n * Deliberately NOT exported. It used to be, so a component needing a shape these helpers did not offer could pin its own wall clock and call Intl itself, which is how `dasha-timeline` came to hardcode `toLocaleString('en', ...)` and pin every boundary date to English. A shape that is missing is added here, beside the locale handling, not reimplemented in a component.\n */\nfunction resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\n/**\n * The clock, in the page locale: `2:30 PM` in English, `14:30` in German.\n *\n * @remarks\n * The hour cycle is the locale's, never ours. It used to be pinned `hour12: true`, which put an AM/PM clock on every page in Europe and Latin America while the embedded form beside it labelled its own input \"formato de 24 horas\". CLDR already knows which convention each locale reads, including the ones that surprise you (`es` is 24-hour, `es-AR` is 12-hour with `p. m.`), so asserting a cycle here is asserting we know better than the locale data.\n */\nexport function formatTime(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(intlLocales(locale), {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tlocale: string | undefined,\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(locale, t.start);\n\tconst end = formatTime(locale, t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(\n\tlocale: string | undefined,\n\tstart: unknown,\n\tend: unknown,\n): string {\n\tconst a = formatDate(locale, start);\n\tconst b = formatDate(locale, end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/** How much of a timestamp a label shows. `time` is the whole date plus the clock. */\nexport type DateGrain = 'year' | 'month' | 'day' | 'time';\n\n/**\n * A timestamp at a chosen granularity, for an axis or a bar end where the full date would not fit.\n *\n * @remarks\n * Every grain below `year` carries the year, because a period routinely straddles new year and a label reading `28 Dec - 3 Jan` says nothing about which side moved. `year` is sliced off the string rather than formatted, since a bare four-digit year is the same in every locale this library ships and running it through Intl would introduce era and numbering-system differences into an axis tick.\n */\nexport function formatDateGrain(\n\tlocale: string | undefined,\n\tinput: unknown,\n\tgrain: DateGrain,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (grain === 'year') {\n\t\tconst m = input.match(/^(\\d{4})/);\n\t\treturn m?.[1] ?? input;\n\t}\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleString(intlLocales(locale), {\n\t\tday: grain === 'month' ? undefined : 'numeric',\n\t\tmonth: 'short',\n\t\tyear: 'numeric',\n\t\thour: grain === 'time' ? 'numeric' : undefined,\n\t\tminute: grain === 'time' ? '2-digit' : undefined,\n\t\ttimeZone,\n\t});\n}\n\n/**\n * Month name from a 1-based month number: `January`, `enero`, `janvier`.\n *\n * @remarks\n * Two components carried a byte-identical array of twelve English month names, which is both a duplicated table and a table of something the platform already knows in every language. Anchored to a UTC noon so no timezone can roll the date into the neighbouring month.\n */\nexport function monthName(locale: string | undefined, month: unknown): string {\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(2000, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * A whole number with the page locale's digit grouping: `12,345` in English, `12.345` in Spanish.\n *\n * @remarks\n * Rounds rather than truncating, so a caller testing the magnitude (`Math.round(km) === 0`) and this label agree about which side of a boundary a value fell.\n */\nexport function formatInteger(\n\tlocale: string | undefined,\n\tvalue: unknown,\n): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toLocaleString(intlLocales(locale), {\n\t\tmaximumFractionDigits: 0,\n\t});\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * Guard on the decimal point, and never strip from the integer side. A naive `.replace(/\\.?0+$/, '')` over the whole string eats zeros off the INTEGER whenever there is no decimal point, so at `dp = 0` it turns `100` into `1`, `90` into `9` and `0` into the empty string.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\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 canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums, and every one of them needs a human form that {@link humanize} cannot derive: KP is an initialism that must stay uppercase, and `raman` is a person, B.V. Raman, not a word. Anything unmapped degrades to a humanized slug rather than rendering the enum. That fallback is a safety net, not a licence to skip the map, since a humanized slug reads as a bare surname where a full name belongs. A test fails if the committed spec gains a frame this map lacks.\n */\nexport const AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n\traman: 'B.V. Raman',\n\n\tcustom: 'Custom',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('en', '1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('en', '1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('de', '1990-01-15T14:30:00'); // '15. Jan. 1990, 14:30'\n * formatDateTime('en', '1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(\n\tlocale: string | undefined,\n\tinput: unknown,\n\ttime?: unknown,\n): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(locale, merged);\n\tconst clock = formatTime(locale, merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n\n/**\n * The Sanskrit form of a name, but only when it actually differs from the English one.\n *\n * @remarks\n * Several endpoints pair an English `name` with a `sanskritName` that is sometimes the SAME string, because the tradition and the translation coincide (a nakshatra is `Ashwini` either way). Rendering the pair unconditionally then prints `Ashwini (Ashwini)`. That guard is the whole reason this exists: it is one comparison, it is easy to leave out, and leaving it out is invisible until a reader hits a name where the two agree.\n *\n * Presentation deliberately stays with the caller, since the same fact is drawn as a parenthetical in a table cell and as a middot-separated span on a chart heading.\n */\nexport function distinctSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string | undefined {\n\tif (typeof sanskritName !== 'string' || !sanskritName) return undefined;\n\treturn sanskritName === name ? undefined : sanskritName;\n}\n\n/**\n * `English (Sanskrit)` for a value that carries both, falling back to whichever one exists.\n *\n * @example\n * ```ts\n * formatWithSanskrit('Tuesday', 'Mangalavara'); // 'Tuesday (Mangalavara)'\n * formatWithSanskrit('Ashwini', 'Ashwini'); // 'Ashwini'\n * ```\n */\nexport function formatWithSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string {\n\tconst english = typeof name === 'string' ? name : '';\n\tconst sanskrit = distinctSanskrit(english, sanskritName);\n\tif (!english) return sanskrit ?? '';\n\treturn sanskrit ? `${english} (${sanskrit})` : english;\n}\n", "/**\n * The value a READER sees, for a response field the API returns twice.\n *\n * @remarks\n * Several endpoints now echo a display translation beside the canonical value: `nameLocalized` next to `name`, `signLocalized` next to `sign`, `typeLocalized` next to `type`. **The canonical field is deliberately always English, whatever `?lang=` says, so it stays safe to compare against in code**, and the localized one is deliberately absent from an English response.\n *\n * That split is the whole contract, and inverting it breaks charts silently rather than loudly: `planetGlyph`, `signGlyph`, `aspectSymbol`, `ASPECT_CLASS`, `SIGNS_ORDER.indexOf`, every `Map` key and every CSS class fragment is keyed on the English name, so pointing one of them at `nameLocalized` resolves to nothing on a translated page and to the same value on an English one, which is exactly the shape of defect that passes every gate (lesson 24). **The lookup stays on the canonical value; only the printed text node, the `title` and the `aria-label` move.**\n *\n * These two helpers exist so that rule lives in one place rather than as a `??` at every call site, and so an English response, where the localized field simply is not there, degrades by construction instead of by remembering. Both take the KEY of the canonical field and derive its partner, so a mistyped key or a field that is not a display string is a compile error rather than a silent empty string.\n */\n\n/** The one naming convention every helper here derives from. Ratified by the API and spreading to more operations, so it is matched as a convention and never as a list of field names. */\nconst LOCALIZED = 'Localized';\n\n/** A response row carrying a canonical English `K` plus the optional localized partner the API writes beside it. */\nexport type Localizable<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string>\n>;\n\n/** The same pairing where the value is a LIST of names, e.g. `retrogradePlanets`. */\nexport type LocalizableList<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string[]>\n>;\n\n/**\n * The text to print for `key`: the localized value when the response carried one, else the English one.\n *\n * @param english - What to print in the English case INSTEAD of the raw field, for a canonical value that is an API enum with a display form of its own (`type` is `SEMI_SEXTILE` on the wire and `Semi-sextile` on screen). Omit it wherever the canonical value is already the readable one.\n *\n * @example\n * ```ts\n * display(planet, 'name'); // 'Sol' on ?lang=es, 'Sun' on English\n * planetGlyph(planet.name) ?? display(planet, 'name'); // the lookup stays English, the fallback TEXT does not\n * display(aspect, 'type', formatAspectName(aspect)); // 'Tr\u00EDgono', else 'Trine' and never 'TRINE'\n * ```\n */\nexport function display<\n\tT extends Localizable<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K, english?: string): string {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tif (typeof localized === 'string' && localized !== '') return localized;\n\tif (english !== undefined) return english;\n\tconst canonical = rec?.[key];\n\treturn typeof canonical === 'string' ? canonical : '';\n}\n\n/**\n * A list field as `{ value, label }` pairs: the English `value` every lookup is keyed on, and the `label` a reader sees.\n *\n * @remarks\n * The localized array is INDEX-ALIGNED with the canonical one, which is the only thing that makes the pairing possible, so it is zipped by position and neither side is ever sorted, filtered or deduped on its own. A list that is short or absent falls back per item, so a partial translation still resolves every glyph.\n */\nexport function displayList<\n\tT extends LocalizableList<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K): Array<{ value: string; label: string }> {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst canonical = rec?.[key];\n\tif (!Array.isArray(canonical)) return [];\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tconst labels = Array.isArray(localized) ? localized : [];\n\treturn canonical.map((value, i) => {\n\t\tconst label = labels[i];\n\t\treturn {\n\t\t\tvalue: String(value),\n\t\t\tlabel: typeof label === 'string' && label !== '' ? label : String(value),\n\t\t};\n\t});\n}\n\n/**\n * Fold every `XLocalized` field into its `X` partner: the reader's value under the canonical NAME, and the duplicate key gone.\n *\n * @remarks\n * For a renderer that has no idea what its fields MEAN and derives its columns from `Object.keys(row)`, which is how `<roxy-data>` started drawing `Planet | Planet Localized | Longitude | Sign | Sign Localized` the day the API began sending both. Two extra columns, headed in English, carrying the same fact twice, on a page whose owner changed nothing. That is a regression rather than a missing feature, so it is repaired at the key layer every render path already funnels through rather than at each of them.\n *\n * Three rules, and each has a way of going wrong:\n *\n * - **A `*Localized` key with no canonical partner stays put.** Suppressing on the name alone deletes data the response carries and nothing else is rendering.\n * - **The canonical key keeps its POSITION**, so a translated response and an English one lay out identically, column for column.\n * - **A row with nothing to fold is returned as the same object**, so the English path is not merely equivalent but untouched.\n *\n * The English value is dropped rather than shown beside its translation because the two are the same fact, and the caller here is generic: it cannot know that `sign` is the value a lookup would be keyed on. A component that needs both halves reads them itself with {@link display}.\n */\nexport function foldLocalized<V>(row: Record<string, V>): Record<string, V> {\n\tlet folded: Record<string, V> | undefined;\n\tfor (const key of Object.keys(row)) {\n\t\tif (!key.endsWith(LOCALIZED)) continue;\n\t\tconst base = key.slice(0, -LOCALIZED.length);\n\t\tif (base === '' || !(base in row)) continue;\n\t\tfolded ??= { ...row };\n\t\tconst value = row[key];\n\t\tif (value !== undefined && value !== null && value !== '')\n\t\t\tfolded[base] = value;\n\t\tdelete folded[key];\n\t}\n\treturn folded ?? row;\n}\n"],
|
|
5
|
+
"mappings": "4MAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,WAAAC,EAAS,OAAAC,MAAW,MACxC,OAAS,iBAAAC,GAAe,YAAAC,MAAgB,oBC4BjC,SAASC,EAAUC,EAAmB,CAC5C,OAAOA,EACL,YAAY,EACZ,QAAQ,WAAY,GAAG,EACvB,KAAK,CACR,CAEO,SAASC,EAAWD,EAAmB,CAC7C,OAAKA,EACEA,EAAE,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAE,MAAM,CAAC,EAAE,YAAY,EAD3C,EAEhB,CCvBA,IAAME,GAAU,CACfC,EACAC,IACyBA,EAAOD,EAAME,EAAUD,CAAI,CAAC,EAAI,OAEpDE,GAAuC,CAC5C,IAAK,SACL,KAAM,SACN,QAAS,SACT,MAAO,SACP,MAAO,SACP,KAAM,SACN,QAAS,SACT,OAAQ,SACR,OAAQ,SACR,QAAS,SACT,MAAO,SACP,KAAM,SACN,KAAM,SACN,UAAW,MACX,MAAO,KACP,aAAc,SACd,aAAc,SACd,OAAQ,SACR,OAAQ,SACR,oBAAqB,QACtB,EAGaC,GACZH,GACwBF,GAAQI,GAAcF,CAAI,EAwBnD,IAAMI,GAAqC,CAC1C,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAGaC,EACZC,GACwBC,GAAQH,GAAYE,CAAI,EAsB1C,IAAME,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EC5HA,OAEC,QAAAC,EACA,cAAAC,GACA,WAAAC,OAEM,MACP,OAAS,YAAAC,EA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,OAAO,KAAK,qBACXgE,EACA,0BACA,KAAK,EAAE,kBAAkB,CAC1B,CACD,CACD,EAvhBanF,EACL,OAAS,CACfqF,EACAC,GACAC,GACAC,04KACD,EAIAC,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GATd1F,EAUZ,uBAmBAyF,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GA5Bd1F,EA6BZ,yBAyBAyF,EAAA,CADCC,EAAS,CAAE,KAAM,KAAM,CAAC,GArDb1F,EAsDZ,sBAtDYA,EAANyF,EAAA,CADNE,GAAc,oBAAoB,GACtB3F",
|
|
6
|
+
"names": ["css", "html", "nothing", "svg", "customElement", "property", "lookupKey", "s", "capitalize", "resolve", "table", "name", "lookupKey", "PLANET_GLYPH", "planetGlyph", "SIGN_GLYPH", "signGlyph", "name", "resolve", "SIGNS_ORDER", "html", "LitElement", "nothing", "property", "state", "ifDefined", "resolveLang", "el", "inherited", "GLOBAL_KEY", "registry", "holder", "existing", "created", "interpolate", "template", "vars", "match", "key", "translate", "lang", "source", "catalogs", "registry", "tag", "catalog", "lookupKey", "onLocaleChange", "listener", "listeners", "LocaleController", "host", "onLocaleChange", "css", "baseStyles", "KEY_REFUSED_MESSAGE", "keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "css", "html", "nothing", "css", "html", "chevron", "disclosureStyles", "interpAccordionStyles", "css", "renderInterpAccordion", "sections", "name", "heading", "shown", "s", "nothing", "html", "i", "chevron", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "source", "vars", "e", "detail", "buildRequest", "MarkupDataController", "LocaleController", "FetchController", "baseStyles", "translate", "changed", "html", "sections", "name", "heading", "nothing", "renderInterpAccordion", "data", "body", "ifDefined", "resolveLang", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "normalizeLongitude", "lon", "wrapped", "longitudeToSignPosition", "longitude", "signIndex", "within", "degree", "minuteFloat", "minute", "second", "SIGNS_ORDER", "oppositePoint", "longitude", "normalizeLongitude", "arcMidpoint", "start", "end", "s", "span", "fanOut", "items", "longitudeOf", "minSeparation", "placed", "item", "a", "b", "i", "prev", "cur", "wanted", "last", "shift", "p", "arcSeparation", "width", "radius", "polarToCartesian", "cx", "cy", "angleDeg", "angleRad", "DATE_ONLY", "BARE_TIME", "NAIVE_DATETIME", "CANONICAL", "intlLocales", "locale", "cached", "canonical", "resolveDisplayDate", "input", "naive", "formatTime", "d", "timeZone", "formatDate", "formatNumber", "value", "dp", "fixed", "ASPECT_CLASS", "normalizeAspect", "a", "formatAspectName", "capitalize", "formatDateTime", "locale", "input", "time", "merged", "DATE_ONLY", "BARE_TIME", "date", "formatDate", "clock", "formatTime", "LOCALIZED", "display", "row", "key", "english", "rec", "localized", "canonical", "SIZE", "CENTER", "AXIS_LABEL_R", "OUTER_R", "SIGN_R", "BAND_R", "TRANSIT_R", "TRANSIT_DEG_R", "NATAL_R", "NATAL_DEG_R", "TRANSIT_LINE_R", "NATAL_LINE_R", "HUB_R", "HOUSE_NUM_R", "GLYPH_WIDTH", "DEG_LABEL_WIDTH", "LEADER_TICK", "LEADER_FOOT", "glyphFor", "name", "label", "planetGlyph", "degLabel", "longitude", "sp", "longitudeToSignPosition", "score", "v", "byName", "list", "m", "p", "capitalize", "RoxyTransitWheel", "RoxyDataElement", "value", "raw", "out", "h", "i", "a", "b", "c", "html", "d", "natal", "transit", "aspects", "when", "formatDateTime", "count", "houses", "nothing", "ticks", "deg", "angle", "isMajor", "polarToCartesian", "svg", "SIGNS_ORDER", "_", "start", "end", "cusps", "cusp", "next", "arcMidpoint", "sign", "pos", "signGlyph", "bodies", "radius", "degRadius", "cls", "kind", "leaderSign", "separation", "arcSeparation", "fanOut", "displayLongitude", "degPos", "retro", "body", "display", "tooltip", "displaced", "tick", "foot", "natalBy", "transitBy", "t", "n", "from", "to", "normalizeAspect", "orb", "formatNumber", "ASPECT_CLASS", "given", "asc", "normalizeLongitude", "oppositePoint", "lon", "inner", "outer", "houseSystem", "s", "byType", "type", "formatAspectName", "transiting", "showHouses", "rows", "cell", "houseCell", "key", "sections", "k", "baseStyles", "disclosureStyles", "interpAccordionStyles", "css", "__decorateClass", "property", "customElement"]
|
|
7
7
|
}
|