@roxyapi/ui 0.11.0 → 0.12.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 +6 -0
- package/README.md +6 -0
- package/components-catalog.json +111 -1
- package/dist/cdn/components/astrocartography-map.js +58 -0
- package/dist/cdn/components/astrocartography-map.js.map +7 -0
- package/dist/cdn/components/divisional-chart.js +7 -7
- package/dist/cdn/components/divisional-chart.js.map +1 -1
- package/dist/cdn/components/dosha-card.js +2 -2
- package/dist/cdn/components/dosha-card.js.map +3 -3
- package/dist/cdn/components/fixed-stars.js +52 -0
- package/dist/cdn/components/fixed-stars.js.map +7 -0
- package/dist/cdn/components/hd-variables.js +2 -2
- package/dist/cdn/components/hd-variables.js.map +3 -3
- package/dist/cdn/components/hexagram.js +3 -3
- package/dist/cdn/components/hexagram.js.map +3 -3
- package/dist/cdn/components/local-space-compass.js +58 -0
- package/dist/cdn/components/local-space-compass.js.map +7 -0
- package/dist/cdn/components/moon-phase.js +3 -3
- package/dist/cdn/components/moon-phase.js.map +3 -3
- package/dist/cdn/components/natal-chart.js +8 -8
- package/dist/cdn/components/natal-chart.js.map +2 -2
- package/dist/cdn/components/positions-table.js +52 -0
- package/dist/cdn/components/positions-table.js.map +7 -0
- package/dist/cdn/components/profection-card.js +52 -0
- package/dist/cdn/components/profection-card.js.map +7 -0
- package/dist/cdn/components/reference-card.js +3 -3
- package/dist/cdn/components/reference-card.js.map +3 -3
- package/dist/cdn/components/relocation-wheel.js +61 -0
- package/dist/cdn/components/relocation-wheel.js.map +7 -0
- package/dist/cdn/components/synastry-chart.js +4 -4
- package/dist/cdn/components/synastry-chart.js.map +2 -2
- package/dist/cdn/components/vedic-kundli.js +5 -5
- package/dist/cdn/components/vedic-kundli.js.map +1 -1
- package/dist/cdn/components/vedic-planets-table.js +2 -2
- package/dist/cdn/components/vedic-planets-table.js.map +1 -1
- package/dist/cdn/components/western-planets-table.js +2 -2
- package/dist/cdn/components/western-planets-table.js.map +1 -1
- package/dist/cdn/components/yoga-list.js +3 -3
- package/dist/cdn/components/yoga-list.js.map +3 -3
- package/dist/cdn/roxy-ui.js +83 -71
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/astrocartography-map.d.ts +27 -0
- package/dist/components/astrocartography-map.d.ts.map +1 -0
- package/dist/components/astrocartography-map.js +8 -0
- package/dist/components/astrocartography-map.js.map +7 -0
- package/dist/components/divisional-chart.js +22 -22
- package/dist/components/divisional-chart.js.map +1 -1
- package/dist/components/dosha-card.d.ts.map +1 -1
- package/dist/components/dosha-card.js +1 -1
- package/dist/components/dosha-card.js.map +3 -3
- package/dist/components/fixed-stars.d.ts +21 -0
- package/dist/components/fixed-stars.d.ts.map +1 -0
- package/dist/components/fixed-stars.js +2 -0
- package/dist/components/fixed-stars.js.map +7 -0
- package/dist/components/hd-variables.d.ts.map +1 -1
- package/dist/components/hd-variables.js +1 -1
- package/dist/components/hd-variables.js.map +3 -3
- package/dist/components/hexagram.d.ts +3 -1
- package/dist/components/hexagram.d.ts.map +1 -1
- package/dist/components/hexagram.js +1 -1
- package/dist/components/hexagram.js.map +3 -3
- package/dist/components/local-space-compass.d.ts +23 -0
- package/dist/components/local-space-compass.d.ts.map +1 -0
- package/dist/components/local-space-compass.js +8 -0
- package/dist/components/local-space-compass.js.map +7 -0
- package/dist/components/moon-phase.d.ts.map +1 -1
- package/dist/components/moon-phase.js +1 -1
- package/dist/components/moon-phase.js.map +3 -3
- package/dist/components/natal-chart.d.ts +2 -0
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +6 -6
- package/dist/components/natal-chart.js.map +2 -2
- package/dist/components/positions-table.d.ts +34 -0
- package/dist/components/positions-table.d.ts.map +1 -0
- package/dist/components/positions-table.js +2 -0
- package/dist/components/positions-table.js.map +7 -0
- package/dist/components/profection-card.d.ts +18 -0
- package/dist/components/profection-card.d.ts.map +1 -0
- package/dist/components/profection-card.js +2 -0
- package/dist/components/profection-card.js.map +7 -0
- package/dist/components/reference-card.d.ts.map +1 -1
- package/dist/components/reference-card.js +1 -1
- package/dist/components/reference-card.js.map +3 -3
- package/dist/components/relocation-wheel.d.ts +21 -0
- package/dist/components/relocation-wheel.d.ts.map +1 -0
- package/dist/components/relocation-wheel.js +11 -0
- package/dist/components/relocation-wheel.js.map +7 -0
- package/dist/components/synastry-chart.js +3 -3
- package/dist/components/synastry-chart.js.map +2 -2
- package/dist/components/vedic-kundli.js +14 -14
- package/dist/components/vedic-kundli.js.map +1 -1
- package/dist/components/vedic-planets-table.js +1 -1
- package/dist/components/vedic-planets-table.js.map +1 -1
- package/dist/components/western-planets-table.js +1 -1
- package/dist/components/western-planets-table.js.map +1 -1
- package/dist/components/yoga-list.d.ts +5 -2
- package/dist/components/yoga-list.d.ts.map +1 -1
- package/dist/components/yoga-list.js +1 -1
- package/dist/components/yoga-list.js.map +3 -3
- package/dist/generated/endpoint-bindings.d.ts.map +1 -1
- package/dist/index.cjs +62 -50
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -50
- package/dist/index.js.map +4 -4
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.json +6 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.gen.d.ts +7864 -5381
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/utils/degree.d.ts +2 -0
- package/dist/utils/degree.d.ts.map +1 -1
- package/dist/utils/planet-color.d.ts +3 -0
- package/dist/utils/planet-color.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -1
- package/src/components/astrocartography-map.ts +436 -0
- package/src/components/dosha-card.ts +48 -16
- package/src/components/fixed-stars.ts +254 -0
- package/src/components/hd-variables.ts +30 -2
- package/src/components/hexagram.ts +11 -11
- package/src/components/local-space-compass.ts +299 -0
- package/src/components/moon-phase.ts +21 -2
- package/src/components/natal-chart.ts +36 -24
- package/src/components/positions-table.ts +442 -0
- package/src/components/profection-card.ts +173 -0
- package/src/components/reference-card.ts +40 -8
- package/src/components/relocation-wheel.ts +170 -0
- package/src/components/yoga-list.ts +95 -2
- package/src/generated/endpoint-bindings.ts +62 -0
- package/src/index.ts +6 -0
- package/src/manifest.ts +79 -0
- package/src/types/index.ts +1 -1
- package/src/types/types.gen.ts +7814 -5263
- package/src/utils/degree.ts +11 -0
- package/src/utils/planet-color.ts +45 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AstrocartographyResponse } from '../types/index.js';
|
|
2
|
+
import { RoxyDataElement } from '../utils/base-element.js';
|
|
3
|
+
/**
|
|
4
|
+
* Astrocartography (relocation) world map. Plots the four planetary lines for
|
|
5
|
+
* every body from a /astrology/astrocartography response over a labeled
|
|
6
|
+
* graticule: MC and IC as straight meridians, the Ascendant and Descendant as
|
|
7
|
+
* latitude-sampled curves. Color is per body and theme-token driven; solid
|
|
8
|
+
* lines are the Ascendant and Midheaven, dashed are the Descendant and IC.
|
|
9
|
+
*/
|
|
10
|
+
export declare class RoxyAstrocartographyMap extends RoxyDataElement<AstrocartographyResponse> {
|
|
11
|
+
static styles: import("lit").CSSResult[];
|
|
12
|
+
protected renderEmpty(): import("lit").TemplateResult<1>;
|
|
13
|
+
protected renderData(data: AstrocartographyResponse): import("lit").TemplateResult<1>;
|
|
14
|
+
private renderMap;
|
|
15
|
+
private renderGraticule;
|
|
16
|
+
private renderBodyLines;
|
|
17
|
+
private renderMeridian;
|
|
18
|
+
private renderCurve;
|
|
19
|
+
private renderLegend;
|
|
20
|
+
private renderInterpretations;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'roxy-astrocartography-map': RoxyAstrocartographyMap;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=astrocartography-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"astrocartography-map.d.ts","sourceRoot":"","sources":["../../src/components/astrocartography-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAuD3D;;;;;;GAMG;AACH,qBACa,uBAAwB,SAAQ,eAAe,CAAC,wBAAwB,CAAC;IACrF,MAAM,CAAC,MAAM,4BAsJX;IAEF,SAAS,CAAC,WAAW;IAIrB,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,wBAAwB;IAsBnD,OAAO,CAAC,SAAS;IAyBjB,OAAO,CAAC,eAAe;IA+BvB,OAAO,CAAC,eAAe;IAwCvB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,WAAW;IAwBnB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,qBAAqB;CAgC7B;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,2BAA2B,EAAE,uBAAuB,CAAC;KACrD;CACD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var I=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var l=(o,e,r,t)=>{for(var n=t>1?void 0:t?K(e,r):e,a=o.length-1,s;a>=0;a--)(s=o[a])&&(n=(t?s(e,r,n):s(n))||n);return t&&n&&I(e,r,n),n};import{css as V,html as p,nothing as y,svg as u}from"lit";import{customElement as W}from"lit/decorators.js";import{html as x,LitElement as D}from"lit";import{property as m,state as L}from"lit/decorators.js";import{ifDefined as _}from"lit/directives/if-defined.js";import{css as G}from"lit";var $=G`: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}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.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}:host{font-variant-emoji:text}`;var H="https://roxyapi.com/api/v2",w=class{constructor(e){this.baseUrl=H;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let r=new AbortController;this.abort=r,this.host.loading=!0,this.host.error=null;try{let t=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:r.signal}):await this.callApi(e,r.signal);if(!t.ok)throw new Error(await this.readError(t));let n=await t.json();if(r.signal.aborted)return;this.host.data=n}catch(t){if(t?.name==="AbortError")return;this.host.error=t instanceof Error?t.message:String(t)}finally{this.abort===r&&(this.abort=void 0),r.signal.aborted||(this.host.loading=!1)}}callApi(e,r){let t=new URL(`${this.baseUrl}${e.path}`);for(let[a,s]of Object.entries(e.query??{}))s!=null&&t.searchParams.set(a,String(s));let n={Accept:"application/json"};return this.publishableKey&&(n["X-API-Key"]=this.publishableKey),e.body!=null&&(n["Content-Type"]="application/json"),fetch(t,{method:e.method??"GET",headers:n,body:e.body!=null?JSON.stringify(e.body):void 0,signal:r})}secretKeyRefused(){let e=this.publishableKey;return!e||e.startsWith("pk_")?!1:(this.host.error="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.",this.host.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key"},bubbles:!0,composed:!0})),!0)}async readError(e){try{let r=await e.json();if(r?.error)return r.error}catch{}return`Request failed (${e.status})`}};function T(o,e,r){let t={...r},n=`/${o.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(d,c)=>{let h=t[c];return delete t[c],encodeURIComponent(String(h??""))}),a={},s={};for(let[d,c]of Object.entries(t))c===void 0||c===""||(e==="GET"?a[d]=c:s[d]=c);return{path:n,method:e,query:a,body:e==="POST"?s:void 0}}var F="roxy-data";function B(o){return o.nodeName==="SCRIPT"&&o.getAttribute("type")==="application/json"}var k=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(B(e)&&e.classList.contains(F))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var i=class extends D{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.onFormSubmit=r=>{let t=r.detail;this.remember&&this.writeRemembered(t.values),this.fetcher.run(T(this.endpoint,this.method,t.values))};new k(this),this.fetcher=new w(this)}static{this.styles=[$]}willUpdate(r){r.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),r.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),r.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.renderData(this.data):this.renderNoData()}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return x`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${_(this.specUrl)}" .initialValues="${this.remember?this.readRemembered():void 0}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let r=sessionStorage.getItem(this.rememberKey());return r?JSON.parse(r):void 0}catch{return}}writeRemembered(r){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(r))}catch{}}renderEmpty(){return x`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return x`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(r){let t=x`<div class="roxy-error" role="alert">${r}</div>`;return this.endpoint?x`${t}${this.renderForm()}`:t}};l([m({attribute:!1})],i.prototype,"data",2),l([m({type:String,attribute:"data-endpoint"})],i.prototype,"endpoint",2),l([m({type:String})],i.prototype,"method",2),l([m({type:String,attribute:"publishable-key"})],i.prototype,"publishableKey",2),l([m({type:String,attribute:"base-url"})],i.prototype,"baseUrl",2),l([m({type:String,attribute:"spec-url"})],i.prototype,"specUrl",2),l([m({type:String,attribute:"submit-url"})],i.prototype,"submitUrl",2),l([m({type:Boolean})],i.prototype,"remember",2),l([L()],i.prototype,"loading",2),l([L()],i.prototype,"error",2);import{css as J,html as q}from"lit";function A(){return q`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var U=J`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;function E(o){return o?o.charAt(0).toUpperCase()+o.slice(1).toLowerCase():""}var Y={Sun:"var(--roxy-accent)",Moon:"var(--roxy-secondary)",Mercury:"var(--roxy-info)",Venus:"var(--roxy-success)",Mars:"var(--roxy-danger)",Jupiter:"var(--roxy-warning)",Saturn:"var(--roxy-muted)",Uranus:"var(--roxy-info-fg)",Neptune:"var(--roxy-success-fg)",Pluto:"var(--roxy-danger-fg)"},P=["var(--roxy-accent)","var(--roxy-info)","var(--roxy-success)","var(--roxy-danger)","var(--roxy-warning)","var(--roxy-secondary)","var(--roxy-info-fg)","var(--roxy-success-fg)","var(--roxy-danger-fg)","var(--roxy-accent-ink)","var(--roxy-warning-fg)","var(--roxy-primary)"];function S(o,e=0){return Y[E(o)]??P[e%P.length]??"var(--roxy-accent)"}var C=360,g=180,v=o=>o+180,f=o=>90-o,z=23.44,M=66.56,O=o=>o===0?"0":`${Math.abs(o)}\xB0${o>0?"E":"W"}`,j=o=>o===0?"0":`${Math.abs(o)}\xB0${o>0?"N":"S"}`;function X(o){let e=[],r=[],t=null;for(let n of o)t!==null&&Math.abs(n.longitude-t)>180&&(r.length&&e.push(r),r=[]),r.push(`${v(n.longitude)},${f(n.latitude)}`),t=n.longitude;return r.length&&e.push(r),e.filter(n=>n.length>1).map(n=>n.join(" "))}var N={mc:"MC",ic:"IC",ascendant:"AC",descendant:"DC"},b=class extends i{renderEmpty(){return p`<div class="roxy-empty" role="status">No astrocartography data</div>`}renderData(e){let r=e.lines??[],t=e.birthDetails;return p`<div class="wrap"><header><h2 class="title">Astrocartography</h2>${t?p`<div class="meta">${[t.date,t.time].filter(Boolean).join(" \xB7 ")} · ${j(Math.round(t.latitude))} ${O(Math.round(t.longitude))}</div>`:y}</header>${this.renderMap(r,t)} ${this.renderLegend(r)} ${e.summary?p`<p class="summary">${e.summary}</p>`:y} ${this.renderInterpretations(r)}</div>`}renderMap(e,r){return p`<svg viewBox="0 0 ${C} ${g}" role="img" aria-label="World map of planetary astrocartography lines"><title>Astrocartography world map</title><desc>Equirectangular world map. Each body has a Midheaven and Imum Coeli meridian and a curved Ascendant and Descendant line, colored per body.</desc><rect class="map-frame" x="0" y="0" width="${C}" height="${g}"/>${this.renderGraticule()} ${e.map((t,n)=>this.renderBodyLines(t,n))} ${r?u`<text class="birthplace" x=${v(r.longitude)} y=${f(r.latitude)} text-anchor="middle" dominant-baseline="central"><title>Birthplace</title>★</text>`:y}</svg>`}renderGraticule(){let e=[];for(let n=-150;n<=150;n+=30){let a=v(n),s=n===0;e.push(u`<line class=${s?"grat-axis":"grat"} x1=${a} y1="0" x2=${a} y2=${g} />`),e.push(u`<text class="axis-label" x=${a} y=${g-2} text-anchor="middle">${O(n)}</text>`)}let r=[];for(let n=-60;n<=60;n+=30){let a=f(n),s=n===0;r.push(u`<line class=${s?"grat-axis":"grat"} x1="0" y1=${a} x2=${C} y2=${a} />`),r.push(u`<text class="axis-label" x="2" y=${a-1}>${j(n)}</text>`)}let t=[z,-z,M,-M].map(n=>u`<line class="grat-ref" x1="0" y1=${f(n)} x2=${C} y2=${f(n)} />`);return u`${e}${r}${t}`}renderBodyLines(e,r){let t=S(e.planet,r),n=e.symbol||e.planet.slice(0,2),a=[this.renderMeridian(e.mc.longitude,t,n,e.planet,"mc",!1),this.renderMeridian(e.ic.longitude,t,n,e.planet,"ic",!0),this.renderCurve(e.ascendant.points,t,n,e.planet,"ascendant",!1),this.renderCurve(e.descendant.points,t,n,e.planet,"descendant",!0)];return u`${a}`}renderMeridian(e,r,t,n,a,s){let d=v(e),c=a==="ic"?g-7:9;return u`<g>
|
|
2
|
+
<line class=${`acg-line${s?" dashed":""}`} stroke=${r} x1=${d} y1="0" x2=${d} y2=${g}><title>${n} ${N[a]} line</title></line>
|
|
3
|
+
<text class="acg-glyph" fill=${r} x=${d} y=${c} text-anchor="middle" dominant-baseline="central">${t}</text>
|
|
4
|
+
</g>`}renderCurve(e,r,t,n,a,s){let d=X(e??[]);if(d.length===0)return y;let c=(e??[]).reduce((h,R)=>Math.abs(R.latitude)<Math.abs(h.latitude)?R:h,e[0]??{latitude:0,longitude:0});return u`<g>
|
|
5
|
+
${d.map(h=>u`<polyline class=${`acg-line${s?" dashed":""}`} stroke=${r} points=${h}><title>${n} ${N[a]} line</title></polyline>`)}
|
|
6
|
+
<text class="acg-glyph" fill=${r} x=${v(c.longitude)} y=${f(c.latitude)} text-anchor="middle" dominant-baseline="central">${t}</text>
|
|
7
|
+
</g>`}renderLegend(e){return e.length===0?y:p`<div class="legend">${e.map((r,t)=>{let n=S(r.planet,t);return p`<span class="legend-item"><span class="legend-swatch" style="${`border-top-color: ${n}`}"></span> ${r.symbol?p`${r.symbol}`:y}${r.planet}</span>`})} <span class="legend-note">Solid lines are the Ascendant and Midheaven, dashed are the Descendant and IC.</span></div>`}renderInterpretations(e){return e.length===0?y:p`<section class="interpretations"><h3>Planetary lines</h3>${e.map((r,t)=>{let n=S(r.planet,t),a=[["MC",r.mc.interpretation],["IC",r.ic.interpretation],["AC",r.ascendant.interpretation],["DC",r.descendant.interpretation]];return p`<details class="interp-card" name="acg-lines" ?open="${t===0}"><summary><span class="interp-head"><span class="interp-dot" style="${`background: ${n}`}"></span> ${r.symbol?p`${r.symbol}`:y}${r.planet} </span>${A()}</summary><div class="interp-body">${a.filter(([,s])=>s).map(([s,d])=>p`<p class="interp-line"><span class="code">${s}</span>${d}</p>`)}</div></details>`})}</section>`}};b.styles=[$,U,V`.wrap{background:var(--roxy-surface,#fff);width:100%;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);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{border-radius:var(--roxy-radius-sm,4px);width:100%;height:auto;display:block}.map-frame{fill:color-mix(in srgb, var(--roxy-border,#e4e4e7) 12%, transparent);stroke:var(--roxy-border,#e4e4e7);stroke-width:.8px}.grat{stroke:var(--roxy-border,#e4e4e7);stroke-width:.4px;fill:none}.grat-axis{stroke:var(--roxy-muted,#71717a);stroke-width:.6px;opacity:.6}.grat-ref{stroke:var(--roxy-secondary,#475569);stroke-width:.4px;stroke-dasharray:2 2;opacity:.5;fill:none}.axis-label{fill:var(--roxy-muted,#71717a);font-size:5px;font-family:var(--roxy-font-sans)}.acg-line{fill:none;stroke-width:1px;opacity:.95}.acg-line.dashed{stroke-dasharray:4 2.5}.acg-glyph{font-size:8px;font-family:var(--roxy-font-sans);font-weight:600}.birthplace{fill:var(--roxy-fg,#0a0a0a);font-size:9px}.legend{gap:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-item{align-items:center;gap:.3rem;display:inline-flex}.legend-swatch{border-top-style:solid;border-top-width:2px;width:14px;height:0}.legend-note{width:100%;color:var(--roxy-muted,#71717a)}.summary{color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);margin:0}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-head{align-items:center;gap:.5rem;display:inline-flex}.interp-dot{border-radius:50%;width:10px;height:10px}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-xs,.25rem);display:grid}.interp-line{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a)}.interp-line .code{color:var(--roxy-accent-ink,#b45309);margin-right:.4rem;font-weight:600}`],b=l([W("roxy-astrocartography-map")],b);export{b as RoxyAstrocartographyMap};
|
|
8
|
+
//# sourceMappingURL=astrocartography-map.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/astrocartography-map.ts", "../../src/utils/base-element.ts", "../../src/utils/base-styles.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/markup-data.ts", "../../src/utils/disclosure.ts", "../../src/utils/string.ts", "../../src/utils/planet-color.ts"],
|
|
4
|
+
"sourcesContent": ["import { css, html, nothing, svg } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport type { AstrocartographyResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport { planetColor } from '../utils/planet-color.js';\n\ntype LineSet = AstrocartographyResponse['lines'][number];\ntype GeoPoint = LineSet['ascendant']['points'][number];\n\n// Equirectangular (plate carree) projection in a 360x180 unit canvas: one unit\n// per degree. The SVG scales to the container width; the 2:1 aspect ratio holds.\nconst W = 360;\nconst H = 180;\nconst lonToX = (lon: number): number => lon + 180;\nconst latToY = (lat: number): number => 90 - lat;\n\n// Reference parallels (degrees). Tropics and polar circles use the current mean\n// obliquity; drawn as dashed guides so the curved rising/setting lines read\n// against real climate bands, not just a bare grid.\nconst TROPIC = 23.44;\nconst POLAR = 66.56;\n\nconst formatLon = (lon: number): string =>\n\tlon === 0 ? '0' : `${Math.abs(lon)}\u00B0${lon > 0 ? 'E' : 'W'}`;\nconst formatLat = (lat: number): string =>\n\tlat === 0 ? '0' : `${Math.abs(lat)}\u00B0${lat > 0 ? 'N' : 'S'}`;\n\n/**\n * Split a rising/setting line into screen polylines, breaking the path wherever\n * consecutive samples jump more than 180 degrees of longitude. Without the\n * split, a line that crosses the antimeridian draws a stray horizontal streak\n * straight across the whole map.\n */\nfunction toSegments(points: GeoPoint[]): string[] {\n\tconst segments: string[][] = [];\n\tlet current: string[] = [];\n\tlet prevLon: number | null = null;\n\tfor (const p of points) {\n\t\tif (prevLon !== null && Math.abs(p.longitude - prevLon) > 180) {\n\t\t\tif (current.length) segments.push(current);\n\t\t\tcurrent = [];\n\t\t}\n\t\tcurrent.push(`${lonToX(p.longitude)},${latToY(p.latitude)}`);\n\t\tprevLon = p.longitude;\n\t}\n\tif (current.length) segments.push(current);\n\treturn segments.filter((s) => s.length > 1).map((s) => s.join(' '));\n}\n\nconst ANGLE_LABEL: Record<string, string> = {\n\tmc: 'MC',\n\tic: 'IC',\n\tascendant: 'AC',\n\tdescendant: 'DC',\n};\n\n/**\n * Astrocartography (relocation) world map. Plots the four planetary lines for\n * every body from a /astrology/astrocartography response over a labeled\n * graticule: MC and IC as straight meridians, the Ascendant and Descendant as\n * latitude-sampled curves. Color is per body and theme-token driven; solid\n * lines are the Ascendant and Midheaven, dashed are the Descendant and IC.\n */\n@customElement('roxy-astrocartography-map')\nexport class RoxyAstrocartographyMap extends RoxyDataElement<AstrocartographyResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);width:100%;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);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.meta{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem)}svg{border-radius:var(--roxy-radius-sm,4px);width:100%;height:auto;display:block}.map-frame{fill:color-mix(in srgb, var(--roxy-border,#e4e4e7) 12%, transparent);stroke:var(--roxy-border,#e4e4e7);stroke-width:.8px}.grat{stroke:var(--roxy-border,#e4e4e7);stroke-width:.4px;fill:none}.grat-axis{stroke:var(--roxy-muted,#71717a);stroke-width:.6px;opacity:.6}.grat-ref{stroke:var(--roxy-secondary,#475569);stroke-width:.4px;stroke-dasharray:2 2;opacity:.5;fill:none}.axis-label{fill:var(--roxy-muted,#71717a);font-size:5px;font-family:var(--roxy-font-sans)}.acg-line{fill:none;stroke-width:1px;opacity:.95}.acg-line.dashed{stroke-dasharray:4 2.5}.acg-glyph{font-size:8px;font-family:var(--roxy-font-sans);font-weight:600}.birthplace{fill:var(--roxy-fg,#0a0a0a);font-size:9px}.legend{gap:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-item{align-items:center;gap:.3rem;display:inline-flex}.legend-swatch{border-top-style:solid;border-top-width:2px;width:14px;height:0}.legend-note{width:100%;color:var(--roxy-muted,#71717a)}.summary{color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);margin:0}.interpretations h3{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em;margin:0 0 var(--roxy-space-sm,.5rem);font-weight:600}.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);justify-content:space-between;align-items:center;gap:var(--roxy-space-md,1rem);font-weight:500;display:flex}.interp-head{align-items:center;gap:.5rem;display:inline-flex}.interp-dot{border-radius:50%;width:10px;height:10px}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-xs,.25rem);display:grid}.interp-line{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a)}.interp-line .code{color:var(--roxy-accent-ink,#b45309);margin-right:.4rem;font-weight:600}`,\n\t];\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No astrocartography data</div>`;\n\t}\n\n\tprotected renderData(data: AstrocartographyResponse) {\n\t\tconst lines = data.lines ?? [];\n\t\tconst bd = data.birthDetails;\n\t\treturn html`<div class=\"wrap\"><header><h2 class=\"title\">Astrocartography</h2>${\n\t\t\t\t\tbd\n\t\t\t\t\t\t? html`<div class=\"meta\">${[bd.date, bd.time].filter(Boolean).join(' \u00B7 ')} \u00B7 ${formatLat(Math.round(bd.latitude))} ${formatLon(Math.round(bd.longitude))}</div>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header>${this.renderMap(lines, bd)} ${this.renderLegend(lines)} ${data.summary ? html`<p class=\"summary\">${data.summary}</p>` : nothing} ${this.renderInterpretations(lines)}</div>`;\n\t}\n\n\tprivate renderMap(\n\t\tlines: LineSet[],\n\t\tbd: AstrocartographyResponse['birthDetails'],\n\t) {\n\t\treturn html`<svg viewBox=\"0 0 ${W} ${H}\" role=\"img\" aria-label=\"World map of planetary astrocartography lines\"><title>Astrocartography world map</title><desc>Equirectangular world map. Each body has a Midheaven and Imum Coeli meridian and a curved Ascendant and Descendant line, colored per body.</desc><rect class=\"map-frame\" x=\"0\" y=\"0\" width=\"${W}\" height=\"${H}\"/>${this.renderGraticule()} ${lines.map((l, i) => this.renderBodyLines(l, i))} ${\n\t\t\t\tbd\n\t\t\t\t\t? svg`<text class=\"birthplace\" x=${lonToX(bd.longitude)} y=${latToY(bd.latitude)} text-anchor=\"middle\" dominant-baseline=\"central\"><title>Birthplace</title>\u2605</text>`\n\t\t\t\t\t: nothing\n\t\t\t}</svg>`;\n\t}\n\n\tprivate renderGraticule() {\n\t\tconst meridians = [];\n\t\tfor (let lon = -150; lon <= 150; lon += 30) {\n\t\t\tconst x = lonToX(lon);\n\t\t\tconst axis = lon === 0;\n\t\t\tmeridians.push(\n\t\t\t\tsvg`<line class=${axis ? 'grat-axis' : 'grat'} x1=${x} y1=\"0\" x2=${x} y2=${H} />`,\n\t\t\t);\n\t\t\tmeridians.push(\n\t\t\t\tsvg`<text class=\"axis-label\" x=${x} y=${H - 2} text-anchor=\"middle\">${formatLon(lon)}</text>`,\n\t\t\t);\n\t\t}\n\t\tconst parallels = [];\n\t\tfor (let lat = -60; lat <= 60; lat += 30) {\n\t\t\tconst y = latToY(lat);\n\t\t\tconst axis = lat === 0;\n\t\t\tparallels.push(\n\t\t\t\tsvg`<line class=${axis ? 'grat-axis' : 'grat'} x1=\"0\" y1=${y} x2=${W} y2=${y} />`,\n\t\t\t);\n\t\t\tparallels.push(\n\t\t\t\tsvg`<text class=\"axis-label\" x=\"2\" y=${y - 1}>${formatLat(lat)}</text>`,\n\t\t\t);\n\t\t}\n\t\t// Tropics and polar circles as dashed climate-band references.\n\t\tconst refs = [TROPIC, -TROPIC, POLAR, -POLAR].map(\n\t\t\t(lat) =>\n\t\t\t\tsvg`<line class=\"grat-ref\" x1=\"0\" y1=${latToY(lat)} x2=${W} y2=${latToY(lat)} />`,\n\t\t);\n\t\treturn svg`${meridians}${parallels}${refs}`;\n\t}\n\n\tprivate renderBodyLines(line: LineSet, index: number) {\n\t\tconst color = planetColor(line.planet, index);\n\t\tconst glyph = line.symbol || line.planet.slice(0, 2);\n\t\tconst items = [\n\t\t\tthis.renderMeridian(\n\t\t\t\tline.mc.longitude,\n\t\t\t\tcolor,\n\t\t\t\tglyph,\n\t\t\t\tline.planet,\n\t\t\t\t'mc',\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tthis.renderMeridian(\n\t\t\t\tline.ic.longitude,\n\t\t\t\tcolor,\n\t\t\t\tglyph,\n\t\t\t\tline.planet,\n\t\t\t\t'ic',\n\t\t\t\ttrue,\n\t\t\t),\n\t\t\tthis.renderCurve(\n\t\t\t\tline.ascendant.points,\n\t\t\t\tcolor,\n\t\t\t\tglyph,\n\t\t\t\tline.planet,\n\t\t\t\t'ascendant',\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tthis.renderCurve(\n\t\t\t\tline.descendant.points,\n\t\t\t\tcolor,\n\t\t\t\tglyph,\n\t\t\t\tline.planet,\n\t\t\t\t'descendant',\n\t\t\t\ttrue,\n\t\t\t),\n\t\t];\n\t\treturn svg`${items}`;\n\t}\n\n\tprivate renderMeridian(\n\t\tlon: number,\n\t\tcolor: string,\n\t\tglyph: string,\n\t\tplanet: string,\n\t\tangle: string,\n\t\tdashed: boolean,\n\t) {\n\t\tconst x = lonToX(lon);\n\t\t// MC label rides the top edge, IC the bottom, so the two meridians of one\n\t\t// body never stack their glyphs at the same point.\n\t\tconst labelY = angle === 'ic' ? H - 7 : 9;\n\t\treturn svg`<g>\n\t\t\t<line class=${`acg-line${dashed ? ' dashed' : ''}`} stroke=${color} x1=${x} y1=\"0\" x2=${x} y2=${H}><title>${planet} ${ANGLE_LABEL[angle]} line</title></line>\n\t\t\t<text class=\"acg-glyph\" fill=${color} x=${x} y=${labelY} text-anchor=\"middle\" dominant-baseline=\"central\">${glyph}</text>\n\t\t</g>`;\n\t}\n\n\tprivate renderCurve(\n\t\tpoints: GeoPoint[],\n\t\tcolor: string,\n\t\tglyph: string,\n\t\tplanet: string,\n\t\tangle: string,\n\t\tdashed: boolean,\n\t) {\n\t\tconst segments = toSegments(points ?? []);\n\t\tif (segments.length === 0) return nothing;\n\t\t// Label at the sample nearest the equator, the most visible band.\n\t\tconst anchor = (points ?? []).reduce(\n\t\t\t(best, p) => (Math.abs(p.latitude) < Math.abs(best.latitude) ? p : best),\n\t\t\tpoints[0] ?? { latitude: 0, longitude: 0 },\n\t\t);\n\t\treturn svg`<g>\n\t\t\t${segments.map(\n\t\t\t\t(pts) =>\n\t\t\t\t\tsvg`<polyline class=${`acg-line${dashed ? ' dashed' : ''}`} stroke=${color} points=${pts}><title>${planet} ${ANGLE_LABEL[angle]} line</title></polyline>`,\n\t\t\t)}\n\t\t\t<text class=\"acg-glyph\" fill=${color} x=${lonToX(anchor.longitude)} y=${latToY(anchor.latitude)} text-anchor=\"middle\" dominant-baseline=\"central\">${glyph}</text>\n\t\t</g>`;\n\t}\n\n\tprivate renderLegend(lines: LineSet[]) {\n\t\tif (lines.length === 0) return nothing;\n\t\treturn html`<div class=\"legend\">${lines.map((l, i) => {\n\t\t\t\tconst color = planetColor(l.planet, i);\n\t\t\t\treturn html`<span class=\"legend-item\"><span class=\"legend-swatch\" style=\"${`border-top-color: ${color}`}\"></span> ${l.symbol ? html`${l.symbol}` : nothing}${l.planet}</span>`;\n\t\t\t})} <span class=\"legend-note\">Solid lines are the Ascendant and Midheaven, dashed are the Descendant and IC.</span></div>`;\n\t}\n\n\tprivate renderInterpretations(lines: LineSet[]) {\n\t\tif (lines.length === 0) return nothing;\n\t\treturn html`<section class=\"interpretations\"><h3>Planetary lines</h3>${lines.map((l, i) => {\n\t\t\t\tconst color = planetColor(l.planet, i);\n\t\t\t\tconst rows: Array<[string, string]> = [\n\t\t\t\t\t['MC', l.mc.interpretation],\n\t\t\t\t\t['IC', l.ic.interpretation],\n\t\t\t\t\t['AC', l.ascendant.interpretation],\n\t\t\t\t\t['DC', l.descendant.interpretation],\n\t\t\t\t];\n\t\t\t\treturn html`<details class=\"interp-card\" name=\"acg-lines\" ?open=\"${i === 0}\"><summary><span class=\"interp-head\"><span class=\"interp-dot\" style=\"${`background: ${color}`}\"></span> ${l.symbol ? html`${l.symbol}` : nothing}${l.planet} </span>${chevron()}</summary><div class=\"interp-body\">${rows\n\t\t\t\t\t\t\t.filter(([, text]) => text)\n\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t([code, text]) =>\n\t\t\t\t\t\t\t\t\thtml`<p class=\"interp-line\"><span class=\"code\">${code}</span>${text}</p>`,\n\t\t\t\t\t\t\t)}</div></details>`;\n\t\t\t})}</section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-astrocartography-map': RoxyAstrocartographyMap;\n\t}\n}\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.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 * @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/** 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\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\tthis.fetcher = new FetchController<T>(this);\n\t}\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) return this.renderData(this.data);\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/** 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 data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" .initialValues=\"${this.remember ? this.readRemembered() : undefined}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\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};\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(this.endpoint, this.method, detail.values),\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\">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=\"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\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\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}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.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}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so\n * the form mixin can attach a controller without the component wiring state by hand.\n */\ninterface FetchHost<T> extends ReactiveControllerHost {\n\tdata: T | null;\n\tloading: boolean;\n\terror: string | null;\n}\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. */\n\tprivate secretKeyRefused(): boolean {\n\t\tconst key = this.publishableKey;\n\t\tif (!key || key.startsWith('pk_')) return false;\n\t\tthis.host.error =\n\t\t\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\t\t(this.host as unknown as EventTarget).dispatchEvent(\n\t\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\t\tdetail: { reason: 'possible-secret-key' },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t);\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 */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\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 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') 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", "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", "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", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n", "import { capitalize } from './string.js';\n\n/**\n * Stable, theme-token stroke color per celestial body, for the multi-line map components (astrocartography, local space) where every body needs a distinct line that still follows the host theme.\n *\n * @remarks\n * Values are `var(--roxy-*)` references, so light and dark both resolve through the design tokens and a host override repaints every line with no rebuild. Classical bodies map to a fixed semantic token; any body the map omits (localized names, asteroids, the lunar nodes, Chiron, Lilith) falls back to a deterministic cycle keyed by its index in the response, so colors stay stable across re-renders and do not collide within the common 14-body set. Strokes and glyph fills are non-text chart marks, so the brighter base tokens are used directly rather than the WCAG-AA text variants.\n */\nconst PLANET_COLOR: Record<string, string> = {\n\tSun: 'var(--roxy-accent)',\n\tMoon: 'var(--roxy-secondary)',\n\tMercury: 'var(--roxy-info)',\n\tVenus: 'var(--roxy-success)',\n\tMars: 'var(--roxy-danger)',\n\tJupiter: 'var(--roxy-warning)',\n\tSaturn: 'var(--roxy-muted)',\n\tUranus: 'var(--roxy-info-fg)',\n\tNeptune: 'var(--roxy-success-fg)',\n\tPluto: 'var(--roxy-danger-fg)',\n};\n\n/** Deterministic fallback palette for bodies outside {@link PLANET_COLOR} (nodes, Chiron, Lilith, asteroids, or localized names). Keyed by response index so a given body keeps one color. */\nconst CYCLE = [\n\t'var(--roxy-accent)',\n\t'var(--roxy-info)',\n\t'var(--roxy-success)',\n\t'var(--roxy-danger)',\n\t'var(--roxy-warning)',\n\t'var(--roxy-secondary)',\n\t'var(--roxy-info-fg)',\n\t'var(--roxy-success-fg)',\n\t'var(--roxy-danger-fg)',\n\t'var(--roxy-accent-ink)',\n\t'var(--roxy-warning-fg)',\n\t'var(--roxy-primary)',\n];\n\n/** Theme-token color for a body, by name with an index fallback. {@link capitalize} matches the canonical TitleCase keys; unmapped or localized names cycle by `index`. */\nexport function planetColor(name: string, index = 0): string {\n\treturn (\n\t\tPLANET_COLOR[capitalize(name)] ??\n\t\tCYCLE[index % CYCLE.length] ??\n\t\t'var(--roxy-accent)'\n\t);\n}\n"],
|
|
5
|
+
"mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,WAAAC,EAAS,OAAAC,MAAW,MACxC,OAAS,iBAAAC,MAAqB,oBCD9B,OAEC,QAAAC,EACA,cAAAC,MAEM,MACP,OAAS,YAAAC,EAAU,SAAAC,MAAa,oBAChC,OAAS,aAAAC,MAAiB,+BCP1B,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,yvDCO1B,IAAME,EAAmB,6BAqBZC,EAAN,KAAiE,CAavE,YAAYC,EAAoB,CANhC,aAAUF,EAOT,KAAK,KAAOE,EACZA,EAAK,cAAc,IAAI,CACxB,CAEA,kBAAmB,CAClB,KAAK,OAAO,MAAM,EAClB,KAAK,MAAQ,MACd,CAOA,MAAM,IAAIC,EAAiC,CAE1C,GAAI,CAAC,KAAK,WAAa,KAAK,iBAAiB,EAAG,OAChD,KAAK,OAAO,MAAM,EAClB,IAAMC,EAAa,IAAI,gBACvB,KAAK,MAAQA,EACb,KAAK,KAAK,QAAU,GACpB,KAAK,KAAK,MAAQ,KAClB,GAAI,CACH,IAAMC,EAAM,KAAK,UACd,MAAM,MAAM,KAAK,UAAW,CAC5B,OAAQ,OACR,QAAS,CACR,OAAQ,mBACR,eAAgB,kBACjB,EACA,KAAM,KAAK,UAAUF,CAAG,EACxB,OAAQC,EAAW,MACpB,CAAC,EACA,MAAM,KAAK,QAAQD,EAAKC,EAAW,MAAM,EAC5C,GAAI,CAACC,EAAI,GAAI,MAAM,IAAI,MAAM,MAAM,KAAK,UAAUA,CAAG,CAAC,EACtD,IAAMC,EAAQ,MAAMD,EAAI,KAAK,EAC7B,GAAID,EAAW,OAAO,QAAS,OAC/B,KAAK,KAAK,KAAOE,CAClB,OAASC,EAAK,C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M,CACzF,IAAMU,EAAQC,EAAYZ,EAAE,OAAQC,CAAC,EAC/BqB,EAAgC,CACrC,CAAC,KAAMtB,EAAE,GAAG,cAAc,EAC1B,CAAC,KAAMA,EAAE,GAAG,cAAc,EAC1B,CAAC,KAAMA,EAAE,UAAU,cAAc,EACjC,CAAC,KAAMA,EAAE,WAAW,cAAc,CACnC,EACA,OAAOL,yDAA4DM,IAAM,CAAC,wEAAwE,eAAeU,CAAK,EAAE,aAAaX,EAAE,OAASL,IAAOK,EAAE,MAAM,GAAKD,CAAO,GAAGC,EAAE,MAAM,WAAWuB,EAAQ,CAAC,sCAAsCD,EAC5R,OAAO,CAAC,CAAC,CAAEE,CAAI,IAAMA,CAAI,EACzB,IACA,CAAC,CAACC,EAAMD,CAAI,IACX7B,8CAAiD8B,CAAI,UAAUD,CAAI,MACrE,CAAC,kBACL,CAAC,CAAC,YACJ,CACD,EA3Ka/B,EACL,OAAS,CACfiC,EACAC,EACAC,slFACD,EALYnC,EAANoC,EAAA,CADNC,EAAc,2BAA2B,GAC7BrC",
|
|
6
|
+
"names": ["css", "html", "nothing", "svg", "customElement", "html", "LitElement", "property", "state", "ifDefined", "css", "baseStyles", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "key", "body", "buildRequest", "endpoint", "method", "values", "rest", "path", "_match", "name", "query", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "e", "detail", "buildRequest", "MarkupDataController", "FetchController", "baseStyles", "changed", "html", "ifDefined", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "css", "html", "chevron", "disclosureStyles", "capitalize", "s", "PLANET_COLOR", "CYCLE", "planetColor", "name", "index", "capitalize", "W", "H", "lonToX", "lon", "latToY", "lat", "TROPIC", "POLAR", "formatLon", "formatLat", "toSegments", "points", "segments", "current", "prevLon", "p", "s", "ANGLE_LABEL", "RoxyAstrocartographyMap", "RoxyDataElement", "html", "data", "lines", "bd", "nothing", "l", "i", "svg", "meridians", "x", "axis", "parallels", "y", "refs", "line", "index", "color", "planetColor", "glyph", "items", "planet", "angle", "dashed", "labelY", "anchor", "best", "pts", "rows", "chevron", "text", "code", "baseStyles", "disclosureStyles", "css", "__decorateClass", "customElement"]
|
|
7
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var ne=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var x=(r,e,t,n)=>{for(var o=n>1?void 0:n?oe(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&ne(e,t,o),o};import{css as Ie,html as S,nothing as K}from"lit";import{customElement as Ke,property as Ge}from"lit/decorators.js";var V={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"},z={Sun:"Su",Moon:"Mo",Mercury:"Me",Venus:"Ve",Mars:"Ma",Jupiter:"Ju",Saturn:"Sa",Uranus:"Ur",Neptune:"Ne",Pluto:"Pl",Rahu:"Ra",Ketu:"Ke",Ascendant:"Asc",Lagna:"La"};var C={Aries:"Ar",Taurus:"Ta",Gemini:"Ge",Cancer:"Cn",Leo:"Le",Virgo:"Vi",Libra:"Li",Scorpio:"Sc",Sagittarius:"Sg",Capricorn:"Cp",Aquarius:"Aq",Pisces:"Pi"},h=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],He=h.map(r=>r.toLowerCase());import{html as k,LitElement as ce}from"lit";import{property as w,state as F}from"lit/decorators.js";import{ifDefined as de}from"lit/directives/if-defined.js";import{css as ie}from"lit";var A=ie`: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}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.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}:host{font-variant-emoji:text}`;var ae="https://roxyapi.com/api/v2",L=class{constructor(e){this.baseUrl=ae;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let t=new AbortController;this.abort=t,this.host.loading=!0,this.host.error=null;try{let n=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t.signal}):await this.callApi(e,t.signal);if(!n.ok)throw new Error(await this.readError(n));let o=await n.json();if(t.signal.aborted)return;this.host.data=o}catch(n){if(n?.name==="AbortError")return;this.host.error=n instanceof Error?n.message:String(n)}finally{this.abort===t&&(this.abort=void 0),t.signal.aborted||(this.host.loading=!1)}}callApi(e,t){let n=new URL(`${this.baseUrl}${e.path}`);for(let[i,s]of Object.entries(e.query??{}))s!=null&&n.searchParams.set(i,String(s));let o={Accept:"application/json"};return this.publishableKey&&(o["X-API-Key"]=this.publishableKey),e.body!=null&&(o["Content-Type"]="application/json"),fetch(n,{method:e.method??"GET",headers:o,body:e.body!=null?JSON.stringify(e.body):void 0,signal:t})}secretKeyRefused(){let e=this.publishableKey;return!e||e.startsWith("pk_")?!1:(this.host.error="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.",this.host.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key"},bubbles:!0,composed:!0})),!0)}async readError(e){try{let t=await e.json();if(t?.error)return t.error}catch{}return`Request failed (${e.status})`}};function j(r,e,t){let n={...t},o=`/${r.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(d,a)=>{let $=n[a];return delete n[a],encodeURIComponent(String($??""))}),i={},s={};for(let[d,a]of Object.entries(n))a===void 0||a===""||(e==="GET"?i[d]=a:s[d]=a);return{path:o,method:e,query:i,body:e==="POST"?s:void 0}}var se="roxy-data";function le(r){return r.nodeName==="SCRIPT"&&r.getAttribute("type")==="application/json"}var M=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(le(e)&&e.classList.contains(se))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var p=class extends ce{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.onFormSubmit=t=>{let n=t.detail;this.remember&&this.writeRemembered(n.values),this.fetcher.run(j(this.endpoint,this.method,n.values))};new M(this),this.fetcher=new L(this)}static{this.styles=[A]}willUpdate(t){t.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),t.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),t.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.renderData(this.data):this.renderNoData()}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return k`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${de(this.specUrl)}" .initialValues="${this.remember?this.readRemembered():void 0}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let t=sessionStorage.getItem(this.rememberKey());return t?JSON.parse(t):void 0}catch{return}}writeRemembered(t){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(t))}catch{}}renderEmpty(){return k`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return k`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(t){let n=k`<div class="roxy-error" role="alert">${t}</div>`;return this.endpoint?k`${n}${this.renderForm()}`:n}};x([w({attribute:!1})],p.prototype,"data",2),x([w({type:String,attribute:"data-endpoint"})],p.prototype,"endpoint",2),x([w({type:String})],p.prototype,"method",2),x([w({type:String,attribute:"publishable-key"})],p.prototype,"publishableKey",2),x([w({type:String,attribute:"base-url"})],p.prototype,"baseUrl",2),x([w({type:String,attribute:"spec-url"})],p.prototype,"specUrl",2),x([w({type:String,attribute:"submit-url"})],p.prototype,"submitUrl",2),x([w({type:Boolean})],p.prototype,"remember",2),x([F()],p.prototype,"loading",2),x([F()],p.prototype,"error",2);import{nothing as g,svg as y}from"lit";function ue(r){let e=r%360;return e<0?e+360:e}function E(r){let e=ue(r),t=Math.floor(e/30)%12,n=e%30,o=Math.floor(n),i=(n-o)*60,s=Math.floor(i),d=Math.round((i-s)*60);return{sign:h[t]??"Aries",signIndex:t,degree:o,minute:s,second:d}}function N(r){return r?r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():""}import{css as ye,html as q,nothing as me}from"lit";var D=ye`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;function B(r){let{items:e,active:t,onSelect:n,label:o,idPrefix:i,controls:s=!1}=r;return q`<div class="roxy-tablist" role="tablist" aria-label="${o}" @keydown="${a=>{if(a.key!=="ArrowRight"&&a.key!=="ArrowLeft")return;a.preventDefault();let $=e.findIndex(O=>O.id===t);if($===-1)return;let G=a.key==="ArrowRight"?1:-1,T=e[($+G+e.length)%e.length];if(!T)return;n(T.id);let _=a.currentTarget.getRootNode();requestAnimationFrame(()=>{_.querySelector(`#${i}-tab-${T.id}`)?.focus()})}}">${e.map(a=>q`<button type="button" class="roxy-tab" role="tab" id="${i}-tab-${a.id}" aria-selected="${t===a.id?"true":"false"}" aria-controls="${s&&t===a.id?`${i}-panel-${a.id}`:me}" tabindex="${t===a.id?"0":"-1"}" @click="${()=>n(a.id)}">${a.label}</button>`)}</div>`}var b=400,c=20,m=b-2*c,u=b/2,Y=Object.fromEntries(h.map(r=>[r.toLowerCase(),r])),xe=[{id:"north",label:"North"},{id:"south",label:"South"},{id:"east",label:"East"}],pe="\u02B3";function J(r,e){return typeof r.longitude!="number"||!Number.isFinite(r.longitude)?!1:E(r.longitude).sign.toLowerCase()!==e.toLowerCase()}function ge(r,e){let t=z[N(r.graha)]??r.graha.slice(0,2),n=r.isRetrograde?pe:"";if(typeof r.longitude!="number"||!Number.isFinite(r.longitude)||J(r,e))return`${t}${n}`;let{degree:o}=E(r.longitude);return`${t} ${o}\xB0${n}`}function he(r,e){let t=[N(r.graha)],n=J(r,e);if(n&&t.push(`in ${e}`),typeof r.longitude=="number"&&Number.isFinite(r.longitude)){let o=E(r.longitude),i=String(o.minute).padStart(2,"0");t.push(n?`D1: ${o.degree}\xB0${i}' ${o.sign}`:`${o.degree}\xB0${i}' ${o.sign}`)}if(r.nakshatra?.name){let o=r.nakshatra.pada?` pada ${r.nakshatra.pada}`:"";t.push(`${r.nakshatra.name}${o}`)}return r.awastha&&t.push(r.awastha),r.isRetrograde&&t.push("retrograde"),t.join(" \xB7 ")}function I(r,e,t,n,o){let i=n-(r.length-1)*o/2;return r.map((s,d)=>{let a=i+d*o;return y`<text class="planet-text" x=${t} y=${a} text-anchor="middle" dominant-baseline="central">${ge(s,e)}<title>${he(s,e)}</title></text>`})}function W(r,e,t){let n={};for(let s of h)n[s.toLowerCase()]=[];let o=t?Y[t.toLowerCase()]??"":"",i=o;for(let[s,d]of Object.entries(r??{})){let a=(d?.rashi??"").toLowerCase();if(s==="Lagna"||d?.graha==="Lagna"){o||(i=Y[a]??"");continue}!a||!(a in n)||n[a]?.push({graha:d.graha??s,longitude:d.longitude,nakshatra:d.nakshatra,isRetrograde:d.isRetrograde,awastha:d.awastha})}return{lagnaSign:i,placements:n,divisionLabel:e}}var v=m/4,be={Pisces:{col:0,row:0},Aries:{col:1,row:0},Taurus:{col:2,row:0},Gemini:{col:3,row:0},Cancer:{col:3,row:1},Leo:{col:3,row:2},Virgo:{col:3,row:3},Libra:{col:2,row:3},Scorpio:{col:1,row:3},Sagittarius:{col:0,row:3},Capricorn:{col:0,row:2},Aquarius:{col:0,row:1}};function fe(r){let e=be[r]??{col:0,row:0};return{x:c+e.col*v,y:c+e.row*v,w:v,h:v}}function $e(r){let e=c,t=c+v,n=c+2*v,o=c+3*v,i=b-c;return y`
|
|
2
|
-
<rect class="line" x=${e} y=${e} width=${
|
|
1
|
+
var ne=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var x=(r,e,t,n)=>{for(var o=n>1?void 0:n?oe(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&ne(e,t,o),o};import{css as Ie,html as S,nothing as K}from"lit";import{customElement as Ke,property as Ge}from"lit/decorators.js";var V={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"},z={Sun:"Su",Moon:"Mo",Mercury:"Me",Venus:"Ve",Mars:"Ma",Jupiter:"Ju",Saturn:"Sa",Uranus:"Ur",Neptune:"Ne",Pluto:"Pl",Rahu:"Ra",Ketu:"Ke",Ascendant:"Asc",Lagna:"La"};var C={Aries:"Ar",Taurus:"Ta",Gemini:"Ge",Cancer:"Cn",Leo:"Le",Virgo:"Vi",Libra:"Li",Scorpio:"Sc",Sagittarius:"Sg",Capricorn:"Cp",Aquarius:"Aq",Pisces:"Pi"},h=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],He=h.map(r=>r.toLowerCase());import{html as k,LitElement as ce}from"lit";import{property as w,state as F}from"lit/decorators.js";import{ifDefined as de}from"lit/directives/if-defined.js";import{css as ie}from"lit";var A=ie`: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}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.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}:host{font-variant-emoji:text}`;var ae="https://roxyapi.com/api/v2",L=class{constructor(e){this.baseUrl=ae;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let t=new AbortController;this.abort=t,this.host.loading=!0,this.host.error=null;try{let n=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t.signal}):await this.callApi(e,t.signal);if(!n.ok)throw new Error(await this.readError(n));let o=await n.json();if(t.signal.aborted)return;this.host.data=o}catch(n){if(n?.name==="AbortError")return;this.host.error=n instanceof Error?n.message:String(n)}finally{this.abort===t&&(this.abort=void 0),t.signal.aborted||(this.host.loading=!1)}}callApi(e,t){let n=new URL(`${this.baseUrl}${e.path}`);for(let[i,s]of Object.entries(e.query??{}))s!=null&&n.searchParams.set(i,String(s));let o={Accept:"application/json"};return this.publishableKey&&(o["X-API-Key"]=this.publishableKey),e.body!=null&&(o["Content-Type"]="application/json"),fetch(n,{method:e.method??"GET",headers:o,body:e.body!=null?JSON.stringify(e.body):void 0,signal:t})}secretKeyRefused(){let e=this.publishableKey;return!e||e.startsWith("pk_")?!1:(this.host.error="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.",this.host.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key"},bubbles:!0,composed:!0})),!0)}async readError(e){try{let t=await e.json();if(t?.error)return t.error}catch{}return`Request failed (${e.status})`}};function j(r,e,t){let n={...t},o=`/${r.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(d,a)=>{let $=n[a];return delete n[a],encodeURIComponent(String($??""))}),i={},s={};for(let[d,a]of Object.entries(n))a===void 0||a===""||(e==="GET"?i[d]=a:s[d]=a);return{path:o,method:e,query:i,body:e==="POST"?s:void 0}}var se="roxy-data";function le(r){return r.nodeName==="SCRIPT"&&r.getAttribute("type")==="application/json"}var M=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(le(e)&&e.classList.contains(se))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var p=class extends ce{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.onFormSubmit=t=>{let n=t.detail;this.remember&&this.writeRemembered(n.values),this.fetcher.run(j(this.endpoint,this.method,n.values))};new M(this),this.fetcher=new L(this)}static{this.styles=[A]}willUpdate(t){t.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),t.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),t.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.renderData(this.data):this.renderNoData()}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return k`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${de(this.specUrl)}" .initialValues="${this.remember?this.readRemembered():void 0}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let t=sessionStorage.getItem(this.rememberKey());return t?JSON.parse(t):void 0}catch{return}}writeRemembered(t){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(t))}catch{}}renderEmpty(){return k`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return k`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(t){let n=k`<div class="roxy-error" role="alert">${t}</div>`;return this.endpoint?k`${n}${this.renderForm()}`:n}};x([w({attribute:!1})],p.prototype,"data",2),x([w({type:String,attribute:"data-endpoint"})],p.prototype,"endpoint",2),x([w({type:String})],p.prototype,"method",2),x([w({type:String,attribute:"publishable-key"})],p.prototype,"publishableKey",2),x([w({type:String,attribute:"base-url"})],p.prototype,"baseUrl",2),x([w({type:String,attribute:"spec-url"})],p.prototype,"specUrl",2),x([w({type:String,attribute:"submit-url"})],p.prototype,"submitUrl",2),x([w({type:Boolean})],p.prototype,"remember",2),x([F()],p.prototype,"loading",2),x([F()],p.prototype,"error",2);import{nothing as g,svg as m}from"lit";function ue(r){let e=r%360;return e<0?e+360:e}function E(r){let e=ue(r),t=Math.floor(e/30)%12,n=e%30,o=Math.floor(n),i=(n-o)*60,s=Math.floor(i),d=Math.round((i-s)*60);return{sign:h[t]??"Aries",signIndex:t,degree:o,minute:s,second:d}}function N(r){return r?r.charAt(0).toUpperCase()+r.slice(1).toLowerCase():""}import{css as me,html as q,nothing as ye}from"lit";var D=me`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;function B(r){let{items:e,active:t,onSelect:n,label:o,idPrefix:i,controls:s=!1}=r;return q`<div class="roxy-tablist" role="tablist" aria-label="${o}" @keydown="${a=>{if(a.key!=="ArrowRight"&&a.key!=="ArrowLeft")return;a.preventDefault();let $=e.findIndex(O=>O.id===t);if($===-1)return;let G=a.key==="ArrowRight"?1:-1,T=e[($+G+e.length)%e.length];if(!T)return;n(T.id);let _=a.currentTarget.getRootNode();requestAnimationFrame(()=>{_.querySelector(`#${i}-tab-${T.id}`)?.focus()})}}">${e.map(a=>q`<button type="button" class="roxy-tab" role="tab" id="${i}-tab-${a.id}" aria-selected="${t===a.id?"true":"false"}" aria-controls="${s&&t===a.id?`${i}-panel-${a.id}`:ye}" tabindex="${t===a.id?"0":"-1"}" @click="${()=>n(a.id)}">${a.label}</button>`)}</div>`}var b=400,c=20,y=b-2*c,u=b/2,Y=Object.fromEntries(h.map(r=>[r.toLowerCase(),r])),xe=[{id:"north",label:"North"},{id:"south",label:"South"},{id:"east",label:"East"}],pe="\u02B3";function J(r,e){return typeof r.longitude!="number"||!Number.isFinite(r.longitude)?!1:E(r.longitude).sign.toLowerCase()!==e.toLowerCase()}function ge(r,e){let t=z[N(r.graha)]??r.graha.slice(0,2),n=r.isRetrograde?pe:"";if(typeof r.longitude!="number"||!Number.isFinite(r.longitude)||J(r,e))return`${t}${n}`;let{degree:o}=E(r.longitude);return`${t} ${o}\xB0${n}`}function he(r,e){let t=[N(r.graha)],n=J(r,e);if(n&&t.push(`in ${e}`),typeof r.longitude=="number"&&Number.isFinite(r.longitude)){let o=E(r.longitude),i=String(o.minute).padStart(2,"0");t.push(n?`D1: ${o.degree}\xB0${i}' ${o.sign}`:`${o.degree}\xB0${i}' ${o.sign}`)}if(r.nakshatra?.name){let o=r.nakshatra.pada?` pada ${r.nakshatra.pada}`:"";t.push(`${r.nakshatra.name}${o}`)}return r.awastha&&t.push(r.awastha),r.isRetrograde&&t.push("retrograde"),t.join(" \xB7 ")}function I(r,e,t,n,o){let i=n-(r.length-1)*o/2;return r.map((s,d)=>{let a=i+d*o;return m`<text class="planet-text" x=${t} y=${a} text-anchor="middle" dominant-baseline="central">${ge(s,e)}<title>${he(s,e)}</title></text>`})}function W(r,e,t){let n={};for(let s of h)n[s.toLowerCase()]=[];let o=t?Y[t.toLowerCase()]??"":"",i=o;for(let[s,d]of Object.entries(r??{})){let a=(d?.rashi??"").toLowerCase();if(s==="Lagna"||d?.graha==="Lagna"){o||(i=Y[a]??"");continue}!a||!(a in n)||n[a]?.push({graha:d.graha??s,longitude:d.longitude,nakshatra:d.nakshatra,isRetrograde:d.isRetrograde,awastha:d.awastha})}return{lagnaSign:i,placements:n,divisionLabel:e}}var v=y/4,be={Pisces:{col:0,row:0},Aries:{col:1,row:0},Taurus:{col:2,row:0},Gemini:{col:3,row:0},Cancer:{col:3,row:1},Leo:{col:3,row:2},Virgo:{col:3,row:3},Libra:{col:2,row:3},Scorpio:{col:1,row:3},Sagittarius:{col:0,row:3},Capricorn:{col:0,row:2},Aquarius:{col:0,row:1}};function fe(r){let e=be[r]??{col:0,row:0};return{x:c+e.col*v,y:c+e.row*v,w:v,h:v}}function $e(r){let e=c,t=c+v,n=c+2*v,o=c+3*v,i=b-c;return m`
|
|
2
|
+
<rect class="line" x=${e} y=${e} width=${y} height=${y} stroke-width="1.5" fill="none" />
|
|
3
3
|
<line class="line" x1=${e} y1=${t} x2=${i} y2=${t} stroke-width="1" />
|
|
4
4
|
<line class="line" x1=${e} y1=${o} x2=${i} y2=${o} stroke-width="1" />
|
|
5
5
|
<line class="line" x1=${t} y1=${e} x2=${t} y2=${i} stroke-width="1" />
|
|
@@ -8,38 +8,38 @@ var ne=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var x=(r,e,t
|
|
|
8
8
|
<line class="line" x1=${o} y1=${n} x2=${i} y2=${n} stroke-width="1" />
|
|
9
9
|
<line class="line" x1=${n} y1=${e} x2=${n} y2=${t} stroke-width="1" />
|
|
10
10
|
<line class="line" x1=${n} y1=${o} x2=${n} y2=${i} stroke-width="1" />
|
|
11
|
-
${r?
|
|
12
|
-
`}function X(r,e){let t=h.findIndex(o=>o===e),n=h.findIndex(o=>o===r);return t===-1||n===-1?0:(n-t+12)%12+1}function we(r,e,t,n){let o=fe(r),i=o.x+o.w/2,s=o.y+o.h/2,d=C[r]??r.slice(0,2),a=14;return
|
|
11
|
+
${r?m`<text class="centre-label" x=${u} y=${u} text-anchor="middle" dominant-baseline="central">${r}</text>`:g}
|
|
12
|
+
`}function X(r,e){let t=h.findIndex(o=>o===e),n=h.findIndex(o=>o===r);return t===-1||n===-1?0:(n-t+12)%12+1}function we(r,e,t,n){let o=fe(r),i=o.x+o.w/2,s=o.y+o.h/2,d=C[r]??r.slice(0,2),a=14;return m`
|
|
13
13
|
<g class=${t?"cell lagna":"cell"}>
|
|
14
|
-
${t?
|
|
14
|
+
${t?m`
|
|
15
15
|
<rect class="lagna-bg" x=${o.x} y=${o.y} width=${o.w} height=${o.h} />
|
|
16
16
|
<line class="lagna-slash" x1=${o.x+o.w-a} y1=${o.y+a} x2=${o.x+a} y2=${o.y+o.h-a} stroke-width="1.2" />
|
|
17
17
|
`:g}
|
|
18
18
|
<text class="sign-text" x=${o.x+6} y=${o.y+12} text-anchor="start" dominant-baseline="central">${d}</text>
|
|
19
|
-
${n>0?
|
|
20
|
-
${t?
|
|
19
|
+
${n>0?m`<text class="house-num" x=${o.x+o.w-6} y=${o.y+12} text-anchor="end" dominant-baseline="central">${n}</text>`:g}
|
|
20
|
+
${t?m`<text class="lagna-marker" x=${i} y=${o.y+26} text-anchor="middle" dominant-baseline="central">Asc</text>`:g}
|
|
21
21
|
${e.length?I(e,r,i,s+4,14):g}
|
|
22
22
|
</g>
|
|
23
|
-
`}function ve(r){let e=r.lagnaSign.toLowerCase();return
|
|
23
|
+
`}function ve(r){let e=r.lagnaSign.toLowerCase();return m`
|
|
24
24
|
${$e(r.divisionLabel)}
|
|
25
25
|
${h.map(t=>we(t,r.placements[t.toLowerCase()]??[],t.toLowerCase()===e,X(t,r.lagnaSign)))}
|
|
26
|
-
`}var l={tl:{x:c,y:c},tr:{x:b-c,y:c},br:{x:b-c,y:b-c},bl:{x:c,y:b-c},top:{x:u,y:c},right:{x:b-c,y:u},bottom:{x:u,y:b-c},left:{x:c,y:u},tlMid:{x:u-
|
|
27
|
-
<rect class="line" x=${e.x} y=${e.y} width=${
|
|
26
|
+
`}var l={tl:{x:c,y:c},tr:{x:b-c,y:c},br:{x:b-c,y:b-c},bl:{x:c,y:b-c},top:{x:u,y:c},right:{x:b-c,y:u},bottom:{x:u,y:b-c},left:{x:c,y:u},tlMid:{x:u-y/4,y:u-y/4},trMid:{x:u+y/4,y:u-y/4},brMid:{x:u+y/4,y:u+y/4},blMid:{x:u-y/4,y:u+y/4}};function f(r){let e=r.reduce((n,o)=>n+o.x,0)/r.length,t=r.reduce((n,o)=>n+o.y,0)/r.length;return{x:e,y:t}}var Se={1:{x:u,y:l.tlMid.y},2:f([l.tl,l.top,l.tlMid]),3:f([l.tl,l.left,l.tlMid]),4:{x:l.tlMid.x,y:u},5:f([l.bl,l.left,l.blMid]),6:f([l.bl,l.bottom,l.blMid]),7:{x:u,y:l.blMid.y},8:f([l.br,l.bottom,l.brMid]),9:f([l.br,l.right,l.brMid]),10:{x:l.brMid.x,y:u},11:f([l.tr,l.right,l.trMid]),12:f([l.tr,l.top,l.trMid])};function Re(r,e){let t=h.findIndex(n=>n===e);return t===-1?r:(t+r-1)%12+1}function ke(r){let{tl:e,tr:t,br:n,bl:o,top:i,right:s,bottom:d,left:a}=l;return m`
|
|
27
|
+
<rect class="line" x=${e.x} y=${e.y} width=${y} height=${y} stroke-width="1.5" fill="none" />
|
|
28
28
|
<polygon class="line" points="${i.x},${i.y} ${s.x},${s.y} ${d.x},${d.y} ${a.x},${a.y}" stroke-width="1" fill="none" />
|
|
29
29
|
<line class="line" x1=${e.x} y1=${e.y} x2=${n.x} y2=${n.y} stroke-width="1" />
|
|
30
30
|
<line class="line" x1=${t.x} y1=${t.y} x2=${o.x} y2=${o.y} stroke-width="1" />
|
|
31
|
-
${r?
|
|
32
|
-
`}function Te(r,e,t,n,o){let i=Se[r];if(!i)return
|
|
31
|
+
${r?m`<text class="centre-label" x=${u} y=${u} text-anchor="middle" dominant-baseline="central">${r}</text>`:g}
|
|
32
|
+
`}function Te(r,e,t,n,o){let i=Se[r];if(!i)return m``;let s=Math.min(14,Math.abs(i.y-u)*.45+6),d=s+12,a=o?`${e} \xB7 ${C[t]??t.slice(0,2)}`:`${e}`;return m`
|
|
33
33
|
<g class=${o?"cell lagna":"cell"}>
|
|
34
34
|
<text class="rashi-num" x=${i.x} y=${i.y-s} text-anchor="middle" dominant-baseline="central">${a}</text>
|
|
35
|
-
${o?
|
|
35
|
+
${o?m`<text class="lagna-marker" x=${i.x} y=${i.y-d} text-anchor="middle" dominant-baseline="central">Asc</text>`:g}
|
|
36
36
|
${n.length?I(n,t,i.x,i.y+8,12):g}
|
|
37
37
|
</g>
|
|
38
|
-
`}function Ce(r){let e=r.lagnaSign||"Aries";return
|
|
38
|
+
`}function Ce(r){let e=r.lagnaSign||"Aries";return m`
|
|
39
39
|
${ke(r.divisionLabel)}
|
|
40
40
|
${Array.from({length:12},(t,n)=>{let o=n+1,i=Re(o,e),s=h[i-1]??"Aries";return Te(o,i,s,r.placements[s.toLowerCase()]??[],o===1)})}
|
|
41
|
-
`}var P=
|
|
42
|
-
<rect class="line" x=${e} y=${e} width=${
|
|
41
|
+
`}var P=y/3;function Ae(){let r=c,e=c+P,t=c+2*P,n=b-c,te={Aries:[{x:e,y:r},{x:t,y:r},{x:t,y:e},{x:e,y:e}],Taurus:[{x:r,y:r},{x:e,y:r},{x:e,y:e}],Gemini:[{x:r,y:r},{x:e,y:e},{x:r,y:e}],Cancer:[{x:r,y:e},{x:e,y:e},{x:e,y:t},{x:r,y:t}],Leo:[{x:r,y:t},{x:e,y:t},{x:r,y:n}],Virgo:[{x:e,y:t},{x:e,y:n},{x:r,y:n}],Libra:[{x:e,y:t},{x:t,y:t},{x:t,y:n},{x:e,y:n}],Scorpio:[{x:t,y:t},{x:t,y:n},{x:n,y:n}],Sagittarius:[{x:t,y:t},{x:n,y:n},{x:n,y:t}],Capricorn:[{x:t,y:e},{x:n,y:e},{x:n,y:t},{x:t,y:t}],Aquarius:[{x:n,y:r},{x:n,y:e},{x:t,y:e}],Pisces:[{x:t,y:r},{x:n,y:r},{x:t,y:e}]},U={};for(let[re,H]of Object.entries(te))U[re]={points:[...H],centroid:f(H)};return U}var Le=Ae();function Me(r){let e=c,t=c+P,n=c+2*P,o=b-c;return m`
|
|
42
|
+
<rect class="line" x=${e} y=${e} width=${y} height=${y} stroke-width="1.5" fill="none" />
|
|
43
43
|
<line class="line" x1=${e} y1=${t} x2=${t} y2=${t} stroke-width="1" />
|
|
44
44
|
<line class="line" x1=${n} y1=${t} x2=${o} y2=${t} stroke-width="1" />
|
|
45
45
|
<line class="line" x1=${e} y1=${n} x2=${t} y2=${n} stroke-width="1" />
|
|
@@ -52,16 +52,16 @@ var ne=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var x=(r,e,t
|
|
|
52
52
|
<line class="line" x1=${o} y1=${e} x2=${n} y2=${t} stroke-width="1" />
|
|
53
53
|
<line class="line" x1=${o} y1=${o} x2=${n} y2=${n} stroke-width="1" />
|
|
54
54
|
<line class="line" x1=${e} y1=${o} x2=${t} y2=${n} stroke-width="1" />
|
|
55
|
-
${r?
|
|
56
|
-
`}function Ee(r,e,t,n){let o=Le[r];if(!o)return
|
|
55
|
+
${r?m`<text class="centre-label" x=${u} y=${u} text-anchor="middle" dominant-baseline="central">${r}</text>`:g}
|
|
56
|
+
`}function Ee(r,e,t,n){let o=Le[r];if(!o)return m``;let{centroid:i,points:s}=o,d=C[r]??r.slice(0,2),a=s.map($=>`${$.x},${$.y}`).join(" ");return m`
|
|
57
57
|
<g class=${t?"cell lagna":"cell"}>
|
|
58
|
-
${t?
|
|
58
|
+
${t?m`<polygon class="lagna-bg" points=${a} />`:g}
|
|
59
59
|
<text class="sign-text" x=${i.x} y=${i.y-16} text-anchor="middle" dominant-baseline="central">${d}</text>
|
|
60
|
-
${n>0?
|
|
61
|
-
${t?
|
|
60
|
+
${n>0?m`<text class="house-num" x=${i.x+18} y=${i.y-16} text-anchor="start" dominant-baseline="central">${n}</text>`:g}
|
|
61
|
+
${t?m`<text class="lagna-marker" x=${i.x} y=${i.y-30} text-anchor="middle" dominant-baseline="central">Asc</text>`:g}
|
|
62
62
|
${e.length?I(e,r,i.x,i.y+4,12):g}
|
|
63
63
|
</g>
|
|
64
|
-
`}function Pe(r){let e=r.lagnaSign.toLowerCase();return
|
|
64
|
+
`}function Pe(r){let e=r.lagnaSign.toLowerCase();return m`
|
|
65
65
|
${Me(r.divisionLabel)}
|
|
66
66
|
${h.map(t=>Ee(t,r.placements[t.toLowerCase()]??[],t.toLowerCase()===e,X(t,r.lagnaSign)))}
|
|
67
67
|
`}function Z(r,e){switch(e){case"north":return Ce(r);case"east":return Pe(r);default:return ve(r)}}function Q(r,e){return B({items:xe,active:r,onSelect:e,label:"Kundli style",idPrefix:"kundli"})}import{css as Ne}from"lit";var ee=Ne`.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);display:grid}.header{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}svg{width:100%;max-width:var(--roxy-chart-max-width,560px);aspect-ratio:1;height:auto;margin:0 auto;display:block}.line{fill:#0000;stroke:var(--roxy-border,#d4d4d8)}.sign-text{fill:var(--roxy-muted,#71717a);font-size:11px;font-weight:500;font-family:var(--roxy-font-sans);text-transform:uppercase;letter-spacing:.04em}.rashi-num{fill:var(--roxy-muted,#71717a);font-size:12px;font-weight:500;font-family:var(--roxy-font-sans)}.house-num{fill:var(--roxy-accent-ink,#b45309);font-size:11px;font-weight:600;font-family:var(--roxy-font-sans);opacity:.85}.planet-text{fill:var(--roxy-fg,#0a0a0a);font-size:13px;font-weight:600;font-family:var(--roxy-font-sans)}.centre-label{fill:var(--roxy-muted,#71717a);font-size:14px;font-weight:600;font-family:var(--roxy-font-sans);letter-spacing:.02em}.lagna-marker{fill:var(--roxy-accent-ink,#b45309);font-size:10px;font-weight:700;font-family:var(--roxy-font-sans);letter-spacing:.08em;text-transform:uppercase}.lagna-bg{fill:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent)}.lagna-slash{stroke:var(--roxy-accent,#f59e0b);stroke-linecap:round;opacity:.7}`;var R=class extends p{constructor(){super(...arguments);this.chartStyle="north";this.setStyle=t=>{this.chartStyle=t}}viewModel(){if(!this.data?.chart?.meta)return null;let{division:t}=this.data,n=`D${t.number} ${t.name}`;return W(this.data.chart.meta,n)}renderEmpty(){return S`<div class="roxy-empty" role="status">No divisional chart data</div>`}renderData(t){let n=this.viewModel();if(!n)return this.renderEmpty();let{division:o,vargottama:i}=t;return S`<div class="wrap"><div class="header"><div><h2 class="title">D${o.number} ${o.name} ${o.sanskritName&&o.sanskritName!==o.name?S`<span class="division-meta">· ${o.sanskritName}</span>`:K}</h2>${o.significance?S`<p class="significance">${o.significance}</p>`:K}</div>${Q(this.chartStyle,this.setStyle)}</div><svg viewBox="0 0 400 400" preserveAspectRatio="xMidYMid meet" role="img" aria-label="D${o.number} ${o.name} divisional chart with twelve sign houses"><title>D${o.number} ${o.name}</title>${Z(n,this.chartStyle)}</svg> ${i&&i.length>0?S`<div class="vargottama-row" role="list" aria-label="Vargottama planets"><span class="vargottama-label">Vargottama:</span> ${i.map(s=>S`<span class="vargottama-pill" role="listitem">${V[s]??""} ${s}</span>`)}</div>`:K}</div>`}};R.styles=[A,ee,D,Ie`.division-meta{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.significance{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);border-left:2px solid var(--roxy-border,#e4e4e7);padding-left:var(--roxy-space-sm,.5rem);margin:0}.vargottama-row{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;align-items:center;display:flex}.vargottama-label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin-right:var(--roxy-space-xs,.25rem);font-weight:500}.vargottama-pill{font-size:var(--roxy-text-sm,.875rem);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 22%, transparent);color:var(--roxy-fg,#0a0a0a);border:1px solid color-mix(in srgb, var(--roxy-accent,#f59e0b) 45%, transparent);border-radius:999px;align-items:center;gap:.2em;padding:.15em .6em;font-weight:600;display:inline-flex}`],x([Ge({type:String,reflect:!0,attribute:"chart-style"})],R.prototype,"chartStyle",2),R=x([Ke("roxy-divisional-chart")],R);export{R as RoxyDivisionalChart};
|