@roxyapi/ui 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/AGENTS.md +13 -0
  2. package/README.md +1 -1
  3. package/THEMING.md +1 -1
  4. package/dist/cdn/components/ashtakavarga-grid.js +1 -1
  5. package/dist/cdn/components/ashtakavarga-grid.js.map +2 -2
  6. package/dist/cdn/components/biorhythm-chart.js +3 -3
  7. package/dist/cdn/components/biorhythm-chart.js.map +2 -2
  8. package/dist/cdn/components/choghadiya-grid.js +1 -1
  9. package/dist/cdn/components/choghadiya-grid.js.map +2 -2
  10. package/dist/cdn/components/compatibility-card.js +1 -1
  11. package/dist/cdn/components/compatibility-card.js.map +2 -2
  12. package/dist/cdn/components/dasha-timeline.js +2 -2
  13. package/dist/cdn/components/dasha-timeline.js.map +2 -2
  14. package/dist/cdn/components/divisional-chart.js +2 -2
  15. package/dist/cdn/components/divisional-chart.js.map +2 -2
  16. package/dist/cdn/components/endpoint-form.js +2 -2
  17. package/dist/cdn/components/endpoint-form.js.map +2 -2
  18. package/dist/cdn/components/guna-milan.js +1 -1
  19. package/dist/cdn/components/guna-milan.js.map +2 -2
  20. package/dist/cdn/components/hexagram.js +1 -1
  21. package/dist/cdn/components/hexagram.js.map +2 -2
  22. package/dist/cdn/components/horoscope-card.js +1 -1
  23. package/dist/cdn/components/horoscope-card.js.map +2 -2
  24. package/dist/cdn/components/kp-chart.js +1 -1
  25. package/dist/cdn/components/kp-chart.js.map +2 -2
  26. package/dist/cdn/components/kp-ruling-planets.js +1 -1
  27. package/dist/cdn/components/kp-ruling-planets.js.map +2 -2
  28. package/dist/cdn/components/location-search.js +1 -1
  29. package/dist/cdn/components/location-search.js.map +2 -2
  30. package/dist/cdn/components/nakshatra-card.js +1 -1
  31. package/dist/cdn/components/nakshatra-card.js.map +2 -2
  32. package/dist/cdn/components/natal-chart.js +4 -4
  33. package/dist/cdn/components/natal-chart.js.map +2 -2
  34. package/dist/cdn/components/numerology-card.js +2 -2
  35. package/dist/cdn/components/numerology-card.js.map +2 -2
  36. package/dist/cdn/components/panchang-table.js +3 -3
  37. package/dist/cdn/components/panchang-table.js.map +3 -3
  38. package/dist/cdn/components/shadbala-table.js +1 -1
  39. package/dist/cdn/components/shadbala-table.js.map +2 -2
  40. package/dist/cdn/components/synastry-chart.js +3 -3
  41. package/dist/cdn/components/synastry-chart.js.map +2 -2
  42. package/dist/cdn/components/transits-table.js +2 -2
  43. package/dist/cdn/components/transits-table.js.map +2 -2
  44. package/dist/cdn/components/vedic-kundli.js +10 -10
  45. package/dist/cdn/components/vedic-kundli.js.map +2 -2
  46. package/dist/cdn/components/vedic-planets-table.js +3 -3
  47. package/dist/cdn/components/vedic-planets-table.js.map +4 -4
  48. package/dist/cdn/components/yoga-list.js +2 -2
  49. package/dist/cdn/components/yoga-list.js.map +2 -2
  50. package/dist/cdn/roxy-ui.js +25 -25
  51. package/dist/cdn/roxy-ui.js.map +3 -3
  52. package/dist/components/ashtakavarga-grid.js +1 -1
  53. package/dist/components/ashtakavarga-grid.js.map +3 -3
  54. package/dist/components/biorhythm-chart.js +1 -1
  55. package/dist/components/biorhythm-chart.js.map +2 -2
  56. package/dist/components/choghadiya-grid.js +1 -1
  57. package/dist/components/choghadiya-grid.js.map +2 -2
  58. package/dist/components/compatibility-card.js +1 -1
  59. package/dist/components/compatibility-card.js.map +2 -2
  60. package/dist/components/dasha-timeline.js +1 -1
  61. package/dist/components/dasha-timeline.js.map +2 -2
  62. package/dist/components/divisional-chart.js +2 -2
  63. package/dist/components/divisional-chart.js.map +2 -2
  64. package/dist/components/endpoint-form.js +1 -1
  65. package/dist/components/endpoint-form.js.map +2 -2
  66. package/dist/components/guna-milan.js +1 -1
  67. package/dist/components/guna-milan.js.map +2 -2
  68. package/dist/components/hexagram.js +1 -1
  69. package/dist/components/hexagram.js.map +2 -2
  70. package/dist/components/horoscope-card.js +1 -1
  71. package/dist/components/horoscope-card.js.map +2 -2
  72. package/dist/components/kp-chart.js +1 -1
  73. package/dist/components/kp-chart.js.map +2 -2
  74. package/dist/components/kp-ruling-planets.js +1 -1
  75. package/dist/components/kp-ruling-planets.js.map +2 -2
  76. package/dist/components/location-search.js +1 -1
  77. package/dist/components/location-search.js.map +2 -2
  78. package/dist/components/nakshatra-card.js +1 -1
  79. package/dist/components/nakshatra-card.js.map +2 -2
  80. package/dist/components/natal-chart.js +2 -2
  81. package/dist/components/natal-chart.js.map +2 -2
  82. package/dist/components/numerology-card.js +1 -1
  83. package/dist/components/numerology-card.js.map +2 -2
  84. package/dist/components/panchang-table.d.ts +22 -1
  85. package/dist/components/panchang-table.d.ts.map +1 -1
  86. package/dist/components/panchang-table.js +1 -1
  87. package/dist/components/panchang-table.js.map +3 -3
  88. package/dist/components/shadbala-table.js +1 -1
  89. package/dist/components/shadbala-table.js.map +2 -2
  90. package/dist/components/synastry-chart.js +4 -4
  91. package/dist/components/synastry-chart.js.map +2 -2
  92. package/dist/components/transits-table.js +1 -1
  93. package/dist/components/transits-table.js.map +2 -2
  94. package/dist/components/vedic-kundli.js +2 -2
  95. package/dist/components/vedic-kundli.js.map +2 -2
  96. package/dist/components/vedic-planets-table.d.ts +14 -0
  97. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  98. package/dist/components/vedic-planets-table.js +1 -1
  99. package/dist/components/vedic-planets-table.js.map +4 -4
  100. package/dist/components/yoga-list.js +1 -1
  101. package/dist/components/yoga-list.js.map +2 -2
  102. package/dist/index.cjs +42 -42
  103. package/dist/index.cjs.map +3 -3
  104. package/dist/index.js +43 -43
  105. package/dist/index.js.map +3 -3
  106. package/dist/styles/tokens.css +4 -4
  107. package/dist/types/types.gen.d.ts +679 -40
  108. package/dist/types/types.gen.d.ts.map +1 -1
  109. package/dist/version.d.ts +1 -1
  110. package/package.json +1 -1
  111. package/src/components/ashtakavarga-grid.ts +1 -1
  112. package/src/components/biorhythm-chart.ts +1 -1
  113. package/src/components/choghadiya-grid.ts +1 -1
  114. package/src/components/compatibility-card.ts +2 -2
  115. package/src/components/dasha-timeline.ts +3 -3
  116. package/src/components/endpoint-form.ts +2 -2
  117. package/src/components/guna-milan.ts +1 -1
  118. package/src/components/hexagram.ts +3 -3
  119. package/src/components/horoscope-card.ts +1 -1
  120. package/src/components/kp-chart.ts +1 -1
  121. package/src/components/kp-ruling-planets.ts +1 -1
  122. package/src/components/location-search.ts +1 -1
  123. package/src/components/nakshatra-card.ts +1 -1
  124. package/src/components/natal-chart.ts +5 -5
  125. package/src/components/numerology-card.ts +2 -2
  126. package/src/components/panchang-table.ts +112 -18
  127. package/src/components/shadbala-table.ts +1 -1
  128. package/src/components/synastry-chart.ts +4 -4
  129. package/src/components/transits-table.ts +1 -1
  130. package/src/components/vedic-planets-table.ts +221 -3
  131. package/src/components/yoga-list.ts +1 -1
  132. package/src/styles/tokens.css +4 -4
  133. package/src/types/types.gen.ts +680 -41
  134. package/src/utils/kundli-styles.ts +2 -2
  135. package/src/utils/tablist.ts +1 -1
  136. package/src/version.ts +1 -1
@@ -1,2 +1,2 @@
1
- var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=(o,a,t,e)=>{for(var r=e>1?void 0:e?g(a,t):a,i=o.length-1,s;i>=0;i--)(s=o[i])&&(r=(e?s(a,t,r):s(r))||r);return e&&r&&m(a,t,r),r};import{css as S,html as n,LitElement as w,nothing as k}from"lit";import{customElement as T,property as A,state as $}from"lit/decorators.js";var p={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var v=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],R=v.map(o=>o.toLowerCase());import{css as f}from"lit";var b=f`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var x="roxy-data";function y(o){return o.nodeName==="SCRIPT"&&o.getAttribute("type")==="application/json"}var h=class{constructor(a){this.host=a,a.addController(this)}hostConnected(){if(this.host.data!=null)return;let a=this.read();a!==void 0&&(this.host.data=a,this.host.requestUpdate())}read(){let a=this.findInlineScript();return a?this.parse(a.textContent):void 0}findInlineScript(){for(let a of Array.from(this.host.children))if(y(a)&&a.classList.contains(x))return a;return null}parse(a){if(a?.trim())try{return JSON.parse(a)}catch{return}}};var L={sarva:"Sarvashtakavarga",bhinna:"Bhinnashtakavarga",pinda:"Shodhya Pinda"},l=["sarva","bhinna","pinda"],d=class extends w{constructor(){super();this.data=null;this.activeTab="sarva";new h(this)}render(){if(!this.data)return n`<div class="roxy-empty" role="status">No ashtakavarga data</div>`;let t=this.data.signs??[];return n`<div class="wrap" aria-label="Ashtakavarga grid"><div class="head"><h2 class="title">Ashtakavarga</h2>${t.length?n`<p class="subtitle">${t.length} signs</p>`:k}</div><div class="tablist" role="tablist" aria-label="Ashtakavarga views" @keydown="${this.onTabKeyDown}">${l.map(e=>n`<button class="tab" role="tab" id="tab-${e}" aria-selected="${this.activeTab===e?"true":"false"}" aria-controls="panel-${e}" tabindex="${this.activeTab===e?"0":"-1"}" @click="${()=>{this.activeTab=e}}">${L[e]}</button>`)}</div><div id="panel-${this.activeTab}" role="tabpanel" aria-labelledby="tab-${this.activeTab}">${this.activeTab==="sarva"?this.renderSarva(t):this.activeTab==="bhinna"?this.renderBhinna(t):this.renderPinda()}</div></div>`}onTabKeyDown(t){let e=l.indexOf(this.activeTab);t.key==="ArrowRight"?(t.preventDefault(),this.activeTab=l[(e+1)%l.length],this.focusActiveTab()):t.key==="ArrowLeft"&&(t.preventDefault(),this.activeTab=l[(e-1+l.length)%l.length],this.focusActiveTab())}focusActiveTab(){requestAnimationFrame(()=>{this.shadowRoot?.querySelector(`#tab-${this.activeTab}`)?.focus()})}bhinnaHeat(t){return t<=1?"heat-1":t<=2?"heat-2":t<=3?"heat-3":t<=4?"heat-4":t<=5?"heat-5":t<=6?"heat-6":"heat-7"}sarvaHeat(t){return t<=18?"heat-1":t<=23?"heat-2":t<=28?"heat-3":t<=32?"heat-4":t<=37?"heat-5":t<=42?"heat-6":"heat-7"}renderSarva(t){let e=this.data.sarvashtakavarga;return e?n`<div class="overflow-scroll"><table aria-label="Sarvashtakavarga bindu counts per sign"><thead><tr><th scope="col">Sign</th><th scope="col">Bindus</th></tr></thead><tbody>${t.map((r,i)=>{let s=e.bindus[i]??0,u=this.sarvaHeat(s);return n`<tr><td><div class="planet-cell"><span class="glyph" aria-hidden="true">${p[r]??""}</span> ${r}</div></td><td class="${`heat-cell ${u}`}">${s}</td></tr>`})}</tbody><tfoot><tr class="total-row"><td>Total</td><td>${e.total}</td></tr></tfoot></table></div>`:n`<p class="roxy-empty">No sarvashtakavarga data</p>`}renderBhinna(t){let e=this.data.bhinnashtakavarga;return e?.length?n`<div class="overflow-scroll"><table class="bhinna-table" aria-label="Bhinnashtakavarga planet-by-sign grid"><thead><tr><th scope="col">Planet</th>${t.map(r=>n`<th scope="col" title="${r}">${p[r]??r.slice(0,2)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${e.map(r=>n`<tr><td>${r.planet}</td>${r.bindus.map(i=>{let s=this.bhinnaHeat(i);return n`<td class="${`heat-cell ${s}`}">${i}</td>`})}<td>${r.total}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No bhinnashtakavarga data</p>`}renderPinda(){let t=this.data.shodhyaPinda;return t?.length?n`<div class="overflow-scroll"><table aria-label="Shodhya Pinda planet strength scores"><thead><tr><th scope="col">Planet</th><th scope="col">Rashi Pinda</th><th scope="col">Graha Pinda</th><th scope="col">Shodhya Pinda</th></tr></thead><tbody>${t.map(e=>n`<tr><td>${e.planet}</td><td>${e.rashiPinda}</td><td>${e.grahaPinda}</td><td>${e.shodhyaPinda}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No shodhya pinda data</p>`}};d.styles=[b,S`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.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}.tab[aria-selected=true]{color:var(--roxy-accent-fg,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.overflow-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.heat-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.heat-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 6%, transparent)}.heat-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 14%, transparent)}.heat-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 26%, transparent)}.heat-4{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 40%, transparent)}.heat-5{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 55%, transparent)}.heat-6{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 72%, transparent)}.heat-7{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 90%, transparent)}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.heat-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`],c([A({attribute:!1})],d.prototype,"data",2),c([$()],d.prototype,"activeTab",2),d=c([T("roxy-ashtakavarga-grid")],d);export{d as RoxyAshtakavargaGrid};
1
+ var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=(i,a,t,e)=>{for(var r=e>1?void 0:e?g(a,t):a,o=i.length-1,s;o>=0;o--)(s=i[o])&&(r=(e?s(a,t,r):s(r))||r);return e&&r&&m(a,t,r),r};import{css as S,html as n,LitElement as w,nothing as k}from"lit";import{customElement as T,property as A,state as $}from"lit/decorators.js";var p={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var v=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],R=v.map(i=>i.toLowerCase());import{css as f}from"lit";var b=f`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var x="roxy-data";function y(i){return i.nodeName==="SCRIPT"&&i.getAttribute("type")==="application/json"}var h=class{constructor(a){this.host=a,a.addController(this)}hostConnected(){if(this.host.data!=null)return;let a=this.read();a!==void 0&&(this.host.data=a,this.host.requestUpdate())}read(){let a=this.findInlineScript();return a?this.parse(a.textContent):void 0}findInlineScript(){for(let a of Array.from(this.host.children))if(y(a)&&a.classList.contains(x))return a;return null}parse(a){if(a?.trim())try{return JSON.parse(a)}catch{return}}};var L={sarva:"Sarvashtakavarga",bhinna:"Bhinnashtakavarga",pinda:"Shodhya Pinda"},l=["sarva","bhinna","pinda"],d=class extends w{constructor(){super();this.data=null;this.activeTab="sarva";new h(this)}render(){if(!this.data)return n`<div class="roxy-empty" role="status">No ashtakavarga data</div>`;let t=this.data.signs??[];return n`<div class="wrap" aria-label="Ashtakavarga grid"><div class="head"><h2 class="title">Ashtakavarga</h2>${t.length?n`<p class="subtitle">${t.length} signs</p>`:k}</div><div class="tablist" role="tablist" aria-label="Ashtakavarga views" @keydown="${this.onTabKeyDown}">${l.map(e=>n`<button class="tab" role="tab" id="tab-${e}" aria-selected="${this.activeTab===e?"true":"false"}" aria-controls="panel-${e}" tabindex="${this.activeTab===e?"0":"-1"}" @click="${()=>{this.activeTab=e}}">${L[e]}</button>`)}</div><div id="panel-${this.activeTab}" role="tabpanel" aria-labelledby="tab-${this.activeTab}">${this.activeTab==="sarva"?this.renderSarva(t):this.activeTab==="bhinna"?this.renderBhinna(t):this.renderPinda()}</div></div>`}onTabKeyDown(t){let e=l.indexOf(this.activeTab);t.key==="ArrowRight"?(t.preventDefault(),this.activeTab=l[(e+1)%l.length],this.focusActiveTab()):t.key==="ArrowLeft"&&(t.preventDefault(),this.activeTab=l[(e-1+l.length)%l.length],this.focusActiveTab())}focusActiveTab(){requestAnimationFrame(()=>{this.shadowRoot?.querySelector(`#tab-${this.activeTab}`)?.focus()})}bhinnaHeat(t){return t<=1?"heat-1":t<=2?"heat-2":t<=3?"heat-3":t<=4?"heat-4":t<=5?"heat-5":t<=6?"heat-6":"heat-7"}sarvaHeat(t){return t<=18?"heat-1":t<=23?"heat-2":t<=28?"heat-3":t<=32?"heat-4":t<=37?"heat-5":t<=42?"heat-6":"heat-7"}renderSarva(t){let e=this.data.sarvashtakavarga;return e?n`<div class="overflow-scroll"><table aria-label="Sarvashtakavarga bindu counts per sign"><thead><tr><th scope="col">Sign</th><th scope="col">Bindus</th></tr></thead><tbody>${t.map((r,o)=>{let s=e.bindus[o]??0,u=this.sarvaHeat(s);return n`<tr><td><div class="planet-cell"><span class="glyph" aria-hidden="true">${p[r]??""}</span> ${r}</div></td><td class="${`heat-cell ${u}`}">${s}</td></tr>`})}</tbody><tfoot><tr class="total-row"><td>Total</td><td>${e.total}</td></tr></tfoot></table></div>`:n`<p class="roxy-empty">No sarvashtakavarga data</p>`}renderBhinna(t){let e=this.data.bhinnashtakavarga;return e?.length?n`<div class="overflow-scroll"><table class="bhinna-table" aria-label="Bhinnashtakavarga planet-by-sign grid"><thead><tr><th scope="col">Planet</th>${t.map(r=>n`<th scope="col" title="${r}">${p[r]??r.slice(0,2)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${e.map(r=>n`<tr><td>${r.planet}</td>${r.bindus.map(o=>{let s=this.bhinnaHeat(o);return n`<td class="${`heat-cell ${s}`}">${o}</td>`})}<td>${r.total}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No bhinnashtakavarga data</p>`}renderPinda(){let t=this.data.shodhyaPinda;return t?.length?n`<div class="overflow-scroll"><table aria-label="Shodhya Pinda planet strength scores"><thead><tr><th scope="col">Planet</th><th scope="col">Rashi Pinda</th><th scope="col">Graha Pinda</th><th scope="col">Shodhya Pinda</th></tr></thead><tbody>${t.map(e=>n`<tr><td>${e.planet}</td><td>${e.rashiPinda}</td><td>${e.grahaPinda}</td><td>${e.shodhyaPinda}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No shodhya pinda data</p>`}};d.styles=[b,S`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.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}.tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.overflow-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.heat-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.heat-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 6%, transparent)}.heat-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 14%, transparent)}.heat-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 26%, transparent)}.heat-4{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 40%, transparent)}.heat-5{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 55%, transparent)}.heat-6{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 72%, transparent)}.heat-7{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 90%, transparent)}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.heat-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`],c([A({attribute:!1})],d.prototype,"data",2),c([$()],d.prototype,"activeTab",2),d=c([T("roxy-ashtakavarga-grid")],d);export{d as RoxyAshtakavargaGrid};
2
2
  //# sourceMappingURL=ashtakavarga-grid.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/ashtakavarga-grid.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'pinda';\n\nconst TAB_LABELS: Record<Tab, string> = {\n\tsarva: 'Sarvashtakavarga',\n\tbhinna: 'Bhinnashtakavarga',\n\tpinda: 'Shodhya Pinda',\n};\n\nconst TABS: Tab[] = ['sarva', 'bhinna', 'pinda'];\n\n/**\n * Ashtakavarga grid with three tabbed views: Sarvashtakavarga, Bhinnashtakavarga,\n * and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.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}.tab[aria-selected=true]{color:var(--roxy-accent-fg,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.overflow-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.heat-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.heat-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 6%, transparent)}.heat-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 14%, transparent)}.heat-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 26%, transparent)}.heat-4{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 40%, transparent)}.heat-5{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 55%, transparent)}.heat-6{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 72%, transparent)}.heat-7{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 90%, transparent)}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.heat-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: AshtakavargaResponse | null = null;\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\trender() {\n\t\tif (!this.data) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t\t}\n\n\t\tconst signs = this.data.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\"><div class=\"head\"><h2 class=\"title\">Ashtakavarga</h2>${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div><div class=\"tablist\" role=\"tablist\" aria-label=\"Ashtakavarga views\" @keydown=\"${this.onTabKeyDown}\">${TABS.map(\n\t\t\t\t\t(tab) => html`<button class=\"tab\" role=\"tab\" id=\"tab-${tab}\" aria-selected=\"${this.activeTab === tab ? 'true' : 'false'}\" aria-controls=\"panel-${tab}\" tabindex=\"${this.activeTab === tab ? '0' : '-1'}\" @click=\"${() => {\n\t\t\t\t\t\t\tthis.activeTab = tab;\n\t\t\t\t\t\t}}\">${TAB_LABELS[tab]}</button>`,\n\t\t\t\t)}</div><div id=\"panel-${this.activeTab}\" role=\"tabpanel\" aria-labelledby=\"tab-${this.activeTab}\">${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}</div></div>`;\n\t}\n\n\tprivate onTabKeyDown(e: KeyboardEvent) {\n\t\tconst idx = TABS.indexOf(this.activeTab);\n\t\tif (e.key === 'ArrowRight') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx + 1) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t} else if (e.key === 'ArrowLeft') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx - 1 + TABS.length) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t}\n\t}\n\n\tprivate focusActiveTab() {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst btn = this.shadowRoot?.querySelector<HTMLButtonElement>(\n\t\t\t\t`#tab-${this.activeTab}`,\n\t\t\t);\n\t\t\tbtn?.focus();\n\t\t});\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (sum of 0/1 contributions\n\t * from each of the 8 reference points). Bucket directly by raw count.\n\t */\n\tprivate bhinnaHeat(count: number): string {\n\t\tif (count <= 1) return 'heat-1';\n\t\tif (count <= 2) return 'heat-2';\n\t\tif (count <= 3) return 'heat-3';\n\t\tif (count <= 4) return 'heat-4';\n\t\tif (count <= 5) return 'heat-5';\n\t\tif (count <= 6) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across all 7 planets, range\n\t * roughly 0..56 with typical values 20..40. Bucketed per classical\n\t * interpretation: 25 below par, 25..30 average, 30..40 strong, 40+ very\n\t * strong. Bucket spans intentionally widen at the extremes so a single\n\t * outlier sign reads as exceptional.\n\t */\n\tprivate sarvaHeat(count: number): string {\n\t\tif (count <= 18) return 'heat-1';\n\t\tif (count <= 23) return 'heat-2';\n\t\tif (count <= 28) return 'heat-3';\n\t\tif (count <= 32) return 'heat-4';\n\t\tif (count <= 37) return 'heat-5';\n\t\tif (count <= 42) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\tprivate renderSarva(signs: AshtakavargaResponse['signs']) {\n\t\tconst sav = this.data!.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Sarvashtakavarga bindu counts per sign\"><thead><tr><th scope=\"col\">Sign</th><th scope=\"col\">Bindus</th></tr></thead><tbody>${signs.map((sign, i) => {\n\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\tconst hc = this.sarvaHeat(count);\n\t\t\t\t\t\treturn html`<tr><td><div class=\"planet-cell\"><span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span> ${sign}</div></td><td class=\"${`heat-cell ${hc}`}\">${count}</td></tr>`;\n\t\t\t\t\t})}</tbody><tfoot><tr class=\"total-row\"><td>Total</td><td>${sav.total}</td></tr></tfoot></table></div>`;\n\t}\n\n\tprivate renderBhinna(signs: AshtakavargaResponse['signs']) {\n\t\tconst bhinna = this.data!.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table class=\"bhinna-table\" aria-label=\"Bhinnashtakavarga planet-by-sign grid\"><thead><tr><th scope=\"col\">Planet</th>${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=\"${s}\">${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}<th scope=\"col\">Total</th></tr></thead><tbody>${bhinna.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td>${row.bindus.map((count) => {\n\t\t\t\t\t\t\tconst hc = this.bhinnaHeat(count);\n\t\t\t\t\t\t\treturn html`<td class=\"${`heat-cell ${hc}`}\">${count}</td>`;\n\t\t\t\t\t\t})}<td>${row.total}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data!.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Shodhya Pinda planet strength scores\"><thead><tr><th scope=\"col\">Planet</th><th scope=\"col\">Rashi Pinda</th><th scope=\"col\">Graha Pinda</th><th scope=\"col\">Shodhya Pinda</th></tr></thead><tbody>${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td><td>${row.rashiPinda}</td><td>${row.grahaPinda}</td><td>${row.shodhyaPinda}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
- "mappings": "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",
6
- "names": ["css", "html", "LitElement", "nothing", "customElement", "property", "state", "SIGN_GLYPH", "SIGNS_ORDER", "RASHI_KEYS", "s", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "TAB_LABELS", "TABS", "RoxyAshtakavargaGrid", "LitElement", "MarkupDataController", "html", "signs", "nothing", "tab", "e", "idx", "count", "sav", "sign", "hc", "SIGN_GLYPH", "bhinna", "s", "row", "pinda", "baseStyles", "css", "__decorateClass", "property", "state", "customElement"]
4
+ "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'pinda';\n\nconst TAB_LABELS: Record<Tab, string> = {\n\tsarva: 'Sarvashtakavarga',\n\tbhinna: 'Bhinnashtakavarga',\n\tpinda: 'Shodhya Pinda',\n};\n\nconst TABS: Tab[] = ['sarva', 'bhinna', 'pinda'];\n\n/**\n * Ashtakavarga grid with three tabbed views: Sarvashtakavarga, Bhinnashtakavarga,\n * and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);gap:2px;display:flex}.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}.tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.overflow-scroll{-webkit-overflow-scrolling:touch;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.heat-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.heat-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 6%, transparent)}.heat-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 14%, transparent)}.heat-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 26%, transparent)}.heat-4{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 40%, transparent)}.heat-5{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 55%, transparent)}.heat-6{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 72%, transparent)}.heat-7{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 90%, transparent)}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.heat-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: AshtakavargaResponse | null = null;\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\trender() {\n\t\tif (!this.data) {\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t\t}\n\n\t\tconst signs = this.data.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\"><div class=\"head\"><h2 class=\"title\">Ashtakavarga</h2>${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div><div class=\"tablist\" role=\"tablist\" aria-label=\"Ashtakavarga views\" @keydown=\"${this.onTabKeyDown}\">${TABS.map(\n\t\t\t\t\t(tab) => html`<button class=\"tab\" role=\"tab\" id=\"tab-${tab}\" aria-selected=\"${this.activeTab === tab ? 'true' : 'false'}\" aria-controls=\"panel-${tab}\" tabindex=\"${this.activeTab === tab ? '0' : '-1'}\" @click=\"${() => {\n\t\t\t\t\t\t\tthis.activeTab = tab;\n\t\t\t\t\t\t}}\">${TAB_LABELS[tab]}</button>`,\n\t\t\t\t)}</div><div id=\"panel-${this.activeTab}\" role=\"tabpanel\" aria-labelledby=\"tab-${this.activeTab}\">${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}</div></div>`;\n\t}\n\n\tprivate onTabKeyDown(e: KeyboardEvent) {\n\t\tconst idx = TABS.indexOf(this.activeTab);\n\t\tif (e.key === 'ArrowRight') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx + 1) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t} else if (e.key === 'ArrowLeft') {\n\t\t\te.preventDefault();\n\t\t\tthis.activeTab = TABS[(idx - 1 + TABS.length) % TABS.length];\n\t\t\tthis.focusActiveTab();\n\t\t}\n\t}\n\n\tprivate focusActiveTab() {\n\t\trequestAnimationFrame(() => {\n\t\t\tconst btn = this.shadowRoot?.querySelector<HTMLButtonElement>(\n\t\t\t\t`#tab-${this.activeTab}`,\n\t\t\t);\n\t\t\tbtn?.focus();\n\t\t});\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (sum of 0/1 contributions\n\t * from each of the 8 reference points). Bucket directly by raw count.\n\t */\n\tprivate bhinnaHeat(count: number): string {\n\t\tif (count <= 1) return 'heat-1';\n\t\tif (count <= 2) return 'heat-2';\n\t\tif (count <= 3) return 'heat-3';\n\t\tif (count <= 4) return 'heat-4';\n\t\tif (count <= 5) return 'heat-5';\n\t\tif (count <= 6) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across all 7 planets, range\n\t * roughly 0..56 with typical values 20..40. Bucketed per classical\n\t * interpretation: 25 below par, 25..30 average, 30..40 strong, 40+ very\n\t * strong. Bucket spans intentionally widen at the extremes so a single\n\t * outlier sign reads as exceptional.\n\t */\n\tprivate sarvaHeat(count: number): string {\n\t\tif (count <= 18) return 'heat-1';\n\t\tif (count <= 23) return 'heat-2';\n\t\tif (count <= 28) return 'heat-3';\n\t\tif (count <= 32) return 'heat-4';\n\t\tif (count <= 37) return 'heat-5';\n\t\tif (count <= 42) return 'heat-6';\n\t\treturn 'heat-7';\n\t}\n\n\tprivate renderSarva(signs: AshtakavargaResponse['signs']) {\n\t\tconst sav = this.data!.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Sarvashtakavarga bindu counts per sign\"><thead><tr><th scope=\"col\">Sign</th><th scope=\"col\">Bindus</th></tr></thead><tbody>${signs.map((sign, i) => {\n\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\tconst hc = this.sarvaHeat(count);\n\t\t\t\t\t\treturn html`<tr><td><div class=\"planet-cell\"><span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span> ${sign}</div></td><td class=\"${`heat-cell ${hc}`}\">${count}</td></tr>`;\n\t\t\t\t\t})}</tbody><tfoot><tr class=\"total-row\"><td>Total</td><td>${sav.total}</td></tr></tfoot></table></div>`;\n\t}\n\n\tprivate renderBhinna(signs: AshtakavargaResponse['signs']) {\n\t\tconst bhinna = this.data!.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table class=\"bhinna-table\" aria-label=\"Bhinnashtakavarga planet-by-sign grid\"><thead><tr><th scope=\"col\">Planet</th>${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=\"${s}\">${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}<th scope=\"col\">Total</th></tr></thead><tbody>${bhinna.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td>${row.bindus.map((count) => {\n\t\t\t\t\t\t\tconst hc = this.bhinnaHeat(count);\n\t\t\t\t\t\t\treturn html`<td class=\"${`heat-cell ${hc}`}\">${count}</td>`;\n\t\t\t\t\t\t})}<td>${row.total}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data!.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table aria-label=\"Shodhya Pinda planet strength scores\"><thead><tr><th scope=\"col\">Planet</th><th scope=\"col\">Rashi Pinda</th><th scope=\"col\">Graha Pinda</th><th scope=\"col\">Shodhya Pinda</th></tr></thead><tbody>${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td><td>${row.rashiPinda}</td><td>${row.grahaPinda}</td><td>${row.shodhyaPinda}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["css", "html", "LitElement", "nothing", "customElement", "property", "state", "SIGN_GLYPH", "SIGNS_ORDER", "RASHI_KEYS", "s", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "TAB_LABELS", "TABS", "RoxyAshtakavargaGrid", "LitElement", "MarkupDataController", "html", "signs", "nothing", "tab", "e", "idx", "count", "sav", "sign", "i", "hc", "SIGN_GLYPH", "bhinna", "s", "row", "pinda", "baseStyles", "css", "__decorateClass", "property", "state", "customElement"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var D=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var p=(n,r,e,t)=>{for(var s=t>1?void 0:t?R(r,e):r,a=n.length-1,i;a>=0;a--)(i=n[a])&&(s=(t?i(r,e,s):i(s))||s);return t&&s&&D(r,e,s),s};import{css as G,html as o,LitElement as F,nothing as m,svg as T}from"lit";import{customElement as M,property as h}from"lit/decorators.js";import{css as C}from"lit";var u=C`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var z="roxy-data";function S(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var y=class{constructor(r){this.host=r,r.addController(this)}hostConnected(){if(this.host.data!=null)return;let r=this.read();r!==void 0&&(this.host.data=r,this.host.requestUpdate())}read(){let r=this.findInlineScript();return r?this.parse(r.textContent):void 0}findInlineScript(){for(let r of Array.from(this.host.children))if(S(r)&&r.classList.contains(z))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var x={physical:"#dc2626",emotional:"#0284c7",intellectual:"#16a34a",intuitive:"#a855f7",aesthetic:"#f59e0b",awareness:"#ec4899",spiritual:"#14b8a6",passion:"#ef4444",mastery:"#6366f1",wisdom:"#475569"},c=class extends F{constructor(){super();this.data=null;this.mode="daily";new y(this)}render(){let e=this.data;return e?this.mode==="critical-days"&&"criticalDays"in e?this.renderCritical(e):this.mode==="forecast"&&"days"in e?this.renderForecast(e):this.renderDaily(e):o`<div class="roxy-empty" role="status">No biorhythm data</div>`}renderDaily(e){let t=e.quickRead??{},s=Object.entries(t).map(([a,i])=>{let l=typeof i=="number"?i:0,d=Math.abs(l)>1?l/100:l;return[a,d]});return o`<section class="wrap" aria-label="Daily biorhythm"><header class="head"><h2 class="title">Biorhythm</h2>${typeof e.energyRating=="number"?o`<span class="energy">Energy ${e.energyRating}/10</span>`:m}</header><div class="bars" role="list">${s.map(([a,i])=>{let l=(i+1)/2*100,d=x[a]??"var(--roxy-accent, #f59e0b)";return o`<div class="bar" role="listitem"><span style="text-transform:capitalize">${a}</span> <span class="track"><span class="fill" style="width:${l}%;background:${d}"></span> </span><span class="value">${Math.round(i*100)}%</span></div>`})}</div>${e.dailyMessage?o`<p class="advice">${e.dailyMessage}</p>`:m} ${e.advice?o`<p class="advice">${e.advice}</p>`:m}</section>`}renderForecast(e){let t=e.days??[];if(t.length===0)return o`<div class="roxy-empty" role="status">No forecast</div>`;let s=600,a=160,i=s/Math.max(t.length-1,1),l=["physical","emotional","intellectual","intuitive"];return o`<section class="wrap" aria-label="Biorhythm forecast"><header class="head"><h2 class="title">Forecast</h2><span class="energy">${e.startDate} - ${e.endDate}</span></header><svg viewBox="0 0 ${s} ${a}" role="img" aria-label="Biorhythm cycle lines across the forecast window"><title>Biorhythm forecast</title><line x1="0" y1="${a/2}" x2="${s}" y2="${a/2}" stroke="var(--roxy-border, #e4e4e7)" stroke-width="1"/>${l.map(d=>{let f=t.map((g,b)=>{let w=g[d]??0,$=b*i,k=a/2-w/100*(a/2-8);return`${$.toFixed(2)},${k.toFixed(2)}`}).join(" "),v=x[d]??"#475569";return T`<polyline points=${f} fill="none" stroke=${v} stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />`})}</svg> ${e.summary?.periodAdvice?o`<p class="advice">${e.summary.periodAdvice}</p>`:m}</section>`}renderCritical(e){return o`<section class="wrap" aria-label="Critical days"><header class="head"><h2 class="title">Critical days</h2><span class="energy">${e.totalCriticalDays} total</span></header><div>${e.criticalDays.map(t=>o`<span class="crit">${t.date} · ${t.cycle} ${t.severity}</span>`)}</div></section>`}};c.styles=[u,G`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`],p([h({attribute:!1})],c.prototype,"data",2),p([h({type:String,reflect:!0})],c.prototype,"mode",2),c=p([M("roxy-biorhythm-chart")],c);export{c as RoxyBiorhythmChart};
1
+ var D=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var p=(n,r,e,t)=>{for(var s=t>1?void 0:t?R(r,e):r,a=n.length-1,i;a>=0;a--)(i=n[a])&&(s=(t?i(r,e,s):i(s))||s);return t&&s&&D(r,e,s),s};import{css as G,html as o,LitElement as F,nothing as m,svg as T}from"lit";import{customElement as M,property as h}from"lit/decorators.js";import{css as C}from"lit";var u=C`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var z="roxy-data";function S(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var y=class{constructor(r){this.host=r,r.addController(this)}hostConnected(){if(this.host.data!=null)return;let r=this.read();r!==void 0&&(this.host.data=r,this.host.requestUpdate())}read(){let r=this.findInlineScript();return r?this.parse(r.textContent):void 0}findInlineScript(){for(let r of Array.from(this.host.children))if(S(r)&&r.classList.contains(z))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var x={physical:"#dc2626",emotional:"#0284c7",intellectual:"#16a34a",intuitive:"#a855f7",aesthetic:"#f59e0b",awareness:"#ec4899",spiritual:"#14b8a6",passion:"#ef4444",mastery:"#6366f1",wisdom:"#475569"},c=class extends F{constructor(){super();this.data=null;this.mode="daily";new y(this)}render(){let e=this.data;return e?this.mode==="critical-days"&&"criticalDays"in e?this.renderCritical(e):this.mode==="forecast"&&"days"in e?this.renderForecast(e):this.renderDaily(e):o`<div class="roxy-empty" role="status">No biorhythm data</div>`}renderDaily(e){let t=e.quickRead??{},s=Object.entries(t).map(([a,i])=>{let l=typeof i=="number"?i:0,d=Math.abs(l)>1?l/100:l;return[a,d]});return o`<section class="wrap" aria-label="Daily biorhythm"><header class="head"><h2 class="title">Biorhythm</h2>${typeof e.energyRating=="number"?o`<span class="energy">Energy ${e.energyRating}/10</span>`:m}</header><div class="bars" role="list">${s.map(([a,i])=>{let l=(i+1)/2*100,d=x[a]??"var(--roxy-accent, #f59e0b)";return o`<div class="bar" role="listitem"><span style="text-transform:capitalize">${a}</span> <span class="track"><span class="fill" style="width:${l}%;background:${d}"></span> </span><span class="value">${Math.round(i*100)}%</span></div>`})}</div>${e.dailyMessage?o`<p class="advice">${e.dailyMessage}</p>`:m} ${e.advice?o`<p class="advice">${e.advice}</p>`:m}</section>`}renderForecast(e){let t=e.days??[];if(t.length===0)return o`<div class="roxy-empty" role="status">No forecast</div>`;let s=600,a=160,i=s/Math.max(t.length-1,1),l=["physical","emotional","intellectual","intuitive"];return o`<section class="wrap" aria-label="Biorhythm forecast"><header class="head"><h2 class="title">Forecast</h2><span class="energy">${e.startDate} - ${e.endDate}</span></header><svg viewBox="0 0 ${s} ${a}" role="img" aria-label="Biorhythm cycle lines across the forecast window"><title>Biorhythm forecast</title><line x1="0" y1="${a/2}" x2="${s}" y2="${a/2}" stroke="var(--roxy-border, #e4e4e7)" stroke-width="1"/>${l.map(d=>{let f=t.map((g,b)=>{let k=g[d]??0,w=b*i,$=a/2-k/100*(a/2-8);return`${w.toFixed(2)},${$.toFixed(2)}`}).join(" "),v=x[d]??"#475569";return T`<polyline points=${f} fill="none" stroke=${v} stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />`})}</svg> ${e.summary?.periodAdvice?o`<p class="advice">${e.summary.periodAdvice}</p>`:m}</section>`}renderCritical(e){return o`<section class="wrap" aria-label="Critical days"><header class="head"><h2 class="title">Critical days</h2><span class="energy">${e.totalCriticalDays} total</span></header><div>${e.criticalDays.map(t=>o`<span class="crit">${t.date} · ${t.cycle} ${t.severity}</span>`)}</div></section>`}};c.styles=[u,G`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`],p([h({attribute:!1})],c.prototype,"data",2),p([h({type:String,reflect:!0})],c.prototype,"mode",2),c=p([M("roxy-biorhythm-chart")],c);export{c as RoxyBiorhythmChart};
2
2
  //# sourceMappingURL=biorhythm-chart.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/biorhythm-chart.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\"><header class=\"head\"><h2 class=\"title\">Biorhythm</h2>${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header><div class=\"bars\" role=\"list\">${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\"><span style=\"text-transform:capitalize\">${cycle}</span> <span class=\"track\"><span class=\"fill\" style=\"width:${pct}%;background:${color}\"></span> </span><span class=\"value\">${Math.round(v * 100)}%</span></div>`;\n\t\t\t\t})}</div>${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing} ${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\"><header class=\"head\"><h2 class=\"title\">Forecast</h2><span class=\"energy\">${d.startDate} - ${d.endDate}</span></header><svg viewBox=\"0 0 ${w} ${h}\" role=\"img\" aria-label=\"Biorhythm cycle lines across the forecast window\"><title>Biorhythm forecast</title><line x1=\"0\" y1=\"${h / 2}\" x2=\"${w}\" y2=\"${h / 2}\" stroke=\"var(--roxy-border, #e4e4e7)\" stroke-width=\"1\"/>${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=${points} fill=\"none\" stroke=${color} stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />`;\n\t\t\t\t})}</svg> ${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\"><header class=\"head\"><h2 class=\"title\">Critical days</h2><span class=\"energy\">${d.totalCriticalDays} total</span></header><div>${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\">${day.date} \u00B7 ${day.cycle} ${day.severity}</span>`,\n\t\t\t\t)}</div></section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
- "mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,cAAAC,EAAY,WAAAC,EAAS,OAAAC,MAAW,MACpD,OAAS,iBAAAC,EAAe,YAAAC,MAAgB,oBCDxC,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,myCCM1B,IAAME,EAAkB,YAKxB,SAASC,EAAaC,EAAsB,CAC3C,OACCA,EAAG,WAAa,UAAYA,EAAG,aAAa,MAAM,IAAM,kBAE1D,CA2CO,IAAMC,EAAN,KAAsE,CAG5E,YAAYC,EAAgB,CAC3B,KAAK,KAAOA,EACZA,EAAK,cAAc,IAAI,CACxB,CAEA,eAAgB,CAGf,GAAI,KAAK,KAAK,MAAQ,KAAM,OAE5B,IAAMC,EAAS,KAAK,KAAK,EACrBA,IAAW,SAEf,KAAK,KAAK,KAAOA,EACjB,KAAK,KAAK,cAAc,EACzB,CAKQ,MAAsB,CAC7B,IAAMC,EAAS,KAAK,iBAAiB,EACrC,OAAOA,EAAS,KAAK,MAAMA,EAAO,WAAW,EAAI,MAClD,CAKQ,kBAAmC,CAC1C,QAAWC,KAAS,MAAM,KAAK,KAAK,KAAK,QAAQ,EAChD,GAAIN,EAAaM,CAAK,GAAKA,EAAM,UAAU,SAASP,CAAe,EAClE,OAAOO,EAGT,OAAO,IACR,CAEQ,MAAMC,EAAoC,CACjD,GAAKA,GAAM,KAAK,EAChB,GAAI,CACH,OAAO,KAAK,MAAMA,CAAI,CACvB,MAAQ,CAGP,MACD,CACD,CACD,EFnGA,IAAMC,EAAsC,CAC3C,SAAU,UACV,UAAW,UACX,aAAc,UACd,UAAW,UACX,UAAW,UACX,UAAW,UACX,UAAW,UACX,QAAS,UACT,QAAS,UACT,OAAQ,SACT,EAMaC,EAAN,cAAiCC,CAAW,CAMlD,aAAc,CACb,MAAM,EAQP,UAA6B,KAG7B,UAA+C,QAP9C,IAAIC,EAAqB,IAAI,CAC9B,CAQA,QAAS,CACR,IAAMC,EAAI,KAAK,KACf,OAAKA,EAGD,KAAK,OAAS,iBAAmB,iBAAkBA,EAC/C,KAAK,eAAeA,CAA4B,EAEpD,KAAK,OAAS,YAAc,SAAUA,EAClC,KAAK,eAAeA,CAAwB,EAE7C,KAAK,YAAYA,CAA8B,EAR9CC,gEAST,CAEQ,YAAYD,EAA8B,CACjD,IAAME,EAAMF,EAAE,WAAa,CAAC,EACtBG,EAAU,OAAO,QAAQD,CAAG,EAAE,IAAI,CAAC,CAACE,EAAOC,CAAK,IAAM,CAC3D,IAAMC,EAAI,OAAOD,GAAU,SAAWA,EAAQ,EACxCE,EAAa,KAAK,IAAID,CAAC,EAAI,EAAIA,EAAI,IAAMA,EAC/C,MAAO,CAACF,EAAOG,CAAU,CAC1B,CAAC,EACD,OAAON,4GACJ,OAAOD,EAAE,cAAiB,SACvBC,gCAAmCD,EAAE,YAAY,aACjDQ,CACJ,0CAA0CL,EAAQ,IAAI,CAAC,CAACC,EAAOE,CAAC,IAAM,CACrE,IAAMG,GAAQH,EAAI,GAAK,EAAK,IACtBI,EAAQd,EAAYQ,CAAK,GAAK,8BACpC,OAAOH,6EAAgFG,CAAK,+DAA+DK,CAAG,gBAAgBC,CAAK,wCAAwC,KAAK,MAAMJ,EAAI,GAAG,CAAC,gBAC/O,CAAC,CAAC,SAASN,EAAE,aAAeC,sBAAyBD,EAAE,YAAY,OAASQ,CAAO,IAAIR,EAAE,OAASC,sBAAyBD,EAAE,MAAM,OAASQ,CAAO,YACtJ,CAEQ,eAAeR,EAAwB,CAC9C,IAAMW,EAAOX,EAAE,MAAQ,CAAC,EACxB,GAAIW,EAAK,SAAW,EACnB,OAAOV,2DACR,IAAMW,EAAI,IACJC,EAAI,IACJC,EAAQF,EAAI,KAAK,IAAID,EAAK,OAAS,EAAG,CAAC,EACvCI,EAAY,CACjB,WACA,YACA,eACA,WACD,EACA,OAAOd,mIAAsID,EAAE,SAAS,MAAMA,EAAE,OAAO,qCAAqCY,CAAC,IAAIC,CAAC,gIAAgIA,EAAI,CAAC,SAASD,CAAC,SAASC,EAAI,CAAC,4DAA4DE,EAAU,IAAKX,GAAU,CACjc,IAAMY,EAASL,EACb,IAAI,CAACM,EAAKC,IAAM,CAChB,IAAMZ,EAAIW,EAAIb,CAAK,GAAK,EAClBe,EAAID,EAAIJ,EACRM,EAAIP,EAAI,EAAKP,EAAI,KAAQO,EAAI,EAAI,GACvC,MAAO,GAAGM,EAAE,QAAQ,CAAC,CAAC,IAAIC,EAAE,QAAQ,CAAC,CAAC,EACvC,CAAC,EACA,KAAK,GAAG,EACJV,EAAQd,EAAYQ,CAAK,GAAK,UACpC,OAAOiB,qBAAuBL,CAAM,uBAAuBN,CAAK,uEACjE,CAAC,CAAC,UACFV,EAAE,SAAS,aACRC,sBAAyBD,EAAE,QAAQ,YAAY,OAC/CQ,CACJ,YACF,CAEQ,eAAeR,EAA4B,CAClD,OAAOC,mIAAsID,EAAE,iBAAiB,8BAA8BA,EAAE,aAAa,IACzMiB,GAAQhB,uBAA0BgB,EAAI,IAAI,MAAMA,EAAI,KAAK,IAAIA,EAAI,QAAQ,SAC3E,CAAC,kBACJ,CACD,EAxFapB,EACL,OAAS,CACfyB,EACAC,i+CACD,EAWAC,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GAdlB5B,EAeZ,oBAGA2B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAjB7B5B,EAkBZ,oBAlBYA,EAAN2B,EAAA,CADNE,EAAc,sBAAsB,GACxB7B",
4
+ "sourcesContent": ["import { css, html, LitElement, nothing, svg } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n\tGetCriticalDaysResponse,\n\tGetDailyBiorhythmResponse,\n\tGetForecastResponse,\n} from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\n\ntype BiorhythmData =\n\t| GetDailyBiorhythmResponse\n\t| GetForecastResponse\n\t| GetCriticalDaysResponse;\n\nconst CYCLE_COLOR: Record<string, string> = {\n\tphysical: '#dc2626',\n\temotional: '#0284c7',\n\tintellectual: '#16a34a',\n\tintuitive: '#a855f7',\n\taesthetic: '#f59e0b',\n\tawareness: '#ec4899',\n\tspiritual: '#14b8a6',\n\tpassion: '#ef4444',\n\tmastery: '#6366f1',\n\twisdom: '#475569',\n};\n\n/**\n * Biorhythm chart. Renders /biorhythm/{daily,forecast,critical-days}.\n */\n@customElement('roxy-biorhythm-chart')\nexport class RoxyBiorhythmChart extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.head{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm,.5rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.energy{font-variant-numeric:tabular-nums;color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.bars{gap:var(--roxy-space-xs,.25rem);display:grid}.bar{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.track{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:14px;position:relative;overflow:hidden}.fill{height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.value{font-variant-numeric:tabular-nums;text-align:right;color:var(--roxy-muted,#71717a)}.advice{color:var(--roxy-fg,#0a0a0a)}.alert{background:color-mix(in srgb, var(--roxy-warning,#ea580c) 12%, transparent);border:1px solid color-mix(in srgb, var(--roxy-warning,#ea580c) 32%, transparent);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);margin:0}svg{width:100%;height:auto;display:block}.crit{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 12%, transparent);border-radius:var(--roxy-radius-sm,4px);font-size:var(--roxy-text-xs,.75rem);margin:2px;padding:4px 8px;display:inline-block}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: BiorhythmData | null = null;\n\n\t@property({ type: String, reflect: true })\n\tmode: 'daily' | 'forecast' | 'critical-days' = 'daily';\n\n\trender() {\n\t\tconst d = this.data;\n\t\tif (!d)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No biorhythm data</div>`;\n\n\t\tif (this.mode === 'critical-days' && 'criticalDays' in d) {\n\t\t\treturn this.renderCritical(d as GetCriticalDaysResponse);\n\t\t}\n\t\tif (this.mode === 'forecast' && 'days' in d) {\n\t\t\treturn this.renderForecast(d as GetForecastResponse);\n\t\t}\n\t\treturn this.renderDaily(d as GetDailyBiorhythmResponse);\n\t}\n\n\tprivate renderDaily(d: GetDailyBiorhythmResponse) {\n\t\tconst raw = d.quickRead ?? {};\n\t\tconst entries = Object.entries(raw).map(([cycle, value]) => {\n\t\t\tconst v = typeof value === 'number' ? value : 0;\n\t\t\tconst normalized = Math.abs(v) > 1 ? v / 100 : v;\n\t\t\treturn [cycle, normalized] as const;\n\t\t});\n\t\treturn html`<section class=\"wrap\" aria-label=\"Daily biorhythm\"><header class=\"head\"><h2 class=\"title\">Biorhythm</h2>${\n\t\t\t\t\ttypeof d.energyRating === 'number'\n\t\t\t\t\t\t? html`<span class=\"energy\">Energy ${d.energyRating}/10</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</header><div class=\"bars\" role=\"list\">${entries.map(([cycle, v]) => {\n\t\t\t\t\tconst pct = ((v + 1) / 2) * 100; // -1..1 -> 0..100\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? 'var(--roxy-accent, #f59e0b)';\n\t\t\t\t\treturn html`<div class=\"bar\" role=\"listitem\"><span style=\"text-transform:capitalize\">${cycle}</span> <span class=\"track\"><span class=\"fill\" style=\"width:${pct}%;background:${color}\"></span> </span><span class=\"value\">${Math.round(v * 100)}%</span></div>`;\n\t\t\t\t})}</div>${d.dailyMessage ? html`<p class=\"advice\">${d.dailyMessage}</p>` : nothing} ${d.advice ? html`<p class=\"advice\">${d.advice}</p>` : nothing}</section>`;\n\t}\n\n\tprivate renderForecast(d: GetForecastResponse) {\n\t\tconst days = d.days ?? [];\n\t\tif (days.length === 0)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No forecast</div>`;\n\t\tconst w = 600;\n\t\tconst h = 160;\n\t\tconst xStep = w / Math.max(days.length - 1, 1);\n\t\tconst cycleKeys = [\n\t\t\t'physical',\n\t\t\t'emotional',\n\t\t\t'intellectual',\n\t\t\t'intuitive',\n\t\t] as const;\n\t\treturn html`<section class=\"wrap\" aria-label=\"Biorhythm forecast\"><header class=\"head\"><h2 class=\"title\">Forecast</h2><span class=\"energy\">${d.startDate} - ${d.endDate}</span></header><svg viewBox=\"0 0 ${w} ${h}\" role=\"img\" aria-label=\"Biorhythm cycle lines across the forecast window\"><title>Biorhythm forecast</title><line x1=\"0\" y1=\"${h / 2}\" x2=\"${w}\" y2=\"${h / 2}\" stroke=\"var(--roxy-border, #e4e4e7)\" stroke-width=\"1\"/>${cycleKeys.map((cycle) => {\n\t\t\t\t\tconst points = days\n\t\t\t\t\t\t.map((day, i) => {\n\t\t\t\t\t\t\tconst v = day[cycle] ?? 0;\n\t\t\t\t\t\t\tconst x = i * xStep;\n\t\t\t\t\t\t\tconst y = h / 2 - (v / 100) * (h / 2 - 8);\n\t\t\t\t\t\t\treturn `${x.toFixed(2)},${y.toFixed(2)}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(' ');\n\t\t\t\t\tconst color = CYCLE_COLOR[cycle] ?? '#475569';\n\t\t\t\t\treturn svg`<polyline points=${points} fill=\"none\" stroke=${color} stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />`;\n\t\t\t\t})}</svg> ${\n\t\t\t\td.summary?.periodAdvice\n\t\t\t\t\t? html`<p class=\"advice\">${d.summary.periodAdvice}</p>`\n\t\t\t\t\t: nothing\n\t\t\t}</section>`;\n\t}\n\n\tprivate renderCritical(d: GetCriticalDaysResponse) {\n\t\treturn html`<section class=\"wrap\" aria-label=\"Critical days\"><header class=\"head\"><h2 class=\"title\">Critical days</h2><span class=\"energy\">${d.totalCriticalDays} total</span></header><div>${d.criticalDays.map(\n\t\t\t\t\t(day) => html`<span class=\"crit\">${day.date} \u00B7 ${day.cycle} ${day.severity}</span>`,\n\t\t\t\t)}</div></section>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-biorhythm-chart': RoxyBiorhythmChart;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n"],
5
+ "mappings": "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",
6
6
  "names": ["css", "html", "LitElement", "nothing", "svg", "customElement", "property", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "CYCLE_COLOR", "RoxyBiorhythmChart", "LitElement", "MarkupDataController", "d", "html", "raw", "entries", "cycle", "value", "v", "normalized", "nothing", "pct", "color", "days", "w", "h", "xStep", "cycleKeys", "points", "day", "i", "x", "y", "svg", "baseStyles", "css", "__decorateClass", "property", "customElement"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=(a,e,r,o)=>{for(var t=o>1?void 0:o?y(e,r):e,i=a.length-1,c;i>=0;i--)(c=a[i])&&(t=(o?c(e,r,t):c(t))||t);return o&&t&&x(e,r,t),t};import{css as w,html as n,LitElement as N,nothing as p}from"lit";import{customElement as C,property as L}from"lit/decorators.js";var u={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"};var f=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],T=f.map(a=>a.toLowerCase());import{css as b}from"lit";var m=b`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var v="roxy-data";function S(a){return a.nodeName==="SCRIPT"&&a.getAttribute("type")==="application/json"}var l=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(S(e)&&e.classList.contains(v))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};function g(a){return a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():""}function h(a){try{let e=new Date(a);return Number.isNaN(e.getTime())?a:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return a}}var s=class extends N{constructor(){super();this.data=null;new l(this)}isCurrent(r){let o=Date.now(),t=Date.parse(r.start),i=Date.parse(r.end);return Number.isNaN(t)||Number.isNaN(i)?!1:o>=t&&o<i}renderTile(r){let o=r.effect==="Good"?"good":r.effect==="Bad"?"bad":"neutral",t=this.isCurrent(r),i=u[g(r.lord)]??"",c=`${h(r.start)} - ${h(r.end)}`;return n`<div class="cho-tile ${o}${t?" now":""}" role="listitem" aria-current="${t?"time":"false"}"><span class="tile-name">${r.name}${t?n`<span class="now-badge">Now</span>`:p} </span><span class="tile-time" aria-label="Time range">${c}</span> <span class="tile-lord">${i?n`<span aria-hidden="true">${i}</span>`:p} ${r.lord}</span></div>`}render(){if(!this.data)return n`<div class="roxy-empty" role="status">No choghadiya data</div>`;let{date:r,dayChoghadiya:o,nightChoghadiya:t}=this.data;return n`<div class="wrap"><div class="header"><h2 class="title">Choghadiya</h2>${r?n`<p class="subtitle">${r}</p>`:p}</div><div class="cho-grid"><section class="period-col" aria-label="Day muhurta periods"><h3 class="period-heading">Day</h3><div role="list" aria-label="Daytime choghadiya">${o&&o.length>0?o.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No daytime periods</p>`}</div></section><section class="period-col" aria-label="Night muhurta periods"><h3 class="period-heading">Night</h3><div role="list" aria-label="Nighttime choghadiya">${t&&t.length>0?t.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No nighttime periods</p>`}</div></section></div></div>`}};s.styles=[m,w`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.header{gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.cho-grid{gap:var(--roxy-space-md,1rem);grid-template-columns:1fr;display:grid}@media (width>=720px){.cho-grid{grid-template-columns:1fr 1fr}}.period-col{gap:var(--roxy-space-xs,.25rem);display:grid}.period-heading{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);margin:0 0 var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0a0a0a)}.cho-tile{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:1fr auto;align-items:center;gap:.25em .75em;padding:.55em .85em;display:grid}.cho-tile.good{background:color-mix(in srgb, var(--roxy-success,#22c55e) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-success,#22c55e) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.bad{background:color-mix(in srgb, var(--roxy-danger,#ef4444) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-danger,#ef4444) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.neutral{color:var(--roxy-fg,#0a0a0a);background:0 0}.cho-tile.now{outline:2px solid var(--roxy-accent,#f59e0b);outline-offset:1px;box-shadow:0 0 0 4px color-mix(in srgb, var(--roxy-accent,#f59e0b) 18%, transparent)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.tile-name{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);grid-column:1}.tile-time{font-size:var(--roxy-text-xs,.75rem);opacity:.8;white-space:nowrap;text-align:right;grid-area:1/2/3;align-self:center}.tile-lord{font-size:var(--roxy-text-sm,.875rem);opacity:.85;grid-column:1;align-items:center;gap:.25em;display:flex}`],d([L({attribute:!1})],s.prototype,"data",2),s=d([C("roxy-choghadiya-grid")],s);export{s as RoxyChoghadiyaGrid};
1
+ var x=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var d=(a,e,r,o)=>{for(var t=o>1?void 0:o?y(e,r):e,i=a.length-1,c;i>=0;i--)(c=a[i])&&(t=(o?c(e,r,t):c(t))||t);return o&&t&&x(e,r,t),t};import{css as w,html as n,LitElement as N,nothing as p}from"lit";import{customElement as C,property as L}from"lit/decorators.js";var u={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"};var f=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"],T=f.map(a=>a.toLowerCase());import{css as b}from"lit";var m=b`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var v="roxy-data";function S(a){return a.nodeName==="SCRIPT"&&a.getAttribute("type")==="application/json"}var l=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(S(e)&&e.classList.contains(v))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};function g(a){return a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():""}function h(a){try{let e=new Date(a);return Number.isNaN(e.getTime())?a:e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return a}}var s=class extends N{constructor(){super();this.data=null;new l(this)}isCurrent(r){let o=Date.now(),t=Date.parse(r.start),i=Date.parse(r.end);return Number.isNaN(t)||Number.isNaN(i)?!1:o>=t&&o<i}renderTile(r){let o=r.effect==="Good"?"good":r.effect==="Bad"?"bad":"neutral",t=this.isCurrent(r),i=u[g(r.lord)]??"",c=`${h(r.start)} - ${h(r.end)}`;return n`<div class="cho-tile ${o}${t?" now":""}" role="listitem" aria-current="${t?"time":"false"}"><span class="tile-name">${r.name}${t?n`<span class="now-badge">Now</span>`:p} </span><span class="tile-time" aria-label="Time range">${c}</span> <span class="tile-lord">${i?n`<span aria-hidden="true">${i}</span>`:p} ${r.lord}</span></div>`}render(){if(!this.data)return n`<div class="roxy-empty" role="status">No choghadiya data</div>`;let{date:r,dayChoghadiya:o,nightChoghadiya:t}=this.data;return n`<div class="wrap"><div class="header"><h2 class="title">Choghadiya</h2>${r?n`<p class="subtitle">${r}</p>`:p}</div><div class="cho-grid"><section class="period-col" aria-label="Day muhurta periods"><h3 class="period-heading">Day</h3><div role="list" aria-label="Daytime choghadiya">${o&&o.length>0?o.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No daytime periods</p>`}</div></section><section class="period-col" aria-label="Night muhurta periods"><h3 class="period-heading">Night</h3><div role="list" aria-label="Nighttime choghadiya">${t&&t.length>0?t.map(i=>this.renderTile(i)):n`<p class="roxy-empty" role="status">No nighttime periods</p>`}</div></section></div></div>`}};s.styles=[m,w`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.header{gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.cho-grid{gap:var(--roxy-space-md,1rem);grid-template-columns:1fr;display:grid}@media (width>=720px){.cho-grid{grid-template-columns:1fr 1fr}}.period-col{gap:var(--roxy-space-xs,.25rem);display:grid}.period-heading{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);margin:0 0 var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0a0a0a)}.cho-tile{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:1fr auto;align-items:center;gap:.25em .75em;padding:.55em .85em;display:grid}.cho-tile.good{background:color-mix(in srgb, var(--roxy-success,#22c55e) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-success,#22c55e) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.bad{background:color-mix(in srgb, var(--roxy-danger,#ef4444) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-danger,#ef4444) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.neutral{color:var(--roxy-fg,#0a0a0a);background:0 0}.cho-tile.now{outline:2px solid var(--roxy-accent,#f59e0b);outline-offset:1px;box-shadow:0 0 0 4px color-mix(in srgb, var(--roxy-accent,#f59e0b) 18%, transparent)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.tile-name{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);grid-column:1}.tile-time{font-size:var(--roxy-text-xs,.75rem);opacity:.8;white-space:nowrap;text-align:right;grid-area:1/2/3;align-self:center}.tile-lord{font-size:var(--roxy-text-sm,.875rem);opacity:.85;grid-column:1;align-items:center;gap:.25em;display:flex}`],d([L({attribute:!1})],s.prototype,"data",2),s=d([C("roxy-choghadiya-grid")],s);export{s as RoxyChoghadiyaGrid};
2
2
  //# sourceMappingURL=choghadiya-grid.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/components/choghadiya-grid.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/markup-data.ts", "../../src/utils/string.ts"],
4
- "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { PLANET_GLYPH } from '../tokens/index.js';\nimport type { GetChoghadiyaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\nimport { capitalize } from '../utils/string.js';\n\ntype ChoghadiyaPeriod = GetChoghadiyaResponse['dayChoghadiya'][number];\n\n/**\n * Format an ISO 8601 datetime string to a short local time (HH:MM).\n * Falls back to the raw string when parsing fails.\n */\nfunction fmtTime(iso: string): string {\n\ttry {\n\t\tconst d = new Date(iso);\n\t\tif (Number.isNaN(d.getTime())) return iso;\n\t\treturn d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n\t} catch {\n\t\treturn iso;\n\t}\n}\n\n/**\n * Choghadiya muhurta grid. Accepts a GetChoghadiyaResponse and renders\n * 8 daytime and 8 nighttime muhurta tiles in a two-column responsive layout.\n * Good periods are highlighted in green, Bad periods in red.\n */\n@customElement('roxy-choghadiya-grid')\nexport class RoxyChoghadiyaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.header{gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.cho-grid{gap:var(--roxy-space-md,1rem);grid-template-columns:1fr;display:grid}@media (width>=720px){.cho-grid{grid-template-columns:1fr 1fr}}.period-col{gap:var(--roxy-space-xs,.25rem);display:grid}.period-heading{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);margin:0 0 var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0a0a0a)}.cho-tile{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:1fr auto;align-items:center;gap:.25em .75em;padding:.55em .85em;display:grid}.cho-tile.good{background:color-mix(in srgb, var(--roxy-success,#22c55e) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-success,#22c55e) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.bad{background:color-mix(in srgb, var(--roxy-danger,#ef4444) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-danger,#ef4444) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.neutral{color:var(--roxy-fg,#0a0a0a);background:0 0}.cho-tile.now{outline:2px solid var(--roxy-accent,#f59e0b);outline-offset:1px;box-shadow:0 0 0 4px color-mix(in srgb, var(--roxy-accent,#f59e0b) 18%, transparent)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.tile-name{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);grid-column:1}.tile-time{font-size:var(--roxy-text-xs,.75rem);opacity:.8;white-space:nowrap;text-align:right;grid-area:1/2/3;align-self:center}.tile-lord{font-size:var(--roxy-text-sm,.875rem);opacity:.85;grid-column:1;align-items:center;gap:.25em;display:flex}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: GetChoghadiyaResponse | null = null;\n\n\t/**\n\t * True when the current wall-clock time falls inside this period. Both\n\t * `start` and `end` are ISO 8601 with timezone, so the comparison is\n\t * timezone-aware via the host's `Date` parsing.\n\t */\n\tprivate isCurrent(period: ChoghadiyaPeriod): boolean {\n\t\tconst now = Date.now();\n\t\tconst start = Date.parse(period.start);\n\t\tconst end = Date.parse(period.end);\n\t\tif (Number.isNaN(start) || Number.isNaN(end)) return false;\n\t\treturn now >= start && now < end;\n\t}\n\n\tprivate renderTile(period: ChoghadiyaPeriod) {\n\t\tconst effectClass =\n\t\t\tperiod.effect === 'Good'\n\t\t\t\t? 'good'\n\t\t\t\t: period.effect === 'Bad'\n\t\t\t\t\t? 'bad'\n\t\t\t\t\t: 'neutral';\n\t\tconst current = this.isCurrent(period);\n\t\tconst lordGlyph = PLANET_GLYPH[capitalize(period.lord)] ?? '';\n\t\tconst timeRange = `${fmtTime(period.start)} - ${fmtTime(period.end)}`;\n\t\treturn html`<div class=\"cho-tile ${effectClass}${current ? ' now' : ''}\" role=\"listitem\" aria-current=\"${current ? 'time' : 'false'}\"><span class=\"tile-name\">${period.name}${current ? html`<span class=\"now-badge\">Now</span>` : nothing} </span><span class=\"tile-time\" aria-label=\"Time range\">${timeRange}</span> <span class=\"tile-lord\">${lordGlyph ? html`<span aria-hidden=\"true\">${lordGlyph}</span>` : nothing} ${period.lord}</span></div>`;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No choghadiya data</div>`;\n\n\t\tconst { date, dayChoghadiya, nightChoghadiya } = this.data;\n\n\t\treturn html`<div class=\"wrap\"><div class=\"header\"><h2 class=\"title\">Choghadiya</h2>${date ? html`<p class=\"subtitle\">${date}</p>` : nothing}</div><div class=\"cho-grid\"><section class=\"period-col\" aria-label=\"Day muhurta periods\"><h3 class=\"period-heading\">Day</h3><div role=\"list\" aria-label=\"Daytime choghadiya\">${\n\t\t\t\t\t\t\tdayChoghadiya && dayChoghadiya.length > 0\n\t\t\t\t\t\t\t\t? dayChoghadiya.map((p) => this.renderTile(p))\n\t\t\t\t\t\t\t\t: html`<p class=\"roxy-empty\" role=\"status\">No daytime periods</p>`\n\t\t\t\t\t\t}</div></section><section class=\"period-col\" aria-label=\"Night muhurta periods\"><h3 class=\"period-heading\">Night</h3><div role=\"list\" aria-label=\"Nighttime choghadiya\">${\n\t\t\t\t\t\t\tnightChoghadiya && nightChoghadiya.length > 0\n\t\t\t\t\t\t\t\t? nightChoghadiya.map((p) => this.renderTile(p))\n\t\t\t\t\t\t\t\t: html`<p class=\"roxy-empty\" role=\"status\">No nighttime periods</p>`\n\t\t\t\t\t\t}</div></section></div></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-choghadiya-grid': RoxyChoghadiyaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { PLANET_GLYPH } from '../tokens/index.js';\nimport type { GetChoghadiyaResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { MarkupDataController } from '../utils/markup-data.js';\nimport { capitalize } from '../utils/string.js';\n\ntype ChoghadiyaPeriod = GetChoghadiyaResponse['dayChoghadiya'][number];\n\n/**\n * Format an ISO 8601 datetime string to a short local time (HH:MM).\n * Falls back to the raw string when parsing fails.\n */\nfunction fmtTime(iso: string): string {\n\ttry {\n\t\tconst d = new Date(iso);\n\t\tif (Number.isNaN(d.getTime())) return iso;\n\t\treturn d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n\t} catch {\n\t\treturn iso;\n\t}\n}\n\n/**\n * Choghadiya muhurta grid. Accepts a GetChoghadiyaResponse and renders\n * 8 daytime and 8 nighttime muhurta tiles in a two-column responsive layout.\n * Good periods are highlighted in green, Bad periods in red.\n */\n@customElement('roxy-choghadiya-grid')\nexport class RoxyChoghadiyaGrid extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{gap:var(--roxy-space-md,1rem);display:grid}.header{gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-muted,#71717a);margin:0}.cho-grid{gap:var(--roxy-space-md,1rem);grid-template-columns:1fr;display:grid}@media (width>=720px){.cho-grid{grid-template-columns:1fr 1fr}}.period-col{gap:var(--roxy-space-xs,.25rem);display:grid}.period-heading{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);margin:0 0 var(--roxy-space-xs,.25rem);color:var(--roxy-fg,#0a0a0a)}.cho-tile{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:1fr auto;align-items:center;gap:.25em .75em;padding:.55em .85em;display:grid}.cho-tile.good{background:color-mix(in srgb, var(--roxy-success,#22c55e) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-success,#22c55e) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.bad{background:color-mix(in srgb, var(--roxy-danger,#ef4444) 18%, transparent);border-color:color-mix(in srgb, var(--roxy-danger,#ef4444) 45%, transparent);color:var(--roxy-fg,#0a0a0a)}.cho-tile.neutral{color:var(--roxy-fg,#0a0a0a);background:0 0}.cho-tile.now{outline:2px solid var(--roxy-accent,#f59e0b);outline-offset:1px;box-shadow:0 0 0 4px color-mix(in srgb, var(--roxy-accent,#f59e0b) 18%, transparent)}.now-badge{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);text-transform:uppercase;letter-spacing:.06em;margin-left:.4em;display:inline-block}.tile-name{font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);grid-column:1}.tile-time{font-size:var(--roxy-text-xs,.75rem);opacity:.8;white-space:nowrap;text-align:right;grid-area:1/2/3;align-self:center}.tile-lord{font-size:var(--roxy-text-sm,.875rem);opacity:.85;grid-column:1;align-items:center;gap:.25em;display:flex}`,\n\t];\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Enables hydrating `data` from a direct-child\n\t\t// <script type=\"application/json\" class=\"roxy-data\"> for server-rendered\n\t\t// and cached consumers. The JavaScript `data` property still wins.\n\t\tnew MarkupDataController(this);\n\t}\n\n\t@property({ attribute: false })\n\tdata: GetChoghadiyaResponse | null = null;\n\n\t/**\n\t * True when the current wall-clock time falls inside this period. Both\n\t * `start` and `end` are ISO 8601 with timezone, so the comparison is\n\t * timezone-aware via the host's `Date` parsing.\n\t */\n\tprivate isCurrent(period: ChoghadiyaPeriod): boolean {\n\t\tconst now = Date.now();\n\t\tconst start = Date.parse(period.start);\n\t\tconst end = Date.parse(period.end);\n\t\tif (Number.isNaN(start) || Number.isNaN(end)) return false;\n\t\treturn now >= start && now < end;\n\t}\n\n\tprivate renderTile(period: ChoghadiyaPeriod) {\n\t\tconst effectClass =\n\t\t\tperiod.effect === 'Good'\n\t\t\t\t? 'good'\n\t\t\t\t: period.effect === 'Bad'\n\t\t\t\t\t? 'bad'\n\t\t\t\t\t: 'neutral';\n\t\tconst current = this.isCurrent(period);\n\t\tconst lordGlyph = PLANET_GLYPH[capitalize(period.lord)] ?? '';\n\t\tconst timeRange = `${fmtTime(period.start)} - ${fmtTime(period.end)}`;\n\t\treturn html`<div class=\"cho-tile ${effectClass}${current ? ' now' : ''}\" role=\"listitem\" aria-current=\"${current ? 'time' : 'false'}\"><span class=\"tile-name\">${period.name}${current ? html`<span class=\"now-badge\">Now</span>` : nothing} </span><span class=\"tile-time\" aria-label=\"Time range\">${timeRange}</span> <span class=\"tile-lord\">${lordGlyph ? html`<span aria-hidden=\"true\">${lordGlyph}</span>` : nothing} ${period.lord}</span></div>`;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No choghadiya data</div>`;\n\n\t\tconst { date, dayChoghadiya, nightChoghadiya } = this.data;\n\n\t\treturn html`<div class=\"wrap\"><div class=\"header\"><h2 class=\"title\">Choghadiya</h2>${date ? html`<p class=\"subtitle\">${date}</p>` : nothing}</div><div class=\"cho-grid\"><section class=\"period-col\" aria-label=\"Day muhurta periods\"><h3 class=\"period-heading\">Day</h3><div role=\"list\" aria-label=\"Daytime choghadiya\">${\n\t\t\t\t\t\t\tdayChoghadiya && dayChoghadiya.length > 0\n\t\t\t\t\t\t\t\t? dayChoghadiya.map((p) => this.renderTile(p))\n\t\t\t\t\t\t\t\t: html`<p class=\"roxy-empty\" role=\"status\">No daytime periods</p>`\n\t\t\t\t\t\t}</div></section><section class=\"period-col\" aria-label=\"Night muhurta periods\"><h3 class=\"period-heading\">Night</h3><div role=\"list\" aria-label=\"Nighttime choghadiya\">${\n\t\t\t\t\t\t\tnightChoghadiya && nightChoghadiya.length > 0\n\t\t\t\t\t\t\t\t? nightChoghadiya.map((p) => this.renderTile(p))\n\t\t\t\t\t\t\t\t: html`<p class=\"roxy-empty\" role=\"status\">No nighttime periods</p>`\n\t\t\t\t\t\t}</div></section></div></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-choghadiya-grid': RoxyChoghadiyaGrid;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
5
+ "mappings": "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",
6
6
  "names": ["css", "html", "LitElement", "nothing", "customElement", "property", "PLANET_GLYPH", "SIGNS_ORDER", "RASHI_KEYS", "s", "css", "baseStyles", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "text", "capitalize", "s", "fmtTime", "iso", "d", "RoxyChoghadiyaGrid", "LitElement", "MarkupDataController", "period", "now", "start", "end", "effectClass", "current", "lordGlyph", "PLANET_GLYPH", "capitalize", "timeRange", "html", "nothing", "date", "dayChoghadiya", "nightChoghadiya", "p", "baseStyles", "css", "__decorateClass", "property", "customElement"]
7
7
  }
@@ -1,2 +1,2 @@
1
- var k=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=(r,t,e,o)=>{for(var i=o>1?void 0:o?w(t,e):t,s=r.length-1,l;s>=0;s--)(l=r[s])&&(i=(o?l(t,e,i):l(i))||i);return o&&i&&k(t,e,i),i};import{css as N,html as n,LitElement as z,nothing as a}from"lit";import{customElement as A,property as C}from"lit/decorators.js";import{css as T}from"lit";var $=T`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;function p(r,t=1){return typeof r!="number"||!Number.isFinite(r)?"":r.toFixed(t).replace(/\.?0+$/,"")}var R="roxy-data";function S(r){return r.nodeName==="SCRIPT"&&r.getAttribute("type")==="application/json"}var u=class{constructor(t){this.host=t,t.addController(this)}hostConnected(){if(this.host.data!=null)return;let t=this.read();t!==void 0&&(this.host.data=t,this.host.requestUpdate())}read(){let t=this.findInlineScript();return t?this.parse(t.textContent):void 0}findInlineScript(){for(let t of Array.from(this.host.children))if(S(t)&&t.classList.contains(R))return t;return null}parse(t){if(t?.trim())try{return JSON.parse(t)}catch{return}}};var d=class extends z{constructor(){super();this.data=null;this.mode="astrology";new u(this)}getBreakdown(){let e=this.data;if(!e)return{};if("categories"in e&&e.categories){let o={};for(let[i,s]of Object.entries(e.categories))typeof s=="number"&&Number.isFinite(s)&&(o[i]=s);return o}return{}}render(){let e=this.data;if(!e)return n`<div class="roxy-empty" role="status">No compatibility data</div>`;let o=e.overallScore,i=this.getBreakdown(),s="rating"in e?e.rating:void 0,l="archetype"in e?e.archetype:void 0,x="advice"in e?e.advice:void 0,y="summary"in e?e.summary:void 0,h="interpretation"in e?e.interpretation:void 0,f="strengths"in e?e.strengths:void 0,g="challenges"in e?e.challenges:void 0,b="keyAspects"in e?e.keyAspects:void 0;return n`<article class="card" aria-label="${`Compatibility (${this.mode})`}"><div class="head"><h2>${this.mode} compatibility</h2><div>${typeof o=="number"?n`<div class="score">${p(o,0)}</div>`:a} ${s?n`<div class="rating">${s}</div>`:a}</div></div>${Object.keys(i).length>0?n`<div role="list">${Object.entries(i).map(([c,v])=>n`<div class="bar-row" role="listitem"><span style="text-transform:capitalize">${c}</span> <span class="bar"><span style="width:${Math.max(0,Math.min(100,v))}%"></span></span> <span>${p(v,0)}</span></div>`)}</div>`:a} ${l?n`<p><span class="archetype">${l.label}</span> ${l.description?n`· ${l.description}`:a}</p>`:a} ${y?n`<p>${y}</p>`:a} ${h&&!y?n`<p>${h}</p>`:a} ${x?n`<p>${x}</p>`:a} ${(f?.length??0)>0||(g?.length??0)>0?n`<div class="lists">${f?.length?n`<div><h3>Strengths</h3><ul>${f.map(c=>n`<li>${c}</li>`)}</ul></div>`:a} ${g?.length?n`<div><h3>Challenges</h3><ul>${g.map(c=>n`<li>${c}</li>`)}</ul></div>`:a}</div>`:a} ${b?.length?n`<div><h3 style="margin:0 0 .25rem;font-size:var(--roxy-text-xs);color:var(--roxy-muted);text-transform:uppercase;letter-spacing:.06em">Key aspects</h3><ul style="margin:0;padding-left:1rem;font-size:var(--roxy-text-sm)">${b.slice(0,6).map(c=>n`<li>${D(c)}</li>`)}</ul></div>`:a}</article>`}};d.styles=[$,N`.card{background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);display:grid}.head{align-items:center;gap:var(--roxy-space-md,1rem);grid-template-columns:1fr auto;display:grid}.head h2{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);text-transform:capitalize;margin:0}.score{font-variant-numeric:tabular-nums;font-size:2rem;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-fg,#b45309);line-height:1}.rating{color:var(--roxy-secondary,#475569);font-size:var(--roxy-text-sm,.875rem)}.bar-row{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.bar{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:8px;overflow:hidden}.bar>span{background:var(--roxy-accent,#f59e0b);height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.bar-row>span:last-child{font-variant-numeric:tabular-nums;color:var(--roxy-muted,#71717a);text-align:right}.archetype{color:var(--roxy-accent-fg,#b45309);font-weight:var(--roxy-weight-bold,600)}.lists{gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.lists h3{margin:0 0 var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.lists ul{padding-left:var(--roxy-space-md,1rem);margin:0}`],m([C({attribute:!1})],d.prototype,"data",2),m([C({type:String,reflect:!0})],d.prototype,"mode",2),d=m([A("roxy-compatibility-card")],d);function D(r){let t=r.type.toLowerCase().replace(/_/g,"-"),e=typeof r.orb=="number"?` (orb ${p(r.orb,1)}\xB0)`:"",o=[r.planet1,t,r.planet2].filter(Boolean).join(" ");return r.description?`${o}${e} \xB7 ${r.description}`:`${o}${e}`}export{d as RoxyCompatibilityCard};
1
+ var k=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var m=(r,t,e,i)=>{for(var o=i>1?void 0:i?w(t,e):t,s=r.length-1,l;s>=0;s--)(l=r[s])&&(o=(i?l(t,e,o):l(o))||o);return i&&o&&k(t,e,o),o};import{css as N,html as n,LitElement as z,nothing as a}from"lit";import{customElement as A,property as C}from"lit/decorators.js";import{css as T}from"lit";var $=T`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}*,:before,:after{box-sizing:border-box}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;function p(r,t=1){return typeof r!="number"||!Number.isFinite(r)?"":r.toFixed(t).replace(/\.?0+$/,"")}var R="roxy-data";function S(r){return r.nodeName==="SCRIPT"&&r.getAttribute("type")==="application/json"}var u=class{constructor(t){this.host=t,t.addController(this)}hostConnected(){if(this.host.data!=null)return;let t=this.read();t!==void 0&&(this.host.data=t,this.host.requestUpdate())}read(){let t=this.findInlineScript();return t?this.parse(t.textContent):void 0}findInlineScript(){for(let t of Array.from(this.host.children))if(S(t)&&t.classList.contains(R))return t;return null}parse(t){if(t?.trim())try{return JSON.parse(t)}catch{return}}};var d=class extends z{constructor(){super();this.data=null;this.mode="astrology";new u(this)}getBreakdown(){let e=this.data;if(!e)return{};if("categories"in e&&e.categories){let i={};for(let[o,s]of Object.entries(e.categories))typeof s=="number"&&Number.isFinite(s)&&(i[o]=s);return i}return{}}render(){let e=this.data;if(!e)return n`<div class="roxy-empty" role="status">No compatibility data</div>`;let i=e.overallScore,o=this.getBreakdown(),s="rating"in e?e.rating:void 0,l="archetype"in e?e.archetype:void 0,x="advice"in e?e.advice:void 0,y="summary"in e?e.summary:void 0,h="interpretation"in e?e.interpretation:void 0,f="strengths"in e?e.strengths:void 0,g="challenges"in e?e.challenges:void 0,b="keyAspects"in e?e.keyAspects:void 0;return n`<article class="card" aria-label="${`Compatibility (${this.mode})`}"><div class="head"><h2>${this.mode} compatibility</h2><div>${typeof i=="number"?n`<div class="score">${p(i,0)}</div>`:a} ${s?n`<div class="rating">${s}</div>`:a}</div></div>${Object.keys(o).length>0?n`<div role="list">${Object.entries(o).map(([c,v])=>n`<div class="bar-row" role="listitem"><span style="text-transform:capitalize">${c}</span> <span class="bar"><span style="width:${Math.max(0,Math.min(100,v))}%"></span></span> <span>${p(v,0)}</span></div>`)}</div>`:a} ${l?n`<p><span class="archetype">${l.label}</span> ${l.description?n`· ${l.description}`:a}</p>`:a} ${y?n`<p>${y}</p>`:a} ${h&&!y?n`<p>${h}</p>`:a} ${x?n`<p>${x}</p>`:a} ${(f?.length??0)>0||(g?.length??0)>0?n`<div class="lists">${f?.length?n`<div><h3>Strengths</h3><ul>${f.map(c=>n`<li>${c}</li>`)}</ul></div>`:a} ${g?.length?n`<div><h3>Challenges</h3><ul>${g.map(c=>n`<li>${c}</li>`)}</ul></div>`:a}</div>`:a} ${b?.length?n`<div><h3 style="margin:0 0 .25rem;font-size:var(--roxy-text-xs);color:var(--roxy-muted);text-transform:uppercase;letter-spacing:.06em">Key aspects</h3><ul style="margin:0;padding-left:1rem;font-size:var(--roxy-text-sm)">${b.slice(0,6).map(c=>n`<li>${D(c)}</li>`)}</ul></div>`:a}</article>`}};d.styles=[$,N`.card{background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);display:grid}.head{align-items:center;gap:var(--roxy-space-md,1rem);grid-template-columns:1fr auto;display:grid}.head h2{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);text-transform:capitalize;margin:0}.score{font-variant-numeric:tabular-nums;font-size:2rem;font-weight:var(--roxy-weight-bold,600);color:var(--roxy-accent-ink,#b45309);line-height:1}.rating{color:var(--roxy-secondary,#475569);font-size:var(--roxy-text-sm,.875rem)}.bar-row{gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);grid-template-columns:8rem 1fr 3.5rem;align-items:center;display:grid}.bar{background:var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);height:8px;overflow:hidden}.bar>span{background:var(--roxy-accent,#f59e0b);height:100%;transition:width var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));display:block}.bar-row>span:last-child{font-variant-numeric:tabular-nums;color:var(--roxy-muted,#71717a);text-align:right}.archetype{color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.lists{gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.lists h3{margin:0 0 var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.lists ul{padding-left:var(--roxy-space-md,1rem);margin:0}`],m([C({attribute:!1})],d.prototype,"data",2),m([C({type:String,reflect:!0})],d.prototype,"mode",2),d=m([A("roxy-compatibility-card")],d);function D(r){let t=r.type.toLowerCase().replace(/_/g,"-"),e=typeof r.orb=="number"?` (orb ${p(r.orb,1)}\xB0)`:"",i=[r.planet1,t,r.planet2].filter(Boolean).join(" ");return r.description?`${i}${e} \xB7 ${r.description}`:`${i}${e}`}export{d as RoxyCompatibilityCard};
2
2
  //# sourceMappingURL=compatibility-card.js.map