zframes 0.4.1 → 0.5.1

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 (116) hide show
  1. package/README.md +30 -18
  2. package/dist/index.js +181 -21
  3. package/package.json +8 -4
  4. package/runtime/assets/{bitcoin-dominance-BHcykQ8j.js → bitcoin-dominance-C5YlmNuX.js} +1 -1
  5. package/runtime/assets/{breakeven-PNgn_Prq.js → breakeven-C6eTFJll.js} +1 -1
  6. package/runtime/assets/{breathing-DrPgIS4r.js → breathing-BK7n4R0D.js} +1 -1
  7. package/runtime/assets/{btc-blocks-mJPjO7gs.js → btc-blocks-BbO7Ju_n.js} +1 -1
  8. package/runtime/assets/{btc-difficulty-D8kmEyQb.js → btc-difficulty-CdmSS3g3.js} +1 -1
  9. package/runtime/assets/{btc-fees-Cv6K9S1L.js → btc-fees-Do_OuXGm.js} +1 -1
  10. package/runtime/assets/{btc-hashrate-DT6qyeME.js → btc-hashrate-BwHRzkT1.js} +1 -1
  11. package/runtime/assets/{btc-mempool-ftlit90k.js → btc-mempool-DdoHkxQW.js} +1 -1
  12. package/runtime/assets/{calculator-CYNDBlrv.js → calculator-njLOYaUn.js} +1 -1
  13. package/runtime/assets/{checklist-DygbP4AG.js → checklist-CJmbQeT2.js} +1 -1
  14. package/runtime/assets/{clock-D2rGZ-yo.js → clock-BQKtB_1T.js} +1 -1
  15. package/runtime/assets/{coin-movers-DpHOtUMJ.js → coin-movers-Ddx_zEYc.js} +1 -1
  16. package/runtime/assets/{countdown-DcbUf2-f.js → countdown-WQrMl1mh.js} +1 -1
  17. package/runtime/assets/{daily-analysis-D3g2BXJd.js → daily-analysis-CFBYgZOx.js} +1 -1
  18. package/runtime/assets/{day-meter-CDmmKsh5.js → day-meter-C1FlE25u.js} +1 -1
  19. package/runtime/assets/dex-volume-chart-icfmEKMe.js +1 -0
  20. package/runtime/assets/dex-volume-treemap-D325lBuo.js +1 -0
  21. package/runtime/assets/{dice-B7dy1iZP.js → dice-B5HdtbhT.js} +1 -1
  22. package/runtime/assets/{dino-game-DLEtJMnt.js → dino-game-BjpU6N3Q.js} +1 -1
  23. package/runtime/assets/{divider-CVjQeL0n.js → divider-CS5oPawt.js} +1 -1
  24. package/runtime/assets/{drawdy-DoJeRpgi.js → drawdy-DCJPBdU1.js} +1 -1
  25. package/runtime/assets/editor-BMMobjrE.css +1 -0
  26. package/runtime/assets/editor-BwFhstwV.js +68 -0
  27. package/runtime/assets/{fear-greed-zPvN2LSi.js → fear-greed-CRGU3_Op.js} +1 -1
  28. package/runtime/assets/{filings-feed-CWAGVlAW.js → filings-feed-BXtSE7kO.js} +1 -1
  29. package/runtime/assets/{financial-stress-C5-XFPqY.js → financial-stress-DbKe77Hb.js} +1 -1
  30. package/runtime/assets/{flappy-bird-CoKOL9Ib.js → flappy-bird-vVMgoHvI.js} +1 -1
  31. package/runtime/assets/{fundamentals-BYjofvJi.js → fundamentals-CcdMBkwq.js} +1 -1
  32. package/runtime/assets/funding-heatmap-Dpik5sTh.js +1 -0
  33. package/runtime/assets/{funding-rate-chart-CxBH7hVe.js → funding-rate-chart-BqZIV8Mq.js} +1 -1
  34. package/runtime/assets/fx-board-BqXLOKTL.js +1 -0
  35. package/runtime/assets/{heading-gFm9ZDY1.js → heading-tImz7ed0.js} +1 -1
  36. package/runtime/assets/{holiday-calendar-ffNyuPje.js → holiday-calendar-DWJQw_Gs.js} +1 -1
  37. package/runtime/assets/{image-D3DwdoU8.js → image-D2XDZTRg.js} +1 -1
  38. package/runtime/assets/{index-DRTPEQtR.css → index-BqHx9BjX.css} +1 -1
  39. package/runtime/assets/index-DK7jWlTL.js +1 -0
  40. package/runtime/assets/index-mNBIIbY4.js +936 -0
  41. package/runtime/assets/inflation-pulse-bzeGPdwn.js +1 -0
  42. package/runtime/assets/{journal-log-CcLb4w4A.js → journal-log-CwBIakMw.js} +1 -1
  43. package/runtime/assets/{journal-open-C0BKFgMk.js → journal-open-BVZNlpPf.js} +1 -1
  44. package/runtime/assets/{journal-results-Bpzb4REp.js → journal-results-C_uWQFb6.js} +1 -1
  45. package/runtime/assets/{journal-score-BUDUgceb.js → journal-score-40mkQn2U.js} +1 -1
  46. package/runtime/assets/{journal-ui-CJIuEcIa.js → journal-ui-BhyvPmL4.js} +1 -1
  47. package/runtime/assets/{labor-market-DJihF3Mk.js → labor-market-C4Sm9c9Q.js} +1 -1
  48. package/runtime/assets/{lightning-stats-BV14FfAY.js → lightning-stats-pONBKZD6.js} +1 -1
  49. package/runtime/assets/{link-grid-DK3kGS1q.js → link-grid-CI34yq1H.js} +1 -1
  50. package/runtime/assets/live-tick-9Q3ubPF9.js +1 -0
  51. package/runtime/assets/liveline-bcaEuskN.js +1 -0
  52. package/runtime/assets/market-cap-treemap-OPrkz91W.js +1 -0
  53. package/runtime/assets/{market-hours-D89LjpUm.js → market-hours-BgccxZWs.js} +1 -1
  54. package/runtime/assets/{marquee-ByOQSr9Q.js → marquee-CW5CHfXe.js} +1 -1
  55. package/runtime/assets/mini-line-chart-CHM5UBjJ.js +1 -0
  56. package/runtime/assets/{mining-pools-D6AnoVnf.js → mining-pools-BcmPW811.js} +1 -1
  57. package/runtime/assets/{mover-row-BTeXB98H.js → mover-row-C4XiEB55.js} +1 -1
  58. package/runtime/assets/{national-debt-CgI8LSK6.js → national-debt-idA0RoOP.js} +1 -1
  59. package/runtime/assets/news-feed-Dfo3tEp3.js +1 -0
  60. package/runtime/assets/note-BXnEnQ-K.js +1 -0
  61. package/runtime/assets/{open-interest-DgDfcYh5.js → open-interest-DU8_SF0H.js} +1 -1
  62. package/runtime/assets/{options-iv-CqDfM4IA.js → options-iv-NBS1840n.js} +1 -1
  63. package/runtime/assets/{options-oi-strike-CrIT5WTU.js → options-oi-strike-rFKn4bh2.js} +1 -1
  64. package/runtime/assets/{options-put-call--RXL3vTA.js → options-put-call-D85-OU0Z.js} +1 -1
  65. package/runtime/assets/{pomodoro-DZEEQU2X.js → pomodoro-Dr-36PxD.js} +1 -1
  66. package/runtime/assets/{portfolio-allocation-DKf6H-m6.js → portfolio-allocation-DuszANX3.js} +1 -1
  67. package/runtime/assets/{portfolio-common-CVt117Oi.js → portfolio-common-COoaTucT.js} +1 -1
  68. package/runtime/assets/{portfolio-holdings-CHtvm8aL.js → portfolio-holdings-DEalEpG7.js} +1 -1
  69. package/runtime/assets/portfolio-value-DBm_NKpj.js +1 -0
  70. package/runtime/assets/price-chart-CrlaAJDt.js +1 -0
  71. package/runtime/assets/price-compare-CbD-OBqf.js +1 -0
  72. package/runtime/assets/price-liveline-D-FbVZJb.js +1 -0
  73. package/runtime/assets/{price-ticker-BmfARqHc.js → price-ticker-BWmeIzis.js} +1 -1
  74. package/runtime/assets/protocol-fees-treemap-C5cQmzek.js +1 -0
  75. package/runtime/assets/{protocol-tvl-chart-Dl_MwJdU.js → protocol-tvl-chart-CVQec2af.js} +1 -1
  76. package/runtime/assets/protocol-tvl-treemap-fT5L8BUu.js +1 -0
  77. package/runtime/assets/{quote-BjjZrPpM.js → quote-BVU9Ij9Z.js} +1 -1
  78. package/runtime/assets/{rates-board-B_OYdW_u.js → rates-board-DtVXg72U.js} +1 -1
  79. package/runtime/assets/{returns-projector-EA7LLxnL.js → returns-projector-BRL9MWt0.js} +1 -1
  80. package/runtime/assets/{risk-reward-xhKH6ouR.js → risk-reward-CFmYwrI1.js} +1 -1
  81. package/runtime/assets/{rules-card-CrDquc56.js → rules-card-CD8_-XB7.js} +1 -1
  82. package/runtime/assets/{session-progress-BquR98Sm.js → session-progress-Bfn9CYRS.js} +1 -1
  83. package/runtime/assets/{short-volume-CYxTQG8H.js → short-volume-DBL4FAKF.js} +1 -1
  84. package/runtime/assets/{snake-9JevhL1w.js → snake-DM8RZ-EM.js} +1 -1
  85. package/runtime/assets/{spotify-embed-CNEzG2xL.js → spotify-embed-7i5uns51.js} +1 -1
  86. package/runtime/assets/{stopwatch-BuN_qlhH.js → stopwatch-DaQtonjw.js} +1 -1
  87. package/runtime/assets/top-movers-D8wxpazR.js +1 -0
  88. package/runtime/assets/{treasury-auctions-bA-385ON.js → treasury-auctions-CZXil70X.js} +1 -1
  89. package/runtime/assets/treemap-leaf-DNIoJEK-.js +1 -0
  90. package/runtime/assets/tvl-treemap-DD51z-qp.js +1 -0
  91. package/runtime/assets/{video-CUWN4TBo.js → video-DiF4EdH9.js} +1 -1
  92. package/runtime/assets/{yield-curve-BOvLIfWe.js → yield-curve-BgR-ThF_.js} +1 -1
  93. package/runtime/index.html +2 -2
  94. package/runtime/assets/dex-volume-chart-C3KHEnoK.js +0 -1
  95. package/runtime/assets/dex-volume-treemap-C-hqWu6U.js +0 -1
  96. package/runtime/assets/editor-CHAAJRb1.css +0 -1
  97. package/runtime/assets/editor-UP2LBUZ9.js +0 -68
  98. package/runtime/assets/funding-heatmap-BhL0jjq8.js +0 -1
  99. package/runtime/assets/fx-board-Cm0_zK03.js +0 -1
  100. package/runtime/assets/index-DbboK5sz.js +0 -820
  101. package/runtime/assets/index-jnySFpSv.js +0 -1
  102. package/runtime/assets/inflation-pulse-GrBWa9Z6.js +0 -1
  103. package/runtime/assets/liveline-C5zt2WuS.js +0 -1
  104. package/runtime/assets/market-cap-treemap-DpuSjWWe.js +0 -1
  105. package/runtime/assets/mini-line-chart-D-i1QqSe.js +0 -1
  106. package/runtime/assets/news-feed-CA8M5V3K.js +0 -1
  107. package/runtime/assets/note-Biu6llug.js +0 -1
  108. package/runtime/assets/portfolio-value-Dj37WMRc.js +0 -1
  109. package/runtime/assets/price-chart-hgZApQaG.js +0 -1
  110. package/runtime/assets/price-compare-BczbPKy-.js +0 -1
  111. package/runtime/assets/price-liveline-Cbor-Nv_.js +0 -1
  112. package/runtime/assets/protocol-fees-treemap-DeSBgGJ9.js +0 -1
  113. package/runtime/assets/protocol-tvl-treemap-Bvgp0EHh.js +0 -1
  114. package/runtime/assets/top-movers-D7sBm6jo.js +0 -1
  115. package/runtime/assets/treemap-leaf-DLQawrx4.js +0 -1
  116. package/runtime/assets/tvl-treemap-jrgafmGj.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as f,j as t}from"./react-qoZPGuNy.js";import{a as p,c as j}from"./format-CfAcS4D8.js";import{f as w,Y as y,M}from"./index-mNBIIbY4.js";import{F as v}from"./ui-Bq3RQsdJ.js";import{M as P}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";y.schema;const S="CUUR0000SA0";function g(a,o){return!o||o<=0?null:(a/o-1)*100}function F({config:a}){const x=new Date().getUTCFullYear(),C=x-2,{series:e,isLoading:N}=M(S,C,x),n=f.useMemo(()=>((e==null?void 0:e.points)??[]).slice(-a.months),[a.months,e==null?void 0:e.points]),s=n.at(-1),r=n.at(-2),c=s?n.find(i=>{const h=new Date(i.time),u=new Date(s.time);return h.getUTCFullYear()===u.getUTCFullYear()-1&&h.getUTCMonth()===u.getUTCMonth()}):void 0,b=f.useMemo(()=>n.map(i=>({date:new Date(i.time).toISOString(),value:i.value})),[n]);if(N)return t.jsx(v,{loading:!0,children:"loading CPI…"});if(!e||!s)return t.jsx(v,{children:"no CPI data yet"});const l=g(s.value,r==null?void 0:r.value),d=g(s.value,c==null?void 0:c.value),m=j(d??l??0);return t.jsxs("div",{className:"flex h-full flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"BLS CPI-U"}),t.jsx("div",{className:"body-sm text-normal",children:s.date})]}),t.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"metric-xl leading-none",style:{color:m,textShadow:`0 0 24px ${m}44`},children:d!==null?p(d):"--"}),t.jsx("div",{className:"caption text-soft mt-1",children:"year over year"})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"caption text-soft",children:"index"}),t.jsx("div",{className:"body-md text-strong font-bold tabular-nums",children:s.value.toFixed(3)}),t.jsx("div",{className:"caption text-soft mt-2",children:"month over month"}),t.jsx("div",{className:"body-md font-bold tabular-nums",style:{color:j(l??0)},children:l!==null?p(l):"--"})]})]}),t.jsx(P,{data:b,width:210,height:46,color:m}),t.jsxs("div",{className:"caption text-soft",children:[e.label," · ",n.length," monthly observations"]})]})}const _=w({...y,component:F});export{_ as inflationPulseFrame};
@@ -1 +1 @@
1
- import{r as a,j as s}from"./react-qoZPGuNy.js";import{f as G,s as U,v as P,k as H,h as c,A as _}from"./index-DbboK5sz.js";import{i as $}from"./content-shared-BZ1XzrJx.js";import{d as M,a as J,c as K,U as q,D as X}from"./format-CfAcS4D8.js";import{C as Y,d as F,a as V,l as Z}from"./journal-store-KCRoPnI_.js";import{s as ee}from"./ui-Bq3RQsdJ.js";const se=["xyz:*"],I=v=>Object.entries(v).filter(([,t])=>t.markPx>0).map(([t])=>t).sort((t,m)=>c(t).localeCompare(c(m)));U.schema;const T=[{label:"funding reset",cls:"mean-reversion"},{label:"oversold bounce",cls:"mean-reversion"},{label:"range reclaim",cls:"mean-reversion"},{label:"breakout",cls:"breakout"},{label:"momentum / trend",cls:"breakout"},{label:"positioning flush",cls:"positioning"},{label:"catalyst / earnings",cls:"macro"}];function te(v){var R;const[t,m]=a.useState("xyz:TSLA"),[j,Q]=a.useState("long"),[N,C]=a.useState(!1),[p,k]=a.useState(""),[x,S]=a.useState(null),[b,w]=a.useState(""),[h,W]=a.useState(65),[L,O]=a.useState(!1),i=P(se,6e4),u=P(void 0,6e4),z=a.useMemo(()=>({...u,...i}),[u,i]),d=a.useMemo(()=>[...I(i),...I(u)],[i,u]),B=H([t]),f=e=>{var l;return B[e]??((l=z[e])==null?void 0:l.markPx)},g=f(t),y=(R=z[t])==null?void 0:R.changePct,o=x!=null?T[x]:null,n=o?Y[o.cls]:null,A=n?n.hits/n.n>=.55:!0,D=a.useMemo(()=>{const e=p.trim().toLowerCase();return(e?d.filter(r=>c(r).toLowerCase().includes(e)):d).slice(0,80)},[p,d]);function E(){if(!o)return;const e=b.trim()?`${o.label} — ${b.trim()}`:o.label;Z({sym:t,dir:j,confidence:h,claim:e,cls:o.cls,entry:g}),S(null),w(""),O(!0),window.setTimeout(()=>O(!1),1100)}return s.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>C(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-2 ${$}`,children:[s.jsx(_,{symbol:t,size:20}),s.jsx("span",{className:"body-md text-strong font-semibold",children:c(t)}),s.jsxs("span",{className:"ml-auto flex items-baseline gap-2 tabular-nums",children:[s.jsx("span",{className:"body-sm text-strong",children:g!=null?M(g):"…"}),y!=null&&s.jsx("span",{className:"caption",style:{color:K(y)},children:J(y)})]}),s.jsx("span",{className:"caption text-disabled ml-1",children:N?"▲":"▼"})]}),N&&s.jsxs("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 flex flex-col gap-1 rounded-md p-1.5 shadow-xl",style:{background:"hsl(248 32% 9%)",border:"1px solid var(--color-accent-line)"},children:[s.jsx("input",{autoFocus:!0,value:p,onChange:e=>k(e.target.value),placeholder:"search ticker…",className:"body-sm w-full rounded bg-white/[0.05] px-2 py-1.5 text-strong outline-none placeholder:text-disabled"}),s.jsxs("div",{className:`flex max-h-44 flex-col ${ee}`,children:[D.map(e=>s.jsxs("button",{type:"button",onClick:()=>{m(e),C(!1),k("")},className:"flex items-center gap-2 rounded px-2 py-1.5 transition-colors hover:bg-white/[0.06]",children:[s.jsx(_,{symbol:e,size:16}),s.jsx("span",{className:"body-sm text-normal",children:c(e)}),s.jsx("span",{className:"caption text-soft ml-auto tabular-nums",children:f(e)!=null?M(f(e)):"—"})]},e)),D.length===0&&s.jsx("span",{className:"caption text-disabled px-2 py-2",children:d.length===0?"loading universe…":"no Hyperliquid market for that"})]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:["long","short"].map(e=>{const l=j===e;return s.jsx("button",{type:"button",onClick:()=>Q(e),className:"body-sm flex-1 rounded-md py-1.5 font-bold uppercase tracking-wide transition-colors",style:{color:l?F(e):"var(--color-soft)",background:l?"var(--color-surface)":"rgba(255,255,255,0.03)",border:`1px solid ${l?F(e)+"55":"transparent"}`},children:e},e)})}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.map((e,l)=>{const r=x===l;return s.jsx("button",{type:"button",onClick:()=>S(r?null:l),className:"caption rounded-full px-2.5 py-1 transition-colors",style:{color:r?"var(--color-strong)":"var(--color-soft)",background:r?"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.3)":"rgba(255,255,255,0.04)",border:`1px solid ${r?"var(--color-accent-line)":"transparent"}`},children:e.label},e.label)})}),s.jsx("input",{value:b,onChange:e=>w(e.target.value),onKeyDown:e=>e.key==="Enter"&&E(),placeholder:"add a note (optional)",className:`body-sm w-full rounded-md px-2.5 py-1.5 text-strong outline-none placeholder:text-disabled ${$}`}),n&&s.jsxs("span",{className:"caption",style:{color:A?q:X},children:["your last ",n.n," ",V[o.cls]," calls: ",n.hits,"/",n.n,A?" · your edge":" · a leak — size down"]}),s.jsxs("div",{className:"mt-auto flex items-center gap-2.5",children:[s.jsx("span",{className:"caption text-disabled",children:"how sure"}),s.jsx("input",{type:"range",min:50,max:95,step:1,value:h,onChange:e=>W(Number(e.target.value)),className:"h-1 flex-1 cursor-pointer",style:{accentColor:"hsl(var(--zf-accent-hue, 242) 85% 68%)"}}),s.jsxs("span",{className:"body-sm text-strong w-9 tabular-nums",children:[h,"%"]}),s.jsx("button",{type:"button",onClick:E,disabled:!o,className:"caption rounded px-3 py-1.5 font-bold uppercase tracking-wide transition-opacity disabled:opacity-40",style:{color:"var(--color-strong)",background:L?q+"55":"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.35)"},children:L?"logged ✓":"log"})]})]})}const ie=G({...U,component:te});export{ie as journalLogFrame};
1
+ import{r as a,j as s}from"./react-qoZPGuNy.js";import{f as G,s as U,v as P,k as H,h as c,A as _}from"./index-mNBIIbY4.js";import{i as $}from"./content-shared-BZ1XzrJx.js";import{d as M,a as J,c as K,U as q,D as X}from"./format-CfAcS4D8.js";import{C as Y,d as F,a as V,l as Z}from"./journal-store-KCRoPnI_.js";import{s as ee}from"./ui-Bq3RQsdJ.js";const se=["xyz:*"],I=v=>Object.entries(v).filter(([,t])=>t.markPx>0).map(([t])=>t).sort((t,m)=>c(t).localeCompare(c(m)));U.schema;const T=[{label:"funding reset",cls:"mean-reversion"},{label:"oversold bounce",cls:"mean-reversion"},{label:"range reclaim",cls:"mean-reversion"},{label:"breakout",cls:"breakout"},{label:"momentum / trend",cls:"breakout"},{label:"positioning flush",cls:"positioning"},{label:"catalyst / earnings",cls:"macro"}];function te(v){var R;const[t,m]=a.useState("xyz:TSLA"),[j,Q]=a.useState("long"),[N,C]=a.useState(!1),[p,k]=a.useState(""),[x,S]=a.useState(null),[b,w]=a.useState(""),[h,W]=a.useState(65),[L,O]=a.useState(!1),i=P(se,6e4),u=P(void 0,6e4),z=a.useMemo(()=>({...u,...i}),[u,i]),d=a.useMemo(()=>[...I(i),...I(u)],[i,u]),B=H([t]),f=e=>{var l;return B[e]??((l=z[e])==null?void 0:l.markPx)},g=f(t),y=(R=z[t])==null?void 0:R.changePct,o=x!=null?T[x]:null,n=o?Y[o.cls]:null,A=n?n.hits/n.n>=.55:!0,D=a.useMemo(()=>{const e=p.trim().toLowerCase();return(e?d.filter(r=>c(r).toLowerCase().includes(e)):d).slice(0,80)},[p,d]);function E(){if(!o)return;const e=b.trim()?`${o.label} — ${b.trim()}`:o.label;Z({sym:t,dir:j,confidence:h,claim:e,cls:o.cls,entry:g}),S(null),w(""),O(!0),window.setTimeout(()=>O(!1),1100)}return s.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[s.jsxs("div",{className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>C(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-2 ${$}`,children:[s.jsx(_,{symbol:t,size:20}),s.jsx("span",{className:"body-md text-strong font-semibold",children:c(t)}),s.jsxs("span",{className:"ml-auto flex items-baseline gap-2 tabular-nums",children:[s.jsx("span",{className:"body-sm text-strong",children:g!=null?M(g):"…"}),y!=null&&s.jsx("span",{className:"caption",style:{color:K(y)},children:J(y)})]}),s.jsx("span",{className:"caption text-disabled ml-1",children:N?"▲":"▼"})]}),N&&s.jsxs("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 flex flex-col gap-1 rounded-md p-1.5 shadow-xl",style:{background:"hsl(248 32% 9%)",border:"1px solid var(--color-accent-line)"},children:[s.jsx("input",{autoFocus:!0,value:p,onChange:e=>k(e.target.value),placeholder:"search ticker…",className:"body-sm w-full rounded bg-white/[0.05] px-2 py-1.5 text-strong outline-none placeholder:text-disabled"}),s.jsxs("div",{className:`flex max-h-44 flex-col ${ee}`,children:[D.map(e=>s.jsxs("button",{type:"button",onClick:()=>{m(e),C(!1),k("")},className:"flex items-center gap-2 rounded px-2 py-1.5 transition-colors hover:bg-white/[0.06]",children:[s.jsx(_,{symbol:e,size:16}),s.jsx("span",{className:"body-sm text-normal",children:c(e)}),s.jsx("span",{className:"caption text-soft ml-auto tabular-nums",children:f(e)!=null?M(f(e)):"—"})]},e)),D.length===0&&s.jsx("span",{className:"caption text-disabled px-2 py-2",children:d.length===0?"loading universe…":"no Hyperliquid market for that"})]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:["long","short"].map(e=>{const l=j===e;return s.jsx("button",{type:"button",onClick:()=>Q(e),className:"body-sm flex-1 rounded-md py-1.5 font-bold uppercase tracking-wide transition-colors",style:{color:l?F(e):"var(--color-soft)",background:l?"var(--color-surface)":"rgba(255,255,255,0.03)",border:`1px solid ${l?F(e)+"55":"transparent"}`},children:e},e)})}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:T.map((e,l)=>{const r=x===l;return s.jsx("button",{type:"button",onClick:()=>S(r?null:l),className:"caption rounded-full px-2.5 py-1 transition-colors",style:{color:r?"var(--color-strong)":"var(--color-soft)",background:r?"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.3)":"rgba(255,255,255,0.04)",border:`1px solid ${r?"var(--color-accent-line)":"transparent"}`},children:e.label},e.label)})}),s.jsx("input",{value:b,onChange:e=>w(e.target.value),onKeyDown:e=>e.key==="Enter"&&E(),placeholder:"add a note (optional)",className:`body-sm w-full rounded-md px-2.5 py-1.5 text-strong outline-none placeholder:text-disabled ${$}`}),n&&s.jsxs("span",{className:"caption",style:{color:A?q:X},children:["your last ",n.n," ",V[o.cls]," calls: ",n.hits,"/",n.n,A?" · your edge":" · a leak — size down"]}),s.jsxs("div",{className:"mt-auto flex items-center gap-2.5",children:[s.jsx("span",{className:"caption text-disabled",children:"how sure"}),s.jsx("input",{type:"range",min:50,max:95,step:1,value:h,onChange:e=>W(Number(e.target.value)),className:"h-1 flex-1 cursor-pointer",style:{accentColor:"hsl(var(--zf-accent-hue, 242) 85% 68%)"}}),s.jsxs("span",{className:"body-sm text-strong w-9 tabular-nums",children:[h,"%"]}),s.jsx("button",{type:"button",onClick:E,disabled:!o,className:"caption rounded px-3 py-1.5 font-bold uppercase tracking-wide transition-opacity disabled:opacity-40",style:{color:"var(--color-strong)",background:L?q+"55":"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.35)"},children:L?"logged ✓":"log"})]})]})}const ie=G({...U,component:te});export{ie as journalLogFrame};
@@ -1 +1 @@
1
- import{r as a,j as t}from"./react-qoZPGuNy.js";import{u,r as l}from"./journal-store-KCRoPnI_.js";import{J as f,O as d}from"./journal-ui-CJIuEcIa.js";import{f as w,w as i,k as x}from"./index-DbboK5sz.js";import{s as j}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";import"./content-shared-BZ1XzrJx.js";i.schema;function v({config:m}){const{open:s}=u(),[n,c]=a.useState(()=>Date.now()),r=x(s.map(o=>o.symbol));if(a.useEffect(()=>{const o=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(o)},[]),a.useEffect(()=>{for(const o of s){const e=r[o.symbol];n>=o.resolveAt&&e!=null&&l(o.id,e)}},[n,s,r]),s.length===0)return t.jsx(f,{children:"no open calls — log a read in Journal · Log"});const p=s.slice(0,m.max);return t.jsx("div",{className:`flex flex-col gap-2 ${j}`,children:p.map(o=>{const e=r[o.symbol];return t.jsx(d,{call:o,now:n,mid:e,onClose:e!=null?()=>l(o.id,e):void 0},o.id)})})}const b=w({...i,component:v});export{b as journalOpenFrame};
1
+ import{r as a,j as t}from"./react-qoZPGuNy.js";import{u,r as l}from"./journal-store-KCRoPnI_.js";import{J as f,O as d}from"./journal-ui-BhyvPmL4.js";import{f as w,w as i,k as x}from"./index-mNBIIbY4.js";import{s as j}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";import"./content-shared-BZ1XzrJx.js";i.schema;function v({config:m}){const{open:s}=u(),[n,c]=a.useState(()=>Date.now()),r=x(s.map(o=>o.symbol));if(a.useEffect(()=>{const o=window.setInterval(()=>c(Date.now()),1e3);return()=>window.clearInterval(o)},[]),a.useEffect(()=>{for(const o of s){const e=r[o.symbol];n>=o.resolveAt&&e!=null&&l(o.id,e)}},[n,s,r]),s.length===0)return t.jsx(f,{children:"no open calls — log a read in Journal · Log"});const p=s.slice(0,m.max);return t.jsx("div",{className:`flex flex-col gap-2 ${j}`,children:p.map(o=>{const e=r[o.symbol];return t.jsx(d,{call:o,now:n,mid:e,onClose:e!=null?()=>l(o.id,e):void 0},o.id)})})}const b=w({...i,component:v});export{b as journalOpenFrame};
@@ -1 +1 @@
1
- import{j as r}from"./react-qoZPGuNy.js";import{u as t}from"./journal-store-KCRoPnI_.js";import{J as n,R as m}from"./journal-ui-CJIuEcIa.js";import{f as i,x as o}from"./index-DbboK5sz.js";import{s as u}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";import"./content-shared-BZ1XzrJx.js";o.schema;function c({config:a}){const{resolved:s}=t();if(s.length===0)return r.jsx(n,{children:"nothing graded yet — your calls resolve here"});const l=s.slice(0,a.max);return r.jsx("div",{className:`flex flex-col gap-2 ${u}`,children:l.map(e=>r.jsx(m,{call:e},e.id))})}const g=i({...o,component:c});export{g as journalResultsFrame};
1
+ import{j as r}from"./react-qoZPGuNy.js";import{u as t}from"./journal-store-KCRoPnI_.js";import{J as n,R as m}from"./journal-ui-BhyvPmL4.js";import{f as i,x as o}from"./index-mNBIIbY4.js";import{s as u}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";import"./content-shared-BZ1XzrJx.js";o.schema;function c({config:a}){const{resolved:s}=t();if(s.length===0)return r.jsx(n,{children:"nothing graded yet — your calls resolve here"});const l=s.slice(0,a.max);return r.jsx("div",{className:`flex flex-col gap-2 ${u}`,children:l.map(e=>r.jsx(m,{call:e},e.id))})}const g=i({...o,component:c});export{g as journalResultsFrame};
@@ -1 +1 @@
1
- import{j as o}from"./react-qoZPGuNy.js";import{U as h,D as x}from"./format-CfAcS4D8.js";import{u as g,a as c,C as n}from"./journal-store-KCRoPnI_.js";import{S as d}from"./journal-ui-CJIuEcIa.js";import{f as b,y as p}from"./index-DbboK5sz.js";import"./content-shared-BZ1XzrJx.js";p.schema;function j(){const r=Object.keys(n).map(e=>({cls:e,rate:n[e].hits/n[e].n}));return r.sort((e,s)=>s.rate-e.rate),{edge:r[0],leak:r[r.length-1]}}function v(r){const{resolved:e}=g(),{edge:s,leak:t}=j(),a=e.length,u=a?Math.round(e.reduce((i,f)=>i+f.confidence,0)/a):0,m=a?Math.round(e.filter(i=>i.verdict==="hit").length/a*100):0,l=u-m;return o.jsxs("div",{className:"flex h-full flex-col gap-2",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsx(d,{label:"your edge",value:`${Math.round(s.rate*100)}%`,sub:c[s.cls],color:h}),o.jsx(d,{label:"your leak",value:`${Math.round(t.rate*100)}%`,sub:`${c[t.cls]} — size down`,color:x}),o.jsx(d,{label:"calibration",value:a?`${u}→${m}`:"—",sub:a?l>4?`overconfident +${l}`:l<-4?`underconfident ${l}`:"well-calibrated":"no calls yet",color:Math.abs(l)>4?"#f4a259":h})]}),o.jsx("div",{className:"rounded-md px-3 py-2",style:{background:"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.1)",border:"1px solid var(--color-accent-line)"},children:o.jsxs("p",{className:"body-sm text-normal leading-snug",children:[o.jsx("span",{className:"font-semibold text-highlight",children:"zAI ·"})," Sharpest on ",c[s.cls],". You leak on ",c[t.cls]," —"," ",n[t.cls].hits,"/",n[t.cls].n,", and your kill rule tripped on most of them. Size those down."]})})]})}const L=b({...p,component:v});export{L as journalScoreFrame};
1
+ import{j as o}from"./react-qoZPGuNy.js";import{U as h,D as x}from"./format-CfAcS4D8.js";import{u as g,a as c,C as n}from"./journal-store-KCRoPnI_.js";import{S as d}from"./journal-ui-BhyvPmL4.js";import{f as b,y as p}from"./index-mNBIIbY4.js";import"./content-shared-BZ1XzrJx.js";p.schema;function j(){const r=Object.keys(n).map(e=>({cls:e,rate:n[e].hits/n[e].n}));return r.sort((e,s)=>s.rate-e.rate),{edge:r[0],leak:r[r.length-1]}}function v(r){const{resolved:e}=g(),{edge:s,leak:t}=j(),a=e.length,u=a?Math.round(e.reduce((i,f)=>i+f.confidence,0)/a):0,m=a?Math.round(e.filter(i=>i.verdict==="hit").length/a*100):0,l=u-m;return o.jsxs("div",{className:"flex h-full flex-col gap-2",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsx(d,{label:"your edge",value:`${Math.round(s.rate*100)}%`,sub:c[s.cls],color:h}),o.jsx(d,{label:"your leak",value:`${Math.round(t.rate*100)}%`,sub:`${c[t.cls]} — size down`,color:x}),o.jsx(d,{label:"calibration",value:a?`${u}→${m}`:"—",sub:a?l>4?`overconfident +${l}`:l<-4?`underconfident ${l}`:"well-calibrated":"no calls yet",color:Math.abs(l)>4?"#f4a259":h})]}),o.jsx("div",{className:"rounded-md px-3 py-2",style:{background:"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.1)",border:"1px solid var(--color-accent-line)"},children:o.jsxs("p",{className:"body-sm text-normal leading-snug",children:[o.jsx("span",{className:"font-semibold text-highlight",children:"zAI ·"})," Sharpest on ",c[s.cls],". You leak on ",c[t.cls]," —"," ",n[t.cls].hits,"/",n[t.cls].n,", and your kill rule tripped on most of them. Size those down."]})})]})}const L=b({...p,component:v});export{L as journalScoreFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{A as b,h}from"./index-DbboK5sz.js";import{i as j}from"./content-shared-BZ1XzrJx.js";import{U as c,D as d,a as p,d as l}from"./format-CfAcS4D8.js";import{d as x,c as g,t as y,a as N,b as v,e as w}from"./journal-store-KCRoPnI_.js";function m({dir:e}){return s.jsx("span",{className:"caption rounded px-1.5 py-0.5 font-bold uppercase tracking-wide",style:{color:x(e),background:"var(--color-surface)"},children:e})}function u({symbol:e}){return s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(b,{symbol:e,size:16}),s.jsx("span",{className:"body-sm text-strong font-semibold",children:h(e)})]})}function S({label:e,value:a,sub:t,color:n}){return s.jsxs("div",{className:`flex flex-col gap-0.5 px-2.5 py-2 ${j}`,children:[s.jsx("span",{className:"caption text-soft uppercase tracking-wide",children:e}),s.jsx("span",{className:"metric-sm font-bold leading-none tabular-nums",style:{color:n??"var(--color-strong)"},children:a}),t&&s.jsx("span",{className:"caption text-disabled",children:t})]})}function A({call:e,now:a,mid:t,onClose:n}){const o=x(e.dir),r=t!=null?g(e,t):null,i=t!=null?y(e,t):0,f=r==null?"var(--color-soft)":r>=0?c:d;return s.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-white/[0.06] bg-white/[0.02] px-3 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{dir:e.dir}),s.jsx(u,{symbol:e.symbol}),s.jsx("span",{className:"caption text-disabled",children:"·"}),s.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),s.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:f},children:r==null?"…":p(r)})]}),s.jsx("p",{className:"body-sm text-normal leading-snug",children:e.claim}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"relative h-1.5 rounded-full bg-white/[0.06]",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full opacity-40",style:{width:`${i*100}%`,background:o}}),s.jsx("span",{className:"absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-black/30",style:{left:`${i*100}%`,background:o}})]}),s.jsxs("div",{className:"caption text-disabled flex items-center justify-between tabular-nums",children:[s.jsxs("span",{children:["entry ",l(e.entry)]}),s.jsxs("span",{className:"text-soft",children:["now ",t!=null?l(t):"…"]}),s.jsxs("span",{children:["target ",l(e.target)]})]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"caption text-disabled uppercase tracking-wide",children:N[e.cls]}),s.jsxs("span",{className:"caption text-soft flex items-center gap-2 tabular-nums",children:[v(e.resolveAt-a),n&&s.jsx("button",{type:"button",onClick:n,disabled:t==null,className:"caption rounded px-1.5 py-0.5 uppercase tracking-wide transition-opacity hover:text-strong disabled:opacity-40",style:{background:"var(--color-surface)"},children:"close"})]})]})]})}function P({call:e}){const a=e.verdict==="hit"?c:d,t=e.signalsFired===void 0?null:w(e);return s.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-white/[0.04] px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{dir:e.dir}),s.jsx(u,{symbol:e.symbol}),s.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),s.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:a},children:p(e.returnPct)})]}),s.jsx("p",{className:"body-sm text-soft leading-snug",children:e.claim}),t?s.jsxs("span",{className:"caption font-medium",style:{color:t.color},children:[t.glyph," ",t.label]}):s.jsxs("span",{className:"caption text-disabled uppercase tracking-wide",children:[e.verdict," · graded by return"]})]})}function D({children:e}){return s.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:e})}export{D as J,A as O,P as R,S};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{A as b,h}from"./index-mNBIIbY4.js";import{i as j}from"./content-shared-BZ1XzrJx.js";import{U as c,D as d,a as p,d as l}from"./format-CfAcS4D8.js";import{d as x,c as g,t as y,a as N,b as v,e as w}from"./journal-store-KCRoPnI_.js";function m({dir:e}){return s.jsx("span",{className:"caption rounded px-1.5 py-0.5 font-bold uppercase tracking-wide",style:{color:x(e),background:"var(--color-surface)"},children:e})}function u({symbol:e}){return s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(b,{symbol:e,size:16}),s.jsx("span",{className:"body-sm text-strong font-semibold",children:h(e)})]})}function S({label:e,value:a,sub:t,color:n}){return s.jsxs("div",{className:`flex flex-col gap-0.5 px-2.5 py-2 ${j}`,children:[s.jsx("span",{className:"caption text-soft uppercase tracking-wide",children:e}),s.jsx("span",{className:"metric-sm font-bold leading-none tabular-nums",style:{color:n??"var(--color-strong)"},children:a}),t&&s.jsx("span",{className:"caption text-disabled",children:t})]})}function A({call:e,now:a,mid:t,onClose:n}){const o=x(e.dir),r=t!=null?g(e,t):null,i=t!=null?y(e,t):0,f=r==null?"var(--color-soft)":r>=0?c:d;return s.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-white/[0.06] bg-white/[0.02] px-3 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{dir:e.dir}),s.jsx(u,{symbol:e.symbol}),s.jsx("span",{className:"caption text-disabled",children:"·"}),s.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),s.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:f},children:r==null?"…":p(r)})]}),s.jsx("p",{className:"body-sm text-normal leading-snug",children:e.claim}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"relative h-1.5 rounded-full bg-white/[0.06]",children:[s.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full opacity-40",style:{width:`${i*100}%`,background:o}}),s.jsx("span",{className:"absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-black/30",style:{left:`${i*100}%`,background:o}})]}),s.jsxs("div",{className:"caption text-disabled flex items-center justify-between tabular-nums",children:[s.jsxs("span",{children:["entry ",l(e.entry)]}),s.jsxs("span",{className:"text-soft",children:["now ",t!=null?l(t):"…"]}),s.jsxs("span",{children:["target ",l(e.target)]})]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"caption text-disabled uppercase tracking-wide",children:N[e.cls]}),s.jsxs("span",{className:"caption text-soft flex items-center gap-2 tabular-nums",children:[v(e.resolveAt-a),n&&s.jsx("button",{type:"button",onClick:n,disabled:t==null,className:"caption rounded px-1.5 py-0.5 uppercase tracking-wide transition-opacity hover:text-strong disabled:opacity-40",style:{background:"var(--color-surface)"},children:"close"})]})]})]})}function P({call:e}){const a=e.verdict==="hit"?c:d,t=e.signalsFired===void 0?null:w(e);return s.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-white/[0.04] px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(m,{dir:e.dir}),s.jsx(u,{symbol:e.symbol}),s.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),s.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:a},children:p(e.returnPct)})]}),s.jsx("p",{className:"body-sm text-soft leading-snug",children:e.claim}),t?s.jsxs("span",{className:"caption font-medium",style:{color:t.color},children:[t.glyph," ",t.label]}):s.jsxs("span",{className:"caption text-disabled uppercase tracking-wide",children:[e.verdict," · graded by return"]})]})}function D({children:e}){return s.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:e})}export{D as J,A as O,P as R,S};
@@ -1 +1 @@
1
- import{r as x,j as t}from"./react-qoZPGuNy.js";import{b,e as h,c as N,g as L}from"./format-CfAcS4D8.js";import{f as M,K as f,L as p}from"./index-DbboK5sz.js";import{F as u}from"./ui-Bq3RQsdJ.js";import{M as S}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";f.schema;const y="LNS14000000",E="CES0000000001";function w({config:l}){const i=new Date().getUTCFullYear(),c=i-2,{series:s,isLoading:j}=p(y,c,i),{series:e,isLoading:v}=p(E,c,i),a=x.useMemo(()=>((s==null?void 0:s.points)??[]).slice(-l.months),[l.months,s==null?void 0:s.points]),g=x.useMemo(()=>a.map(d=>({date:new Date(d.time).toISOString(),value:d.value})),[a]);if(j&&v)return t.jsx(u,{loading:!0,children:"loading labor data…"});const r=a.at(-1);if(!s||!r)return t.jsx(u,{children:"no labor data yet"});const o=e==null?void 0:e.points.at(-1),m=e==null?void 0:e.points.at(-2),n=o&&m?o.value-m.value:null;return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"unemployment rate"}),t.jsx("div",{className:"body-sm text-normal",children:r.date})]}),t.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"metric-xl text-strong leading-none",children:b(r.value,1)}),t.jsxs("div",{className:"caption text-soft mt-1",children:[s.source," · U-3"]})]}),n!==null&&o&&t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"caption text-soft",children:"nonfarm payrolls"}),t.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:N(n)},children:[n>=0?"+":"",h(n*1e3)]}),t.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[h(o.value*1e3)," jobs"]})]})]}),t.jsx(S,{data:g,width:210,height:44,color:L}),t.jsxs("div",{className:"caption text-soft",children:[s.label," · ",a.length," monthly observations"]})]})}const Y=M({...f,component:w});export{Y as laborMarketFrame};
1
+ import{r as x,j as t}from"./react-qoZPGuNy.js";import{b,e as h,c as N,g as L}from"./format-CfAcS4D8.js";import{f as M,L as f,M as p}from"./index-mNBIIbY4.js";import{F as u}from"./ui-Bq3RQsdJ.js";import{M as S}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";f.schema;const y="LNS14000000",E="CES0000000001";function w({config:l}){const i=new Date().getUTCFullYear(),c=i-2,{series:s,isLoading:j}=p(y,c,i),{series:e,isLoading:v}=p(E,c,i),a=x.useMemo(()=>((s==null?void 0:s.points)??[]).slice(-l.months),[l.months,s==null?void 0:s.points]),g=x.useMemo(()=>a.map(d=>({date:new Date(d.time).toISOString(),value:d.value})),[a]);if(j&&v)return t.jsx(u,{loading:!0,children:"loading labor data…"});const r=a.at(-1);if(!s||!r)return t.jsx(u,{children:"no labor data yet"});const o=e==null?void 0:e.points.at(-1),m=e==null?void 0:e.points.at(-2),n=o&&m?o.value-m.value:null;return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"unemployment rate"}),t.jsx("div",{className:"body-sm text-normal",children:r.date})]}),t.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"metric-xl text-strong leading-none",children:b(r.value,1)}),t.jsxs("div",{className:"caption text-soft mt-1",children:[s.source," · U-3"]})]}),n!==null&&o&&t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"caption text-soft",children:"nonfarm payrolls"}),t.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:N(n)},children:[n>=0?"+":"",h(n*1e3)]}),t.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[h(o.value*1e3)," jobs"]})]})]}),t.jsx(S,{data:g,width:210,height:44,color:L}),t.jsxs("div",{className:"caption text-soft",children:[s.label," · ",a.length," monthly observations"]})]})}const Y=M({...f,component:w});export{Y as laborMarketFrame};
@@ -1 +1 @@
1
- import{j as e}from"./react-qoZPGuNy.js";import{j as r,a as c,c as d}from"./format-CfAcS4D8.js";import{f as m,aY as i,aZ as u}from"./index-DbboK5sz.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;function s(n,t){return t==null||t===0?null:(n-t)/t*100}function l({label:n,value:t,delta:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-md bg-white/[0.04] px-2 py-2 text-center",children:[e.jsx("span",{className:"metric-sm text-strong leading-none",children:t}),e.jsx("span",{className:"caption text-soft mt-1",children:n}),a!==null&&e.jsx("span",{className:"caption mt-0.5 font-bold tabular-nums",style:{color:d(a)},children:c(a)})]})}function g({config:n}){const{stats:t,isLoading:a}=u();return a?e.jsx(o,{loading:!0,children:"loading lightning…"}):t?e.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-1.5",children:[e.jsx(l,{label:"nodes",value:t.nodeCount.toLocaleString("en-US"),delta:s(t.nodeCount,t.prevNodeCount)}),e.jsx(l,{label:"channels",value:t.channelCount.toLocaleString("en-US"),delta:s(t.channelCount,t.prevChannelCount)}),e.jsx(l,{label:"capacity",value:r(t.totalCapacity),delta:s(t.totalCapacity,t.prevTotalCapacity)})]}),n.showSplit&&e.jsxs("div",{className:"caption text-soft text-center",children:[t.clearnetNodes.toLocaleString("en-US")," clearnet ·"," ",t.torNodes.toLocaleString("en-US")," tor"]})]}):e.jsx(o,{children:"no lightning data yet"})}const j=m({...i,component:g});export{j as lightningStatsFrame};
1
+ import{j as e}from"./react-qoZPGuNy.js";import{j as r,a as c,c as d}from"./format-CfAcS4D8.js";import{f as m,a_ as i,a$ as u}from"./index-mNBIIbY4.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;function s(n,t){return t==null||t===0?null:(n-t)/t*100}function l({label:n,value:t,delta:a}){return e.jsxs("div",{className:"flex flex-col items-center justify-center rounded-md bg-white/[0.04] px-2 py-2 text-center",children:[e.jsx("span",{className:"metric-sm text-strong leading-none",children:t}),e.jsx("span",{className:"caption text-soft mt-1",children:n}),a!==null&&e.jsx("span",{className:"caption mt-0.5 font-bold tabular-nums",style:{color:d(a)},children:c(a)})]})}function g({config:n}){const{stats:t,isLoading:a}=u();return a?e.jsx(o,{loading:!0,children:"loading lightning…"}):t?e.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-1.5",children:[e.jsx(l,{label:"nodes",value:t.nodeCount.toLocaleString("en-US"),delta:s(t.nodeCount,t.prevNodeCount)}),e.jsx(l,{label:"channels",value:t.channelCount.toLocaleString("en-US"),delta:s(t.channelCount,t.prevChannelCount)}),e.jsx(l,{label:"capacity",value:r(t.totalCapacity),delta:s(t.totalCapacity,t.prevTotalCapacity)})]}),n.showSplit&&e.jsxs("div",{className:"caption text-soft text-center",children:[t.clearnetNodes.toLocaleString("en-US")," clearnet ·"," ",t.torNodes.toLocaleString("en-US")," tor"]})]}):e.jsx(o,{children:"no lightning data yet"})}const j=m({...i,component:g});export{j as lightningStatsFrame};
@@ -1 +1 @@
1
- import{j as t,r as m}from"./react-qoZPGuNy.js";import{i as d}from"./content-shared-BZ1XzrJx.js";import{f as u,aD as i}from"./index-DbboK5sz.js";import{s as f}from"./ui-Bq3RQsdJ.js";i.schema;const p=e=>/^https?:\/\//i.test(e);function h(e){for(const r of[e,`https://${e}`])try{const n=new URL(r).hostname;if(n)return n}catch{}return null}function x(e){const r=h(e);return r?`https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(r)}`:null}function g({link:e}){const[r,n]=m.useState(!1),s=e.icon.trim(),a=s&&p(s)?s:null,o=s&&!a?s:null,l=a??(o?null:x(e.url)),c=l!=null&&!r;return t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.url,className:`group flex items-center gap-2 px-2.5 py-2 ${d}`,children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md bg-white/[0.06] text-base leading-none","aria-hidden":!0,children:o?t.jsx("span",{children:o}):c?t.jsx("img",{src:l,alt:"",className:"h-full w-full object-contain",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>n(!0)}):t.jsx("span",{className:"text-soft font-dmsans font-bold uppercase",children:e.label.charAt(0)})}),t.jsx("span",{className:"body-sm text-normal min-w-0 flex-1 truncate font-medium group-hover:text-strong",children:e.label})]})}function j({config:e}){return t.jsx("div",{className:f,children:t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`},children:e.links.map((r,n)=>t.jsx(g,{link:r},`${r.url}-${n}`))})})}const N=u({...i,component:j});export{N as linkGridFrame};
1
+ import{j as t,r as m}from"./react-qoZPGuNy.js";import{i as d}from"./content-shared-BZ1XzrJx.js";import{f as u,aF as i}from"./index-mNBIIbY4.js";import{s as f}from"./ui-Bq3RQsdJ.js";i.schema;const p=e=>/^https?:\/\//i.test(e);function h(e){for(const r of[e,`https://${e}`])try{const n=new URL(r).hostname;if(n)return n}catch{}return null}function x(e){const r=h(e);return r?`https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(r)}`:null}function g({link:e}){const[r,n]=m.useState(!1),s=e.icon.trim(),a=s&&p(s)?s:null,o=s&&!a?s:null,l=a??(o?null:x(e.url)),c=l!=null&&!r;return t.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.url,className:`group flex items-center gap-2 px-2.5 py-2 ${d}`,children:[t.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md bg-white/[0.06] text-base leading-none","aria-hidden":!0,children:o?t.jsx("span",{children:o}):c?t.jsx("img",{src:l,alt:"",className:"h-full w-full object-contain",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>n(!0)}):t.jsx("span",{className:"text-soft font-dmsans font-bold uppercase",children:e.label.charAt(0)})}),t.jsx("span",{className:"body-sm text-normal min-w-0 flex-1 truncate font-medium group-hover:text-strong",children:e.label})]})}function j({config:e}){return t.jsx("div",{className:f,children:t.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`},children:e.links.map((r,n)=>t.jsx(g,{link:r},`${r.url}-${n}`))})})}const N=u({...i,component:j});export{N as linkGridFrame};
@@ -0,0 +1 @@
1
+ import{r as s}from"./react-qoZPGuNy.js";const r=new Set;let t;function d(e){return r.add(e),t===void 0&&typeof window<"u"&&(t=setInterval(()=>{for(const n of[...r])n()},1e3)),()=>{r.delete(e),r.size===0&&t!==void 0&&(clearInterval(t),t=void 0)}}function l(e="200px"){const n=s.useRef(null),i=s.useRef(!0);return s.useEffect(()=>{const o=n.current;if(!o||typeof IntersectionObserver>"u")return;const f=new IntersectionObserver(u=>{const c=u[0];c&&(i.current=c.isIntersecting)},{rootMargin:e});return f.observe(o),()=>f.disconnect()},[e]),{ref:n,visibleRef:i}}export{d as o,l as u};
@@ -0,0 +1 @@
1
+ import{r as S,j as ce}from"./react-qoZPGuNy.js";function nn(e){const r=e.match(/^#([0-9a-f]{3,8})$/i);if(r){let t=r[1];return t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const n=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return n?[+n[1],+n[2],+n[3]]:[128,128,128]}function jt(e,r,n,t){return`rgba(${e}, ${r}, ${n}, ${t})`}function rn(e,r){const[n,t,l]=nn(e),o=r==="dark";return{line:e,lineWidth:2,fillTop:jt(n,t,l,o?.12:.08),fillBottom:jt(n,t,l,0),gridLine:o?"rgba(255, 255, 255, 0.06)":"rgba(0, 0, 0, 0.06)",gridLabel:o?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.35)",dotUp:"#22c55e",dotDown:"#ef4444",dotFlat:e,glowUp:"rgba(34, 197, 94, 0.18)",glowDown:"rgba(239, 68, 68, 0.18)",glowFlat:jt(n,t,l,.12),badgeOuterBg:o?"rgba(40, 40, 40, 0.95)":"rgba(255, 255, 255, 0.95)",badgeOuterShadow:o?"rgba(0, 0, 0, 0.4)":"rgba(0, 0, 0, 0.15)",badgeBg:e,badgeText:"#ffffff",dashLine:jt(n,t,l,.4),refLine:o?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)",refLabel:o?"rgba(255, 255, 255, 0.45)":"rgba(0, 0, 0, 0.4)",timeLabel:o?"rgba(255, 255, 255, 0.35)":"rgba(0, 0, 0, 0.3)",crosshairLine:o?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.12)",tooltipBg:o?"rgba(30, 30, 30, 0.95)":"rgba(255, 255, 255, 0.95)",tooltipText:o?"#e5e5e5":"#1a1a1a",tooltipBorder:o?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)",bgRgb:o?[10,10,10]:[255,255,255],labelFont:'11px "SF Mono", Menlo, Monaco, "Cascadia Code", monospace',valueFont:'600 11px "SF Mono", Menlo, monospace',badgeFont:'500 11px "SF Mono", Menlo, monospace'}}var It=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#06b6d4","#f97316"];function mr(e,r){const n=new Map;for(let t=0;t<e.length;t++){const l=e[t],o=l.color||It[t%It.length];n.set(l.id,rn(o,r))}return n}function te(e,r,n,t=16.67){const l=1-Math.pow(1-n,t/16.67);return e+(r-e)*l}function Jt(e,r,n,t){let l=1/0,o=-1/0;for(const s of e)s.value<l&&(l=s.value),s.value>o&&(o=s.value);r<l&&(l=r),r>o&&(o=r),n!==void 0&&(n<l&&(l=n),n>o&&(o=n));const i=o-l,c=t?.01:.12,a=i*(t?.02:.1)||(t?.04:.4);if(i<a){const s=(l+o)/2;l=s-a/2,o=s+a/2}else{const s=i*c;l-=s,o+=s}return{min:l,max:o}}function Fn(e,r=20){if(e.length<5)return"flat";const n=Math.max(0,e.length-r);let t=1/0,l=-1/0;for(let f=n;f<e.length;f++){const g=e[f].value;g<t&&(t=g),g>l&&(l=g)}const o=l-t;if(o===0)return"flat";const i=Math.max(n,e.length-5),c=e[i].value,s=e[e.length-1].value-c,h=o*.12;return s>h?"up":s<-h?"down":"flat"}function lr(e,r){if(e.length===0)return null;if(r<=e[0].time)return e[0].value;if(r>=e[e.length-1].time)return e[e.length-1].value;let n=0,t=e.length-1;for(;t-n>1;){const a=n+t>>1;e[a].time<=r?n=a:t=a}const l=e[n],o=e[t],i=o.time-l.time;if(i===0)return l.value;const c=(r-l.time)/i;return l.value+(o.value-l.value)*c}function br(){if(typeof window>"u")return 1;const e=(navigator.deviceMemory??8)<=4||(navigator.hardwareConcurrency??8)<=4;return Math.min(window.devicePixelRatio||1,e?2:3)}function vr(e,r,n,t){e.setTransform(r,0,0,r,0,0)}function pr(e,r,n,t){if(t>0){const i=t*r;if(i>=n*.5&&i<=n*4)return t}const l=[[2,2.5,2],[2,2,2.5],[2.5,2,2]];let o=1/0;for(const i of l){let c=Math.pow(10,Math.ceil(Math.log10(e))),a=0;for(;c/i[a%3]*r>=n;)c/=i[a%3],a++;c<o&&(o=c)}return o===1/0?e/5:o}function Mr(e,r){const n=e/r;return Math.abs(n-Math.round(n))<.01}var $n=.18,Sr=.12;function an(e,r,n,t,l,o){const{w:i,h:c,pad:a,valRange:s,minVal:h,maxVal:f,toY:g}=r,M=c-a.top-a.bottom;if(M<=0||s<=0)return;const m=M/s,v=pr(s,m,36,l.interval);l.interval=v;const w=v/2,R=w*m,y=R<40?0:R>=60?1:(R-40)/20,T=32,C=p=>{const A=Math.min(p-a.top,c-a.bottom-p);return A>=T?1:A<=0?0:A/T},P=new Map,E=Math.ceil(h/w)*w;for(let p=E;p<=f;p+=w){const A=g(p);if(A<a.top-2||A>c-a.bottom+2)continue;const k=(Mr(p,v)?1:y)*C(A),b=Math.round(p*1e6);P.set(b,k)}for(const[p,A]of l.labels){const W=P.get(p)??0,k=W>=A?$n:Sr;let b=te(A,W,k,o);Math.abs(b-W)<.02&&(b=W),b<.01&&W===0?l.labels.delete(p):l.labels.set(p,b)}for(const[p,A]of P)l.labels.has(p)||l.labels.set(p,A*$n);const I=e.globalAlpha;e.setLineDash([1,3]),e.lineWidth=1,e.font=n.labelFont,e.textAlign="left";for(const[p,A]of l.labels){if(A<.02)continue;const W=p/1e6,k=g(W);k<a.top-10||k>c-a.bottom+10||(e.save(),e.globalAlpha=I*A,e.strokeStyle=n.gridLine,e.beginPath(),e.moveTo(a.left,k),e.lineTo(i-a.right,k),e.stroke(),e.fillStyle=n.gridLabel,e.fillText(t(W),i-a.right+8,k+4),e.restore())}e.setLineDash([])}function Zt(e,r){if(r.length<2)return;if(r.length===2){e.lineTo(r[1][0],r[1][1]);return}const n=r.length,t=new Array(n-1),l=new Array(n-1);for(let i=0;i<n-1;i++)l[i]=r[i+1][0]-r[i][0],t[i]=l[i]===0?0:(r[i+1][1]-r[i][1])/l[i];const o=new Array(n);o[0]=t[0],o[n-1]=t[n-2];for(let i=1;i<n-1;i++)t[i-1]*t[i]<=0?o[i]=0:o[i]=(t[i-1]+t[i])/2;for(let i=0;i<n-1;i++)if(t[i]===0)o[i]=0,o[i+1]=0;else{const c=o[i]/t[i],a=o[i+1]/t[i],s=c*c+a*a;if(s>9){const h=3/Math.sqrt(s);o[i]=h*c*t[i],o[i+1]=h*a*t[i]}}for(let i=0;i<n-1;i++){const c=l[i];e.bezierCurveTo(r[i][0]+c/3,r[i][1]+o[i]*c/3,r[i+1][0]-c/3,r[i+1][1]-o[i+1]*c/3,r[i+1][0],r[i+1][1])}}var sn=.07,cn=.001;function un(e,r,n,t){return r+n*(Math.sin(e*9.4+t)*.55+Math.sin(e*15.7+t*1.3)*.3+Math.sin(e*4.2+t*.7)*.15)}function fn(e){return .22+.08*Math.sin(e/1200*Math.PI)}function Vn(e){const r=e.match(/^#([0-9a-f]{3,8})$/i);if(r){let l=r[1];return l.length===3&&(l=l[0]+l[0]+l[1]+l[1]+l[2]+l[2]),[parseInt(l.slice(0,2),16),parseInt(l.slice(2,4),16),parseInt(l.slice(4,6),16),1]}const n=e.match(/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)/);if(n)return[+n[1],+n[2],+n[3],+n[4]];const t=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return t?[+t[1],+t[2],+t[3],1]:[128,128,128,1]}function wr(e,r,n){if(n<=0)return e;if(n>=1)return r;const[t,l,o,i]=Vn(e),[c,a,s,h]=Vn(r),f=Math.round(t+(c-t)*n),g=Math.round(l+(a-l)*n),M=Math.round(o+(s-o)*n),m=i+(h-i)*n;return m>=.995?`rgb(${f},${g},${M})`:`rgba(${f},${g},${M},${m.toFixed(3)})`}function Kt(e,r,n,t,l,o=1,i=1,c){const{h:a,pad:s}=r,h=e.globalAlpha;if(l&&i>.01){e.globalAlpha=h*i;const f=e.createLinearGradient(0,s.top,0,a-s.bottom);f.addColorStop(0,n.fillTop),f.addColorStop(1,n.fillBottom),e.beginPath(),e.moveTo(t[0][0],a-s.bottom),e.lineTo(t[0][0],t[0][1]),Zt(e,t),e.lineTo(t[t.length-1][0],a-s.bottom),e.closePath(),e.fillStyle=f,e.fill()}e.globalAlpha=h*o,e.beginPath(),e.moveTo(t[0][0],t[0][1]),Zt(e,t),e.strokeStyle=c??n.line,e.lineWidth=n.lineWidth,e.lineJoin="round",e.lineCap="round",e.stroke(),e.globalAlpha=h}function hn(e,r,n,t,l,o,i,c,a=0,s=1,h=0,f=1,g=!1,M=1){const{h:m,pad:v,toX:w,toY:R,chartW:y,chartH:T}=r,C=e.globalAlpha,P=v.top,E=m-v.bottom,I=ue=>Math.max(P,Math.min(E,ue)),p=v.top+T/2,A=T*sn,W=h*cn,k=s<1?(ue,Ce)=>{const pe=Math.max(0,Math.min(1,(Ce-v.left)/y)),We=Math.abs(pe-.5)*2,Ee=Math.max(0,Math.min(1,(s-We*.4)/.6)),Le=un(pe,p,A,W);return Le+(ue-Le)*Ee}:(ue,Ce)=>ue,b=t.map((ue,Ce)=>{const pe=w(ue.time),We=Ce===t.length-1?k(I(R(l)),pe):k(I(R(ue.value)),pe);return[pe,We]}),d=w(o),L=v.left+y,J=s<1?d+(L-d)*(1-s):d;if(b.push([J,k(I(R(l)),J)]),b.length<2)return;let Z=1,z=M;if(s<1){const ue=fn(h);Z=ue+(1-ue)*s,z=s*M}const oe=Math.min(1,s*3)*f,K=s<1||f<1?wr(n.gridLabel,n.line,oe):void 0,qe=c!==null;if(e.save(),e.beginPath(),e.rect(v.left-1,v.top,y+2,T),e.clip(),qe?(e.save(),e.beginPath(),e.rect(0,0,c,m),e.clip(),Kt(e,r,n,b,i,Z,z,K),e.restore(),e.save(),e.beginPath(),e.rect(c,0,r.w-c,m),e.clip(),e.globalAlpha=C*(1-a*.6),Kt(e,r,n,b,i,Z,z,K),e.restore()):Kt(e,r,n,b,i,Z,z,K),e.restore(),!g){const ue=Math.max(v.top,Math.min(m-v.bottom,R(l))),Ce=s<1?p+(ue-p)*s:ue;e.setLineDash([4,4]),e.strokeStyle=n.dashLine,e.lineWidth=1;const pe=qe?1-a*.2:1;e.globalAlpha=C*(s<1?pe*s:pe),e.beginPath(),e.moveTo(v.left,Ce),e.lineTo(r.w-v.right,Ce),e.stroke(),e.setLineDash([])}e.globalAlpha=C;const Ye=b[b.length-1];return Ye[1]=Math.max(10,Math.min(m-10,Ye[1])),b}var ir=1500,ar=900;function Rr(e,r,n){const t=Math.round(e[0]+(r[0]-e[0])*n),l=Math.round(e[1]+(r[1]-e[1])*n),o=Math.round(e[2]+(r[2]-e[2])*n);return`rgb(${t},${l},${o})`}function sr(e,r,n,t,l=!0,o=0,i=performance.now()){const c=e.globalAlpha,a=o*.7;if(l&&a<.3){const h=i%ir/ar;if(h<1){const f=9+h*12,g=.35*(1-h)*(1-a*3);e.beginPath(),e.arc(r,n,f,0,Math.PI*2),e.strokeStyle=t.line,e.lineWidth=1.5,e.globalAlpha=c*g,e.stroke()}}const s=nn(t.badgeOuterBg);if(e.save(),e.globalAlpha=c,e.shadowColor=t.badgeOuterShadow,e.shadowBlur=6*(1-a),e.shadowOffsetY=1,e.beginPath(),e.arc(r,n,6.5,0,Math.PI*2),e.fillStyle=t.badgeOuterBg,e.fill(),e.restore(),e.globalAlpha=c,e.beginPath(),e.arc(r,n,3.5,0,Math.PI*2),a>.01){const h=nn(t.line);e.fillStyle=Rr(h,s,a)}else e.fillStyle=t.line;e.fill()}function Ar(e,r,n,t,l=!0,o=performance.now(),i=3){const c=e.globalAlpha;if(l){const a=o%ir/ar;if(a<1){const s=9+a*10,h=.3*(1-a);e.beginPath(),e.arc(r,n,s,0,Math.PI*2),e.strokeStyle=t,e.lineWidth=1.5,e.globalAlpha=c*h,e.stroke()}}e.globalAlpha=c,e.beginPath(),e.arc(r,n,i,0,Math.PI*2),e.fillStyle=t,e.fill()}function Tr(e,r,n,t,l=3){e.beginPath(),e.arc(r,n,l,0,Math.PI*2),e.fillStyle=t,e.fill()}function Er(e,r,n,t,l,o,i,c=performance.now()){const a=e.globalAlpha,s=t==="up"?1:0,h=t==="down"?1:0,f=o.down<.02,g=o.up<.02;o.up=te(o.up,f?s:0,s>o.up?.08:.04,i),o.down=te(o.down,g?h:0,h>o.down?.08:.04,i),o.up<.01&&(o.up=0),o.down<.01&&(o.down=0),o.up>.99&&(o.up=1),o.down>.99&&(o.down=1);const M=c%1400/1400,m=(v,w)=>{if(w<.01)return;const R=r+19,y=n;e.save(),e.strokeStyle=l.gridLabel,e.lineWidth=2.5,e.lineCap="round",e.lineJoin="round";for(let T=0;T<2;T++){const C=T*.2,P=.35,E=M-C,p=.3+.7*(E>=0&&E<P?Math.sin(E/P*Math.PI):0);e.globalAlpha=a*w*p;const A=v===-1?-3:3,W=y+v*(T*8-4)+A;e.beginPath(),e.moveTo(R-5,W-v*3.5),e.lineTo(R,W),e.lineTo(R+5,W-v*3.5),e.stroke()}e.restore()};m(-1,o.up),m(1,o.down),e.globalAlpha=a}function Lr(e,r,n,t,l,o,i,c,a,s,h,f){if(a<.01)return;const{h:g,pad:M,toY:m}=r,v=m(l);e.save(),e.globalAlpha=a*.5,e.strokeStyle=n.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(t,M.top),e.lineTo(t,g-M.bottom),e.stroke(),e.restore();const w=4*Math.min(a*3,1);if(w>.5&&(e.globalAlpha=1,e.beginPath(),e.arc(t,v,w,0,Math.PI*2),e.fillStyle=n.line,e.fill()),a<.1||r.w<300)return;const R=i(l),y=c(o),T=" · ";e.save(),e.globalAlpha=a,e.font='400 13px "SF Mono", Menlo, monospace';const C=e.measureText(R).width,P=e.measureText(T).width,E=e.measureText(y).width,I=C+P+E;let p=t-I/2;const A=M.left+4,k=(h!=null?h+7:r.w-M.right)-I;p<A&&(p=A),p>k&&(p=k);const b=M.top+(s??14)+10;e.textAlign="left",f&&(e.strokeStyle=n.tooltipBg,e.lineWidth=3,e.lineJoin="round",e.strokeText(R,p,b),e.strokeText(T+y,p+C,b)),e.fillStyle=n.tooltipText,e.fillText(R,p,b),e.fillStyle=n.gridLabel,e.fillText(T+y,p+C,b),e.restore()}function yr(e,r,n,t,l,o,i,c,a,s,h,f){if(a<.01||o.length===0)return;const{h:g,pad:M,toY:m}=r;e.save(),e.globalAlpha=a*.5,e.strokeStyle=n.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(t,M.top),e.lineTo(t,g-M.bottom),e.stroke(),e.restore();const v=4*Math.min(a*3,1);if(v>.5){e.globalAlpha=1;for(const b of o){const d=m(b.value);e.beginPath(),e.arc(t,d,v,0,Math.PI*2),e.fillStyle=b.color,e.fill()}}if(a<.1||r.w<300)return;e.save(),e.globalAlpha=a,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";const w=c(l),R=" · ",y=" ",T=[{text:w,color:n.gridLabel}];for(const b of o){T.push({text:R,color:n.gridLabel}),T.push({text:y,color:b.color,isDot:!0});const d=b.label?`${b.label} `:"";d&&T.push({text:d,color:n.gridLabel}),T.push({text:i(b.value),color:n.tooltipText})}let C=0;const P=[];for(const b of T){const d=b.isDot?12:e.measureText(b.text).width;P.push(d),C+=d}let E=t-C/2;const I=M.left+4,A=(f!=null?f+7:r.w-M.right)-C;E<I&&(E=I),E>A&&(E=A);const W=M.top+(s??14)+10;if(h!==!1){e.strokeStyle=n.tooltipBg,e.lineWidth=3,e.lineJoin="round";let b=E;for(let d=0;d<T.length;d++){const L=T[d];L.isDot||e.strokeText(L.text,b,W),b+=P[d]}}let k=E;for(let b=0;b<T.length;b++){const d=T[b];d.isDot?(e.beginPath(),e.arc(k+4,W-4,3.5,0,Math.PI*2),e.fillStyle=d.color,e.fill()):(e.fillStyle=d.color,e.fillText(d.text,k,W)),k+=P[b]}e.restore()}function cr(e,r,n,t){const{w:l,h:o,pad:i,toY:c,chartW:a}=r,s=c(t.value);if(s<i.top-10||s>o-i.bottom+10)return;const h=t.label??"";if(h){e.font="500 11px system-ui, sans-serif";const f=e.measureText(h).width,g=i.left+a/2,M=8;e.strokeStyle=n.refLine,e.lineWidth=1,e.beginPath(),e.moveTo(i.left,s),e.lineTo(g-f/2-M,s),e.stroke(),e.beginPath(),e.moveTo(g+f/2+M,s),e.lineTo(l-i.right,s),e.stroke(),e.fillStyle=n.refLabel,e.textAlign="center",e.fillText(h,g,s+4)}else e.strokeStyle=n.refLine,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(i.left,s),e.lineTo(l-i.right,s),e.stroke(),e.setLineDash([])}function Pr(e){return e<=15?2:e<=30?5:e<=60?10:e<=120?15:e<=300?30:e<=600?60:e<=1800?300:e<=3600?600:e<=14400?1800:e<=43200?3600:e<=86400?7200:e<=604800?86400:604800}var kr=.08;function dn(e,r,n,t,l,o,i,c){const{h:a,pad:s,leftEdge:h,rightEdge:f,toX:g}=r,M=s.left,m=r.w-s.right,v=m-M,w=50,R=b=>{const d=b-M,L=m-b,J=Math.min(d,L);return J>=w?1:J<=0?0:J/w};e.font=n.labelFont;const y=v/l;let T=Pr(l);for(;T*y<60&&T<l;)T*=2;const C=T>=86400;let P;if(C){const b=new Date((h-T)*1e3);b.setHours(0,0,0,0),P=b.getTime()/1e3}else P=Math.ceil((h-T)/T)*T;const E=new Set;for(let b=P;b<=f+T&&E.size<30;b+=T)E.add(Math.round(b*100));for(const b of E){const d=o(b/100),L=i.labels.get(b);L?L.text=d:i.labels.set(b,{alpha:0,text:d})}for(const[b,d]of i.labels){const L=g(b/100),Z=E.has(b)?R(L):0;let z=te(d.alpha,Z,kr,c);Math.abs(z-Z)<.02&&(z=Z),z<.01&&Z===0?i.labels.delete(b):d.alpha=z}const I=e.globalAlpha,p=a-s.bottom,A=5;e.strokeStyle=n.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(M,p),e.lineTo(m,p),e.stroke(),e.textAlign="center";const W=[];for(const[b,d]of i.labels){if(d.alpha<.02)continue;const L=g(b/100);if(L<M-20||L>m)continue;const J=e.measureText(d.text).width;W.push({x:L,alpha:d.alpha,text:d.text,w:J})}W.sort((b,d)=>b.x-d.x);const k=[];for(const b of W){const d=b.x-b.w/2;if(k.length>0){const L=k[k.length-1],J=L.x+L.w/2;if(d<J+8){b.alpha>L.alpha&&(k[k.length-1]=b);continue}}k.push(b)}for(const b of k)e.save(),e.globalAlpha=I*b.alpha,e.strokeStyle=n.gridLine,e.lineWidth=1,e.beginPath(),e.moveTo(b.x,p),e.lineTo(b.x,p+A),e.stroke(),e.fillStyle=n.timeLabel,e.fillText(b.text,b.x,p+A+14),e.restore()}var Cr=[34,197,94],Wr=[239,68,68];function Dr(){return{labels:[],spawnTimer:0,smoothSpeed:on,prevBidTotal:0,prevAskTotal:0,churnRate:0}}var Ir=50,On=6,Hn=40,_r=22,on=60,Br=160;function Fr(e,r,n){const t=Math.round(e[0]+(r[0]-e[0])*n),l=Math.round(e[1]+(r[1]-e[1])*n),o=Math.round(e[2]+(r[2]-e[2])*n);return`rgb(${t},${l},${o})`}function $r(e,r,n,t,l,o,i){const{pad:c,h:a,chartH:s}=r,h=l/1e3;if(t.bids.length===0&&t.asks.length===0)return;let f=0,g=0,M=0;for(const[,d]of t.bids)g+=d,d>f&&(f=d);for(const[,d]of t.asks)M+=d,d>f&&(f=d);if(f===0)return;const m=o.prevBidTotal+o.prevAskTotal;let v=0;if(m>0){const d=Math.abs(g-o.prevBidTotal)+Math.abs(M-o.prevAskTotal);v=Math.min(d/m,1)}o.prevBidTotal=g,o.prevAskTotal=M;const w=v>o.churnRate?.3:.05;o.churnRate+=(v-o.churnRate)*w;const R=Math.max(Math.min(i*5,1),o.churnRate),y=on+R*(Br-on),T=1-Math.pow(.95,l/16.67);o.smoothSpeed+=(y-o.smoothSpeed)*T;const C=o.smoothSpeed,P=c.left+8,E=a-c.bottom-6,I=c.top,p=n.bgRgb;for(o.spawnTimer+=l;o.spawnTimer>=Hn&&o.labels.length<Ir;){o.spawnTimer-=Hn;let d=!1;for(let K=0;K<o.labels.length;K++)if(Math.abs(o.labels[K].y-E)<_r){d=!0;break}if(d)break;const L=[];for(const[,K]of t.bids)L.push({size:K,green:!0});for(const[,K]of t.asks)L.push({size:K,green:!1});let J=0;for(const K of L)J+=K.size;let Z=Math.random()*J,z=L[0];for(const K of L)if(Z-=K.size,Z<=0){z=K;break}const oe=z.size/f;o.labels.push({y:E,text:`+ ${Vr(z.size)}`,green:z.green,life:On,maxLife:On,intensity:.5+oe*.5})}const A=E-I;let W=0;for(let d=0;d<o.labels.length;d++){const L=o.labels[d];if(L.life-=h,L.life<=0)continue;const J=A>0?(L.y-I)/A:1;L.y-=C*(.7+.3*J)*h,!(L.y<I-14)&&(o.labels[W++]=L)}o.labels.length=W;const k=e.globalAlpha;e.save(),e.font='600 13px "SF Mono", Menlo, monospace',e.textAlign="left",e.textBaseline="middle",e.globalAlpha=k;const b=`rgb(${p[0]},${p[1]},${p[2]})`;for(let d=0;d<o.labels.length;d++){const L=o.labels[d],J=L.life/L.maxLife,Z=Math.min((1-J)*10,1),z=(L.y-I)/s,oe=z<.45?z/.45:1,K=L.intensity*Z*oe,qe=L.green?Cr:Wr,Ye=Fr(qe,p,1-K);e.strokeStyle=b,e.lineWidth=4,e.lineJoin="round",e.strokeText(L.text,P,L.y),e.fillStyle=Ye,e.fillText(L.text,P,L.y)}e.restore()}function Vr(e){return e>=10?`$${Math.round(e)}`:e>=1?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function Or(){return{particles:[],cooldown:0,burstCount:0}}var Hr=80,Xr=1,Gr=400,Nr=.08,Yr=3;function Ur(e,r,n,t,l,o,i,c){if(e.cooldown=Math.max(0,e.cooldown-i),r==="flat"||e.cooldown>0)return 0;if(l<Nr)return e.burstCount=0,0;if(r==="down"&&(c==null?void 0:c.downMomentum)!==!0||e.burstCount>=Yr)return 0;e.cooldown=Gr;const a=(c==null?void 0:c.scale)??1,s=r==="up",h=Math.min(l*5,1),f=h>.6?1:[1,.6,.35][e.burstCount]??.35;e.burstCount++;const g=Math.round((12+h*20)*a*f),M=1+h*.8;for(let m=0;m<g&&e.particles.length<Hr;m++){const v=s?-Math.PI/2:Math.PI/2,w=Math.PI*1.2,R=v+(Math.random()-.5)*w,y=(60+Math.random()*100)*M;e.particles.push({x:n+(Math.random()-.5)*24,y:t+(Math.random()-.5)*8,vx:Math.cos(R)*y,vy:Math.sin(R)*y,life:1,size:(1+Math.random()*1.2)*a*f,color:o})}return f}function jr(e,r,n){if(r.particles.length===0)return;const t=n/1e3;e.save();let l=0;for(let o=0;o<r.particles.length;o++){const i=r.particles[o];i.life-=t/Xr,!(i.life<=0)&&(i.x+=i.vx*t,i.y+=i.vy*t,i.vx*=.95,i.vy*=.95,e.globalAlpha=i.life*.55,e.fillStyle=i.color,e.beginPath(),e.arc(i.x,i.y,i.size*(.5+i.life*.5),0,Math.PI*2),e.fill(),r.particles[l++]=i)}r.particles.length=l,e.restore()}var gn="#22c55e",mn="#ef4444",Qt=[34,197,94],Wt=[239,68,68];function ur(e){const r=Math.round(Wt[0]+(Qt[0]-Wt[0])*e),n=Math.round(Wt[1]+(Qt[1]-Wt[1])*e),t=Math.round(Wt[2]+(Qt[2]-Wt[2])*e);return`rgb(${r},${n},${t})`}function Xn(e){const r=e.match(/^#([0-9a-f]{6})$/i);if(r){const t=r[1];return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}const n=e.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return n?[+n[1],+n[2],+n[3]]:[128,128,128]}function zr(e,r,n){if(n<=0)return e;if(n>=1)return r;const[t,l,o]=Xn(e),[i,c,a]=Xn(r),s=Math.round(t+(i-t)*n),h=Math.round(l+(c-l)*n),f=Math.round(o+(a-o)*n);return`rgb(${s},${h},${f})`}function qr(e,r){const n=e.chartW/(e.rightEdge-e.leftEdge),t=r*n,l=Math.max(1,t*.7),o=Math.max(.8,Math.min(2,l*.15)),i=l>6?1.5:0;return{bodyW:l,wickW:o,radius:i}}function Gn(e,r,n,t,l,o){if(o<=0||l<o*2){e.rect(r,n,t,l);return}e.moveTo(r+o,n),e.lineTo(r+t-o,n),e.arcTo(r+t,n,r+t,n+o,o),e.lineTo(r+t,n+l-o),e.arcTo(r+t,n+l,r+t-o,n+l,o),e.lineTo(r+o,n+l),e.arcTo(r,n+l,r,n+l-o,o),e.lineTo(r,n+o),e.arcTo(r,n,r+o,n,o),e.closePath()}function xt(e,r,n,t,l,o,i,c,a=1,s=-1,h,f=0){if(n.length===0)return;const{toX:g,toY:M}=r,{bodyW:m,wickW:v,radius:w}=qr(r,t),R=m/2,y=r.pad.left,T=r.pad.left+r.chartW,C=.12+Math.sin(o*.004)*.08;for(const P of n){const E=g(P.time+t/2);if(E+R<y||E-R>T)continue;const I=P.close>=P.open,p=P.time===l;let A=p&&s>=0?ur(s):I?gn:mn;h&&f>.01&&(A=zr(A,h,f));let W=p?a:1;if(c>.01&&i>0){const z=E-i;if(z>0){const oe=m*1.5,K=Math.min(z/oe,1);W*=1-c*.5*K}}const k=e.globalAlpha;e.globalAlpha=k*W;const b=M(Math.max(P.open,P.close)),d=M(Math.min(P.open,P.close)),L=Math.max(1,d-b),J=M(P.high),Z=M(P.low);e.lineCap="round",e.strokeStyle=A,b-J>.5&&(e.beginPath(),e.moveTo(E,b),e.lineTo(E,J),e.lineWidth=v,e.stroke()),Z-d>.5&&(e.beginPath(),e.moveTo(E,d),e.lineTo(E,Z),e.lineWidth=v,e.stroke()),e.fillStyle=A,e.beginPath(),Gn(e,E-R,b,m,L,w),e.fill(),p&&(e.save(),e.globalAlpha=k*W*C,e.shadowColor=A,e.shadowBlur=8,e.fillStyle=A,e.beginPath(),Gn(e,E-R,b,m,L,w),e.fill(),e.restore()),e.globalAlpha=k}}function Jr(e,r,n,t,l,o=-1){const i=r.toY(t.close);if(i<r.pad.top||i>r.h-r.pad.bottom)return;const c=t.close>=t.open,a=o>=0?ur(o):c?gn:mn,s=e.globalAlpha;e.save(),e.setLineDash([4,4]),e.strokeStyle=a,e.lineWidth=1,e.globalAlpha=s*(1-l*.3)*.4,e.beginPath(),e.moveTo(r.pad.left,i),e.lineTo(r.w-r.pad.right,i),e.stroke(),e.setLineDash([]),e.restore()}function Zr(e,r,n,t,l,o,i,c,a){if(a<.01)return;const{h:s,pad:h}=r;if(e.save(),e.globalAlpha=a*.5,e.strokeStyle=n.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(t,h.top),e.lineTo(t,s-h.bottom),e.stroke(),e.restore(),a<.1||r.w<200)return;const g=l.close>=l.open?gn:mn,M=i(l.close),m=c(o);e.save(),e.globalAlpha=a,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";let v;if(r.w>=400){const I=i(l.open),p=i(l.high),A=i(l.low);v=[{text:"O ",color:n.gridLabel},{text:I,color:g},{text:" H ",color:n.gridLabel},{text:p,color:g},{text:" L ",color:n.gridLabel},{text:A,color:g},{text:" C ",color:n.gridLabel},{text:M,color:g},{text:" · ",color:n.gridLabel},{text:m,color:n.gridLabel}]}else v=[{text:"C ",color:n.gridLabel},{text:M,color:g},{text:" · ",color:n.gridLabel},{text:m,color:n.gridLabel}];let w=0;const R=[];for(const I of v){const p=e.measureText(I.text).width;R.push(p),w+=p}let y=t-w/2;const T=h.left+4,C=r.w-h.right-w;y<T&&(y=T),y>C&&(y=C);const P=h.top+24;e.strokeStyle=n.tooltipBg,e.lineWidth=3,e.lineJoin="round";let E=y;for(let I=0;I<v.length;I++)e.strokeText(v[I].text,E,P),E+=R[I];E=y;for(let I=0;I<v.length;I++)e.fillStyle=v[I].color,e.fillText(v[I].text,E,P),E+=R[I];e.restore()}function Kr(e,r,n,t,l,o,i,c,a){if(a<.01)return;const{h:s,pad:h}=r,f=r.toY(l);if(e.save(),e.globalAlpha=a*.5,e.strokeStyle=n.crosshairLine,e.lineWidth=1,e.beginPath(),e.moveTo(t,h.top),e.lineTo(t,s-h.bottom),e.stroke(),e.globalAlpha=a*.3,e.beginPath(),e.moveTo(h.left,f),e.lineTo(r.w-h.right,f),e.stroke(),e.restore(),a<.1||r.w<200)return;const g=i(l),M=c(o);e.save(),e.globalAlpha=a,e.font='400 13px "SF Mono", Menlo, monospace',e.textAlign="left";const m=[{text:g,color:n.line},{text:" · ",color:n.gridLabel},{text:M,color:n.gridLabel}];let v=0;const w=[];for(const E of m){const I=e.measureText(E.text).width;w.push(I),v+=I}let R=t-v/2;const y=h.left+4,T=r.w-h.right-v;R<y&&(R=y),R>T&&(R=T);const C=h.top+24;e.strokeStyle=n.tooltipBg,e.lineWidth=3,e.lineJoin="round";let P=R;for(let E=0;E<m.length;E++)e.strokeText(m[E].text,P,C),P+=w[E];P=R;for(let E=0;E<m.length;E++)e.fillStyle=m[E].color,e.fillText(m[E].text,P,C),P+=w[E];e.restore()}function Ot(e,r,n,t,l,o=1,i=0,c=!1,a){const s=r-t.left-t.right,h=n-t.top-t.bottom,f=t.top+h/2,g=t.left+s/2,M=a??"No data to display",m=h*sn;e.save(),e.font="400 12px system-ui, -apple-system, sans-serif";const w=e.measureText(M).width/2+20,R=30;if(!c){const E=i*cn,I=fn(i),p=32,A=[];for(let W=0;W<=p;W++){const k=W/p,b=t.left+k*s,d=un(k,f,m,E);A.push([b,d])}e.beginPath(),e.moveTo(A[0][0],A[0][1]),Zt(e,A),e.strokeStyle=l.gridLabel,e.lineWidth=l.lineWidth,e.globalAlpha=I*o,e.lineCap="round",e.lineJoin="round",e.stroke()}e.save(),e.globalCompositeOperation="destination-out";const y=g-w-R,T=g+w+R,C=e.createLinearGradient(y,0,T,0);C.addColorStop(0,"rgba(0,0,0,0)"),C.addColorStop(R/(T-y),"rgba(0,0,0,1)"),C.addColorStop(1-R/(T-y),"rgba(0,0,0,1)"),C.addColorStop(1,"rgba(0,0,0,0)"),e.fillStyle=C,e.globalAlpha=o;const P=m*2+l.lineWidth+6;e.fillRect(y,f-P/2,T-y,P),e.restore(),e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.35*o,e.fillStyle=l.gridLabel,e.fillText(M,g,f),e.restore()}var Qr=.002,Nn=.2,ut=40,ct=5;function xr(){return{amplitude:0}}function eo(e,r,n,t){const l=t.shakeState;let o=0,i=0;if(l&&l.amplitude>Nn&&(o=(Math.random()-.5)*2*l.amplitude,i=(Math.random()-.5)*2*l.amplitude,e.save(),e.translate(o,i)),l){const m=Math.pow(Qr,t.dt/1e3);l.amplitude*=m,l.amplitude<Nn&&(l.amplitude=0)}const c=t.chartReveal,a=t.pauseProgress,s=(m,v)=>{const w=Math.max(0,Math.min(1,(c-m)/(v-m)));return w*w*(3-2*w)};if(t.referenceLine&&c>.01&&(e.save(),c<1&&(e.globalAlpha=c),cr(e,r,n,t.referenceLine),e.restore()),t.showGrid){const m=c<1?s(.15,.7):1;m>.01&&(e.save(),m<1&&(e.globalAlpha=m),an(e,r,n,t.formatValue,t.gridState,t.dt),e.restore())}t.orderbookData&&t.orderbookState&&c>.01&&(e.save(),c<1&&(e.globalAlpha=c),$r(e,r,n,t.orderbookData,t.dt,t.orderbookState,t.swingMagnitude),e.restore());const h=t.scrubAmount>.05?t.hoverX:null,f=hn(e,r,n,t.visible,t.smoothValue,t.now,t.showFill,h,t.scrubAmount,c,t.now_ms);{const m=c<1?s(.15,.7):1;m>.01&&(e.save(),m<1&&(e.globalAlpha=m),dn(e,r,n,t.windowSecs,t.targetWindowSecs,t.formatTime,t.timeAxisState,t.dt),e.restore())}if(f&&f.length>0){const m=f[f.length-1];let v=t.scrubAmount;if(t.hoverX!==null&&v>0){const y=m[0]-t.hoverX,T=Math.min(80,r.chartW*.3);v=y<ct?0:y>=T?t.scrubAmount:(y-ct)/(T-ct)*t.scrubAmount}const w=c<.3?0:(c-.3)/.7,R=t.showPulse&&c>.6&&a<.5;if(w>.01&&(e.save(),w<1&&(e.globalAlpha=w),sr(e,m[0],m[1],n,R,v,t.now_ms),e.restore()),t.showMomentum){const T=(c<1?s(.6,1):1)*(1-a);T>.01&&(e.save(),T<1&&(e.globalAlpha=T),Er(e,m[0],m[1],t.momentum,n,t.arrowState,t.dt,t.now_ms),e.restore())}if(t.particleState&&c>.9){const y=Ur(t.particleState,t.momentum,m[0],m[1],t.swingMagnitude,n.line,t.dt,t.particleOptions);y>0&&l&&(l.amplitude=(3+t.swingMagnitude*4)*y),jr(e,t.particleState,t.dt)}}const g=ut;e.save(),e.globalCompositeOperation="destination-out";const M=e.createLinearGradient(r.pad.left,0,r.pad.left+g,0);if(M.addColorStop(0,"rgba(0, 0, 0, 1)"),M.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=M,e.fillRect(0,0,r.pad.left+g,r.h),e.restore(),t.hoverX!==null&&t.hoverValue!==null&&t.hoverTime!==null&&f&&f.length>0){const m=f[f.length-1],v=m[0]-t.hoverX,w=Math.min(80,r.chartW*.3),R=v<ct?0:v>=w?t.scrubAmount:(v-ct)/(w-ct)*t.scrubAmount;R>.01&&Lr(e,r,n,t.hoverX,t.hoverValue,t.hoverTime,t.formatValue,t.formatTime,R,t.tooltipY,m[0],t.tooltipOutline)}l&&(o!==0||i!==0)&&e.restore()}function to(e,r,n){const t=n.primaryPalette,l=n.chartReveal,o=(s,h)=>{const f=Math.max(0,Math.min(1,(l-s)/(h-s)));return f*f*(3-2*f)};if(n.referenceLine&&l>.01&&(e.save(),l<1&&(e.globalAlpha=l),cr(e,r,t,n.referenceLine),e.restore()),n.showGrid){const s=l<1?o(.15,.7):1;s>.01&&(e.save(),s<1&&(e.globalAlpha=s),an(e,r,t,n.formatValue,n.gridState,n.dt),e.restore())}const i=n.scrubAmount>.05?n.hoverX:null,c=[];for(let s=0;s<n.series.length;s++){const h=n.series[s],f=h.alpha??1,M=(s>0&&l<1?Math.min(1,l*2):1)*f;if(M<.01)continue;e.save(),M<1&&(e.globalAlpha=M);const m=hn(e,r,h.palette,h.visible,h.smoothValue,n.now,!1,i,n.scrubAmount,l,n.now_ms);e.restore(),m&&m.length>0&&c.push({pts:m,palette:h.palette,label:h.label,alpha:f})}{const s=l<1?o(.15,.7):1;s>.01&&(e.save(),s<1&&(e.globalAlpha=s),dn(e,r,t,n.windowSecs,n.targetWindowSecs,n.formatTime,n.timeAxisState,n.dt),e.restore())}if(l>.3&&c.length>0){const s=(l-.3)/.7,h=n.showPulse&&l>.6&&n.pauseProgress<.5;for(const f of c){if(f.alpha<.01)continue;const g=f.pts[f.pts.length-1];e.save(),e.globalAlpha=s*f.alpha,h&&f.alpha>.5?Ar(e,g[0],g[1],f.palette.line,!0,n.now_ms,3):Tr(e,g[0],g[1],f.palette.line,3),f.label&&(e.font='600 10px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',e.textAlign="left",e.fillStyle=f.palette.line,e.fillText(f.label,g[0]+6,g[1]+3.5)),e.restore()}}e.save(),e.globalCompositeOperation="destination-out";const a=e.createLinearGradient(r.pad.left,0,r.pad.left+ut,0);if(a.addColorStop(0,"rgba(0, 0, 0, 1)"),a.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=a,e.fillRect(0,0,r.pad.left+ut,r.h),e.restore(),n.hoverX!==null&&n.hoverTime!==null&&n.hoverEntries.length>0&&c.length>0&&n.scrubAmount>.01){let s=0;for(const M of c){if(M.alpha<.01)continue;const m=M.pts[M.pts.length-1][0];m>s&&(s=m)}const h=s-n.hoverX,f=Math.min(80,r.chartW*.3),g=h<ct?0:h>=f?n.scrubAmount:(h-ct)/(f-ct)*n.scrubAmount;g>.01&&yr(e,r,t,n.hoverX,n.hoverTime,n.hoverEntries,n.formatValue,n.formatTime,g,n.tooltipY,n.tooltipOutline,s)}}function no(e,r,n,t){var E,I;const{w:l,h:o,pad:i,chartW:c,chartH:a}=r,s=t.chartReveal,h=t.lineModeProg>=.99,f=h?1-s:(1-s)*(1-s)*(1-s),g=Math.max(t.lineModeProg,f),M=g>.001?t.lineModeProg/g:1,m=(p,A)=>{const W=Math.max(0,Math.min(1,(s-p)/(A-p)));return W*W*(3-2*W)},v=m(.25,.6);t.showGrid&&v>.01&&(e.save(),v<1&&(e.globalAlpha=v),an(e,r,n,t.formatValue,t.gridState,t.dt),e.restore());let w;if(g>.01&&t.lineVisible.length>=2){const p=t.scrubAmount>.05?t.hoverX:null;e.save(),e.globalAlpha=g,w=hn(e,r,n,t.lineVisible,t.lineSmoothValue,t.now,t.lineModeProg>.01,p,t.scrubAmount,t.chartReveal,t.now_ms,M,!h,t.lineModeProg),e.restore()}const R=m(.4,.8),y=t.closePriceCandle??t.liveCandle;if(y&&R>.01&&(g<.99&&(e.save(),e.globalAlpha=R*(1-g),Jr(e,r,n,y,t.scrubAmount,t.liveBullBlend),e.restore()),g>.01&&!h)){const p=r.toY(y.close);p>=i.top&&p<=o-i.bottom&&(e.save(),e.setLineDash([4,4]),e.strokeStyle=n.dashLine,e.lineWidth=1,e.globalAlpha=R*g*(1-t.scrubAmount*.2),e.beginPath(),e.moveTo(i.left,p),e.lineTo(l-i.right,p),e.stroke(),e.setLineDash([]),e.restore())}const T=t.chartReveal*(1-g);if(T>.01){const p=s*s*(3-2*s),A=d=>p>=.99?d:{time:d.time,open:d.close+(d.open-d.close)*p,high:d.close+(d.high-d.close)*p,low:d.close+(d.low-d.close)*p,close:d.close},W=p<.99?t.candles.map(A):t.candles,k=p<.99&&t.oldCandles.length>0?t.oldCandles.map(A):t.oldCandles;e.save(),e.beginPath(),e.rect(i.left-1,i.top,c+2,a),e.clip();const b=g>.01?n.line:void 0;t.morphT>=0&&k.length>0?(e.globalAlpha=(1-t.morphT)*T,xt(e,r,k,t.oldWidth,-1,t.now_ms,t.hoverX??0,t.scrubAmount,1,-1,b,g),e.globalAlpha=t.morphT*T,xt(e,r,W,t.displayCandleWidth,((E=t.liveCandle)==null?void 0:E.time)??-1,t.now_ms,t.hoverX??0,t.scrubAmount,t.liveBirthAlpha,t.liveBullBlend,b,g),e.globalAlpha=1):(T<1&&(e.globalAlpha=T),xt(e,r,W,t.displayCandleWidth,((I=t.liveCandle)==null?void 0:I.time)??-1,t.now_ms,t.hoverX??0,t.scrubAmount,t.liveBirthAlpha,t.liveBullBlend,b,g)),e.restore()}if(g>.5&&w&&w.length>0&&s>.3){const p=w[w.length-1],A=(g-.5)*2*((s-.3)/.7),W=g>.8&&s>.6;A>.01&&(e.save(),e.globalAlpha=A,sr(e,p[0],p[1],n,W,t.scrubAmount,t.now_ms),e.restore())}const C=m(.25,.6);C>.01&&(e.save(),C<1&&(e.globalAlpha=C),dn(e,r,n,t.targetWindowSecs,t.targetWindowSecs,t.formatTime,t.timeAxisState,t.dt),e.restore()),e.save(),e.globalCompositeOperation="destination-out";const P=e.createLinearGradient(i.left,0,i.left+ut,0);if(P.addColorStop(0,"rgba(0, 0, 0, 1)"),P.addColorStop(1,"rgba(0, 0, 0, 0)"),e.fillStyle=P,e.fillRect(0,0,i.left+ut,o),e.restore(),t.showEmptyOverlay){const p=1-t.chartReveal;if(p>.01){const A=(1-t.loadingAlpha)*p;A>.01&&Ot(e,l,o,i,n,A,t.now_ms,!0,t.emptyText)}}t.chartReveal>.7&&t.hoveredCandle&&t.hoverX!==null&&t.scrubAmount>.01&&(t.lineModeProg>.5?Kr(e,r,n,t.hoverX,t.hoveredCandle.close,t.hoverTime??0,t.formatValue,t.formatTime,t.scrubAmount):Zr(e,r,n,t.hoverX,t.hoveredCandle,t.hoverTime??0,t.formatValue,t.formatTime,t.scrubAmount))}function Yn(e,r,n,t,l,o,i=1,c){const a=r-t.left-t.right,s=n-t.top-t.bottom,h=t.top+s/2,f=t.left,g=s*sn,M=o*cn,m=fn(o),v=32,w=[];for(let R=0;R<=v;R++){const y=R/v,T=f+y*a,C=un(y,h,g,M);w.push([T,C])}e.save(),e.beginPath(),e.moveTo(w[0][0],w[0][1]),Zt(e,w),e.strokeStyle=c??l.line,e.lineWidth=l.lineWidth,e.globalAlpha=m*i,e.lineCap="round",e.lineJoin="round",e.stroke(),e.restore()}function ro(e,r,n,t){const l=r/2;return[`M${n},0`,`L${n+e},0`,`L${n+e},${r}`,`L${n},${r}`,`L0,${l}`,"Z"].join(" ")}function oo(e,r){return["M0,0",`L${e},0`,`L${e},${r}`,`L0,${r}`,"Z"].join(" ")}var zt=10,en=3,Un=5,jn=16,zn="http://www.w3.org/2000/svg",lo=50,fr=.12,io=.15,ao=.35,so=.5,co=.12,hr=750,qn=.05,Jn=.015,Zn=.001,dr=.2,tn=[34,197,94],Dt=[239,68,68],uo=.14,fo=.09,ho=.12,go=.08,mo=.22,bo=.14,vo=.1,qt=.25,po=300,Mo=500,So=.25,wo=350,Kn=.08,Qn=.2,xn=.001,Ro=.15,Ao=.2,To=.015;function er(e,r,n,t,l,o){const i=Math.abs(e-r),c=t-n||1,a=Math.min(i/c,1);return o?1:l+(1-a)*dr}function tr(e,r,n,t,l,o,i,c,a,s,h){var M;if(r.to!==e.windowSecs){r.from=n,r.to=e.windowSecs,r.startMs=i,r.rangeFromMin=t,r.rangeFromMax=l;const m=c+e.windowSecs*h,v=m-e.windowSecs,w=[];for(const R of a)R.time>=v-2&&R.time<=m&&w.push(R);if(w.length>0){const R=Jt(w,s,(M=e.referenceLine)==null?void 0:M.value,e.exaggerate);r.rangeToMin=R.min,r.rangeToMax=R.max}}let f=0,g;if(o||r.startMs===0)g=e.windowSecs;else{const m=i-r.startMs,w=Math.min(m/hr,1),R=(1-Math.cos(w*Math.PI))/2;f=R;const y=Math.log(r.from),T=Math.log(r.to);g=Math.exp(y+(T-y)*R),w>=1&&(g=e.windowSecs,r.startMs=0,f=0)}return{windowSecs:g,windowTransProgress:f}}function nr(e,r,n,t,l,o,i,c,a,s,h,f){if(!r)return{minVal:e.min,maxVal:e.max,valRange:e.max-e.min||.001,targetMin:e.min,targetMax:e.max,displayMin:e.min,displayMax:e.max,rangeInited:!0};if(i)l=a.rangeFromMin+(a.rangeToMin-a.rangeFromMin)*c,o=a.rangeFromMax+(a.rangeToMax-a.rangeFromMax)*c,n=e.min,t=e.max;else{const g=o-l;n=e.min,t=e.max,l=te(l,n,s,f),o=te(o,t,s,f);const M=.5*g/h||.001;Math.abs(l-n)<M&&(l=n),Math.abs(o-t)<M&&(o=t)}return{minVal:l,maxVal:o,valRange:o-l||.001,targetMin:n,targetMax:t,displayMin:l,displayMax:o,rangeInited:!0}}function Eo(e,r,n,t,l,o,i,c,a,s,h,f,g,M){var E;let m=null,v=null,w=null,R=!1;if(e!==null&&e>=r.left&&e<=n-r.right){const I=t.toX(l),p=Math.min(e,I),A=h+(p-r.left)/g*(f-h),W=lr(o,A);W!==null&&(m=W,v=A,w=p,R=!0,c={x:p,value:W,time:A},(E=a.onHover)==null||E.call(a,{time:A,value:W,x:p,y:t.toY(W)}))}const y=R?1:0;s?i=y:(i+=(y-i)*fr,i<.01&&(i=0),i>.99&&(i=1));let T=w,C=m,P=v;return!R&&i>0&&c&&(T=c.x,C=c.value,P=c.time),{hoverX:T,hoverValue:C,hoverTime:P,scrubAmount:i,isActiveHover:R,lastHover:c}}function rr(e,r,n,t,l,o,i,c,a,s,h,f=1){if(!r.showBadge||f<.25)return e.container.style.display="none",o;e.container.style.display="";const g=f<.5?(f-.25)/.25:1;e.container.style.opacity=g<1?String(g):"";const{w:M,h:m,pad:v}=t,w=r.formatValue(n);e.text.textContent=w,e.text.style.font=r.palette.labelFont,e.text.style.lineHeight=`${jn}px`;const R=r.badgeTail?Un:0;e.text.style.padding=`${en}px ${zt}px ${en}px ${R+zt}px`,s.font=r.palette.labelFont;const y=w.replace(/[0-9]/g,"8"),T=s.measureText(y).width;e.targetW=T,e.displayW===0&&(e.displayW=T),e.displayW=te(e.displayW,e.targetW,io,h),Math.abs(e.displayW-e.targetW)<.3&&(e.displayW=e.targetW);const P=e.displayW+zt*2,E=jn+en*2,I=R+P;e.svg.setAttribute("width",String(Math.ceil(I))),e.svg.setAttribute("height",String(E)),e.svg.setAttribute("viewBox",`0 0 ${I} ${E}`),e.path.setAttribute("d",r.badgeTail?ro(P,E,Un):oo(P,E));const p=v.top+t.chartH/2,A=Math.max(v.top,Math.min(m-v.bottom,t.toY(n))),W=f<1?p+(A-p)*f:A;o===null||a?o=W:o=te(o,W,c?so:ao,h);const k=M-v.right-zt-R,b=o-E/2;if(e.container.style.transform=`translate3d(${k}px, ${b}px, 0)`,r.badgeVariant==="minimal")e.path.setAttribute("fill",r.palette.badgeOuterBg),e.text.style.color=r.palette.tooltipText,e.container.style.filter=`drop-shadow(0 1px 4px ${r.palette.badgeOuterShadow})`;else{e.container.style.filter="",e.text.style.color="#fff";const d=i;let L;if(!r.showMomentum)L=r.palette.line;else{const J=l==="up"?1:l==="down"?0:d.green;d.green=a?J:te(d.green,J,co,h),d.green>.99&&(d.green=1),d.green<.01&&(d.green=0);const Z=d.green,z=Math.round(Dt[0]+(tn[0]-Dt[0])*Z),oe=Math.round(Dt[1]+(tn[1]-Dt[1])*Z),K=Math.round(Dt[2]+(tn[2]-Dt[2])*Z);L=`rgb(${z},${oe},${K})`}e.path.setAttribute("fill",L)}return o}function ln(e){let r=1/0,n=-1/0;for(const i of e)i.low<r&&(r=i.low),i.high>n&&(n=i.high);if(!isFinite(r)||!isFinite(n))return{min:99,max:101};const t=n-r,l=t*.12,o=t*.1||.4;if(t<o){const i=(r+n)/2;return{min:i-o/2,max:i+o/2}}return{min:r-l,max:n+l}}function or(e,r,n,t){const l=t.leftEdge+(r-t.pad.left)/t.chartW*(t.rightEdge-t.leftEdge);let o=0,i=e.length-1;for(;o<=i;){const c=o+i>>1,a=e[c];if(l<a.time)i=c-1;else if(l>=a.time+n)o=c+1;else return a}return null}function Lo(e,r,n,t,l,o,i,c,a){if(!r)return{minVal:e.min,maxVal:e.max,valRange:e.max-e.min||.001,displayMin:e.min,displayMax:e.max,rangeInited:!0};if(l)n=i.rangeFromMin+(i.rangeToMin-i.rangeFromMin)*o,t=i.rangeFromMax+(i.rangeToMax-i.rangeFromMax)*o;else{const s=t-n||1,h=Math.abs(n-e.min),f=Math.abs(t-e.max),g=Math.min((h+f)/s,1),M=Ro+(1-g)*Ao;n=te(n,e.min,M,a),t=te(t,e.max,M,a);const m=.5*s/c||.001;Math.abs(n-e.min)<m&&(n=e.min),Math.abs(t-e.max)<m&&(t=e.max)}return{minVal:n,maxVal:t,valRange:t-n||.001,displayMin:n,displayMax:t,rangeInited:!0}}function yo(e,r,n,t,l,o,i,c,a,s,h){if(r.to!==e){r.from=n,r.to=e,r.startMs=o,r.rangeFromMin=t,r.rangeFromMax=l;const M=i+e*h,m=M-e,v=[];for(const w of c)w.time+s>=m&&w.time<=M&&v.push(w);if(a&&a.time+s>=m&&a.time<=M&&v.push(a),v.length>0){const w=ln(v);r.rangeToMin=w.min,r.rangeToMax=w.max}}let f=0,g;if(r.startMs===0)g=e;else{const M=o-r.startMs,m=Math.min(M/hr,1),v=(1-Math.cos(m*Math.PI))/2;f=v;const w=Math.log(r.from),R=Math.log(r.to);g=Math.exp(w+(R-w)*v),m>=1&&(g=e,r.startMs=0,f=0)}return{windowSecs:g,windowTransProgress:f}}function Po(e,r,n){const t=S.useRef(n);t.current=n;const l=S.useRef(n.value),o=S.useRef(new Map),i=S.useRef(new Map),c=S.useRef(0),a=S.useRef(0),s=S.useRef(0),h=S.useRef(0),f=S.useRef(!1),g=S.useRef(n.windowSecs),M=S.useRef({from:n.windowSecs,to:n.windowSecs,startMs:0,rangeFromMin:0,rangeFromMax:0,rangeToMin:0,rangeToMax:0}),m=S.useRef({up:0,down:0}),v=S.useRef({interval:0,labels:new Map}),w=S.useRef({labels:new Map}),R=S.useRef(Dr()),y=S.useRef(Or()),T=S.useRef(xr()),C=S.useRef({green:1}),P=S.useRef(null),E=S.useRef(!1),I=S.useRef({w:0,h:0}),p=S.useRef(null),A=S.useRef(0),W=S.useRef(0),k=S.useRef(null),b=S.useRef(null),d=S.useRef(0),L=S.useRef(null),J=S.useRef([]),Z=S.useRef(0),z=S.useRef(0),oe=S.useRef(0),K=S.useRef([]),qe=S.useRef([]),Ye=S.useRef(0),ue=S.useRef(null),Ce=S.useRef(null),pe=S.useRef(n.loading?1:0),We=S.useRef(null),Ee=S.useRef(1),Le=S.useRef(.5),Ue=S.useRef(0),Mt=S.useRef(!1),ft=S.useRef(0),St=S.useRef(!1),ht=S.useRef(0),Ht=S.useRef({startMs:0,from:0,to:0}),_t=S.useRef(0),Bt=S.useRef({startMs:0,from:0,to:0}),xe=S.useRef(0),Lt=S.useRef(!1),Xt=S.useRef({fromWidth:n.candleWidth??1,toWidth:n.candleWidth??1,startMs:0,rangeFromMin:0,rangeFromMax:0,rangeToMin:0,rangeToMax:0,oldCandles:[],oldWidth:n.candleWidth??1}),it=S.useRef({candles:[],width:n.candleWidth??1}),at=S.useRef(null),Ft=S.useRef(null),yt=S.useRef(null),$t=S.useRef(null),wt=S.useRef([]),Gt=S.useRef(null),je=S.useRef([]),et=S.useRef(void 0);S.useEffect(()=>{const $=r.current;if(!$)return;const O=document.createElement("div");O.style.cssText="position:absolute;top:0;left:0;pointer-events:none;will-change:transform;display:none;z-index:1;";const U=document.createElementNS(zn,"svg");U.style.cssText="position:absolute;top:0;left:0;";const u=document.createElementNS(zn,"path");U.appendChild(u);const ye=document.createElement("span");return ye.style.cssText="position:relative;display:block;color:#fff;white-space:nowrap;",O.appendChild(U),O.appendChild(ye),$.appendChild(O),k.current={container:O,svg:U,path:u,text:ye,displayW:0,targetW:0},()=>{$.removeChild(O),k.current=null}},[r]),S.useEffect(()=>{const $=r.current;if(!$)return;const O=new ResizeObserver(u=>{const ye=u[0];if(!ye)return;const{width:Q,height:x}=ye.contentRect;I.current={w:Q,h:x}});O.observe($);const U=$.getBoundingClientRect();return I.current={w:U.width,h:U.height},()=>O.disconnect()},[r]),S.useEffect(()=>{const $=r.current;if(!$)return;const O=x=>{if(!t.current.scrub)return;const Me=$.getBoundingClientRect();b.current=x.clientX-Me.left},U=()=>{var x,Me;b.current=null,(Me=(x=t.current).onHover)==null||Me.call(x,null)},u=x=>{if(!t.current.scrub||x.touches.length!==1)return;const Me=$.getBoundingClientRect();b.current=x.touches[0].clientX-Me.left},ye=x=>{if(!t.current.scrub||x.touches.length!==1)return;x.preventDefault();const Me=$.getBoundingClientRect();b.current=x.touches[0].clientX-Me.left},Q=()=>{var x,Me;b.current=null,(Me=(x=t.current).onHover)==null||Me.call(x,null)};return $.addEventListener("mousemove",O),$.addEventListener("mouseleave",U),$.addEventListener("touchstart",u,{passive:!0}),$.addEventListener("touchmove",ye,{passive:!1}),$.addEventListener("touchend",Q),$.addEventListener("touchcancel",Q),()=>{$.removeEventListener("mousemove",O),$.removeEventListener("mouseleave",U),$.removeEventListener("touchstart",u),$.removeEventListener("touchmove",ye),$.removeEventListener("touchend",Q),$.removeEventListener("touchcancel",Q)}},[r]),S.useEffect(()=>{const $=window.matchMedia("(prefers-reduced-motion: reduce)");E.current=$.matches;const O=U=>{E.current=U.matches};return $.addEventListener("change",O),()=>$.removeEventListener("change",O)},[]);const Pt=S.useRef(!0);S.useEffect(()=>{const $=()=>{!document.hidden&&Pt.current&&!A.current&&(A.current=requestAnimationFrame(Ve))};return document.addEventListener("visibilitychange",$),()=>document.removeEventListener("visibilitychange",$)},[]),S.useEffect(()=>{const $=r.current;if(!$)return;const O=new IntersectionObserver(U=>{const u=U[0];u&&(Pt.current=u.isIntersecting,u.isIntersecting&&!document.hidden&&!A.current&&(A.current=requestAnimationFrame(Ve)))},{rootMargin:"200px"});return O.observe($),()=>O.disconnect()},[r]);const Ve=S.useCallback(()=>{var pn,Mn,Sn,wn,Rn,An,Tn,En,Ln,yn,Pn,kn,Cn,Wn,Dn,In;if(document.hidden||!Pt.current){A.current=0;return}const $=e.current,{w:O,h:U}=I.current;if(!$||O===0||U===0){A.current=requestAnimationFrame(Ve);return}const u=t.current,ye=br(),Q=performance.now(),x=W.current?Math.min(Q-W.current,lo):16.67;W.current=Q;const Me=Math.round(O*ye),Nt=Math.round(U*ye);($.width!==Me||$.height!==Nt)&&($.width=Me,$.height=Nt,$.style.width=`${O}px`,$.style.height=`${U}px`);let Y=p.current;if((!Y||Y.canvas!==$)&&(Y=$.getContext("2d"),p.current=Y),!Y){A.current=requestAnimationFrame(Ve);return}vr(Y,ye);const ge=E.current,tt=u.mode==="candle";if(tt)u.paused&&at.current===null&&(((pn=u.candles)==null?void 0:pn.length)??0)>0&&(at.current=u.candles.slice(),Ft.current=u.liveCandle??null,yt.current=((Mn=u.lineData)==null?void 0:Mn.slice())??null,$t.current=u.lineValue??null),u.paused||(at.current=null,Ft.current=null,yt.current=null,$t.current=null);else if(u.isMultiSeries&&u.multiSeries){if(u.paused&&Ce.current===null){const V=new Map;for(const ae of u.multiSeries)ae.data.length>=2&&V.set(ae.id,{data:ae.data.slice(),value:ae.value});V.size>0&&(Ce.current=V)}u.paused||(Ce.current=null)}else u.paused&&ue.current===null&&u.data.length>=2&&(ue.current=u.data.slice()),u.paused||(ue.current=null);const j=tt?[]:ue.current??u.data,kt=tt?at.current??u.candles??[]:[],nt=u.isMultiSeries&&u.multiSeries?u.multiSeries.some(V=>V.data.length>=2):!1,me=tt?kt.length>=2:nt||j.length>=2,G=u.padding,_=U-G.top-G.bottom,we=u.paused?1:0;z.current=ge?we:te(z.current,we,ho,x),z.current<.005&&(z.current=0),z.current>.995&&(z.current=1);const ee=z.current,ne=x*(1-ee),bn=x/1e3;if(oe.current+=bn*ee,!u.paused&&oe.current>.001){const V=oe.current>10?mo:go;oe.current=te(oe.current,0,V,x),oe.current<.01&&(oe.current=0)}const vn=u.loading?1:0;pe.current=ge?vn:te(pe.current,vn,bo,x),pe.current<.01&&(pe.current=0),pe.current>.99&&(pe.current=1);const Je=pe.current,Rt=!u.loading&&me?1:0;Z.current=ge?Rt:te(Z.current,Rt,Rt===1?fo:uo,x),Math.abs(Z.current-Rt)<.005&&(Z.current=Rt);const Oe=Z.current;Oe<.01&&(f.current=!1);let Ze,dt=!1;if(tt?Ze=!me&&Oe>.005&&wt.current.length>0:(dt=!me&&Oe>.005&&qe.current.length>0,nt&&u.multiSeries&&(qe.current=u.multiSeries.map(V=>({id:V.id,data:V.data.slice(),value:V.value,palette:V.palette,label:V.label}))),me&&!u.isMultiSeries&&(qe.current=[]),Ze=!dt&&!me&&Oe>.005&&K.current.length>=2,me&&!u.isMultiSeries&&(K.current=j)),tt){const V=Ht.current,ae=u.lineMode?1:0;if(V.to!==ae&&(V.from=ht.current,V.to=ae,V.startMs=Q),V.startMs>0){const H=Q-V.startMs,se=Math.min(H/Mo,1);ht.current=V.from+(V.to-V.from)*((1-Math.cos(se*Math.PI))/2),se>=1&&(ht.current=V.to,V.startMs=0)}else ht.current=V.to}if(!me&&!Ze&&!dt){Y.clearRect(0,0,O,U);const V=tt||u.isMultiSeries||qe.current.length>0?u.palette.gridLabel:void 0;Je>.01&&Yn(Y,O,U,G,u.palette,Q,Je,V),1-Je>.01&&Ot(Y,O,U,G,u.palette,1-Je,Q,!1,u.emptyText),Y.save(),Y.globalCompositeOperation="destination-out";const ae=Y.createLinearGradient(G.left,0,G.left+ut,0);ae.addColorStop(0,"rgba(0, 0, 0, 1)"),ae.addColorStop(1,"rgba(0, 0, 0, 0)"),Y.fillStyle=ae,Y.fillRect(0,0,G.left+ut,U),Y.restore(),k.current&&(k.current.container.style.display="none"),A.current=requestAnimationFrame(Ve);return}if(tt){Y.clearRect(0,0,O,U);const V=To;me&&(Ye.current=Date.now()/1e3-oe.current);const ae=me||Oe<.005?Date.now()/1e3-oe.current:Ye.current,H=at.current?Ft.current??void 0:u.liveCandle;let se=yt.current??u.lineData,De=$t.current??u.lineValue;me&&se&&se.length>0&&(je.current=se,et.current=De),Ze&&je.current.length>0&&(se=je.current,De=et.current);const He=u.candleWidth??1,X=Xt.current;let Re=-1,ve;if(X.startMs>0){const D=Q-X.startMs,F=Math.min(D/po,1);Re=(1-Math.cos(F*Math.PI))/2,ve=Math.exp(Math.log(X.fromWidth)+(Math.log(X.toWidth)-Math.log(X.fromWidth))*Re),F>=1&&(ve=X.toWidth,X.startMs=0,Re=-1)}else ve=X.toWidth;if(He!==X.toWidth){X.oldCandles=it.current.candles,X.oldWidth=it.current.width,X.fromWidth=ve,X.toWidth=He,X.startMs=Q,Re=0,X.rangeFromMin=c.current,X.rangeFromMax=a.current;const D=g.current,F=ae+D*V,ke=F-D,q=[];for(const Be of kt)Be.time+He>=ke&&Be.time<=F&&q.push(Be);if(H&&q.push(H),q.length>0){const Be=ln(q);X.rangeToMin=Be.min,X.rangeToMax=Be.max}else X.rangeToMin=c.current,X.rangeToMax=a.current}it.current={candles:u.candles??[],width:He};const Ae=ht.current,Te=Bt.current,gt=se&&se.length>0,ze=u.lineMode&&Ae>=.3&&gt?1:0;Te.to!==ze&&(Te.from=_t.current,Te.to=ze,Te.startMs=Q);let Fe;if(Te.startMs>0){const D=Q-Te.startMs,F=Math.min(D/wo,1);Fe=Te.from+(Te.to-Te.from)*(1-(1-F)*(1-F)),F>=1&&(Fe=Te.to,Te.startMs=0)}else Fe=Te.to;_t.current=Fe;const At=M.current,fe=yo(u.windowSecs,At,g.current,c.current,a.current,Q,ae,kt,H,He,V);g.current=fe.windowSecs;const Qe=fe.windowSecs,Ct=fe.windowTransProgress,Xe=At.startMs>0,Ie=ae+Qe*V,Pe=Ie-Qe;let Ge;if(H){const D=We.current;if(!D||D.time!==H.time)We.current={time:H.time,open:H.open,high:H.open,low:H.open,close:H.open},Ee.current=0;else{const q=We.current;q.open=te(q.open,H.open,qt,ne),q.high=te(q.high,H.high,qt,ne),q.low=te(q.low,H.low,qt,ne),q.close=te(q.close,H.close,qt,ne)}Ee.current=te(Ee.current,1,.2,ne),Ee.current>.99&&(Ee.current=1);const F=We.current,ke=F.close>=F.open?1:0;Le.current=te(Le.current,ke,.12,ne),Le.current>.99&&(Le.current=1),Le.current<.01&&(Le.current=0),Ge=F}else We.current=null,Ee.current=1,Le.current=.5;if(H)if(!St.current)ft.current=H.close,St.current=!0;else{ft.current=te(ft.current,H.close,So,ne);const D=Math.abs(ft.current-H.close),F=a.current-c.current||1;D<F*5e-4&&(ft.current=H.close)}else Ze||(St.current=!1);if(H)if(!Mt.current)Ue.current=H.close,Mt.current=!0;else{const D=Math.abs(H.close-Ue.current),F=a.current-c.current||1,ke=Math.min(D/F,1),q=Kn+(1-ke)*Qn;Ue.current=te(Ue.current,H.close,q,ne),D<F*xn&&(Ue.current=H.close)}else Ze||(Mt.current=!1);if(De!==void 0&&gt)if(!Lt.current)xe.current=De,Lt.current=!0;else{const D=Math.abs(De-xe.current),F=a.current-c.current||1,ke=Math.min(D/F,1),q=Kn+(1-ke)*Qn;xe.current=te(xe.current,De,q,ne),D<F*xn&&(xe.current=De)}else Ze||(Lt.current=!1);const rt=[];for(const D of kt)D.time+He>=Pe&&D.time<=Ie&&rt.push(D);Ge&&Ge.time+ve>=Pe&&Ge.time<=Ie&&rt.push(Ge);let Ne=[];if(Re>=0&&X.oldCandles.length>0)for(const D of X.oldCandles)D.time+X.oldWidth>=Pe&&D.time<=Ie&&Ne.push(D);me&&(wt.current=rt,Gt.current=Ge??null);const Ke=Ze?wt.current:rt,mt=Ze?Gt.current??void 0:Ge,bt=O-G.left-G.right,Tt=Ke.length>0?ln(Ke):{min:c.current,max:a.current},be=Lo(Tt,f.current,c.current,a.current,Xe,Ct,At,_,ne);Re>=0&&(be.displayMin=X.rangeFromMin+(X.rangeToMin-X.rangeFromMin)*Re,be.displayMax=X.rangeFromMax+(X.rangeToMax-X.rangeFromMax)*Re,be.minVal=be.displayMin,be.maxVal=be.displayMax,be.valRange=be.displayMax-be.displayMin||.001),f.current=be.rangeInited,c.current=be.displayMin,a.current=be.displayMax;const{minVal:vt,maxVal:Et,valRange:st}=be,he={w:O,h:U,pad:G,chartW:bt,chartH:_,leftEdge:Pe,rightEdge:Ie,minVal:vt,maxVal:Et,valRange:st,toX:D=>G.left+(D-Pe)/(Ie-Pe)*bt,toY:D=>G.top+(1-(D-vt)/st)*_},_e=b.current;let re=null,B=!1;_e!==null&&_e>=G.left&&_e<=O-G.right&&(re=or(Ke,_e,ve,he),re&&(B=!0));const N=B?1:0;d.current=te(d.current,N,.12,x),d.current<.01&&(d.current=0),d.current>.99&&(d.current=1);const de=d.current;let Se=_e,$e=0,ot=re;!B&&de>0&&L.current?(Se=L.current.x,$e=L.current.time,ot=or(Ke,L.current.x,ve,he)):B&&_e!==null&&($e=he.leftEdge+(_e-G.left)/bt*(he.rightEdge-he.leftEdge),L.current={x:_e,value:(re==null?void 0:re.close)??0,time:$e});let le=Ke,pt=Ne,ie=mt;if(Ae>.01&&ie&&Mt.current){const D=ie.close+(Ue.current-ie.close)*Ae;ie={...ie,close:D};const F=le.length-1;F>=0&&le[F].time===ie.time&&(le=le.slice(),le[F]={...le[F],close:D})}if(Ae>.01&&Ae<.99){const D=F=>{const ke=1-Ae;return{time:F.time,open:F.close+(F.open-F.close)*ke,high:F.close+(F.high-F.close)*ke,low:F.close+(F.low-F.close)*ke,close:F.close}};le=le.map(D),pt.length>0&&(pt=pt.map(D)),ie&&(ie=D(ie))}let lt,Yt;if(se&&se.length>0&&(Fe>.01||Ae>.05)){const D=[];for(const q of le)D.push({t:q.time+ve/2,v:q.close});ie&&D.push({t:ae,v:ie.close}),lt=[];let F=0;for(const q of se){if(q.time<Pe||q.time>Ie)continue;for(;F<D.length-2&&D[F+1].t<q.time;)F++;let Be;if(D.length===0)Be=q.value;else if(D.length===1||q.time<=D[0].t)Be=D[0].v;else if(F>=D.length-1)Be=D[D.length-1].v;else{const Ut=D[F],_n=D[F+1],Bn=_n.t-Ut.t,gr=Bn>0?Math.max(0,Math.min(1,(q.time-Ut.t)/Bn)):0;Be=Ut.v+(_n.v-Ut.v)*gr}const Vt=Be+(q.value-Be)*Fe;lt.push({time:q.time,value:Vt})}const ke=Lt.current?xe.current:De??se[se.length-1].value;Yt=Ue.current+(ke-Ue.current)*Fe}else lt=le.map(D=>({time:D.time+ve/2,value:D.close})),Yt=Mt.current?Ue.current:(ie==null?void 0:ie.close)??((Sn=le[le.length-1])==null?void 0:Sn.close)??0;if(Oe<1&&lt.length>=2){const D=lt[0].time,F=Ie-Pe;if(D-Pe>F*.05){const ke=lt[0].value,q=F/32,Be=[];for(let Vt=Pe;Vt<D-q*.5;Vt+=q)Be.push({time:Vt,value:ke});lt=[...Be,...lt]}}if(no(Y,he,u.palette,{candles:le,displayCandleWidth:ve,oldCandles:pt,oldWidth:X.oldWidth,morphT:Re,liveCandle:ie,closePriceCandle:St.current&&H?{...H,close:ft.current}:H,liveTime:(mt==null?void 0:mt.time)??-1,liveBirthAlpha:Ee.current,liveBullBlend:Le.current,lineModeProg:Ae,chartReveal:Oe,now_ms:Q,now:ae,showGrid:u.showGrid,scrubAmount:de,hoverX:Se,hoverValue:(ot==null?void 0:ot.close)??null,hoverTime:$e,hoveredCandle:ot,formatValue:u.formatValue,formatTime:u.formatTime,gridState:v.current,timeAxisState:w.current,dt:ne,targetWindowSecs:u.windowSecs,tooltipY:u.tooltipY,tooltipOutline:u.tooltipOutline,lineVisible:lt,lineSmoothValue:Yt,emptyText:u.emptyText,loadingAlpha:Je,showEmptyOverlay:!(u.loading??!1)&&Je<.01}),k.current)if(Ae>.5&&u.showBadge){const D=Fn(lt);P.current=rr(k.current,u,Yt,he,D,P.current,C.current,Xe,ge,Y,ne,Oe);const F=(Ae-.5)*2;if(k.current.container.style.display!=="none"){const ke=k.current.container.style.opacity?parseFloat(k.current.container.style.opacity):1;k.current.container.style.opacity=String(ke*F*(1-ee))}}else k.current.container.style.display="none"}else if(u.isMultiSeries&&u.multiSeries&&u.multiSeries.length>0||dt){Y.clearRect(0,0,O,U);const V=dt?qe.current:u.multiSeries;let ae=0;if(V.some(B=>B.label)){Y.font='600 10px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif';let B=0;for(const N of V)if(N.label){const de=Y.measureText(N.label).width;de>B&&(B=de)}ae=Math.max(0,B-2)*Oe}const H=O-G.left-G.right-ae,se=u.showBadge?qn:Jn;if(!dt){const B=new Set(V.map(N=>N.id));for(const N of o.current.keys())B.has(N)||o.current.delete(N)}const De=V[0],He=M.current;me&&(Ye.current=Date.now()/1e3-oe.current);const X=dt?Ye.current:Date.now()/1e3-oe.current,Re=new Map;for(const B of V){let N=o.current.get(B.id);if(N===void 0&&(N=B.value),!dt){const de=er(B.value,N,c.current,a.current,u.lerpSpeed,ge);N=te(N,B.value,de,ne);const Se=a.current-c.current||1;Math.abs(N-B.value)<Se*Zn&&(N=B.value),o.current.set(B.id,N)}Re.set(B.id,N)}const ve=u.hiddenSeriesIds,Ae=i.current;for(const B of V){let N=Ae.get(B.id)??1;const de=ve!=null&&ve.has(B.id)?0:1;N=ge?de:te(N,de,vo,ne),N<.01&&(N=0),N>.99&&(N=1),Ae.set(B.id,N)}const Te=((Rn=(wn=Ce.current)==null?void 0:wn.get(De.id))==null?void 0:Rn.data)??De.data,gt=tr(u,He,g.current,c.current,a.current,ge,Q,X,Te,Re.get(De.id)??De.value,se);if(He.startMs>0&&V.length>1){const B=X+u.windowSecs*se,N=B-u.windowSecs;let de=1/0,Se=-1/0;for(const $e of V){const ot=((Tn=(An=Ce.current)==null?void 0:An.get($e.id))==null?void 0:Tn.data)??$e.data,le=Re.get($e.id)??$e.value,pt=[];for(const ie of ot)ie.time>=N-2&&ie.time<=B&&pt.push(ie);if(pt.length>0){const ie=Jt(pt,le,(En=u.referenceLine)==null?void 0:En.value,u.exaggerate);ie.min<de&&(de=ie.min),ie.max>Se&&(Se=ie.max)}}isFinite(de)&&isFinite(Se)&&(He.rangeToMin=de,He.rangeToMax=Se)}g.current=gt.windowSecs;const ze=gt.windowSecs,Fe=gt.windowTransProgress,At=He.startMs>0,fe=X+ze*se,Qe=fe-ze,Ct=fe-(fe-X)*ee,Xe=[];let Ie=1/0,Pe=-1/0;for(const B of V){const N=(Ln=Ce.current)==null?void 0:Ln.get(B.id),de=(N==null?void 0:N.data)??B.data,Se=[];for(const le of de)le.time>=Qe-2&&le.time<=Ct&&Se.push(le);const $e=Re.get(B.id)??B.value,ot=Ae.get(B.id)??1;if(Se.length>=2){if(ot>.01){const le=Jt(Se,$e,(yn=u.referenceLine)==null?void 0:yn.value,u.exaggerate);le.min<Ie&&(Ie=le.min),le.max>Pe&&(Pe=le.max)}Xe.push({visible:Se,smoothValue:$e,palette:B.palette,label:B.label,alpha:ot})}}if(Xe.length===0){Je>.01&&Yn(Y,O,U,G,u.palette,Q,Je,u.palette.gridLabel),1-Je>.01&&Ot(Y,O,U,G,u.palette,1-Je,Q,!1,u.emptyText),Y.save(),Y.globalCompositeOperation="destination-out";const B=Y.createLinearGradient(G.left,0,G.left+ut,0);B.addColorStop(0,"rgba(0, 0, 0, 1)"),B.addColorStop(1,"rgba(0, 0, 0, 0)"),Y.fillStyle=B,Y.fillRect(0,0,G.left+ut,U),Y.restore(),k.current&&(k.current.container.style.display="none"),A.current=requestAnimationFrame(Ve);return}const Ge={min:isFinite(Ie)?Ie:0,max:isFinite(Pe)?Pe:1},rt=u.lerpSpeed+dr*.5,Ne=nr(Ge,f.current,s.current,h.current,c.current,a.current,At,Fe,He,rt,_,ne);f.current=Ne.rangeInited,s.current=Ne.targetMin,h.current=Ne.targetMax,c.current=Ne.displayMin,a.current=Ne.displayMax;const{minVal:Ke,maxVal:mt,valRange:bt}=Ne,Tt={w:O,h:U,pad:G,chartW:H,chartH:_,leftEdge:Qe,rightEdge:fe,minVal:Ke,maxVal:mt,valRange:bt,toX:B=>G.left+(B-Qe)/(fe-Qe)*H,toY:B=>G.top+(1-(B-Ke)/bt)*_},be=b.current;let vt=null,Et=null,st=!1,he=[];if(be!==null&&be>=G.left&&be<=O-G.right){const B=Tt.toX(X),N=Math.min(be,B),de=Qe+(N-G.left)/H*(fe-Qe);vt=N,Et=de,st=!0;for(const Se of Xe){if((Se.alpha??1)<.5)continue;const $e=lr(Se.visible,de);$e!==null&&he.push({color:Se.palette.line,label:Se.label??"",value:$e})}L.current={x:N,value:((Pn=he[0])==null?void 0:Pn.value)??0,time:de},J.current=he,(Wn=u.onHover)==null||Wn.call(u,{time:de,value:((kn=he[0])==null?void 0:kn.value)??0,x:N,y:Tt.toY(((Cn=he[0])==null?void 0:Cn.value)??0)})}const _e=st?1:0;ge?d.current=_e:(d.current+=(_e-d.current)*fr,d.current<.01&&(d.current=0),d.current>.99&&(d.current=1)),!st&&d.current>0&&L.current&&(vt=L.current.x,Et=L.current.time,he=J.current),to(Y,Tt,{series:Xe,now:X,showGrid:u.showGrid,showPulse:u.showPulse,referenceLine:u.referenceLine,hoverX:vt,hoverTime:Et,hoverEntries:he,scrubAmount:d.current,windowSecs:ze,formatValue:u.formatValue,formatTime:u.formatTime,gridState:v.current,timeAxisState:w.current,dt:x,targetWindowSecs:u.windowSecs,tooltipY:u.tooltipY,tooltipOutline:u.tooltipOutline,chartReveal:Oe,pauseProgress:ee,now_ms:Q,primaryPalette:u.palette});const re=1-Oe;if(re>.01&&Rt===0&&!u.loading){const B=(1-Je)*re;B>.01&&Ot(Y,O,U,G,u.palette,B,Q,!0,u.emptyText)}k.current&&(k.current.container.style.display="none")}else{const V=Ze?K.current:j,ae=er(u.value,l.current,c.current,a.current,u.lerpSpeed,ge);if(!Ze&&(l.current=te(l.current,u.value,ae,ne),ee<.5)){const re=a.current-c.current||1;Math.abs(l.current-u.value)<re*Zn&&(l.current=u.value)}const H=l.current,se=O-G.left-G.right,De=u.showBadge?qn:Jn,X=u.showMomentum&&u.showBadge?Math.max(De,52/Math.max(se,1)):De,Re=M.current;me&&(Ye.current=Date.now()/1e3-oe.current);const ve=Ze?Ye.current:Date.now()/1e3-oe.current,Ae=tr(u,Re,g.current,c.current,a.current,ge,Q,ve,V,H,X);g.current=Ae.windowSecs;const Te=Ae.windowSecs,gt=Ae.windowTransProgress,ze=ve+Te*X,Fe=ze-Te,At=ze-(ze-ve)*ee,fe=[];for(const re of V)re.time>=Fe-2&&re.time<=At&&fe.push(re);if(fe.length<2){k.current&&(k.current.container.style.display="none"),A.current=requestAnimationFrame(Ve);return}Y.clearRect(0,0,O,U);const Qe=Jt(fe,H,(Dn=u.referenceLine)==null?void 0:Dn.value,u.exaggerate),Ct=Re.startMs>0,Xe=nr(Qe,f.current,s.current,h.current,c.current,a.current,Ct,gt,Re,ae,_,ne);f.current=Xe.rangeInited,s.current=Xe.targetMin,h.current=Xe.targetMax,c.current=Xe.displayMin,a.current=Xe.displayMax;const{minVal:Ie,maxVal:Pe,valRange:Ge}=Xe,rt={w:O,h:U,pad:G,chartW:se,chartH:_,leftEdge:Fe,rightEdge:ze,minVal:Ie,maxVal:Pe,valRange:Ge,toX:re=>G.left+(re-Fe)/(ze-Fe)*se,toY:re=>G.top+(1-(re-Ie)/Ge)*_},Ne=u.momentumOverride??Fn(fe),Ke=Eo(b.current,G,O,rt,ve,fe,d.current,L.current,u,ge,Fe,ze,se);d.current=Ke.scrubAmount,L.current=Ke.lastHover;const{hoverX:mt,hoverValue:bt,hoverTime:Tt}=Ke,be=Math.min(5,fe.length-1),vt=be>0?Math.abs(fe[fe.length-1].value-fe[fe.length-1-be].value):0,Et=Ge>0?Math.min(vt/Ge,1):0;eo(Y,rt,u.palette,{visible:fe,smoothValue:H,now:ve,momentum:Ne,arrowState:m.current,showGrid:u.showGrid,showMomentum:u.showMomentum,showPulse:u.showPulse,showFill:u.showFill,referenceLine:u.referenceLine,hoverX:mt,hoverValue:bt,hoverTime:Tt,scrubAmount:d.current,windowSecs:Te,formatValue:u.formatValue,formatTime:u.formatTime,gridState:v.current,timeAxisState:w.current,dt:x,targetWindowSecs:u.windowSecs,tooltipY:u.tooltipY,tooltipOutline:u.tooltipOutline,orderbookData:u.orderbookData,orderbookState:u.orderbookData?R.current:void 0,particleState:u.degenOptions?y.current:void 0,particleOptions:u.degenOptions,swingMagnitude:Et,shakeState:u.degenOptions?T.current:void 0,chartReveal:Oe,pauseProgress:ee,now_ms:Q});const st=1-Oe;if(st>.01&&Rt===0&&!u.loading){const re=(1-Je)*st;re>.01&&Ot(Y,O,U,G,u.palette,re,Q,!0,u.emptyText)}const he=k.current;if(he&&(P.current=rr(he,u,H,rt,Ne,P.current,C.current,Ct,ge,Y,ne,Oe),ee>.01&&he.container.style.display!=="none")){const re=he.container.style.opacity?parseFloat(he.container.style.opacity):1;he.container.style.opacity=String(re*(1-ee))}const _e=(In=u.valueDisplayRef)==null?void 0:In.current;if(_e){const re=u.valueMomentumColor?Math.abs(H):H;if(_e.textContent=u.formatValue(re),u.valueMomentumColor){const B=Ne==="up"?"#22c55e":Ne==="down"?"#ef4444":"";B?_e.style.color=B:_e.style.removeProperty("color")}}}A.current=requestAnimationFrame(Ve)},[e]);S.useEffect(()=>(A.current=requestAnimationFrame(Ve),()=>cancelAnimationFrame(A.current)),[Ve])}var ko=e=>e.toFixed(2),Co=e=>{const r=new Date(e*1e3),n=r.getHours().toString().padStart(2,"0"),t=r.getMinutes().toString().padStart(2,"0"),l=r.getSeconds().toString().padStart(2,"0");return`${n}:${t}:${l}`};function Do({data:e,value:r,series:n,theme:t="dark",color:l="#3b82f6",window:o=30,grid:i=!0,badge:c=!0,momentum:a=!0,fill:s=!0,scrub:h=!0,loading:f=!1,paused:g=!1,emptyText:M,exaggerate:m=!1,degen:v,badgeTail:w=!0,badgeVariant:R="default",showValue:y=!1,valueMomentumColor:T=!1,windows:C,onWindowChange:P,windowStyle:E,tooltipY:I=14,tooltipOutline:p=!0,orderbook:A,referenceLine:W,formatValue:k=ko,formatTime:b=Co,lerpSpeed:d=.08,padding:L,onHover:J,cursor:Z="crosshair",pulse:z=!0,mode:oe="line",candles:K,candleWidth:qe,liveCandle:Ye,lineMode:ue,lineData:Ce,lineValue:pe,onModeChange:We,onSeriesToggle:Ee,seriesToggleCompact:Le=!1,lineWidth:Ue,className:Mt,style:ft}){var G;const St=S.useRef(null),ht=S.useRef(null),Ht=S.useRef(null),_t=S.useRef(null),Bt=S.useRef(new Map),[xe,Lt]=S.useState(null),Xt=S.useRef(null),it=S.useRef(new Map),[at,Ft]=S.useState(null),[yt,$t]=S.useState(new Set),wt=S.useRef(n);n&&n.length>0&&(wt.current=n);const Gt=S.useMemo(()=>{const _=rn(l,t);return Ue!=null&&(_.lineWidth=Ue),_},[l,t,Ue]),je=t==="dark",et=n!=null&&n.length>0,Pt=(((G=wt.current)==null?void 0:G.length)??0)>1,Ve=S.useMemo(()=>!n||n.length===0?null:mr(n,t),[n,t]),$=S.useMemo(()=>{if(!(!n||!Ve))return n.map((_,we)=>({id:_.id,data:_.data,value:_.value,palette:Ve.get(_.id)??rn(_.color||It[we%It.length],t),label:_.label}))},[n,Ve,t]),O=a!==!1,U=typeof a=="string"?a:void 0,u=c?80:i?54:12,ye={top:(L==null?void 0:L.top)??12,right:(L==null?void 0:L.right)??u,bottom:(L==null?void 0:L.bottom)??28,left:(L==null?void 0:L.left)??12},x=(v!=null?v!==!1:!1)?typeof v=="object"?v:{}:void 0,[Me,Nt]=S.useState(C&&C.length>0?C[0].secs:o),Y=C?Me:o;S.useLayoutEffect(()=>{if(!C||C.length===0)return;const _=Bt.current.get(Me),we=_t.current;if(_&&we){const ee=we.getBoundingClientRect(),ne=_.getBoundingClientRect();Lt({left:ne.left-ee.left,width:ne.width})}},[Me,C]);const ge=ue?"line":"candle";S.useLayoutEffect(()=>{if(!We)return;const _=it.current.get(ge),we=Xt.current;if(_&&we){const ee=we.getBoundingClientRect(),ne=_.getBoundingClientRect();Ft({left:ne.left-ee.left,width:ne.width})}},[ge,We]);const tt=S.useCallback(_=>{$t(we=>{const ee=new Set(we);if(ee.has(_))ee.delete(_),Ee==null||Ee(_,!0);else{if(((n==null?void 0:n.length)??0)-ee.size<=1)return we;ee.add(_),Ee==null||Ee(_,!1)}return ee})},[n==null?void 0:n.length,Ee]),j=E??"default";Po(St,ht,{data:e,value:r,palette:Gt,windowSecs:Y,lerpSpeed:d,showGrid:i,showBadge:et?!1:c,showMomentum:et?!1:O,momentumOverride:U,showFill:et?!1:s,referenceLine:W,formatValue:k,formatTime:b,padding:ye,onHover:J,showPulse:z,scrub:h,exaggerate:m,degenOptions:et?void 0:x,badgeTail:w,badgeVariant:R,tooltipY:I,tooltipOutline:p,valueMomentumColor:T,valueDisplayRef:y?Ht:void 0,orderbookData:A,loading:f,paused:g,emptyText:M,mode:oe,candles:K,candleWidth:qe,liveCandle:Ye,lineMode:ue,lineData:Ce,lineValue:pe,multiSeries:$,isMultiSeries:et,hiddenSeriesIds:yt});const kt=h?Z:"default",nt=je?"rgba(255,255,255,0.7)":"rgba(0,0,0,0.55)",me=je?"rgba(255,255,255,0.25)":"rgba(0,0,0,0.22)";return ce.jsxs(ce.Fragment,{children:[y&&ce.jsx("span",{ref:Ht,style:{display:"block",fontSize:20,fontWeight:500,fontFamily:'"SF Mono", Menlo, monospace',color:je?"rgba(255,255,255,0.85)":"#111",transition:"color 0.3s",letterSpacing:"-0.01em",marginBottom:8,paddingTop:4,paddingLeft:ye.left}}),(C&&C.length>0||We||Pt)&&ce.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6,marginLeft:ye.left},children:[C&&C.length>0&&ce.jsxs("div",{ref:_t,style:{position:"relative",display:"inline-flex",gap:j==="text"?4:2,background:j==="text"?"transparent":je?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:j==="rounded"?999:6,padding:j==="text"?0:j==="rounded"?3:2},children:[j!=="text"&&xe&&ce.jsx("div",{style:{position:"absolute",top:j==="rounded"?3:2,left:xe.left,width:xe.width,height:j==="rounded"?"calc(100% - 6px)":"calc(100% - 4px)",background:je?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",borderRadius:j==="rounded"?999:4,transition:"left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"none"}}),C.map(_=>{const we=_.secs===Me;return ce.jsx("button",{ref:ee=>{ee?Bt.current.set(_.secs,ee):Bt.current.delete(_.secs)},onClick:()=>{Nt(_.secs),P==null||P(_.secs)},style:{position:"relative",zIndex:1,fontSize:11,padding:j==="text"?"2px 6px":"3px 10px",borderRadius:j==="rounded"?999:4,border:"none",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:we?600:400,background:"transparent",color:we?nt:me,transition:"color 0.2s, background 0.15s",lineHeight:"16px"},children:_.label},_.secs)})]}),We&&ce.jsxs("div",{ref:Xt,style:{position:"relative",display:"inline-flex",gap:j==="text"?4:2,background:j==="text"?"transparent":je?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:j==="rounded"?999:6,padding:j==="text"?0:j==="rounded"?3:2},children:[j!=="text"&&at&&ce.jsx("div",{style:{position:"absolute",top:j==="rounded"?3:2,left:at.left,width:at.width,height:j==="rounded"?"calc(100% - 6px)":"calc(100% - 4px)",background:je?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",borderRadius:j==="rounded"?999:4,transition:"left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1)",pointerEvents:"none"}}),ce.jsx("button",{ref:_=>{_?it.current.set("line",_):it.current.delete("line")},onClick:()=>We("line"),style:{position:"relative",zIndex:1,padding:"5px 7px",borderRadius:j==="rounded"?999:4,border:"none",cursor:"pointer",background:"transparent",display:"flex",alignItems:"center"},children:ce.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:ce.jsx("path",{d:"M1 8.5C2.5 8.5 3 4 5.5 4S7.5 7 8.5 7C9.5 7 10 3.5 11 3.5",stroke:ge==="line"?nt:me,strokeWidth:ge==="line"?1.5:1.2,strokeLinecap:"round",fill:"none"})})}),ce.jsx("button",{ref:_=>{_?it.current.set("candle",_):it.current.delete("candle")},onClick:()=>We("candle"),style:{position:"relative",zIndex:1,padding:"5px 7px",borderRadius:j==="rounded"?999:4,border:"none",cursor:"pointer",background:"transparent",display:"flex",alignItems:"center"},children:ce.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[ce.jsx("line",{x1:"3.5",y1:"1",x2:"3.5",y2:"11",stroke:ge==="candle"?nt:me,strokeWidth:"1"}),ce.jsx("rect",{x:"2",y:"3",width:"3",height:"5",rx:"0.5",fill:ge==="candle"?nt:me}),ce.jsx("line",{x1:"8.5",y1:"2",x2:"8.5",y2:"10",stroke:ge==="candle"?nt:me,strokeWidth:"1"}),ce.jsx("rect",{x:"7",y:"4",width:"3",height:"4",rx:"0.5",fill:ge==="candle"?nt:me})]})})]}),Pt&&ce.jsx("div",{style:{display:"inline-flex",gap:j==="text"?4:2,background:j==="text"?"transparent":je?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.02)",borderRadius:j==="rounded"?999:6,padding:j==="text"?0:j==="rounded"?3:2,opacity:et?1:0,transition:"opacity 0.4s",pointerEvents:et?"auto":"none"},children:(wt.current??[]).map((_,we)=>{const ee=yt.has(_.id),ne=_.color||It[we%It.length];return ce.jsxs("button",{onClick:()=>tt(_.id),style:{position:"relative",zIndex:1,fontSize:11,padding:Le?j==="text"?"2px 4px":"5px 7px":j==="text"?"2px 6px":"3px 8px",borderRadius:j==="rounded"?999:4,border:"none",cursor:"pointer",fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:500,background:ee||j==="text"?"transparent":je?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.035)",color:ee?me:nt,opacity:ee?.4:1,transition:"opacity 0.2s, background 0.15s, color 0.2s",lineHeight:"16px",display:"flex",alignItems:"center",gap:Le?0:4},children:[ce.jsx("span",{style:{width:Le?8:6,height:Le?8:6,borderRadius:"50%",background:ne,flexShrink:0,opacity:ee?.4:1,transition:"opacity 0.2s"}}),!Le&&(_.label??_.id)]},_.id)})})]}),ce.jsx("div",{ref:ht,className:Mt,style:{width:"100%",height:"100%",position:"relative",...ft},children:ce.jsx("canvas",{ref:St,style:{display:"block",cursor:kt}})})]})}export{Do as L};
@@ -0,0 +1 @@
1
+ import{r as p,j as m}from"./react-qoZPGuNy.js";import{f as i,a as c}from"./format-CfAcS4D8.js";import{f,aw as n,ax as d}from"./index-mNBIIbY4.js";import{T as h,a as l}from"./treemap-leaf-DNIoJEK-.js";import{F as s}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function u({width:r,height:o,data:a}){const t=i(a.marketCapUsd);return m.jsx(l,{width:r,height:o,label:a.id,secondary:t,title:`${a.id} · ${t} mcap · ${c(a.changePct24h)}`})}function C({config:r}){const{entries:o,isLoading:a}=d(),t=p.useMemo(()=>o.slice(0,r.topN).map(e=>({id:e.symbol,value:e.marketCapUsd,marketCapUsd:e.marketCapUsd,changePct24h:e.changePct24h??0})),[o,r.topN]);return a?m.jsx(s,{loading:!0,children:"loading market caps…"}):t.length===0?m.jsx(s,{children:"no market data"}):m.jsx(h,{data:t,LeafComponent:u,getColorValue:e=>e.changePct24h})}const U=f({...n,component:C});export{U as marketCapTreemapFrame};
@@ -1 +1 @@
1
- import{j as e,r as d}from"./react-qoZPGuNy.js";import{D as x,E as m,e as g,s as f,f as b}from"./market-data-CvmpLFSo.js";import{U as l}from"./format-CfAcS4D8.js";import{f as w,X as h}from"./index-DbboK5sz.js";import{F as j}from"./ui-Bq3RQsdJ.js";h.schema;const u={open:{color:l,chipBg:"rgba(63, 208, 143, 0.13)",label:"Open",verb:"closes",rail:l,railOpacity:1,wash:"linear-gradient(90deg, rgba(63, 208, 143, 0.08), transparent 40%)"},closed:{color:"#8b92a1",chipBg:"rgba(255, 255, 255, 0.045)",label:"Closed",verb:"opens",rail:"rgba(255, 255, 255, 0.22)",railOpacity:.55,wash:"none"},holiday:{color:"#f2b066",chipBg:"rgba(242, 176, 102, 0.13)",label:"Holiday",verb:"opens",rail:"#f2b066",railOpacity:1,wash:"linear-gradient(90deg, rgba(242, 176, 102, 0.07), transparent 40%)"}};function k(){return e.jsxs("svg",{"aria-hidden":"true",className:"shrink-0",fill:"none",height:"15",viewBox:"0 0 20 20",width:"15",children:[e.jsx("circle",{cx:"10",cy:"10",r:"7.25",stroke:"currentColor",strokeOpacity:"0.75",strokeWidth:"1.5"}),e.jsx("path",{d:"M2.75 10h14.5M10 2.75c2 2 3 4.42 3 7.25s-1 5.25-3 7.25M10 2.75c-2 2-3 4.42-3 7.25s1 5.25 3 7.25",stroke:"currentColor",strokeLinecap:"round",strokeOpacity:"0.55",strokeWidth:"1.2"}),e.jsx("path",{d:"m5.25 12.75 2.6-2.3 2.1 1.55 3.95-4.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})]})}function v(s,r){try{return new Intl.DateTimeFormat("en-US",{timeZone:r,hour:"2-digit",minute:"2-digit",hour12:!1,timeZoneName:"short"}).format(s)}catch{return r}}function y(s){return/^[A-Z]{2}$/i.test(s)?[...s.toUpperCase()].map(r=>String.fromCodePoint(127462+r.charCodeAt(0)-65)).join(""):s}function N(){return e.jsxs("svg",{"aria-hidden":"true",className:"opacity-50 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5 group-hover:opacity-95",fill:"none",height:"12",viewBox:"0 0 16 16",width:"12",children:[e.jsx("path",{d:"M6 4.5H4.5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),e.jsx("path",{d:"M9 2.5h4.5V7M8.25 7.75l5-5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function C({state:s}){return e.jsx("span",{"aria-hidden":"true",className:"grid h-[30px] w-[30px] shrink-0 place-items-center overflow-hidden rounded-[9px] border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.12),0_4px_10px_-7px_rgba(0,0,0,0.8)]",style:{background:"linear-gradient(150deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02) 48%, rgba(0,0,0,0.22))"},children:e.jsx("span",{className:"text-[1.15rem] leading-none drop-shadow-[0_1px_3px_rgba(0,0,0,0.5)]",children:y(s.country)})})}function _({state:s}){const r=u[s.status],n=s.status==="closed";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border px-2 py-[3px] font-dmsans text-[0.5rem] font-bold uppercase leading-none tracking-[0.09em]",style:{borderColor:n?"rgba(255,255,255,0.1)":`${r.color}33`,background:r.chipBg,color:n?"rgba(255,255,255,0.62)":r.color},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:n?"rgba(255,255,255,0.45)":r.color,boxShadow:s.status==="open"?`0 0 6px ${r.color}`:void 0}}),r.label]})}function S({now:s,state:r}){const n=u[r.status],o=b(r.nextChangeMin),c=v(s,r.tz);return e.jsxs("a",{"aria-label":`${r.name} website`,className:"group text-normal relative grid min-h-[42px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 overflow-hidden rounded-xl border border-white/[0.06] bg-white/[0.022] py-1.5 pr-2.5 pl-3 transition duration-200 hover:-translate-y-px hover:border-white/[0.14] hover:bg-white/[0.05] hover:text-strong focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/50",href:r.website,rel:"noreferrer",style:{backgroundImage:n.wash},target:"_blank",title:`${r.name} · ${r.city} · ${r.open}-${r.close}`,children:[e.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-[5px] left-0 w-[3px] rounded-r-full",style:{background:n.rail,opacity:n.railOpacity}}),e.jsx(C,{state:r}),e.jsxs("span",{className:"relative min-w-0 pl-0.5",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"body-sm text-strong truncate font-bold",children:r.name}),e.jsx(N,{})]}),e.jsxs("span",{className:"caption text-soft flex min-w-0 items-center gap-1.5 tabular-nums",children:[e.jsx("span",{className:"truncate",children:r.city}),e.jsx("span",{className:"h-[3px] w-[3px] shrink-0 rounded-full bg-white/25"}),e.jsx("span",{className:"shrink-0",children:c})]})]}),e.jsxs("span",{className:"relative flex min-w-[84px] flex-col items-end gap-1",children:[e.jsx(_,{state:r}),e.jsxs("span",{className:"caption whitespace-nowrap text-right tabular-nums",style:{color:r.status==="closed"?"rgba(255,255,255,0.55)":n.color},children:[n.verb," ",o]})]})]})}function E({config:s}){const[r,n]=d.useState(()=>new Date);d.useEffect(()=>{const a=window.setInterval(()=>n(new Date),3e4);return()=>window.clearInterval(a)},[]);const o=s.exchanges.length?s.exchanges:x,c=o.join(","),i=d.useMemo(()=>{const a=o.map(t=>m[t.toUpperCase()]).filter(t=>!!t).map(t=>g(t,r));return f(a,s.sort)},[c,r,s.sort]);if(i.length===0)return e.jsx(j,{children:"no known exchanges — check the codes"});const p=i.filter(a=>a.status==="open").length;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"caption text-soft mb-2 flex items-center justify-between gap-3 uppercase tracking-wide",children:[e.jsx("span",{className:"truncate",children:"exchange sessions"}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-white/[0.08] bg-white/[0.045] px-2 py-0.5 tabular-nums",children:[p>0&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:l,boxShadow:`0 0 6px ${l}`}}),e.jsx("span",{className:"text-strong font-bold",children:p}),e.jsxs("span",{className:"text-soft",children:["/ ",i.length," open"]})]})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-auto pr-0.5",children:i.map(a=>e.jsx(S,{now:r,state:a},a.code))})]})}const I=w({...h,component:E,titleIcon:k});export{I as marketHoursFrame};
1
+ import{j as e,r as d}from"./react-qoZPGuNy.js";import{D as x,E as m,e as g,s as f,f as b}from"./market-data-CvmpLFSo.js";import{U as l}from"./format-CfAcS4D8.js";import{f as w,Z as h}from"./index-mNBIIbY4.js";import{F as j}from"./ui-Bq3RQsdJ.js";h.schema;const u={open:{color:l,chipBg:"rgba(63, 208, 143, 0.13)",label:"Open",verb:"closes",rail:l,railOpacity:1,wash:"linear-gradient(90deg, rgba(63, 208, 143, 0.08), transparent 40%)"},closed:{color:"#8b92a1",chipBg:"rgba(255, 255, 255, 0.045)",label:"Closed",verb:"opens",rail:"rgba(255, 255, 255, 0.22)",railOpacity:.55,wash:"none"},holiday:{color:"#f2b066",chipBg:"rgba(242, 176, 102, 0.13)",label:"Holiday",verb:"opens",rail:"#f2b066",railOpacity:1,wash:"linear-gradient(90deg, rgba(242, 176, 102, 0.07), transparent 40%)"}};function k(){return e.jsxs("svg",{"aria-hidden":"true",className:"shrink-0",fill:"none",height:"15",viewBox:"0 0 20 20",width:"15",children:[e.jsx("circle",{cx:"10",cy:"10",r:"7.25",stroke:"currentColor",strokeOpacity:"0.75",strokeWidth:"1.5"}),e.jsx("path",{d:"M2.75 10h14.5M10 2.75c2 2 3 4.42 3 7.25s-1 5.25-3 7.25M10 2.75c-2 2-3 4.42-3 7.25s1 5.25 3 7.25",stroke:"currentColor",strokeLinecap:"round",strokeOpacity:"0.55",strokeWidth:"1.2"}),e.jsx("path",{d:"m5.25 12.75 2.6-2.3 2.1 1.55 3.95-4.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})]})}function v(s,r){try{return new Intl.DateTimeFormat("en-US",{timeZone:r,hour:"2-digit",minute:"2-digit",hour12:!1,timeZoneName:"short"}).format(s)}catch{return r}}function y(s){return/^[A-Z]{2}$/i.test(s)?[...s.toUpperCase()].map(r=>String.fromCodePoint(127462+r.charCodeAt(0)-65)).join(""):s}function N(){return e.jsxs("svg",{"aria-hidden":"true",className:"opacity-50 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5 group-hover:opacity-95",fill:"none",height:"12",viewBox:"0 0 16 16",width:"12",children:[e.jsx("path",{d:"M6 4.5H4.5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),e.jsx("path",{d:"M9 2.5h4.5V7M8.25 7.75l5-5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function C({state:s}){return e.jsx("span",{"aria-hidden":"true",className:"grid h-[30px] w-[30px] shrink-0 place-items-center overflow-hidden rounded-[9px] border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.12),0_4px_10px_-7px_rgba(0,0,0,0.8)]",style:{background:"linear-gradient(150deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02) 48%, rgba(0,0,0,0.22))"},children:e.jsx("span",{className:"text-[1.15rem] leading-none drop-shadow-[0_1px_3px_rgba(0,0,0,0.5)]",children:y(s.country)})})}function _({state:s}){const r=u[s.status],n=s.status==="closed";return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border px-2 py-[3px] font-dmsans text-[0.5rem] font-bold uppercase leading-none tracking-[0.09em]",style:{borderColor:n?"rgba(255,255,255,0.1)":`${r.color}33`,background:r.chipBg,color:n?"rgba(255,255,255,0.62)":r.color},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:n?"rgba(255,255,255,0.45)":r.color,boxShadow:s.status==="open"?`0 0 6px ${r.color}`:void 0}}),r.label]})}function S({now:s,state:r}){const n=u[r.status],o=b(r.nextChangeMin),c=v(s,r.tz);return e.jsxs("a",{"aria-label":`${r.name} website`,className:"group text-normal relative grid min-h-[42px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 overflow-hidden rounded-xl border border-white/[0.06] bg-white/[0.022] py-1.5 pr-2.5 pl-3 transition duration-200 hover:-translate-y-px hover:border-white/[0.14] hover:bg-white/[0.05] hover:text-strong focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/50",href:r.website,rel:"noreferrer",style:{backgroundImage:n.wash},target:"_blank",title:`${r.name} · ${r.city} · ${r.open}-${r.close}`,children:[e.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-[5px] left-0 w-[3px] rounded-r-full",style:{background:n.rail,opacity:n.railOpacity}}),e.jsx(C,{state:r}),e.jsxs("span",{className:"relative min-w-0 pl-0.5",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"body-sm text-strong truncate font-bold",children:r.name}),e.jsx(N,{})]}),e.jsxs("span",{className:"caption text-soft flex min-w-0 items-center gap-1.5 tabular-nums",children:[e.jsx("span",{className:"truncate",children:r.city}),e.jsx("span",{className:"h-[3px] w-[3px] shrink-0 rounded-full bg-white/25"}),e.jsx("span",{className:"shrink-0",children:c})]})]}),e.jsxs("span",{className:"relative flex min-w-[84px] flex-col items-end gap-1",children:[e.jsx(_,{state:r}),e.jsxs("span",{className:"caption whitespace-nowrap text-right tabular-nums",style:{color:r.status==="closed"?"rgba(255,255,255,0.55)":n.color},children:[n.verb," ",o]})]})]})}function E({config:s}){const[r,n]=d.useState(()=>new Date);d.useEffect(()=>{const a=window.setInterval(()=>n(new Date),3e4);return()=>window.clearInterval(a)},[]);const o=s.exchanges.length?s.exchanges:x,c=o.join(","),i=d.useMemo(()=>{const a=o.map(t=>m[t.toUpperCase()]).filter(t=>!!t).map(t=>g(t,r));return f(a,s.sort)},[c,r,s.sort]);if(i.length===0)return e.jsx(j,{children:"no known exchanges — check the codes"});const p=i.filter(a=>a.status==="open").length;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[e.jsxs("div",{className:"caption text-soft mb-2 flex items-center justify-between gap-3 uppercase tracking-wide",children:[e.jsx("span",{className:"truncate",children:"exchange sessions"}),e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-white/[0.08] bg-white/[0.045] px-2 py-0.5 tabular-nums",children:[p>0&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:l,boxShadow:`0 0 6px ${l}`}}),e.jsx("span",{className:"text-strong font-bold",children:p}),e.jsxs("span",{className:"text-soft",children:["/ ",i.length," open"]})]})]}),e.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-auto pr-0.5",children:i.map(a=>e.jsx(S,{now:r,state:a},a.code))})]})}const I=w({...h,component:E,titleIcon:k});export{I as marketHoursFrame};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./react-qoZPGuNy.js";import{f as i,aH as r}from"./index-DbboK5sz.js";r.schema;const s={slow:24,normal:14,fast:8},m=`
1
+ import{j as e}from"./react-qoZPGuNy.js";import{f as i,aJ as r}from"./index-mNBIIbY4.js";r.schema;const s={slow:24,normal:14,fast:8},m=`
2
2
  .zf-marquee {
3
3
  display: flex;
4
4
  align-items: center;
@@ -0,0 +1 @@
1
+ import{r as p,j as $}from"./react-qoZPGuNy.js";import{s as w,c as B,e as j,l as G,d as H,f as V,g as N}from"./d3-xK4fOkBU.js";import{c as X}from"./utils-DaT-yT0k.js";const q=({data:n,width:l=120,height:d=40,color:m,className:R,variant:b="default"})=>{const h=p.useRef(null),x=`mini-chart-gradient-${p.useId().replace(/:/g,"")}`,{strokeColor:C,isPositive:y,variantType:f,customColor:v}=p.useMemo(()=>{var r,s;if(m)return{strokeColor:m,isPositive:!0,variantType:"custom",customColor:m};if(b==="auto"&&n.length>0){const g=((r=n[0])==null?void 0:r.value)??0,o=(((s=n[n.length-1])==null?void 0:s.value)??0)>=g;return{strokeColor:o?"var(--color-green-500)":"var(--color-red-500)",isPositive:o,variantType:o?"green":"red",customColor:void 0}}switch(b){case"green":return{strokeColor:"var(--color-green-500)",isPositive:!0,variantType:"green",customColor:void 0};case"red":return{strokeColor:"var(--color-red-500)",isPositive:!1,variantType:"red",customColor:void 0};case"blue":return{strokeColor:"#75A3FF",isPositive:!0,variantType:"blue",customColor:void 0};default:return{strokeColor:"var(--color-blue-600)",isPositive:!0,variantType:"blue",customColor:void 0}}},[m,b,n]),u=p.useMemo(()=>{if(!n||n.length===0)return[];const r=n.map(o=>({...o,date:new Date(o.date)})),s=Math.max(30,Math.floor(l/4));if(r.length<=s)return r;const g=Math.floor(r.length/s),a=[];for(let o=0;o<r.length;o+=g)a.push(r[o]);return a[a.length-1]!==r[r.length-1]&&a.push(r[r.length-1]),a},[n,l]);return p.useEffect(()=>{if(!h.current||!u.length)return;const r=w(h.current),s={top:2,right:0,bottom:2,left:0},g=l-s.left-s.right,a=d-s.top-s.bottom;r.selectAll("*").remove();const o=B().domain(j(u,t=>t.date)).range([0,g]),[k,I]=j(u,t=>t.value),W=(I-k)*.4,P=G().domain([k-W,I]).range([a,0]),E=H().x(t=>o(t.date)).y(t=>P(t.value)).curve(V),M=r.append("g").attr("transform",`translate(${s.left},${s.top})`),F=N().x(t=>o(t.date)).y0(a).y1(t=>P(t.value)).curve(V),i=r.append("defs").append("linearGradient").attr("id",x).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%"),T=(t,c)=>{if(t.startsWith("var("))return t.includes("blue")?`rgba(59, 130, 246, ${c})`:t.includes("green")?`rgba(37, 255, 205, ${c})`:t.includes("red")?`rgba(239, 68, 68, ${c})`:`rgba(59, 130, 246, ${c})`;if(t.startsWith("#")){const e=t.slice(1),A=e.length===3?parseInt(e[0]+e[0],16):parseInt(e.slice(0,2),16),D=e.length===3?parseInt(e[1]+e[1],16):parseInt(e.slice(2,4),16),L=e.length===3?parseInt(e[2]+e[2],16):parseInt(e.slice(4,6),16);return`rgba(${A}, ${D}, ${L}, ${c})`}if(t.startsWith("rgb")){const e=t.match(/\d+/g);if(e&&e.length>=3)return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${c})`}return`rgba(59, 130, 246, ${c})`};f==="custom"&&v?(i.append("stop").attr("offset","45.9%").attr("stop-color",T(v,.16)),i.append("stop").attr("offset","96.67%").attr("stop-color",T(v,0))):f==="blue"?(i.append("stop").attr("offset","45.9%").attr("stop-color","rgba(7, 77, 215, 0.3)"),i.append("stop").attr("offset","96.67%").attr("stop-color","rgba(7, 77, 215, 0.3)")):f==="green"||y&&f!=="red"?(i.append("stop").attr("offset","45.9%").attr("stop-color","rgba(63, 194, 167, 0.1)"),i.append("stop").attr("offset","96.67%").attr("stop-color","rgba(63, 194, 167, 0)")):(i.append("stop").attr("offset","0%").attr("stop-color","rgba(255, 93, 127, 0.1)"),i.append("stop").attr("offset","91.8%").attr("stop-color","rgba(255, 63, 105, 0)")),M.append("path").datum(u).attr("fill",`url(#${x})`).attr("d",F),M.append("path").datum(u).attr("fill","none").attr("stroke",C).attr("stroke-width",1).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("d",E)},[u,l,d,C,y,f,v]),!n||n.length===0?$.jsx($.Fragment,{}):$.jsx("svg",{ref:h,width:l,height:d,viewBox:`0 0 ${l} ${d}`,className:X("h-auto max-w-full",R),style:{width:l,height:"auto"}})},U=p.memo(q);export{U as M};
@@ -1 +1 @@
1
- import{r as f,j as a}from"./react-qoZPGuNy.js";import{b as h}from"./format-CfAcS4D8.js";import{f as P,aW as u,aX as g}from"./index-DbboK5sz.js";import{T as x,a as b}from"./treemap-leaf-DLQawrx4.js";import{F as p}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";u.schema;function j({width:o,height:t,data:r}){const s=h(r.sharePct,1);return a.jsx(b,{width:o,height:t,label:r.id,secondary:s,title:`${r.id} · ${s} of blocks`})}function C({config:o}){const{pools:t,isLoading:r}=g(o.window),s=f.useMemo(()=>{const n=(t==null?void 0:t.pools)??[],l=n.slice(0,o.topN).map(e=>({id:e.name,value:e.blockCount,sharePct:e.sharePct})),i=n.slice(o.topN);if(i.length>0){const e=i.reduce((c,m)=>c+m.blockCount,0),d=i.reduce((c,m)=>c+m.sharePct,0);e>0&&l.push({id:"Other",value:e,sharePct:d})}return l},[t,o.topN]);return r?a.jsx(p,{loading:!0,children:"loading pools…"}):s.length===0?a.jsx(p,{children:"no mining data yet"}):a.jsx(x,{data:s,LeafComponent:j,getColorValue:n=>n.sharePct})}const y=P({...u,component:C});export{y as miningPoolsFrame};
1
+ import{r as f,j as a}from"./react-qoZPGuNy.js";import{b as h}from"./format-CfAcS4D8.js";import{f as P,aY as u,aZ as g}from"./index-mNBIIbY4.js";import{T as x,a as b}from"./treemap-leaf-DNIoJEK-.js";import{F as p}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";u.schema;function j({width:o,height:t,data:r}){const s=h(r.sharePct,1);return a.jsx(b,{width:o,height:t,label:r.id,secondary:s,title:`${r.id} · ${s} of blocks`})}function C({config:o}){const{pools:t,isLoading:r}=g(o.window),s=f.useMemo(()=>{const n=(t==null?void 0:t.pools)??[],l=n.slice(0,o.topN).map(e=>({id:e.name,value:e.blockCount,sharePct:e.sharePct})),i=n.slice(o.topN);if(i.length>0){const e=i.reduce((c,m)=>c+m.blockCount,0),d=i.reduce((c,m)=>c+m.sharePct,0);e>0&&l.push({id:"Other",value:e,sharePct:d})}return l},[t,o.topN]);return r?a.jsx(p,{loading:!0,children:"loading pools…"}):s.length===0?a.jsx(p,{children:"no mining data yet"}):a.jsx(x,{data:s,LeafComponent:j,getColorValue:n=>n.sharePct})}const y=P({...u,component:C});export{y as miningPoolsFrame};
@@ -1 +1 @@
1
- import{j as t}from"./react-qoZPGuNy.js";import{A as m}from"./index-DbboK5sz.js";import{d as r,a as n,c as l}from"./format-CfAcS4D8.js";function c({symbol:i,label:a,price:s,changePct:o,logoSize:e=16,gap:d="gap-2"}){return t.jsxs("div",{className:`grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center ${d}`,title:s!==void 0?`${a} · ${r(s)}`:a,children:[t.jsx(m,{symbol:i,size:e}),t.jsx("span",{className:"body-sm truncate font-bold text-strong",children:a}),t.jsx("span",{className:"caption text-soft text-right tabular-nums",children:s!==void 0?r(s):"—"}),t.jsx("span",{className:`caption text-right font-bold tabular-nums${o===void 0?" text-disabled":""}`,style:o!==void 0?{color:l(o)}:void 0,children:o!==void 0?n(o):"…"})]})}export{c as M};
1
+ import{j as t}from"./react-qoZPGuNy.js";import{A as m}from"./index-mNBIIbY4.js";import{d as r,a as n,c as l}from"./format-CfAcS4D8.js";function c({symbol:i,label:a,price:s,changePct:o,logoSize:e=16,gap:d="gap-2"}){return t.jsxs("div",{className:`grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center ${d}`,title:s!==void 0?`${a} · ${r(s)}`:a,children:[t.jsx(m,{symbol:i,size:e}),t.jsx("span",{className:"body-sm truncate font-bold text-strong",children:a}),t.jsx("span",{className:"caption text-soft text-right tabular-nums",children:s!==void 0?r(s):"—"}),t.jsx("span",{className:`caption text-right font-bold tabular-nums${o===void 0?" text-disabled":""}`,style:o!==void 0?{color:l(o)}:void 0,children:o!==void 0?n(o):"…"})]})}export{c as M};
@@ -1 +1 @@
1
- import{r as m,j as t}from"./react-qoZPGuNy.js";import{f as a}from"./format-CfAcS4D8.js";import{f as x,M as o,O as h}from"./index-DbboK5sz.js";import{F as l}from"./ui-Bq3RQsdJ.js";import{M as p}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";o.schema;function u({config:n}){const{debt:e,isLoading:d}=h(n.trendDays),c=m.useMemo(()=>((e==null?void 0:e.trend)??[]).map(r=>({date:new Date(r.time).toISOString(),value:r.total})),[e==null?void 0:e.trend]);if(d)return t.jsx(l,{loading:!0,children:"loading national debt…"});if(!e)return t.jsx(l,{children:"no debt data yet"});const s=e.trend[0],i=s?e.total-s.total:null;return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"total public debt"}),t.jsxs("div",{className:"body-sm text-normal",children:["as of ",e.date]})]}),t.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsx("div",{className:"metric-xl text-strong leading-none",children:a(e.total)}),i!==null&&s&&t.jsxs("div",{className:"text-right",children:[t.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[i>=0?"+":"",a(i)]}),t.jsxs("div",{className:"caption text-soft",children:["since ",s.date]})]})]}),t.jsx(p,{data:c,width:210,height:42,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),n.showSplit&&t.jsxs("div",{className:"grid grid-cols-2 gap-1.5 border-t border-white/[0.08] pt-2",children:[t.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[t.jsx("div",{className:"caption text-soft truncate",children:"Held by public"}),t.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(e.heldByPublic)})]}),t.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[t.jsx("div",{className:"caption text-soft truncate",children:"Intragovernmental"}),t.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(e.intragovernmental)})]})]})]})}const w=x({...o,component:u});export{w as nationalDebtFrame};
1
+ import{r as m,j as t}from"./react-qoZPGuNy.js";import{f as a}from"./format-CfAcS4D8.js";import{f as x,O as o,P as h}from"./index-mNBIIbY4.js";import{F as l}from"./ui-Bq3RQsdJ.js";import{M as p}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";o.schema;function u({config:n}){const{debt:e,isLoading:d}=h(n.trendDays),c=m.useMemo(()=>((e==null?void 0:e.trend)??[]).map(r=>({date:new Date(r.time).toISOString(),value:r.total})),[e==null?void 0:e.trend]);if(d)return t.jsx(l,{loading:!0,children:"loading national debt…"});if(!e)return t.jsx(l,{children:"no debt data yet"});const s=e.trend[0],i=s?e.total-s.total:null;return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"total public debt"}),t.jsxs("div",{className:"body-sm text-normal",children:["as of ",e.date]})]}),t.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsx("div",{className:"metric-xl text-strong leading-none",children:a(e.total)}),i!==null&&s&&t.jsxs("div",{className:"text-right",children:[t.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[i>=0?"+":"",a(i)]}),t.jsxs("div",{className:"caption text-soft",children:["since ",s.date]})]})]}),t.jsx(p,{data:c,width:210,height:42,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),n.showSplit&&t.jsxs("div",{className:"grid grid-cols-2 gap-1.5 border-t border-white/[0.08] pt-2",children:[t.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[t.jsx("div",{className:"caption text-soft truncate",children:"Held by public"}),t.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(e.heldByPublic)})]}),t.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[t.jsx("div",{className:"caption text-soft truncate",children:"Intragovernmental"}),t.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:a(e.intragovernmental)})]})]})]})}const w=x({...o,component:u});export{w as nationalDebtFrame};
@@ -0,0 +1 @@
1
+ import{j as s,r as h}from"./react-qoZPGuNy.js";import{F as f}from"./feed-row-mVg1d5Zj.js";import{t as p}from"./format-CfAcS4D8.js";import{f as x,_ as i,$ as b}from"./index-mNBIIbY4.js";import{F as t,s as j}from"./ui-Bq3RQsdJ.js";i.schema;const g={coindesk:"CoinDesk",cointelegraph:"Cointelegraph",decrypt:"Decrypt",cnbc:"CNBC Markets",nasdaq:"Nasdaq",stocks:"Google News"};function y({src:e}){const[r,a]=h.useState(!1);return r?null:s.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:()=>a(!0),className:"size-12 shrink-0 rounded-md bg-white/[0.04] object-cover ring-1 ring-white/10"})}function w({item:e}){return s.jsx(f,{href:e.url,leading:e.imageUrl?s.jsx(y,{src:e.imageUrl}):void 0,title:e.title,subtitle:e.summary||void 0,meta:e.publishedAt!==void 0?p(e.publishedAt):void 0})}function N({config:e}){var n;const r=e.source==="stocks",a=r&&e.symbols.length===0,c=a?"":e.source,{items:o,isLoading:d}=b(c,r?e.symbols:void 0,e.count);if(a)return s.jsx(t,{children:"add stock symbols to show company headlines"});if(d)return s.jsx(t,{loading:!0,children:"loading headlines…"});const m=((n=o[0])==null?void 0:n.source)??g[e.source]??"news";return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsx("span",{className:"caption text-soft truncate",children:m}),s.jsx("span",{className:"caption text-soft shrink-0",children:"headlines"})]}),s.jsx("div",{className:j,children:o.length>0?o.map((l,u)=>s.jsx(w,{item:l},`${l.url}-${u}`)):s.jsxs(t,{children:["no headlines ",r?"for these symbols":"available"," — the runtime proxy may be offline"]})})]})}const A=x({...i,component:N});export{A as newsFeedFrame};
@@ -0,0 +1 @@
1
+ import{r as a,j as c}from"./react-qoZPGuNy.js";import{f,a0 as m,m as d}from"./index-mNBIIbY4.js";import{s as p}from"./ui-Bq3RQsdJ.js";m.schema;function h({config:e}){const t=d(),[n,o]=a.useState(!1),[r,l]=a.useState(e.text),i=a.useRef(null);a.useEffect(()=>{l(e.text)},[e.text]),a.useEffect(()=>{var s;n&&((s=i.current)==null||s.focus())},[n]);const u=a.useCallback(()=>{r!==e.text&&(t==null||t({text:r})),o(!1)},[t,r,e.text]),x=e.align==="center"?"flex items-center justify-center text-center":"";return n?c.jsx("textarea",{ref:i,className:`body-sm text-normal h-full w-full resize-none bg-transparent outline-none placeholder:text-disabled ${x}`,value:r,onChange:s=>l(s.target.value),onBlur:u,onKeyDown:s=>{s.key==="Escape"&&(l(e.text),o(!1))},placeholder:"Write a note…"}):c.jsx("div",{className:`body-sm text-normal whitespace-pre-wrap ${p} ${x} ${t?"cursor-text":""}`,onClick:()=>t&&o(!0),title:t?"Click to edit":void 0,children:e.text||c.jsx("span",{className:"text-soft italic",children:t?"Click to add a note…":"New note"})})}const b=f({...m,component:h});export{b as noteFrame};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./react-qoZPGuNy.js";import{f as p,aw as l,ax as x,A as f,h as u}from"./index-DbboK5sz.js";import{f as r}from"./format-CfAcS4D8.js";import{F as i,s as h}from"./ui-Bq3RQsdJ.js";l.schema;const b=25;function g({config:m}){const{entries:a,isLoading:c}=x(m.symbols),t=n.useMemo(()=>a.slice(0,b),[a]),o=n.useMemo(()=>t.reduce((s,d)=>Math.max(s,d.openInterestUsd),0),[t]);return c?e.jsx(i,{loading:!0,children:"loading open interest…"}):t.length===0?e.jsx(i,{children:"no open-interest data"}):e.jsx("div",{className:`flex flex-col gap-1.5 ${h}`,children:t.map(s=>e.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",title:`${s.symbol} · ${r(s.openInterestUsd)} open interest`,children:[e.jsx(f,{symbol:s.symbol,size:16}),e.jsxs("div",{className:"relative h-4 w-full overflow-hidden rounded-sm bg-white/[0.06]",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-sm",style:{width:`${o>0?s.openInterestUsd/o*100:0}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72% / 0.5)"}}),e.jsx("span",{className:"absolute inset-y-0 left-1.5 flex items-center",children:e.jsx("span",{className:"body-sm truncate font-bold text-strong",children:u(s.symbol)})})]}),e.jsx("span",{className:"caption text-soft text-right tabular-nums",children:r(s.openInterestUsd)})]},s.symbol))})}const w=p({...l,component:g});export{w as openInterestFrame};
1
+ import{r as n,j as e}from"./react-qoZPGuNy.js";import{f as p,ay as l,az as f,A as u,h as x}from"./index-mNBIIbY4.js";import{f as r}from"./format-CfAcS4D8.js";import{F as i,s as h}from"./ui-Bq3RQsdJ.js";l.schema;const b=25;function g({config:m}){const{entries:a,isLoading:c}=f(m.symbols),t=n.useMemo(()=>a.slice(0,b),[a]),o=n.useMemo(()=>t.reduce((s,d)=>Math.max(s,d.openInterestUsd),0),[t]);return c?e.jsx(i,{loading:!0,children:"loading open interest…"}):t.length===0?e.jsx(i,{children:"no open-interest data"}):e.jsx("div",{className:`flex flex-col gap-1.5 ${h}`,children:t.map(s=>e.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",title:`${s.symbol} · ${r(s.openInterestUsd)} open interest`,children:[e.jsx(u,{symbol:s.symbol,size:16}),e.jsxs("div",{className:"relative h-4 w-full overflow-hidden rounded-sm bg-white/[0.06]",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-sm",style:{width:`${o>0?s.openInterestUsd/o*100:0}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72% / 0.5)"}}),e.jsx("span",{className:"absolute inset-y-0 left-1.5 flex items-center",children:e.jsx("span",{className:"body-sm truncate font-bold text-strong",children:x(s.symbol)})})]}),e.jsx("span",{className:"caption text-soft text-right tabular-nums",children:r(s.openInterestUsd)})]},s.symbol))})}const w=p({...l,component:g});export{w as openInterestFrame};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./react-qoZPGuNy.js";import{c as x}from"./format-CfAcS4D8.js";import{f as p,b0 as m,b1 as v}from"./index-DbboK5sz.js";import{F as c}from"./ui-Bq3RQsdJ.js";import{M as f}from"./mini-line-chart-D-i1QqSe.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";m.schema;const j={"7D":{ms:7*864e5,res:3600},"1M":{ms:30*864e5,res:43200},"3M":{ms:90*864e5,res:86400}};function g({config:a}){const{ms:i,res:o}=j[a.lookback],d=l.useMemo(()=>{const t=o*1e3;return Math.floor((Date.now()-i)/t)*t},[i,o]),{points:s,isLoading:h}=v(a.currency,d,o),u=l.useMemo(()=>s.map(t=>({date:new Date(t.time).toISOString(),value:t.value})),[s]);if(h)return e.jsx(c,{loading:!0,children:"loading volatility…"});if(s.length===0)return e.jsx(c,{children:"no volatility data yet"});const n=s[s.length-1].value,r=n-s[0].value;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[e.jsxs("div",{className:"flex items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"caption text-soft uppercase",children:[a.currency," DVOL · implied vol"]}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:n.toFixed(1)})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:x(r)},children:[r>=0?"+":"",r.toFixed(1)]}),e.jsxs("div",{className:"caption text-soft",children:["past ",a.lookback]})]})]}),e.jsx(f,{data:u,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"})]})}const O=p({...m,component:g});export{O as optionsIvFrame};
1
+ import{r as l,j as e}from"./react-qoZPGuNy.js";import{c as x}from"./format-CfAcS4D8.js";import{f as p,b2 as m,b3 as v}from"./index-mNBIIbY4.js";import{F as c}from"./ui-Bq3RQsdJ.js";import{M as f}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";m.schema;const j={"7D":{ms:7*864e5,res:3600},"1M":{ms:30*864e5,res:43200},"3M":{ms:90*864e5,res:86400}};function g({config:a}){const{ms:i,res:o}=j[a.lookback],d=l.useMemo(()=>{const t=o*1e3;return Math.floor((Date.now()-i)/t)*t},[i,o]),{points:s,isLoading:h}=v(a.currency,d,o),u=l.useMemo(()=>s.map(t=>({date:new Date(t.time).toISOString(),value:t.value})),[s]);if(h)return e.jsx(c,{loading:!0,children:"loading volatility…"});if(s.length===0)return e.jsx(c,{children:"no volatility data yet"});const n=s[s.length-1].value,r=n-s[0].value;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[e.jsxs("div",{className:"flex items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"caption text-soft uppercase",children:[a.currency," DVOL · implied vol"]}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:n.toFixed(1)})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:x(r)},children:[r>=0?"+":"",r.toFixed(1)]}),e.jsxs("div",{className:"caption text-soft",children:["past ",a.lookback]})]})]}),e.jsx(f,{data:u,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"})]})}const O=p({...m,component:g});export{O as optionsIvFrame};
@@ -1 +1 @@
1
- import{r as L,j as t}from"./react-qoZPGuNy.js";import{U as S,D as E,e as v,d as F}from"./format-CfAcS4D8.js";import{f as P,b2 as N,a$ as R}from"./index-DbboK5sz.js";import{F as g}from"./ui-Bq3RQsdJ.js";N.schema;const w=S,M=E;function B({config:h}){const{summary:p,isLoading:W}=R(h.currency),j=L.useMemo(()=>{if(!p)return null;const s=p.underlyingPrice,x=p.nearestExpiry.strikes;if(x.length===0)return null;const n=[...x].sort((r,y)=>Math.abs(r.strike-s)-Math.abs(y.strike-s)).slice(0,h.strikes).sort((r,y)=>r.strike-y.strike),d=Math.max(1,...n.map(r=>Math.max(r.callOi,r.putOi)));return{near:n,maxOi:d,spot:s,expiry:p.nearestExpiry.expiry}},[p,h.strikes]);if(W)return t.jsx(g,{loading:!0,children:"loading strikes…"});if(!j)return t.jsx(g,{children:"no options data yet"});const{near:e,maxOi:C,spot:a,expiry:H}=j,f=600,O=200,i=6,o=O-i-4,m=e.length,u=f/m,k=Math.max(2,u*.34),l=s=>s*u+u/2,b=s=>s/C*o;let c=null;if(a<=e[0].strike)c=l(0);else if(a>=e[m-1].strike)c=l(m-1);else for(let s=0;s<m-1;s++)if(a>=e[s].strike&&a<=e[s+1].strike){const x=e[s+1].strike-e[s].strike||1,n=(a-e[s].strike)/x;c=l(s)+n*(l(s+1)-l(s));break}return t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[t.jsxs("span",{children:["OI by strike · ",H]}),t.jsxs("span",{children:[t.jsx("span",{style:{color:w},children:"calls"})," ·"," ",t.jsx("span",{style:{color:M},children:"puts"})]})]}),t.jsxs("svg",{viewBox:`0 0 ${f} ${O}`,preserveAspectRatio:"none",className:"min-h-0 w-full flex-1",children:[t.jsx("line",{x1:0,y1:i+o,x2:f,y2:i+o,style:{stroke:"var(--color-disabled)"},strokeWidth:1}),e.map((s,x)=>{const n=l(x),d=b(s.callOi),r=b(s.putOi);return t.jsxs("g",{children:[t.jsx("rect",{x:n-k-1,y:i+o-d,width:k,height:d,fill:w}),t.jsx("rect",{x:n+1,y:i+o-r,width:k,height:r,fill:M})]},s.strike)}),c!==null&&t.jsx("line",{x1:c,y1:i,x2:c,y2:i+o,style:{stroke:"var(--color-soft)"},strokeWidth:1,strokeDasharray:"4 3"})]}),t.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[t.jsx("span",{children:v(e[0].strike)}),t.jsxs("span",{className:"text-normal",children:["spot ",F(a)]}),t.jsx("span",{children:v(e[m-1].strike)})]})]})}const _=P({...N,component:B});export{_ as optionsOiStrikeFrame};
1
+ import{r as L,j as t}from"./react-qoZPGuNy.js";import{U as S,D as E,e as v,d as F}from"./format-CfAcS4D8.js";import{f as P,b4 as N,b1 as R}from"./index-mNBIIbY4.js";import{F as g}from"./ui-Bq3RQsdJ.js";N.schema;const w=S,M=E;function B({config:h}){const{summary:p,isLoading:W}=R(h.currency),j=L.useMemo(()=>{if(!p)return null;const s=p.underlyingPrice,x=p.nearestExpiry.strikes;if(x.length===0)return null;const n=[...x].sort((r,y)=>Math.abs(r.strike-s)-Math.abs(y.strike-s)).slice(0,h.strikes).sort((r,y)=>r.strike-y.strike),d=Math.max(1,...n.map(r=>Math.max(r.callOi,r.putOi)));return{near:n,maxOi:d,spot:s,expiry:p.nearestExpiry.expiry}},[p,h.strikes]);if(W)return t.jsx(g,{loading:!0,children:"loading strikes…"});if(!j)return t.jsx(g,{children:"no options data yet"});const{near:e,maxOi:C,spot:a,expiry:H}=j,f=600,O=200,i=6,o=O-i-4,m=e.length,u=f/m,k=Math.max(2,u*.34),l=s=>s*u+u/2,b=s=>s/C*o;let c=null;if(a<=e[0].strike)c=l(0);else if(a>=e[m-1].strike)c=l(m-1);else for(let s=0;s<m-1;s++)if(a>=e[s].strike&&a<=e[s+1].strike){const x=e[s+1].strike-e[s].strike||1,n=(a-e[s].strike)/x;c=l(s)+n*(l(s+1)-l(s));break}return t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[t.jsxs("span",{children:["OI by strike · ",H]}),t.jsxs("span",{children:[t.jsx("span",{style:{color:w},children:"calls"})," ·"," ",t.jsx("span",{style:{color:M},children:"puts"})]})]}),t.jsxs("svg",{viewBox:`0 0 ${f} ${O}`,preserveAspectRatio:"none",className:"min-h-0 w-full flex-1",children:[t.jsx("line",{x1:0,y1:i+o,x2:f,y2:i+o,style:{stroke:"var(--color-disabled)"},strokeWidth:1}),e.map((s,x)=>{const n=l(x),d=b(s.callOi),r=b(s.putOi);return t.jsxs("g",{children:[t.jsx("rect",{x:n-k-1,y:i+o-d,width:k,height:d,fill:w}),t.jsx("rect",{x:n+1,y:i+o-r,width:k,height:r,fill:M})]},s.strike)}),c!==null&&t.jsx("line",{x1:c,y1:i,x2:c,y2:i+o,style:{stroke:"var(--color-soft)"},strokeWidth:1,strokeDasharray:"4 3"})]}),t.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[t.jsx("span",{children:v(e[0].strike)}),t.jsxs("span",{className:"text-normal",children:["spot ",F(a)]}),t.jsx("span",{children:v(e[m-1].strike)})]})]})}const $=P({...N,component:B});export{$ as optionsOiStrikeFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{U as h,D as f,b as e}from"./format-CfAcS4D8.js";import{f as j,a_ as u,a$ as v}from"./index-DbboK5sz.js";import{F as d}from"./ui-Bq3RQsdJ.js";u.schema;const i=h,o=f;function y(t){return t>1?o:i}function O({config:t}){const{summary:l,isLoading:m}=v(t.currency);if(m)return s.jsx(d,{loading:!0,children:"loading options…"});if(!l)return s.jsx(d,{children:"no options data yet"});const n=t.basis==="oi"?l.putCallRatioOi:l.putCallRatioVolume,x=t.basis==="oi"?l.putCallRatioVolume:l.putCallRatioOi,r=l.callOi+l.putOi,a=r>0?l.callOi/r*100:50,c=100-a,p=y(n);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[s.jsxs("div",{className:"flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"caption text-soft uppercase",children:[t.currency," put/call · ",t.basis==="oi"?"OI":"vol"]}),s.jsx("div",{className:"metric-xl leading-none",style:{color:p},children:n.toFixed(2)})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:x.toFixed(2)}),s.jsxs("div",{className:"caption text-soft",children:["by ",t.basis==="oi"?"volume":"OI"]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex h-3 w-full gap-1 overflow-hidden rounded-full",children:[s.jsx("div",{className:"h-full rounded-l-full",style:{width:`${a}%`,background:i}}),s.jsx("div",{className:"h-full rounded-r-full",style:{width:`${c}%`,background:o}})]}),s.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:i},children:"calls"})," ",e(a,0)]}),s.jsxs("span",{children:[e(c,0)," ",s.jsx("span",{style:{color:o},children:"puts"})]})]})]}),s.jsxs("div",{className:"caption text-soft",children:["avg implied vol ",e(l.avgIv,1)]})]})}const g=j({...u,component:O});export{g as optionsPutCallFrame};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{U as h,D as f,b as e}from"./format-CfAcS4D8.js";import{f as j,b0 as u,b1 as v}from"./index-mNBIIbY4.js";import{F as d}from"./ui-Bq3RQsdJ.js";u.schema;const i=h,o=f;function y(t){return t>1?o:i}function b({config:t}){const{summary:l,isLoading:m}=v(t.currency);if(m)return s.jsx(d,{loading:!0,children:"loading options…"});if(!l)return s.jsx(d,{children:"no options data yet"});const n=t.basis==="oi"?l.putCallRatioOi:l.putCallRatioVolume,x=t.basis==="oi"?l.putCallRatioVolume:l.putCallRatioOi,r=l.callOi+l.putOi,a=r>0?l.callOi/r*100:50,c=100-a,p=y(n);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[s.jsxs("div",{className:"flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"caption text-soft uppercase",children:[t.currency," put/call · ",t.basis==="oi"?"OI":"vol"]}),s.jsx("div",{className:"metric-xl leading-none",style:{color:p},children:n.toFixed(2)})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:x.toFixed(2)}),s.jsxs("div",{className:"caption text-soft",children:["by ",t.basis==="oi"?"volume":"OI"]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex h-3 w-full gap-1 overflow-hidden rounded-full",children:[s.jsx("div",{className:"h-full rounded-l-full",style:{width:`${a}%`,background:i}}),s.jsx("div",{className:"h-full rounded-r-full",style:{width:`${c}%`,background:o}})]}),s.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[s.jsxs("span",{children:[s.jsx("span",{style:{color:i},children:"calls"})," ",e(a,0)]}),s.jsxs("span",{children:[e(c,0)," ",s.jsx("span",{style:{color:o},children:"puts"})]})]})]}),s.jsxs("div",{className:"caption text-soft",children:["avg implied vol ",e(l.avgIv,1)]})]})}const g=j({...u,component:b});export{g as optionsPutCallFrame};
@@ -1 +1 @@
1
- import{r,j as s}from"./react-qoZPGuNy.js";import{i as k}from"./content-shared-BZ1XzrJx.js";import{f as w,ba as y}from"./index-DbboK5sz.js";y.schema;function M(e){const t=Math.floor(e/60),a=e%60;return`${t}:${String(a).padStart(2,"0")}`}function R({config:e}){const t=Math.max(1,Math.round(e.workMin*60)),a=Math.max(1,Math.round(e.breakMin*60)),[n,c]=r.useState("work"),[b,o]=r.useState(t),[l,i]=r.useState(!1),[u,m]=r.useState(1);r.useEffect(()=>{c("work"),o(t),i(!1),m(1)},[t,a]);const p=r.useRef(n);p.current=n;const x=r.useRef(u);x.current=u,r.useEffect(()=>{if(!l)return;const f=setInterval(()=>{o(h=>h>1?h-1:p.current==="work"?(c("break"),a):(c("work"),m(S=>x.current>=e.cycles?1:S+1),t))},1e3);return()=>clearInterval(f)},[l,t,a,e.cycles]);const j=()=>{i(!1),c("work"),o(t),m(1)},d=e.label.trim(),v=n==="work"?"var(--color-highlight)":void 0;return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1",children:[d&&s.jsx("div",{className:"caption text-soft uppercase tracking-[0.12em]",children:d}),s.jsxs("div",{className:"caption text-soft uppercase tracking-[0.18em]",children:[n," · ",u,"/",e.cycles]}),s.jsx("div",{className:"metric-xl text-strong",style:{color:v},children:M(b)}),s.jsxs("div",{className:"mt-1 flex gap-1",children:[s.jsx("button",{type:"button",onClick:()=>i(f=>!f),className:`caption text-normal px-3 py-1 ${k}`,children:l?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,className:`caption text-soft px-3 py-1 ${k}`,children:"Reset"})]})]})}const $=w({...y,component:R});export{$ as pomodoroFrame};
1
+ import{r,j as s}from"./react-qoZPGuNy.js";import{i as k}from"./content-shared-BZ1XzrJx.js";import{f as w,bc as y}from"./index-mNBIIbY4.js";y.schema;function M(e){const t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,"0")}`}function R({config:e}){const t=Math.max(1,Math.round(e.workMin*60)),n=Math.max(1,Math.round(e.breakMin*60)),[a,c]=r.useState("work"),[b,o]=r.useState(t),[l,i]=r.useState(!1),[u,m]=r.useState(1);r.useEffect(()=>{c("work"),o(t),i(!1),m(1)},[t,n]);const p=r.useRef(a);p.current=a;const x=r.useRef(u);x.current=u,r.useEffect(()=>{if(!l)return;const f=setInterval(()=>{o(h=>h>1?h-1:p.current==="work"?(c("break"),n):(c("work"),m(S=>x.current>=e.cycles?1:S+1),t))},1e3);return()=>clearInterval(f)},[l,t,n,e.cycles]);const j=()=>{i(!1),c("work"),o(t),m(1)},d=e.label.trim(),v=a==="work"?"var(--color-highlight)":void 0;return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1",children:[d&&s.jsx("div",{className:"caption text-soft uppercase tracking-[0.12em]",children:d}),s.jsxs("div",{className:"caption text-soft uppercase tracking-[0.18em]",children:[a," · ",u,"/",e.cycles]}),s.jsx("div",{className:"metric-xl text-strong",style:{color:v},children:M(b)}),s.jsxs("div",{className:"mt-1 flex gap-1",children:[s.jsx("button",{type:"button",onClick:()=>i(f=>!f),className:`caption text-normal px-3 py-1 ${k}`,children:l?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,className:`caption text-soft px-3 py-1 ${k}`,children:"Reset"})]})]})}const $=w({...y,component:R});export{$ as pomodoroFrame};
@@ -1 +1 @@
1
- import{r as m,j as t}from"./react-qoZPGuNy.js";import{f as R,g as j,h as A}from"./index-DbboK5sz.js";import{f as v,b as S}from"./format-CfAcS4D8.js";import{P as F,u as M,a as G}from"./portfolio-common-CVt117Oi.js";import{F as P}from"./ui-Bq3RQsdJ.js";import{C as y}from"./chart-utils-BYIZMM9J.js";import{s as p,p as E,a as h,o as _}from"./d3-xK4fOkBU.js";const B=["#FF1F5F","#81FE90"],L=({data:a,width:r=270,height:o=270,innerRadius:s=90,outerRadius:n=100,colors:e=B,children:l})=>{const d=m.useRef(null);return m.useEffect(()=>{if(!d.current||!a.length)return;p(d.current).selectAll("*").remove();const g=p(d.current),b=r/2,N=o/2,u=g.append("defs");u.append("filter").attr("id","glow").append("feGaussianBlur").attr("stdDeviation","3").attr("result","coloredBlur"),u.select("#glow").append("feMerge").selectAll("feMergeNode").data(["coloredBlur","SourceGraphic"]).enter().append("feMergeNode").attr("in",i=>i),u.append("filter").attr("id","glow-layer").append("feGaussianBlur").attr("stdDeviation","6").attr("result","glowBlur"),u.select("#glow-layer").append("feColorMatrix").attr("type","matrix").attr("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0").attr("result","glowColor");const k=E().value(i=>i.value).padAngle(.02),w=h().innerRadius(s).outerRadius(n).cornerRadius(100),C=h().innerRadius(s).outerRadius(n).cornerRadius(100),x=_().domain(a.map((i,c)=>c.toString())).range(e),f=g.append("g").attr("transform",`translate(${b}, ${N})`).selectAll("g").data(k(a)).enter().append("g");f.append("path").attr("class","glow-layer").attr("d",C).attr("fill",(i,c)=>x(c.toString())).attr("filter","url(#glow-layer)").style("opacity",0).style("pointer-events","none"),f.append("path").attr("class","main-slice").attr("d",w).attr("fill",(i,c)=>x(c.toString())).attr("stroke","none"),f.on("mouseenter",function(){p(this).select(".glow-layer").transition().duration(300).style("opacity",1)}).on("mouseleave",function(){p(this).select(".glow-layer").transition().duration(300).style("opacity",0)})},[a,r,o,s,n,e]),t.jsxs("div",{className:"relative flex flex-col items-center justify-center rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%)"},children:[t.jsx("svg",{ref:d,width:r,height:o,className:"relative z-10"}),t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l}),t.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}}),t.jsx("div",{className:"pointer-events-none absolute inset-[10%] rounded-full",style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}})]})};j.schema;function O({portfolio:a,config:r}){const{priced:o}=M(a.holdings),s=m.useMemo(()=>o.map((e,l)=>({name:A(e.symbol),value:e.value??0,color:y[l%y.length]})).filter(e=>e.value>0).sort((e,l)=>l.value-e.value),[o]),n=s.reduce((e,l)=>e+l.value,0);return s.length===0?t.jsx(P,{children:"no live prices yet"}):t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4",children:[t.jsx(L,{data:s,width:200,height:200,innerRadius:58,outerRadius:92,colors:s.map(e=>e.color),children:t.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[t.jsx(G,{portfolio:a,config:r,className:"caption text-soft"}),t.jsx("span",{className:"metric-lg text-strong",children:v(n)})]})}),t.jsx("div",{className:"flex w-full max-w-xs flex-wrap justify-center gap-x-5 gap-y-1.5",children:s.map(e=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:e.color}}),t.jsx("span",{className:"body-sm text-soft",children:e.name}),t.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:S(e.value/n*100,1)}),t.jsx("span",{className:"caption text-soft tabular-nums",children:v(e.value)})]},e.name))})]})}function I({config:a}){return t.jsx(F,{config:a,loadingLabel:"loading allocation…",children:r=>t.jsx(O,{portfolio:r,config:a})})}const Y=R({...j,component:I});export{Y as portfolioAllocationFrame};
1
+ import{r as m,j as t}from"./react-qoZPGuNy.js";import{f as R,g as j,h as A}from"./index-mNBIIbY4.js";import{f as v,b as S}from"./format-CfAcS4D8.js";import{P as F,u as M,a as P}from"./portfolio-common-COoaTucT.js";import{F as G}from"./ui-Bq3RQsdJ.js";import{C as y}from"./chart-utils-BYIZMM9J.js";import{s as p,p as E,a as h,o as _}from"./d3-xK4fOkBU.js";const B=["#FF1F5F","#81FE90"],L=({data:a,width:r=270,height:o=270,innerRadius:s=90,outerRadius:n=100,colors:e=B,children:l})=>{const d=m.useRef(null);return m.useEffect(()=>{if(!d.current||!a.length)return;p(d.current).selectAll("*").remove();const g=p(d.current),b=r/2,N=o/2,u=g.append("defs");u.append("filter").attr("id","glow").append("feGaussianBlur").attr("stdDeviation","3").attr("result","coloredBlur"),u.select("#glow").append("feMerge").selectAll("feMergeNode").data(["coloredBlur","SourceGraphic"]).enter().append("feMergeNode").attr("in",i=>i),u.append("filter").attr("id","glow-layer").append("feGaussianBlur").attr("stdDeviation","6").attr("result","glowBlur"),u.select("#glow-layer").append("feColorMatrix").attr("type","matrix").attr("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0").attr("result","glowColor");const k=E().value(i=>i.value).padAngle(.02),w=h().innerRadius(s).outerRadius(n).cornerRadius(100),C=h().innerRadius(s).outerRadius(n).cornerRadius(100),x=_().domain(a.map((i,c)=>c.toString())).range(e),f=g.append("g").attr("transform",`translate(${b}, ${N})`).selectAll("g").data(k(a)).enter().append("g");f.append("path").attr("class","glow-layer").attr("d",C).attr("fill",(i,c)=>x(c.toString())).attr("filter","url(#glow-layer)").style("opacity",0).style("pointer-events","none"),f.append("path").attr("class","main-slice").attr("d",w).attr("fill",(i,c)=>x(c.toString())).attr("stroke","none"),f.on("mouseenter",function(){p(this).select(".glow-layer").transition().duration(300).style("opacity",1)}).on("mouseleave",function(){p(this).select(".glow-layer").transition().duration(300).style("opacity",0)})},[a,r,o,s,n,e]),t.jsxs("div",{className:"relative flex flex-col items-center justify-center rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%)"},children:[t.jsx("svg",{ref:d,width:r,height:o,className:"relative z-10"}),t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l}),t.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}}),t.jsx("div",{className:"pointer-events-none absolute inset-[10%] rounded-full",style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}})]})},O=m.memo(L);j.schema;function $({portfolio:a,config:r}){const{priced:o}=M(a.holdings),s=m.useMemo(()=>o.map((e,l)=>({name:A(e.symbol),value:e.value??0,color:y[l%y.length]})).filter(e=>e.value>0).sort((e,l)=>l.value-e.value),[o]),n=s.reduce((e,l)=>e+l.value,0);return s.length===0?t.jsx(G,{children:"no live prices yet"}):t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4",children:[t.jsx(O,{data:s,width:200,height:200,innerRadius:58,outerRadius:92,colors:s.map(e=>e.color),children:t.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[t.jsx(P,{portfolio:a,config:r,className:"caption text-soft"}),t.jsx("span",{className:"metric-lg text-strong",children:v(n)})]})}),t.jsx("div",{className:"flex w-full max-w-xs flex-wrap justify-center gap-x-5 gap-y-1.5",children:s.map(e=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:e.color}}),t.jsx("span",{className:"body-sm text-soft",children:e.name}),t.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:S(e.value/n*100,1)}),t.jsx("span",{className:"caption text-soft tabular-nums",children:v(e.value)})]},e.name))})]})}function I({config:a}){return t.jsx(F,{config:a,loadingLabel:"loading allocation…",children:r=>t.jsx($,{portfolio:r,config:a})})}const q=R({...j,component:I});export{q as portfolioAllocationFrame};
@@ -1 +1 @@
1
- import{j as s,r as d}from"./react-qoZPGuNy.js";import{j as b,k as j,l as g,A as y,m as w}from"./index-DbboK5sz.js";import{F as h}from"./ui-Bq3RQsdJ.js";function P(n){if(n.source==="wallet"){const o=(n.address??"").trim();return o?{kind:"wallet",address:o}:null}return{kind:"binance"}}const C={WETH:"ETH",WBTC:"BTC"};function x(n){return C[n.toUpperCase()]??n}function D(n){const o=n??[],r=o.map(e=>x(e.symbol)),l=j(r);return d.useMemo(()=>{const e=o.map(a=>{const u=l[x(a.symbol)],c=u!==void 0?a.amount*u:a.valueUsd;return{...a,value:c}}),i=e.reduce((a,u)=>a+(u.value??0),0);return{priced:e,total:i}},[n,l])}function _({portfolio:n,config:o,className:r=""}){var i;const l=n.label??(o.source==="wallet"?"wallet":"portfolio"),e=(i=o.address)==null?void 0:i.trim();return o.source==="wallet"&&e?s.jsx("a",{href:`https://etherscan.io/address/${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",title:"View on Etherscan",className:`hover:text-white hover:underline ${r}`,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),children:l}):s.jsx("span",{className:r,children:l})}function v(n,o){const r=(n==null?void 0:n.kind)==="binance",[l,e]=d.useState({loading:r,connected:!1,keyMasked:null});return d.useEffect(()=>{if(!r||!n){e({loading:!1,connected:!1,keyMasked:null});return}let i=!1;return e(a=>({...a,loading:!0})),fetch(`${g}?source=${n.kind}`,{headers:{accept:"application/json"}}).then(a=>a.ok?a.json():{connected:!1,keyMasked:null}).then(a=>{i||e({loading:!1,connected:!!a.connected,keyMasked:a.keyMasked??null})}).catch(()=>{i||e({loading:!1,connected:!1,keyMasked:null})}),()=>{i=!0}},[r,n==null?void 0:n.kind,o]),l}function N(n){const[o,r]=d.useState(0),l=d.useCallback(()=>r(p=>p+1),[]),e=P(n),i=v(e,o),a=(e==null?void 0:e.kind)==="binance",u=!!e&&(!a||i.connected),{portfolio:c,isLoading:f}=b(u?e:null);let t;return e?a&&i.loading?t={state:"checking"}:a&&!i.connected?t={state:"needs-connect",source:e}:f&&!c?t={state:"loading"}:c?c.holdings.length===0?t={state:"empty",portfolio:c}:t={state:"live",portfolio:c}:t={state:"error"}:t={state:"needs-address"},{view:t,refresh:l}}const m="w-full rounded-md border border-white/10 bg-white/[0.04] px-2 py-1.5 text-xs text-white/90 outline-none focus:border-white/25 placeholder:text-white/30",k="rounded-md bg-[hsl(var(--zf-accent-hue,242)_90%_60%)] px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50";function S({onConnected:n}){const[o,r]=d.useState(""),[l,e]=d.useState(""),[i,a]=d.useState(!1),[u,c]=d.useState(null),f=async()=>{a(!0),c(null);try{const t=await fetch(g,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:"binance",key:o.trim(),secret:l.trim()})}),p=await t.json().catch(()=>({}));if(!t.ok||!p.ok)throw new Error(p.error??`HTTP ${t.status}`);r(""),e(""),n()}catch(t){c(t instanceof Error?t.message:String(t))}finally{a(!1)}};return s.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(y,{symbol:"BNB",size:18}),s.jsx("span",{className:"text-strong text-sm font-bold",children:"Connect Binance"})]}),s.jsxs("p",{className:"caption text-soft",children:["Use a ",s.jsx("strong",{children:"read-only"})," key + secret — create them in Binance"," ",s.jsx("a",{href:"https://www.binance.com/en/my/settings/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[hsl(var(--zf-accent-hue,242)_90%_72%)] underline underline-offset-2 hover:text-white",onClick:t=>t.stopPropagation(),onPointerDown:t=>t.stopPropagation(),children:"API Management"})," ","(enable Reading only). Both stay on your machine, never shared."]}),s.jsx("input",{className:m,placeholder:"API key",value:o,autoComplete:"off",onChange:t=>r(t.target.value),onPointerDown:t=>t.stopPropagation()}),s.jsx("input",{className:m,placeholder:"API secret",type:"password",value:l,autoComplete:"off",onChange:t=>e(t.target.value),onPointerDown:t=>t.stopPropagation()}),u?s.jsx("p",{className:"caption text-[#ff6b81]",children:u}):null,s.jsx("button",{type:"button",className:k,disabled:i||!o.trim()||!l.trim(),onClick:t=>{t.stopPropagation(),f()},onPointerDown:t=>t.stopPropagation(),children:i?"Verifying…":"Connect"})]})}function E({current:n}){const o=w(),[r,l]=d.useState(n??"");return s.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(y,{symbol:"ETH",size:18}),s.jsx("span",{className:"text-strong text-sm font-bold",children:"Track a wallet"})]}),s.jsx("p",{className:"caption text-soft",children:"Enter a public Ethereum address or ENS name. No keys — it’s public on-chain data. Sharing this dashboard reveals the holdings."}),s.jsx("input",{className:m,placeholder:"0x… or name.eth",value:r,autoComplete:"off",onChange:e=>l(e.target.value),onPointerDown:e=>e.stopPropagation()}),o?s.jsx("button",{type:"button",className:k,disabled:!r.trim(),onClick:e=>{e.stopPropagation(),o({address:r.trim()})},onPointerDown:e=>e.stopPropagation(),children:"Track"}):s.jsx("p",{className:"caption text-soft",children:"Set the address in the frame’s config to start tracking."})]})}function I({config:n,loadingLabel:o="loading portfolio…",children:r}){const{view:l,refresh:e}=N(n);switch(l.state){case"needs-address":case"needs-connect":return s.jsx(T,{view:l,config:n,onConnected:e});case"checking":case"loading":return s.jsx(h,{loading:!0,children:o});case"error":return s.jsx(h,{children:"couldn’t load — check the address or try again"});case"empty":return s.jsx(h,{children:"no holdings to show"});case"live":return s.jsx(s.Fragment,{children:r(l.portfolio)})}}function T({view:n,config:o,onConnected:r}){return n.state==="needs-connect"&&n.source.kind==="binance"?s.jsx(S,{onConnected:r}):s.jsx(E,{current:o.address})}export{I as P,_ as a,D as u};
1
+ import{j as s,r as d}from"./react-qoZPGuNy.js";import{j as b,k as j,l as g,A as y,m as w}from"./index-mNBIIbY4.js";import{F as h}from"./ui-Bq3RQsdJ.js";function P(n){if(n.source==="wallet"){const o=(n.address??"").trim();return o?{kind:"wallet",address:o}:null}return{kind:"binance"}}const C={WETH:"ETH",WBTC:"BTC"};function x(n){return C[n.toUpperCase()]??n}function D(n){const o=n??[],r=o.map(e=>x(e.symbol)),l=j(r);return d.useMemo(()=>{const e=o.map(a=>{const u=l[x(a.symbol)],c=u!==void 0?a.amount*u:a.valueUsd;return{...a,value:c}}),i=e.reduce((a,u)=>a+(u.value??0),0);return{priced:e,total:i}},[n,l])}function _({portfolio:n,config:o,className:r=""}){var i;const l=n.label??(o.source==="wallet"?"wallet":"portfolio"),e=(i=o.address)==null?void 0:i.trim();return o.source==="wallet"&&e?s.jsx("a",{href:`https://etherscan.io/address/${encodeURIComponent(e)}`,target:"_blank",rel:"noopener noreferrer",title:"View on Etherscan",className:`hover:text-white hover:underline ${r}`,onClick:a=>a.stopPropagation(),onPointerDown:a=>a.stopPropagation(),children:l}):s.jsx("span",{className:r,children:l})}function v(n,o){const r=(n==null?void 0:n.kind)==="binance",[l,e]=d.useState({loading:r,connected:!1,keyMasked:null});return d.useEffect(()=>{if(!r||!n){e({loading:!1,connected:!1,keyMasked:null});return}let i=!1;return e(a=>({...a,loading:!0})),fetch(`${g}?source=${n.kind}`,{headers:{accept:"application/json"}}).then(a=>a.ok?a.json():{connected:!1,keyMasked:null}).then(a=>{i||e({loading:!1,connected:!!a.connected,keyMasked:a.keyMasked??null})}).catch(()=>{i||e({loading:!1,connected:!1,keyMasked:null})}),()=>{i=!0}},[r,n==null?void 0:n.kind,o]),l}function N(n){const[o,r]=d.useState(0),l=d.useCallback(()=>r(p=>p+1),[]),e=P(n),i=v(e,o),a=(e==null?void 0:e.kind)==="binance",u=!!e&&(!a||i.connected),{portfolio:c,isLoading:f}=b(u?e:null);let t;return e?a&&i.loading?t={state:"checking"}:a&&!i.connected?t={state:"needs-connect",source:e}:f&&!c?t={state:"loading"}:c?c.holdings.length===0?t={state:"empty",portfolio:c}:t={state:"live",portfolio:c}:t={state:"error"}:t={state:"needs-address"},{view:t,refresh:l}}const m="w-full rounded-md border border-white/10 bg-white/[0.04] px-2 py-1.5 text-xs text-white/90 outline-none focus:border-white/25 placeholder:text-white/30",k="rounded-md bg-[hsl(var(--zf-accent-hue,242)_90%_60%)] px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50";function S({onConnected:n}){const[o,r]=d.useState(""),[l,e]=d.useState(""),[i,a]=d.useState(!1),[u,c]=d.useState(null),f=async()=>{a(!0),c(null);try{const t=await fetch(g,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:"binance",key:o.trim(),secret:l.trim()})}),p=await t.json().catch(()=>({}));if(!t.ok||!p.ok)throw new Error(p.error??`HTTP ${t.status}`);r(""),e(""),n()}catch(t){c(t instanceof Error?t.message:String(t))}finally{a(!1)}};return s.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(y,{symbol:"BNB",size:18}),s.jsx("span",{className:"text-strong text-sm font-bold",children:"Connect Binance"})]}),s.jsxs("p",{className:"caption text-soft",children:["Use a ",s.jsx("strong",{children:"read-only"})," key + secret — create them in Binance"," ",s.jsx("a",{href:"https://www.binance.com/en/my/settings/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[hsl(var(--zf-accent-hue,242)_90%_72%)] underline underline-offset-2 hover:text-white",onClick:t=>t.stopPropagation(),onPointerDown:t=>t.stopPropagation(),children:"API Management"})," ","(enable Reading only). Both stay on your machine, never shared."]}),s.jsx("input",{className:m,placeholder:"API key",value:o,autoComplete:"off",onChange:t=>r(t.target.value),onPointerDown:t=>t.stopPropagation()}),s.jsx("input",{className:m,placeholder:"API secret",type:"password",value:l,autoComplete:"off",onChange:t=>e(t.target.value),onPointerDown:t=>t.stopPropagation()}),u?s.jsx("p",{className:"caption text-[#ff6b81]",children:u}):null,s.jsx("button",{type:"button",className:k,disabled:i||!o.trim()||!l.trim(),onClick:t=>{t.stopPropagation(),f()},onPointerDown:t=>t.stopPropagation(),children:i?"Verifying…":"Connect"})]})}function E({current:n}){const o=w(),[r,l]=d.useState(n??"");return s.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(y,{symbol:"ETH",size:18}),s.jsx("span",{className:"text-strong text-sm font-bold",children:"Track a wallet"})]}),s.jsx("p",{className:"caption text-soft",children:"Enter a public Ethereum address or ENS name. No keys — it’s public on-chain data. Sharing this dashboard reveals the holdings."}),s.jsx("input",{className:m,placeholder:"0x… or name.eth",value:r,autoComplete:"off",onChange:e=>l(e.target.value),onPointerDown:e=>e.stopPropagation()}),o?s.jsx("button",{type:"button",className:k,disabled:!r.trim(),onClick:e=>{e.stopPropagation(),o({address:r.trim()})},onPointerDown:e=>e.stopPropagation(),children:"Track"}):s.jsx("p",{className:"caption text-soft",children:"Set the address in the frame’s config to start tracking."})]})}function I({config:n,loadingLabel:o="loading portfolio…",children:r}){const{view:l,refresh:e}=N(n);switch(l.state){case"needs-address":case"needs-connect":return s.jsx(T,{view:l,config:n,onConnected:e});case"checking":case"loading":return s.jsx(h,{loading:!0,children:o});case"error":return s.jsx(h,{children:"couldn’t load — check the address or try again"});case"empty":return s.jsx(h,{children:"no holdings to show"});case"live":return s.jsx(s.Fragment,{children:r(l.portfolio)})}}function T({view:n,config:o,onConnected:r}){return n.state==="needs-connect"&&n.source.kind==="binance"?s.jsx(S,{onConnected:r}):s.jsx(E,{current:o.address})}export{I as P,_ as a,D as u};