${this.t('Bhava Bala')}
${
d.houseSystem
? this.t(
'Twelve houses ranked by strength on the {{system}} frame',
{ system: d.houseSystem },
)
: this.t('Twelve houses ranked by strength')
}
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
${bhavas.map((b) => this.renderBhava(b, peak, d.houseThemes))}
${COMPONENTS.map(
(c) => html`
${this.t('{{component}} Bala', { component: this.t(c.source) })}
`,
)}
`;
}
private renderBhava(
b: Bhava,
peak: number,
themes: BhavaBalaResponse['houseThemes'],
) {
const words =
typeof b.house === 'number' ? houseWords([b.house], themes) : '';
return html`
${this.t('House {{n}}', { n: b.house })}
${b.rashi}
${b.lord ? html`${this.t('lord {{graha}}', { graha: b.lord })}` : nothing}
${this.t('{{value}} rupas', { value: formatNumber(this.effectiveLang(), b.totalRupas, 2) })}
${
typeof b.rank === 'number'
? html`#${b.rank}`
: nothing
}
${COMPONENTS.map((c) => {
const v = Math.max(0, (b[c.key] as number | undefined) ?? 0);
return v > 0
? html``
: nothing;
})}
${words ? html`${words}
` : nothing}
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'roxy-bhava-bala-table': RoxyBhavaBalaTable;
}
}