zframes 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/index.js +130 -3
  2. package/package.json +6 -6
  3. package/runtime/assets/{bitcoin-dominance-CweHlZx7.js → bitcoin-dominance-rskkp4h2.js} +1 -1
  4. package/runtime/assets/{breakeven-CG9rKwgE.js → breakeven-DyCA3ya5.js} +1 -1
  5. package/runtime/assets/{breathing-cDundHq6.js → breathing-C8Y-Izs8.js} +1 -1
  6. package/runtime/assets/{btc-blocks-Do_nySHd.js → btc-blocks-BxS4aEAB.js} +1 -1
  7. package/runtime/assets/{btc-difficulty-vNbz5uRo.js → btc-difficulty-CNFxEiPh.js} +1 -1
  8. package/runtime/assets/{btc-fees-BmADLsmK.js → btc-fees-Db-5JKh9.js} +1 -1
  9. package/runtime/assets/{btc-hashrate-Wx2RAG-5.js → btc-hashrate-Dy2c30Gb.js} +1 -1
  10. package/runtime/assets/{btc-mempool-CTwbkMUR.js → btc-mempool-DFgUVk8y.js} +1 -1
  11. package/runtime/assets/{calculator-mvv6XpQC.js → calculator-v01_FkZv.js} +1 -1
  12. package/runtime/assets/chain-activity-CuA1eiPY.js +1 -0
  13. package/runtime/assets/{chart-utils-BYIZMM9J.js → chart-utils-Ct7WziT9.js} +1 -1
  14. package/runtime/assets/{checklist-CuEw3GpE.js → checklist-Be_y1aTE.js} +1 -1
  15. package/runtime/assets/{clock-Cjnwi03W.js → clock-BWFux5om.js} +1 -1
  16. package/runtime/assets/{coin-movers-Bcx1XR0F.js → coin-movers-BcXfoFc6.js} +1 -1
  17. package/runtime/assets/{countdown-Cdi5gSSu.js → countdown-CXSOeUWD.js} +1 -1
  18. package/runtime/assets/{cycle-shared-BOGcJDzT.js → cycle-shared-pyXzkgt1.js} +1 -1
  19. package/runtime/assets/{cycle-signals-CS629ZDc.js → cycle-signals-BrKJX2c6.js} +1 -1
  20. package/runtime/assets/{d3-xK4fOkBU.js → d3-Dr3MHXm3.js} +1 -1
  21. package/runtime/assets/{daily-analysis-DX8bVq85.js → daily-analysis-CWluVygw.js} +1 -1
  22. package/runtime/assets/{day-meter-DDfTuhms.js → day-meter-Bi5OZCC4.js} +1 -1
  23. package/runtime/assets/{defi-revenue-CpeAGwhb.js → defi-revenue-CFNSNfG7.js} +1 -1
  24. package/runtime/assets/dex-hot-pools-C4TrRB17.js +1 -0
  25. package/runtime/assets/dex-pool-treemap-DqvlN1Jo.js +1 -0
  26. package/runtime/assets/{dex-volume-chart-sHIuJACJ.js → dex-volume-chart-BLR-L_B0.js} +1 -1
  27. package/runtime/assets/{dex-volume-treemap-rSTrzz7O.js → dex-volume-treemap-qyEBx4ll.js} +1 -1
  28. package/runtime/assets/{dice-BrFORdjN.js → dice-CuzcQipj.js} +1 -1
  29. package/runtime/assets/{dino-game-BOV8mV1d.js → dino-game-CiGWzsag.js} +1 -1
  30. package/runtime/assets/{divider-C33tH1RU.js → divider-DvK5oM9v.js} +1 -1
  31. package/runtime/assets/{drawdy-BIb36JN9.js → drawdy-Bxr7eJ-7.js} +1 -1
  32. package/runtime/assets/{dxy-CRifEdp_.js → dxy-CVbZmRsT.js} +1 -1
  33. package/runtime/assets/editor-CQM8mtD8.css +1 -0
  34. package/runtime/assets/{editor-Dnp1eXvY.js → editor-EOEtB4_n.js} +1 -1
  35. package/runtime/assets/{etf-flows-BV10E2R-.js → etf-flows-Cl1WliDl.js} +1 -1
  36. package/runtime/assets/{etf-flows-chart-DHu8mkXm.js → etf-flows-chart-B4Im9TVy.js} +1 -1
  37. package/runtime/assets/{eth-staking-BqWeJq6F.js → eth-staking-_q2b8DEx.js} +1 -1
  38. package/runtime/assets/{eth-supply-CF-MgHjn.js → eth-supply-55OpYYBL.js} +1 -1
  39. package/runtime/assets/{fear-greed-DuDR56h2.js → fear-greed-CywOCckQ.js} +1 -1
  40. package/runtime/assets/{filings-feed-BpfO2yF6.js → filings-feed-CosEi4NL.js} +1 -1
  41. package/runtime/assets/{financial-stress-BfYJdlry.js → financial-stress-DBCae4TA.js} +1 -1
  42. package/runtime/assets/{flappy-bird-Dbb2UQBv.js → flappy-bird-CBVgwfgX.js} +1 -1
  43. package/runtime/assets/{fundamentals-CUnqjF--.js → fundamentals-zRwGUcmb.js} +1 -1
  44. package/runtime/assets/{funding-comparison-CMKxW1n-.js → funding-comparison-wCNoCb1H.js} +1 -1
  45. package/runtime/assets/{funding-heatmap-CZWnYF8Y.js → funding-heatmap-a4zdnKi9.js} +1 -1
  46. package/runtime/assets/{funding-rate-chart-C-tpwid_.js → funding-rate-chart-Da9WMKyJ.js} +1 -1
  47. package/runtime/assets/{fx-board-YAy44m5d.js → fx-board-CxhwDBHO.js} +1 -1
  48. package/runtime/assets/{heading-uIVBEE7K.js → heading-b5H33lig.js} +1 -1
  49. package/runtime/assets/{holiday-calendar-DCj83hi2.js → holiday-calendar-C77t3m6c.js} +1 -1
  50. package/runtime/assets/{image-CITPAmp0.js → image-C8ZSUHEx.js} +1 -1
  51. package/runtime/assets/{index-XGtH5pVY.css → index-BXLwJuoo.css} +1 -1
  52. package/runtime/assets/{index-CrmTiZaB.css → index-C-VdMqKb.css} +1 -1
  53. package/runtime/assets/index-DKixdHYB.js +1 -0
  54. package/runtime/assets/index-kB-TyxKi.js +1073 -0
  55. package/runtime/assets/{inflation-pulse-Bqa3-cuC.js → inflation-pulse-CoXcuabd.js} +1 -1
  56. package/runtime/assets/{journal-log-Bgjia8cQ.js → journal-log-BDu39CBE.js} +1 -1
  57. package/runtime/assets/{journal-open-Bm5gwWXz.js → journal-open-FejLOzlA.js} +1 -1
  58. package/runtime/assets/{journal-results-cEWe2pbe.js → journal-results-CtKy6MZM.js} +1 -1
  59. package/runtime/assets/{journal-score-vmfF-9bK.js → journal-score-Bd7IDYl4.js} +1 -1
  60. package/runtime/assets/{journal-ui-ApBNIq5_.js → journal-ui-C_htu3aM.js} +1 -1
  61. package/runtime/assets/{labor-market-azDXD-dR.js → labor-market-DR0j05Gy.js} +1 -1
  62. package/runtime/assets/{lightning-stats-nkyh2dOX.js → lightning-stats-botYMCIX.js} +1 -1
  63. package/runtime/assets/{link-grid-BEo4b54T.js → link-grid-DFuD6XVK.js} +1 -1
  64. package/runtime/assets/{ma-multiplier-BllDQMF5.js → ma-multiplier-s6ix-kL8.js} +1 -1
  65. package/runtime/assets/{macro-calendar-Ck0dJk4p.js → macro-calendar-Dhnx2n5Q.js} +1 -1
  66. package/runtime/assets/{market-cap-treemap-AxE2EYPO.js → market-cap-treemap-BWtivvac.js} +1 -1
  67. package/runtime/assets/{market-hours-BSwXtU8c.js → market-hours-wSrW5Elv.js} +1 -1
  68. package/runtime/assets/{marquee-1Zr5qDJP.js → marquee-NHBiLJUk.js} +1 -1
  69. package/runtime/assets/{mayer-multiple-DpBJNd4d.js → mayer-multiple-CZC5q6ra.js} +1 -1
  70. package/runtime/assets/{mini-line-chart-CHM5UBjJ.js → mini-line-chart-QWeuTPfP.js} +1 -1
  71. package/runtime/assets/{mining-pools-B-jxdTot.js → mining-pools-BxipfJmv.js} +1 -1
  72. package/runtime/assets/{mover-row-Dg96EIqq.js → mover-row-CUd1i2yt.js} +1 -1
  73. package/runtime/assets/{mvrv-Dx_S0TwE.js → mvrv-BIwCiyRN.js} +1 -1
  74. package/runtime/assets/{national-debt-BKVBHaqm.js → national-debt-DwC5azy3.js} +1 -1
  75. package/runtime/assets/{news-feed-C9itZmyp.js → news-feed-BhAsJ6gt.js} +1 -1
  76. package/runtime/assets/nft-collections-sD-yDfKU.js +1 -0
  77. package/runtime/assets/nft-treemap-Bqhk41Of.js +1 -0
  78. package/runtime/assets/{note-BtCnmuMo.js → note-C1-RPOvR.js} +1 -1
  79. package/runtime/assets/{nupl-aIjkc57m.js → nupl-U-WHVDJ0.js} +1 -1
  80. package/runtime/assets/{open-interest-C0ulogv6.js → open-interest-C0_M6MkH.js} +1 -1
  81. package/runtime/assets/{options-iv-CdUder3x.js → options-iv-CIHzBULM.js} +1 -1
  82. package/runtime/assets/{options-oi-strike-CvCZnMCR.js → options-oi-strike-Db8lP27S.js} +1 -1
  83. package/runtime/assets/{options-put-call-FuaDHJ-S.js → options-put-call-5ex7Ablt.js} +1 -1
  84. package/runtime/assets/{pi-cycle-BuCnLnIJ.js → pi-cycle-eACZGQhd.js} +1 -1
  85. package/runtime/assets/{pomodoro-DDBVVcSR.js → pomodoro-CaS6y-eQ.js} +1 -1
  86. package/runtime/assets/portfolio-allocation-NR-4wbGL.js +1 -0
  87. package/runtime/assets/{portfolio-common-Bi16i0aA.js → portfolio-common-Cfpnudvk.js} +1 -1
  88. package/runtime/assets/{portfolio-holdings-MyAinCzt.js → portfolio-holdings-D-SG9B5X.js} +1 -1
  89. package/runtime/assets/{portfolio-value-BPURwKf8.js → portfolio-value-DPKyirHc.js} +1 -1
  90. package/runtime/assets/{prediction-markets-Bzy51qnV.js → prediction-markets-Cnf0KZba.js} +1 -1
  91. package/runtime/assets/{price-chart-BOCD8ka3.js → price-chart-BEnpZLyb.js} +1 -1
  92. package/runtime/assets/{price-compare-DZlF-qhZ.js → price-compare-8LvkF-xq.js} +1 -1
  93. package/runtime/assets/{price-liveline-Bl7qCd5-.js → price-liveline-DkTeXuC2.js} +1 -1
  94. package/runtime/assets/{price-ticker-D2W4T02y.js → price-ticker-DgDJ3k4b.js} +1 -1
  95. package/runtime/assets/{protocol-fees-treemap-DiIt4bfo.js → protocol-fees-treemap-fvVOfUFt.js} +1 -1
  96. package/runtime/assets/{protocol-tvl-chart-CmzANiR7.js → protocol-tvl-chart-BfrszRqq.js} +1 -1
  97. package/runtime/assets/{protocol-tvl-treemap-BjNPrrtL.js → protocol-tvl-treemap-v5kaQdP4.js} +1 -1
  98. package/runtime/assets/{puell-multiple-BGrJX43r.js → puell-multiple-BdOLF9Wh.js} +1 -1
  99. package/runtime/assets/{quote-CRM3bfI7.js → quote-slpulzHo.js} +1 -1
  100. package/runtime/assets/{rates-board-Cb9rV0_-.js → rates-board-B6hHyiDM.js} +1 -1
  101. package/runtime/assets/{realized-price-CYlrFa0m.js → realized-price-dn6bApj-.js} +1 -1
  102. package/runtime/assets/{reserve-risk-Be98XUsD.js → reserve-risk-_07r_h5w.js} +1 -1
  103. package/runtime/assets/{returns-projector-D67a_yvC.js → returns-projector-NBs7iGAV.js} +1 -1
  104. package/runtime/assets/{risk-reward-C7WMz2od.js → risk-reward-Baq_TRho.js} +1 -1
  105. package/runtime/assets/{rsi-momentum-IglnulkJ.js → rsi-momentum-B6oTu5W6.js} +1 -1
  106. package/runtime/assets/{rules-card-DJs3fDVN.js → rules-card-D98hKEwY.js} +1 -1
  107. package/runtime/assets/{sector-performance-DVMaleLY.js → sector-performance-DlnYIM-L.js} +1 -1
  108. package/runtime/assets/{sector-treemap-B681nSi6.js → sector-treemap-C3sX3Q9o.js} +1 -1
  109. package/runtime/assets/{session-progress-CZO3LqUi.js → session-progress-BYwNuuP-.js} +1 -1
  110. package/runtime/assets/{short-volume-l8_9Yoh3.js → short-volume-CxBDSjP6.js} +1 -1
  111. package/runtime/assets/{snake-CifbTGlZ.js → snake-CGV0Kg4z.js} +1 -1
  112. package/runtime/assets/{sopr-Dw_oz-mC.js → sopr-DAn99w9D.js} +1 -1
  113. package/runtime/assets/{spotify-embed-BA0m1IRb.js → spotify-embed-BBfim9vk.js} +1 -1
  114. package/runtime/assets/{stablecoin-chains-Dd2LqqqY.js → stablecoin-chains-D4EKi_YR.js} +1 -1
  115. package/runtime/assets/{stablecoin-supply-DM4ogL4V.js → stablecoin-supply-1m6FGR7-.js} +1 -1
  116. package/runtime/assets/{stopwatch-Co72v-7u.js → stopwatch-CCqsSaII.js} +1 -1
  117. package/runtime/assets/{top-movers-CLmC2TNu.js → top-movers-CAqBZOUL.js} +1 -1
  118. package/runtime/assets/{treasury-auctions-Dl9fiRgf.js → treasury-auctions-Bl19yaM_.js} +1 -1
  119. package/runtime/assets/{treemap-leaf-Dn31k9S9.js → treemap-leaf-A45Ge4-e.js} +1 -1
  120. package/runtime/assets/{trending-coins-Cpx9T6cG.js → trending-coins-Dm9R9zGQ.js} +1 -1
  121. package/runtime/assets/{tvl-treemap-e610jE8k.js → tvl-treemap-CSM9ioUr.js} +1 -1
  122. package/runtime/assets/{utils-DaT-yT0k.js → utils-DxneYyA_.js} +1 -1
  123. package/runtime/assets/{video-CeKjM-cE.js → video-CkvIGlHg.js} +1 -1
  124. package/runtime/assets/{volume-profile-CiMFsIBu.js → volume-profile-UJPTgNwV.js} +1 -1
  125. package/runtime/assets/{yield-curve-DkB0u2_Q.js → yield-curve-DlXQg4sl.js} +1 -1
  126. package/runtime/assets/{yield-scanner-BP90untT.js → yield-scanner-Qm88hZuv.js} +1 -1
  127. package/runtime/index.html +2 -2
  128. package/runtime/assets/editor-CZoWRTJC.css +0 -1
  129. package/runtime/assets/index-Bx7RmzY8.js +0 -1
  130. package/runtime/assets/index-DyvZokhk.js +0 -1097
  131. package/runtime/assets/portfolio-allocation-DAnQk_h_.js +0 -1
package/dist/index.js CHANGED
@@ -435,7 +435,12 @@ var SOURCES = {
435
435
  bitcoinData: { name: "bitcoin-data.com", url: "https://bitcoin-data.com" },
436
436
  ultrasound: { name: "ultrasound.money", url: "https://ultrasound.money" },
437
437
  polymarket: { name: "Polymarket", url: "https://polymarket.com" },
438
- sosovalue: { name: "SoSoValue", url: "https://sosovalue.com" }
438
+ sosovalue: { name: "SoSoValue", url: "https://sosovalue.com" },
439
+ geckoterminal: {
440
+ name: "GeckoTerminal",
441
+ url: "https://www.geckoterminal.com"
442
+ },
443
+ blockchair: { name: "Blockchair", url: "https://blockchair.com" }
439
444
  };
440
445
  var clockMeta = defineFrameMeta({
441
446
  name: "clock",
@@ -2047,6 +2052,71 @@ var reserveRiskMeta = defineFrameMeta({
2047
2052
  window: z3.enum(["90D", "180D", "1Y"]).default("1Y").describe("How much history the sparkline shows.")
2048
2053
  })
2049
2054
  });
2055
+ var nftCollectionsMeta = defineFrameMeta({
2056
+ name: "nft-collections",
2057
+ label: "NFT Collections",
2058
+ category: "crypto",
2059
+ iconUrl: widgetIcon("nft-collections"),
2060
+ layout: { w: 3, h: 4, minW: 2, minH: 3 },
2061
+ description: "Blue-chip NFT collections ranked by 24h trading volume \u2014 floor price (USD), 24h floor change, and volume, for a hand-picked set of majors (Bored Ape, Pudgy Penguins, CryptoPunks, Azuki, \u2026). Keyless (CoinGecko free tier). A quick read on where the top NFT market is trading.",
2062
+ capabilities: ["nft-market"],
2063
+ source: SOURCES.coingecko,
2064
+ schema: z3.object({
2065
+ topN: z3.number().int().min(4).max(10).default(8).describe("How many collections to show (up to 10 curated majors).")
2066
+ })
2067
+ });
2068
+ var dexHotPoolsMeta = defineFrameMeta({
2069
+ name: "dex-hot-pools",
2070
+ label: "Hot DEX Pools",
2071
+ category: "onchain",
2072
+ iconUrl: widgetIcon("dex-hot-pools"),
2073
+ layout: { w: 3, h: 4, minW: 2, minH: 3 },
2074
+ description: "Trending DEX liquidity pools on a chain, ranked by 24h volume \u2014 each pool's pair, base-token price, 24h price change, and 24h volume. Surfaces what's hot on-chain (new listings, momentum pairs) across Ethereum, Solana, Base and more. Keyless (GeckoTerminal free tier).",
2075
+ capabilities: ["dex-pools"],
2076
+ source: SOURCES.geckoterminal,
2077
+ schema: z3.object({
2078
+ network: z3.enum(["eth", "solana", "base", "arbitrum", "bsc", "polygon_pos"]).default("eth").describe("Which chain's trending pools to show."),
2079
+ count: z3.number().int().min(5).max(15).default(10).describe("How many trending pools to list (up to 15).")
2080
+ })
2081
+ });
2082
+ var chainActivityMeta = defineFrameMeta({
2083
+ name: "chain-activity",
2084
+ label: "Chain Activity",
2085
+ category: "onchain",
2086
+ iconUrl: widgetIcon("chain-activity"),
2087
+ layout: { w: 3, h: 4, minW: 2, minH: 3 },
2088
+ description: "Cross-chain network activity for major layer-1s (Bitcoin, Ethereum, Litecoin, \u2026), ranked by 24h transaction count \u2014 with blocks mined and mempool backlog per chain. A side-by-side pulse of which chains are busiest right now. Keyless (Blockchair).",
2089
+ capabilities: ["chain-activity"],
2090
+ source: SOURCES.blockchair,
2091
+ schema: z3.object({})
2092
+ });
2093
+ var nftTreemapMeta = defineFrameMeta({
2094
+ name: "nft-treemap",
2095
+ label: "NFT Treemap",
2096
+ category: "crypto",
2097
+ iconUrl: widgetIcon("nft-treemap"),
2098
+ layout: { w: 4, h: 4, minW: 3, minH: 3 },
2099
+ description: "Treemap of blue-chip NFT collections sized by market capitalisation, tiles colored green/red by 24h floor-price change. A heat-map of the top NFT market at a glance. Keyless (CoinGecko free tier).",
2100
+ capabilities: ["nft-market"],
2101
+ source: SOURCES.coingecko,
2102
+ schema: z3.object({
2103
+ topN: z3.number().int().min(4).max(10).default(8).describe("How many collections to show (up to 10 curated majors).")
2104
+ })
2105
+ });
2106
+ var dexPoolTreemapMeta = defineFrameMeta({
2107
+ name: "dex-pool-treemap",
2108
+ label: "DEX Pool Treemap",
2109
+ category: "onchain",
2110
+ iconUrl: widgetIcon("dex-pool-treemap"),
2111
+ layout: { w: 4, h: 4, minW: 3, minH: 3 },
2112
+ description: "Treemap of trending DEX pools on a chain sized by 24h trading volume, tiles colored green/red by 24h price change. Shows at a glance which pairs are pulling the most on-chain volume. Keyless (GeckoTerminal free tier).",
2113
+ capabilities: ["dex-pools"],
2114
+ source: SOURCES.geckoterminal,
2115
+ schema: z3.object({
2116
+ network: z3.enum(["eth", "solana", "base", "arbitrum", "bsc", "polygon_pos"]).default("eth").describe("Which chain's trending pools to show."),
2117
+ count: z3.number().int().min(5).max(15).default(12).describe("How many trending pools to include (up to 15).")
2118
+ })
2119
+ });
2050
2120
  var frameMetas = [
2051
2121
  newsFeedMeta,
2052
2122
  portfolioValueMeta,
@@ -2133,7 +2203,12 @@ var frameMetas = [
2133
2203
  sectorTreemapMeta,
2134
2204
  etfFlowsChartMeta,
2135
2205
  realizedPriceMeta,
2136
- reserveRiskMeta
2206
+ reserveRiskMeta,
2207
+ nftCollectionsMeta,
2208
+ dexHotPoolsMeta,
2209
+ chainActivityMeta,
2210
+ nftTreemapMeta,
2211
+ dexPoolTreemapMeta
2137
2212
  ];
2138
2213
  var allFrameMetas = [
2139
2214
  ...frameMetas,
@@ -3529,6 +3604,19 @@ var GLOBAL_URL = "https://api.coingecko.com/api/v3/global";
3529
3604
  var MARKETS_URL = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=50&page=1&sparkline=false&price_change_percentage=24h";
3530
3605
  var TRENDING_URL = "https://api.coingecko.com/api/v3/search/trending";
3531
3606
  var CATEGORIES_URL = "https://api.coingecko.com/api/v3/coins/categories";
3607
+ var NFT_URL = "https://api.coingecko.com/api/v3/nfts";
3608
+ var NFT_IDS = [
3609
+ "bored-ape-yacht-club",
3610
+ "pudgy-penguins",
3611
+ "mutant-ape-yacht-club",
3612
+ "cryptopunks",
3613
+ "azuki",
3614
+ "milady",
3615
+ "doodles-official",
3616
+ "moonbirds",
3617
+ "lil-pudgys",
3618
+ "degods"
3619
+ ];
3532
3620
  var globalCache = new TtlCache({
3533
3621
  namespace: "zframes:coingecko:global",
3534
3622
  ttlMs: 12 * 6e4,
@@ -3549,13 +3637,23 @@ var categoriesCache = new TtlCache({
3549
3637
  ttlMs: 12 * 6e4,
3550
3638
  persist: true
3551
3639
  });
3640
+ var nftCache = new TtlCache({
3641
+ namespace: "zframes:coingecko:nft",
3642
+ ttlMs: 45 * 6e4,
3643
+ persist: true
3644
+ });
3645
+ function numberOr(value, fallback) {
3646
+ const n = Number(value);
3647
+ return Number.isFinite(n) ? n : fallback;
3648
+ }
3552
3649
  var CoinGeckoProvider = class {
3553
3650
  name = "coingecko";
3554
3651
  capabilities = [
3555
3652
  "global-market",
3556
3653
  "coin-markets",
3557
3654
  "trending-coins",
3558
- "sector-performance"
3655
+ "sector-performance",
3656
+ "nft-market"
3559
3657
  ];
3560
3658
  async getTrendingCoins() {
3561
3659
  return trendingCache.get("trending", async () => {
@@ -3588,6 +3686,35 @@ var CoinGeckoProvider = class {
3588
3686
  })).sort((a, b) => b.marketCap - a.marketCap).slice(0, 30);
3589
3687
  });
3590
3688
  }
3689
+ async getNftMarket() {
3690
+ return nftCache.get("nft", async () => {
3691
+ const collections = [];
3692
+ for (const id of NFT_IDS) {
3693
+ try {
3694
+ const body = await fetchJson(`${NFT_URL}/${id}`);
3695
+ const floorUsd = Number(body?.floor_price?.usd);
3696
+ if (!body?.id || !Number.isFinite(floorUsd)) continue;
3697
+ collections.push({
3698
+ id: body.id,
3699
+ name: body.name ?? body.id,
3700
+ floorNative: numberOr(body.floor_price?.native_currency, 0),
3701
+ floorUsd,
3702
+ floorChangePct24h: numberOr(
3703
+ body.floor_price_24h_percentage_change?.usd,
3704
+ 0
3705
+ ),
3706
+ marketCapUsd: numberOr(body.market_cap?.usd, 0),
3707
+ volume24hUsd: numberOr(body.volume_24h?.usd, 0),
3708
+ sales24h: numberOr(body.one_day_sales, 0)
3709
+ });
3710
+ } catch {
3711
+ }
3712
+ }
3713
+ if (collections.length === 0)
3714
+ throw new Error("coingecko nfts: no collections resolved");
3715
+ return collections.sort((a, b) => b.volume24hUsd - a.volume24hUsd);
3716
+ });
3717
+ }
3591
3718
  async getGlobalMarket() {
3592
3719
  return globalCache.get("global", async () => {
3593
3720
  const body = await fetchJson(GLOBAL_URL);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zframes",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "zframes CLI — serve a dashboard.json as a live, editable market terminal (serve), print the frame catalogue for generating agents (catalogue), and validate a dashboard.json (lint).",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zentry",
@@ -42,14 +42,14 @@
42
42
  "typescript": "^5.8.0",
43
43
  "@zframes/account": "0.0.0",
44
44
  "@zframes/frames": "0.0.0",
45
- "@zframes/provider-defillama": "0.0.0",
46
- "@zframes/provider-coingecko": "0.0.0",
47
45
  "@zframes/provider-alternativeme": "0.0.0",
46
+ "@zframes/provider-coingecko": "0.0.0",
47
+ "@zframes/provider-defillama": "0.0.0",
48
48
  "@zframes/provider-hyperliquid": "0.0.0",
49
- "@zframes/serve": "0.0.0",
50
49
  "@zframes/spec": "0.0.0",
51
- "@zframes/store": "0.0.0",
52
- "@zframes/zai": "0.0.0"
50
+ "@zframes/serve": "0.0.0",
51
+ "@zframes/zai": "0.0.0",
52
+ "@zframes/store": "0.0.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "node scripts/build-runtime.mjs && tsup && node scripts/assert-artifacts.mjs",
@@ -1 +1 @@
1
- import{r as f,j as e}from"./react-qoZPGuNy.js";import{b as r,f as p,a as x,c as g}from"./format-CfAcS4D8.js";import{f as j,n as i,o as v}from"./index-DyvZokhk.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c={BTC:"linear-gradient(90deg, #FF810F 0%, #FF9E37 100%)",ETH:"hsl(var(--zf-accent-hue, 242) 85% 72%)",Others:"hsl(var(--zf-accent-hue, 242) 38% 52%)"};function y({config:d}){const{market:s,isLoading:m}=v(),n=f.useMemo(()=>{if(!s)return[];const a=s.dominance.btc??0,t=s.dominance.eth??0;return[{type:"BTC",value:a},{type:"ETH",value:t},{type:"Others",value:Math.max(0,100-a-t)}].sort((h,u)=>u.value-h.value)},[s]);if(m)return e.jsx(o,{loading:!0,children:"loading dominance…"});if(!s)return e.jsx(o,{children:"no market data"});const l=n[0];return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"metric-xl text-strong",children:r(l.value,1)}),e.jsx("span",{className:"body-md text-soft",children:l.type})]}),e.jsx("div",{className:"flex h-3 w-full max-w-sm gap-1 overflow-hidden rounded-full",children:n.map((a,t)=>e.jsx("div",{className:`h-full ${t===0?"rounded-l-full":""} ${t===n.length-1?"rounded-r-full":""}`,style:{width:`${a.value}%`,background:c[a.type]}},a.type))}),e.jsx("div",{className:"grid w-full max-w-sm grid-cols-3",children:n.map(a=>e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx("div",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:c[a.type]}}),e.jsx("span",{className:"body-sm text-soft",children:a.type}),e.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:r(a.value,1)})]},a.type))}),d.showTotalMarketCap&&e.jsxs("div",{className:"caption text-soft",children:["total mcap ",p(s.totalMarketCapUsd)," ·"," ",e.jsxs("span",{style:{color:g(s.marketCapChangePct24h)},children:[x(s.marketCapChangePct24h)," 24h"]})]})]})}const F=j({...i,component:y});export{F as bitcoinDominanceFrame};
1
+ import{r as f,j as e}from"./react-qoZPGuNy.js";import{b as r,f as p,a as x,c as g}from"./format-CfAcS4D8.js";import{f as j,n as i,o as v}from"./index-kB-TyxKi.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c={BTC:"linear-gradient(90deg, #FF810F 0%, #FF9E37 100%)",ETH:"hsl(var(--zf-accent-hue, 242) 85% 72%)",Others:"hsl(var(--zf-accent-hue, 242) 38% 52%)"};function y({config:d}){const{market:s,isLoading:m}=v(),n=f.useMemo(()=>{if(!s)return[];const a=s.dominance.btc??0,t=s.dominance.eth??0;return[{type:"BTC",value:a},{type:"ETH",value:t},{type:"Others",value:Math.max(0,100-a-t)}].sort((h,u)=>u.value-h.value)},[s]);if(m)return e.jsx(o,{loading:!0,children:"loading dominance…"});if(!s)return e.jsx(o,{children:"no market data"});const l=n[0];return e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"metric-xl text-strong",children:r(l.value,1)}),e.jsx("span",{className:"body-md text-soft",children:l.type})]}),e.jsx("div",{className:"flex h-3 w-full max-w-sm gap-1 overflow-hidden rounded-full",children:n.map((a,t)=>e.jsx("div",{className:`h-full ${t===0?"rounded-l-full":""} ${t===n.length-1?"rounded-r-full":""}`,style:{width:`${a.value}%`,background:c[a.type]}},a.type))}),e.jsx("div",{className:"grid w-full max-w-sm grid-cols-3",children:n.map(a=>e.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[e.jsx("div",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:c[a.type]}}),e.jsx("span",{className:"body-sm text-soft",children:a.type}),e.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:r(a.value,1)})]},a.type))}),d.showTotalMarketCap&&e.jsxs("div",{className:"caption text-soft",children:["total mcap ",p(s.totalMarketCapUsd)," ·"," ",e.jsxs("span",{style:{color:g(s.marketCapChangePct24h)},children:[x(s.marketCapChangePct24h)," 24h"]})]})]})}const F=j({...i,component:y});export{F as bitcoinDominanceFrame};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./react-qoZPGuNy.js";import{i as c}from"./content-shared-BZ1XzrJx.js";import{d as N,a as j,c as y}from"./format-CfAcS4D8.js";import{f as k,bO as b}from"./index-DyvZokhk.js";import{s as z}from"./ui-Bq3RQsdJ.js";b.schema;function C({config:l}){const[o,m]=u.useState(l.fills.length?l.fills:[{price:0,size:0}]),[n,g]=u.useState(l.currentPrice),{avg:r,totalSize:p}=u.useMemo(()=>{let s=0,a=0;for(const t of o)s+=t.price*t.size,a+=t.size;return{avg:a>0?s/a:0,totalSize:a}},[o]),x=r>0&&n>0?(n-r)/r*100:null,d=l.label.trim(),h=(s,a,t)=>m(f=>f.map((i,v)=>v===s?{...i,[a]:t}:i));return e.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[d&&e.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:d}),e.jsxs("div",{className:"shrink-0",children:[e.jsx("div",{className:"caption text-soft",children:"break-even (avg cost)"}),e.jsx("div",{className:"metric-lg text-strong",children:p>0?N(r):"—"}),e.jsxs("div",{className:"caption text-soft",children:[p>0?`${p} units`:"add fills below",x!==null&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("span",{style:{color:y(x)},children:[j(x)," unrealized"]})]})]})]}),e.jsxs("div",{className:`min-h-0 flex-1 ${z}`,children:[o.map((s,a)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft",children:"px"}),e.jsx("input",{type:"number",value:Number.isFinite(s.price)?s.price:0,onChange:t=>h(a,"price",Number(t.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),e.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft",children:"sz"}),e.jsx("input",{type:"number",value:Number.isFinite(s.size)?s.size:0,onChange:t=>h(a,"size",Number(t.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),e.jsx("button",{type:"button",onClick:()=>m(t=>t.length>1?t.filter((f,i)=>i!==a):t),className:"caption text-soft hover:text-strong shrink-0 px-1","aria-label":"remove fill",children:"×"})]},a)),e.jsx("button",{type:"button",onClick:()=>m(s=>[...s,{price:0,size:0}]),className:`caption text-soft hover:text-strong w-full px-2 py-1 ${c}`,children:"+ add fill"})]}),e.jsxs("label",{className:`flex shrink-0 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft shrink-0",children:"current price"}),e.jsx("input",{type:"number",value:Number.isFinite(n)?n:0,onChange:s=>g(Number(s.target.value)),className:"body-sm text-strong w-full bg-transparent text-right outline-none"})]})]})}const E=k({...b,component:C});export{E as breakevenFrame};
1
+ import{r as u,j as e}from"./react-qoZPGuNy.js";import{i as c}from"./content-shared-BZ1XzrJx.js";import{d as N,a as j,c as y}from"./format-CfAcS4D8.js";import{f as k,bO as b}from"./index-kB-TyxKi.js";import{s as z}from"./ui-Bq3RQsdJ.js";b.schema;function C({config:l}){const[o,m]=u.useState(l.fills.length?l.fills:[{price:0,size:0}]),[n,g]=u.useState(l.currentPrice),{avg:r,totalSize:p}=u.useMemo(()=>{let s=0,a=0;for(const t of o)s+=t.price*t.size,a+=t.size;return{avg:a>0?s/a:0,totalSize:a}},[o]),x=r>0&&n>0?(n-r)/r*100:null,d=l.label.trim(),h=(s,a,t)=>m(f=>f.map((i,v)=>v===s?{...i,[a]:t}:i));return e.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[d&&e.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:d}),e.jsxs("div",{className:"shrink-0",children:[e.jsx("div",{className:"caption text-soft",children:"break-even (avg cost)"}),e.jsx("div",{className:"metric-lg text-strong",children:p>0?N(r):"—"}),e.jsxs("div",{className:"caption text-soft",children:[p>0?`${p} units`:"add fills below",x!==null&&e.jsxs(e.Fragment,{children:[" · ",e.jsxs("span",{style:{color:y(x)},children:[j(x)," unrealized"]})]})]})]}),e.jsxs("div",{className:`min-h-0 flex-1 ${z}`,children:[o.map((s,a)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft",children:"px"}),e.jsx("input",{type:"number",value:Number.isFinite(s.price)?s.price:0,onChange:t=>h(a,"price",Number(t.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),e.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft",children:"sz"}),e.jsx("input",{type:"number",value:Number.isFinite(s.size)?s.size:0,onChange:t=>h(a,"size",Number(t.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),e.jsx("button",{type:"button",onClick:()=>m(t=>t.length>1?t.filter((f,i)=>i!==a):t),className:"caption text-soft hover:text-strong shrink-0 px-1","aria-label":"remove fill",children:"×"})]},a)),e.jsx("button",{type:"button",onClick:()=>m(s=>[...s,{price:0,size:0}]),className:`caption text-soft hover:text-strong w-full px-2 py-1 ${c}`,children:"+ add fill"})]}),e.jsxs("label",{className:`flex shrink-0 items-center gap-1 px-2 py-1 ${c}`,children:[e.jsx("span",{className:"caption text-soft shrink-0",children:"current price"}),e.jsx("input",{type:"number",value:Number.isFinite(n)?n:0,onChange:s=>g(Number(s.target.value)),className:"body-sm text-strong w-full bg-transparent text-right outline-none"})]})]})}const E=k({...b,component:C});export{E as breakevenFrame};
@@ -1 +1 @@
1
- import{r as s,j as r}from"./react-qoZPGuNy.js";import{f as m,bS as n}from"./index-DyvZokhk.js";n.schema;function c(e){return[{name:"Breathe in",dur:e.inhale,scale:1},{name:"Hold",dur:e.hold,scale:1},{name:"Breathe out",dur:e.exhale,scale:.45},{name:"Hold",dur:e.holdAfter,scale:.45}]}function x({config:e}){const t=c(e),[a,l]=s.useState(0);s.useEffect(()=>{l(0)},[e.inhale,e.hold,e.exhale,e.holdAfter]),s.useEffect(()=>{const d=Math.max(0,t[a].dur),u=setTimeout(()=>l(i=>(i+1)%t.length),Math.max(300,d*1e3));return()=>clearTimeout(u)},[a,e.inhale,e.hold,e.exhale,e.holdAfter]);const o=t[a].scale,h=Math.max(.3,t[a].dur);return r.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden",children:[r.jsx("div",{className:"aspect-square w-[55%] rounded-full",style:{background:"var(--color-highlight)",opacity:.25,transform:`scale(${o})`,transition:`transform ${h}s ease-in-out`}}),r.jsx("div",{className:"caption text-soft absolute uppercase tracking-[0.2em]",children:t[a].name})]})}const b=m({...n,component:x});export{b as breathingFrame};
1
+ import{r as s,j as r}from"./react-qoZPGuNy.js";import{f as m,bS as n}from"./index-kB-TyxKi.js";n.schema;function c(e){return[{name:"Breathe in",dur:e.inhale,scale:1},{name:"Hold",dur:e.hold,scale:1},{name:"Breathe out",dur:e.exhale,scale:.45},{name:"Hold",dur:e.holdAfter,scale:.45}]}function x({config:e}){const t=c(e),[a,l]=s.useState(0);s.useEffect(()=>{l(0)},[e.inhale,e.hold,e.exhale,e.holdAfter]),s.useEffect(()=>{const d=Math.max(0,t[a].dur),u=setTimeout(()=>l(i=>(i+1)%t.length),Math.max(300,d*1e3));return()=>clearTimeout(u)},[a,e.inhale,e.hold,e.exhale,e.holdAfter]);const o=t[a].scale,h=Math.max(.3,t[a].dur);return r.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden",children:[r.jsx("div",{className:"aspect-square w-[55%] rounded-full",style:{background:"var(--color-highlight)",opacity:.25,transform:`scale(${o})`,transition:`transform ${h}s ease-in-out`}}),r.jsx("div",{className:"caption text-soft absolute uppercase tracking-[0.2em]",children:t[a].name})]})}const b=m({...n,component:x});export{b as breathingFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{t as c,j as i}from"./format-CfAcS4D8.js";import{f as r,aS as o,aT as m}from"./index-DyvZokhk.js";import{F as a,s as d}from"./ui-Bq3RQsdJ.js";o.schema;function x({config:l}){const{blocks:e,isLoading:n}=m(l.count);return n?s.jsx(a,{loading:!0,children:"loading blocks…"}):e.length===0?s.jsx(a,{children:"no block data yet"}):s.jsx("div",{className:"flex h-full min-h-0 flex-col",children:s.jsx("div",{className:d,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(t=>s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 rounded-md bg-white/[0.03] px-2 py-1.5",title:`Block ${t.height} · ${t.poolName} · ${t.txCount.toLocaleString("en-US")} txs`,children:[s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"body-sm text-strong font-bold tabular-nums",children:t.height.toLocaleString("en-US")}),s.jsx("span",{className:"caption text-soft",children:c(t.time)})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"body-sm text-normal block truncate",children:t.poolName}),s.jsxs("span",{className:"caption text-soft",children:[t.txCount.toLocaleString("en-US")," txs"]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("span",{className:"body-sm text-normal block font-bold tabular-nums",children:i(t.totalFees)}),s.jsxs("span",{className:"caption text-soft",children:["~",Math.round(t.medianFee)," sat/vB"]})]})]},t.id))})})})}const j=r({...o,component:x});export{j as btcBlocksFrame};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{t as c,j as i}from"./format-CfAcS4D8.js";import{f as r,aS as o,aT as m}from"./index-kB-TyxKi.js";import{F as a,s as d}from"./ui-Bq3RQsdJ.js";o.schema;function x({config:l}){const{blocks:e,isLoading:n}=m(l.count);return n?s.jsx(a,{loading:!0,children:"loading blocks…"}):e.length===0?s.jsx(a,{children:"no block data yet"}):s.jsx("div",{className:"flex h-full min-h-0 flex-col",children:s.jsx("div",{className:d,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:e.map(t=>s.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 rounded-md bg-white/[0.03] px-2 py-1.5",title:`Block ${t.height} · ${t.poolName} · ${t.txCount.toLocaleString("en-US")} txs`,children:[s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"body-sm text-strong font-bold tabular-nums",children:t.height.toLocaleString("en-US")}),s.jsx("span",{className:"caption text-soft",children:c(t.time)})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"body-sm text-normal block truncate",children:t.poolName}),s.jsxs("span",{className:"caption text-soft",children:[t.txCount.toLocaleString("en-US")," txs"]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("span",{className:"body-sm text-normal block font-bold tabular-nums",children:i(t.totalFees)}),s.jsxs("span",{className:"caption text-soft",children:["~",Math.round(t.medianFee)," sat/vB"]})]})]},t.id))})})})}const j=r({...o,component:x});export{j as btcBlocksFrame};
@@ -1 +1 @@
1
- import{j as t}from"./react-qoZPGuNy.js";import{a as r,b as m,c as o}from"./format-CfAcS4D8.js";import{f as u,aW as c,aX as h}from"./index-DyvZokhk.js";import{F as l}from"./ui-Bq3RQsdJ.js";c.schema;function x(n){const e=Math.max(0,Math.round((n-Date.now())/1e3)),i=Math.floor(e/86400),s=Math.floor(e%86400/3600),a=Math.floor(e%3600/60);return i>0?`in ${i}d ${s}h`:s>0?`in ${s}h ${a}m`:`in ${a}m`}function j({config:n}){const{adjustment:e,isLoading:i}=h();if(i)return t.jsx(l,{loading:!0,children:"loading difficulty…"});if(!e)return t.jsx(l,{children:"no difficulty data yet"});const{progressPercent:s,difficultyChange:a,remainingBlocks:d}=e,f=o(a);return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"next adjustment"}),t.jsx("div",{className:"metric-lg leading-none",style:{color:f},children:r(a)}),t.jsx("div",{className:"body-sm text-soft",children:a>=0?"harder":"easier"})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:x(e.estimatedRetargetDate)}),t.jsxs("div",{className:"caption text-soft",children:[d.toLocaleString("en-US")," blocks left"]})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"relative h-2.5 w-full overflow-hidden rounded-full bg-white/[0.08]",children:t.jsx("div",{className:"absolute left-0 top-0 h-full rounded-full",style:{width:`${Math.min(100,Math.max(0,s))}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}})}),t.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[m(s,1)," through this epoch"]})]}),n.showPrevious&&t.jsxs("div",{className:"caption text-soft border-t border-white/[0.08] pt-2",children:["previous retarget"," ",t.jsx("span",{className:"font-bold tabular-nums",style:{color:o(e.previousRetarget)},children:r(e.previousRetarget)})]})]})}const N=u({...c,component:j});export{N as btcDifficultyFrame};
1
+ import{j as t}from"./react-qoZPGuNy.js";import{a as r,b as m,c as o}from"./format-CfAcS4D8.js";import{f as u,aW as c,aX as h}from"./index-kB-TyxKi.js";import{F as l}from"./ui-Bq3RQsdJ.js";c.schema;function x(n){const e=Math.max(0,Math.round((n-Date.now())/1e3)),i=Math.floor(e/86400),s=Math.floor(e%86400/3600),a=Math.floor(e%3600/60);return i>0?`in ${i}d ${s}h`:s>0?`in ${s}h ${a}m`:`in ${a}m`}function j({config:n}){const{adjustment:e,isLoading:i}=h();if(i)return t.jsx(l,{loading:!0,children:"loading difficulty…"});if(!e)return t.jsx(l,{children:"no difficulty data yet"});const{progressPercent:s,difficultyChange:a,remainingBlocks:d}=e,f=o(a);return t.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[t.jsxs("div",{className:"flex items-end justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("div",{className:"caption text-soft uppercase",children:"next adjustment"}),t.jsx("div",{className:"metric-lg leading-none",style:{color:f},children:r(a)}),t.jsx("div",{className:"body-sm text-soft",children:a>=0?"harder":"easier"})]}),t.jsxs("div",{className:"text-right",children:[t.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:x(e.estimatedRetargetDate)}),t.jsxs("div",{className:"caption text-soft",children:[d.toLocaleString("en-US")," blocks left"]})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"relative h-2.5 w-full overflow-hidden rounded-full bg-white/[0.08]",children:t.jsx("div",{className:"absolute left-0 top-0 h-full rounded-full",style:{width:`${Math.min(100,Math.max(0,s))}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}})}),t.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[m(s,1)," through this epoch"]})]}),n.showPrevious&&t.jsxs("div",{className:"caption text-soft border-t border-white/[0.08] pt-2",children:["previous retarget"," ",t.jsx("span",{className:"font-bold tabular-nums",style:{color:o(e.previousRetarget)},children:r(e.previousRetarget)})]})]})}const N=u({...c,component:j});export{N as btcDifficultyFrame};
@@ -1 +1 @@
1
- import{j as t}from"./react-qoZPGuNy.js";import{F as i,a as e}from"./btc-shared-DeqDaCze.js";import{f as c,aO as n,aP as f}from"./index-DyvZokhk.js";import{F as a}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";n.schema;const l={fastest:"Next block",halfHour:"~30 min",hour:"~1 hour",economy:"Economy",minimum:"Minimum"},u={fastest:e[0],halfHour:e[1],hour:e[2],economy:e[3],minimum:e[4]};function p({config:m}){const{fees:o,isLoading:r}=f();return r?t.jsx(a,{loading:!0,children:"loading fees…"}):o?t.jsx("div",{className:"flex h-full flex-wrap content-center items-stretch justify-center gap-2",children:m.tiers.map(s=>t.jsx(i,{className:"min-w-[64px] flex-1",color:u[s],value:o[s],caption:l[s]},s))}):t.jsx(a,{children:"no fee data yet"})}const E=c({...n,component:p});export{E as btcFeesFrame};
1
+ import{j as t}from"./react-qoZPGuNy.js";import{F as i,a as e}from"./btc-shared-DeqDaCze.js";import{f as c,aO as n,aP as f}from"./index-kB-TyxKi.js";import{F as a}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";n.schema;const l={fastest:"Next block",halfHour:"~30 min",hour:"~1 hour",economy:"Economy",minimum:"Minimum"},u={fastest:e[0],halfHour:e[1],hour:e[2],economy:e[3],minimum:e[4]};function p({config:m}){const{fees:o,isLoading:r}=f();return r?t.jsx(a,{loading:!0,children:"loading fees…"}):o?t.jsx("div",{className:"flex h-full flex-wrap content-center items-stretch justify-center gap-2",children:m.tiers.map(s=>t.jsx(i,{className:"min-w-[64px] flex-1",color:u[s],value:o[s],caption:l[s]},s))}):t.jsx(a,{children:"no fee data yet"})}const E=c({...n,component:p});export{E as btcFeesFrame};
@@ -1 +1 @@
1
- import{r as c,j as e}from"./react-qoZPGuNy.js";import{k as h,e as l}from"./format-CfAcS4D8.js";import{f as m,aU as i,aV as d}from"./index-DyvZokhk.js";import{F as r}from"./ui-Bq3RQsdJ.js";import{M as f}from"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";i.schema;function x({config:a}){const{data:t,isLoading:n}=d(a.window),o=c.useMemo(()=>((t==null?void 0:t.hashrates)??[]).map(s=>({date:new Date(s.time).toISOString(),value:s.hashrate})),[t==null?void 0:t.hashrates]);return n?e.jsx(r,{loading:!0,children:"loading hashrate…"}):t?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.jsx("div",{className:"caption text-soft uppercase",children:"network hashrate"}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:h(t.currentHashrate)})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:l(t.currentDifficulty)}),e.jsx("div",{className:"caption text-soft",children:"difficulty"})]})]}),e.jsx(f,{data:o,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),e.jsxs("div",{className:"caption text-soft",children:["past ",a.window]})]}):e.jsx(r,{children:"no hashrate data yet"})}const b=m({...i,component:x});export{b as btcHashrateFrame};
1
+ import{r as c,j as e}from"./react-qoZPGuNy.js";import{k as h,e as l}from"./format-CfAcS4D8.js";import{f as m,aU as i,aV as d}from"./index-kB-TyxKi.js";import{F as r}from"./ui-Bq3RQsdJ.js";import{M as f}from"./mini-line-chart-QWeuTPfP.js";import"./d3-Dr3MHXm3.js";import"./utils-DxneYyA_.js";i.schema;function x({config:a}){const{data:t,isLoading:n}=d(a.window),o=c.useMemo(()=>((t==null?void 0:t.hashrates)??[]).map(s=>({date:new Date(s.time).toISOString(),value:s.hashrate})),[t==null?void 0:t.hashrates]);return n?e.jsx(r,{loading:!0,children:"loading hashrate…"}):t?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.jsx("div",{className:"caption text-soft uppercase",children:"network hashrate"}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:h(t.currentHashrate)})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:l(t.currentDifficulty)}),e.jsx("div",{className:"caption text-soft",children:"difficulty"})]})]}),e.jsx(f,{data:o,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),e.jsxs("div",{className:"caption text-soft",children:["past ",a.window]})]}):e.jsx(r,{children:"no hashrate data yet"})}const b=m({...i,component:x});export{b as btcHashrateFrame};
@@ -1 +1 @@
1
- import{j as e}from"./react-qoZPGuNy.js";import{F as m,f as d}from"./btc-shared-DeqDaCze.js";import{e as x}from"./format-CfAcS4D8.js";import{f as p,aQ as o,aR as f}from"./index-DyvZokhk.js";import{F as a,a as j}from"./ui-Bq3RQsdJ.js";o.schema;function u({config:i}){const{state:s,isLoading:n}=f();if(n)return e.jsx(a,{loading:!0,children:"loading mempool…"});if(!s)return e.jsx(a,{children:"no mempool data yet"});const l=s.projected.slice(0,i.projectedBlocks),r=(s.vsize/1e6).toFixed(1);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.jsx("div",{className:"caption text-soft uppercase",children:"unconfirmed"}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:s.count.toLocaleString("en-US")}),e.jsx("div",{className:"body-sm text-soft",children:"transactions"})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[r," MvB"]}),e.jsx("div",{className:"caption text-soft",children:"pending vsize"})]})]}),e.jsx("div",{className:`flex gap-1.5 ${j}`,children:l.map((t,c)=>e.jsx(m,{className:"min-w-[76px]",color:d(t.medianFee),value:`~${Math.round(t.medianFee)}`,caption:`${x(t.nTx)} tx`},c))})]})}const M=p({...o,component:u});export{M as btcMempoolFrame};
1
+ import{j as e}from"./react-qoZPGuNy.js";import{F as m,f as d}from"./btc-shared-DeqDaCze.js";import{e as x}from"./format-CfAcS4D8.js";import{f as p,aQ as o,aR as f}from"./index-kB-TyxKi.js";import{F as a,a as j}from"./ui-Bq3RQsdJ.js";o.schema;function u({config:i}){const{state:s,isLoading:n}=f();if(n)return e.jsx(a,{loading:!0,children:"loading mempool…"});if(!s)return e.jsx(a,{children:"no mempool data yet"});const l=s.projected.slice(0,i.projectedBlocks),r=(s.vsize/1e6).toFixed(1);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.jsx("div",{className:"caption text-soft uppercase",children:"unconfirmed"}),e.jsx("div",{className:"metric-lg text-strong leading-none",children:s.count.toLocaleString("en-US")}),e.jsx("div",{className:"body-sm text-soft",children:"transactions"})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[r," MvB"]}),e.jsx("div",{className:"caption text-soft",children:"pending vsize"})]})]}),e.jsx("div",{className:`flex gap-1.5 ${j}`,children:l.map((t,c)=>e.jsx(m,{className:"min-w-[76px]",color:d(t.medianFee),value:`~${Math.round(t.medianFee)}`,caption:`${x(t.nTx)} tx`},c))})]})}const M=p({...o,component:u});export{M as btcMempoolFrame};
@@ -1 +1 @@
1
- import{r as n,j as e}from"./react-qoZPGuNy.js";import{i as C}from"./content-shared-BZ1XzrJx.js";import{f as F,aG as N}from"./index-DyvZokhk.js";import{s as A}from"./ui-Bq3RQsdJ.js";N.schema;const R="var(--color-highlight)";function x(t){const s=Number(t);return Number.isFinite(s)?s:0}function d({label:t,value:s,onChange:i,prefix:r,suffix:l}){return e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:t}),e.jsxs("span",{className:`flex items-center gap-1 px-2 py-1.5 ${C}`,children:[r&&e.jsx("span",{className:"body-sm text-soft",children:r}),e.jsx("input",{type:"number",inputMode:"decimal",value:s,onChange:c=>i(c.target.value),className:"body-sm text-normal min-w-0 flex-1 bg-transparent text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),l&&e.jsx("span",{className:"body-sm text-soft",children:l})]})]})}function M({config:t}){const[s,i]=n.useState(String(t.account)),[r,l]=n.useState(String(t.riskPct)),[c,g]=n.useState(String(t.entry)),[h,v]=n.useState(String(t.stop));n.useEffect(()=>i(String(t.account)),[t.account]),n.useEffect(()=>l(String(t.riskPct)),[t.riskPct]),n.useEffect(()=>g(String(t.entry)),[t.entry]),n.useEffect(()=>v(String(t.stop)),[t.stop]);const a=n.useMemo(()=>{const o=x(s),w=x(r),m=x(c),j=x(h),S=o*w/100,p=Math.abs(m-j),y=p>0?S/p:0,E=y*m,P=m===j?"—":j<m?"long":"short";return{riskAmount:S,perUnit:p,size:y,value:E,side:P,hasStop:p>0}},[s,r,c,h]),u=t.currency,f=o=>`${u}${o.toLocaleString(void 0,{maximumFractionDigits:2})}`,k=o=>o.toLocaleString(void 0,{maximumFractionDigits:o>=1?2:4});return e.jsxs("div",{className:`${A} flex flex-col gap-3`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(d,{label:"Account",value:s,onChange:i,prefix:u}),e.jsx(d,{label:"Risk",value:r,onChange:l,suffix:"%"}),e.jsx(d,{label:"Entry",value:c,onChange:g,prefix:u}),e.jsx(d,{label:"Stop",value:h,onChange:v,prefix:u})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-2.5",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Position size"}),e.jsx("span",{className:"body-lg font-extrabold tabular-nums",style:{color:a.hasStop?R:void 0},children:a.hasStop?k(a.size):"—"})]}),e.jsx(b,{label:"Risk amount",value:f(a.riskAmount)}),e.jsx(b,{label:"Per-unit risk",value:a.hasStop?f(a.perUnit):"set a stop"}),e.jsx(b,{label:"Position value",value:a.hasStop?f(a.value):"—"}),e.jsx(b,{label:"Direction",value:a.side})]})]})}function b({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"body-sm text-soft",children:t}),e.jsx("span",{className:"body-sm text-normal tabular-nums",children:s})]})}const U=F({...N,component:M});export{U as calculatorFrame};
1
+ import{r as n,j as e}from"./react-qoZPGuNy.js";import{i as C}from"./content-shared-BZ1XzrJx.js";import{f as F,aG as N}from"./index-kB-TyxKi.js";import{s as A}from"./ui-Bq3RQsdJ.js";N.schema;const R="var(--color-highlight)";function x(t){const s=Number(t);return Number.isFinite(s)?s:0}function d({label:t,value:s,onChange:i,prefix:r,suffix:l}){return e.jsxs("label",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:t}),e.jsxs("span",{className:`flex items-center gap-1 px-2 py-1.5 ${C}`,children:[r&&e.jsx("span",{className:"body-sm text-soft",children:r}),e.jsx("input",{type:"number",inputMode:"decimal",value:s,onChange:c=>i(c.target.value),className:"body-sm text-normal min-w-0 flex-1 bg-transparent text-right tabular-nums outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"}),l&&e.jsx("span",{className:"body-sm text-soft",children:l})]})]})}function M({config:t}){const[s,i]=n.useState(String(t.account)),[r,l]=n.useState(String(t.riskPct)),[c,g]=n.useState(String(t.entry)),[h,v]=n.useState(String(t.stop));n.useEffect(()=>i(String(t.account)),[t.account]),n.useEffect(()=>l(String(t.riskPct)),[t.riskPct]),n.useEffect(()=>g(String(t.entry)),[t.entry]),n.useEffect(()=>v(String(t.stop)),[t.stop]);const a=n.useMemo(()=>{const o=x(s),w=x(r),m=x(c),j=x(h),S=o*w/100,p=Math.abs(m-j),y=p>0?S/p:0,E=y*m,P=m===j?"—":j<m?"long":"short";return{riskAmount:S,perUnit:p,size:y,value:E,side:P,hasStop:p>0}},[s,r,c,h]),u=t.currency,f=o=>`${u}${o.toLocaleString(void 0,{maximumFractionDigits:2})}`,k=o=>o.toLocaleString(void 0,{maximumFractionDigits:o>=1?2:4});return e.jsxs("div",{className:`${A} flex flex-col gap-3`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(d,{label:"Account",value:s,onChange:i,prefix:u}),e.jsx(d,{label:"Risk",value:r,onChange:l,suffix:"%"}),e.jsx(d,{label:"Entry",value:c,onChange:g,prefix:u}),e.jsx(d,{label:"Stop",value:h,onChange:v,prefix:u})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-2.5",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Position size"}),e.jsx("span",{className:"body-lg font-extrabold tabular-nums",style:{color:a.hasStop?R:void 0},children:a.hasStop?k(a.size):"—"})]}),e.jsx(b,{label:"Risk amount",value:f(a.riskAmount)}),e.jsx(b,{label:"Per-unit risk",value:a.hasStop?f(a.perUnit):"set a stop"}),e.jsx(b,{label:"Position value",value:a.hasStop?f(a.value):"—"}),e.jsx(b,{label:"Direction",value:a.side})]})]})}function b({label:t,value:s}){return e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"body-sm text-soft",children:t}),e.jsx("span",{className:"body-sm text-normal tabular-nums",children:s})]})}const U=F({...N,component:M});export{U as calculatorFrame};
@@ -0,0 +1 @@
1
+ import{j as i}from"./react-qoZPGuNy.js";import{e as t}from"./format-CfAcS4D8.js";import{M as r}from"./metric-row-BVVhjsjK.js";import{f as e,bY as m,bZ as c}from"./index-kB-TyxKi.js";import{F as s,s as l}from"./ui-Bq3RQsdJ.js";function h(){const{chains:o,isLoading:n}=c();return n?i.jsx(s,{loading:!0,children:"loading chain activity…"}):o.length===0?i.jsx(s,{children:"no chain data"}):i.jsx("div",{className:l,children:o.map(a=>i.jsx(r,{label:a.label,meta:`${t(a.mempoolTxns)} mempool · ${t(a.blocks24h)} blocks`,value:`${t(a.transactions24h)} tx`},a.chain))})}const v=e({...m,component:h});export{v as chainActivityFrame};
@@ -1 +1 @@
1
- import{m as M,b as r,t as u}from"./d3-xK4fOkBU.js";var l=(n=>(n["30m"]="30m",n["24h"]="24h",n["3D"]="3D",n["7D"]="7D",n["1M"]="1M",n["3M"]="3M",n.YTD="YTD",n))(l||{});const e=(n,o)=>{const t=new Date(n);return o===l["24h"]?u("%H:%M")(t):u("%b %d")(t)},x=(n,o=.1)=>{const t=n.map(F=>F.value),s=M(t)||0,c=r(t)||0,D=c-s,m=c+D*o;let a=s-D*o;return s>=0&&a<0&&(a=0),[a,m]},E=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#06B6D4","#84CC16","#F97316"];export{E as C,l as a,x as c,e as f};
1
+ import{m as M,b as r,t as u}from"./d3-Dr3MHXm3.js";var l=(n=>(n["30m"]="30m",n["24h"]="24h",n["3D"]="3D",n["7D"]="7D",n["1M"]="1M",n["3M"]="3M",n.YTD="YTD",n))(l||{});const e=(n,o)=>{const t=new Date(n);return o===l["24h"]?u("%H:%M")(t):u("%b %d")(t)},x=(n,o=.1)=>{const t=n.map(F=>F.value),s=M(t)||0,c=r(t)||0,D=c-s,m=c+D*o;let a=s-D*o;return s>=0&&a<0&&(a=0),[a,m]},E=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#06B6D4","#84CC16","#F97316"];export{E as C,l as a,x as c,e as f};
@@ -1 +1 @@
1
- import{r as x,j as t}from"./react-qoZPGuNy.js";import{f as p,bP as o,m as u}from"./index-DyvZokhk.js";import{s as b}from"./ui-Bq3RQsdJ.js";o.schema;function f({config:s}){const r=u(),[i,m]=x.useState(s.checked),l=r?s.checked:i,h=a=>{const e=s.items.map((k,c)=>c===a?!l[c]:!!l[c]);r?r({checked:e}):m(e)},d=s.items.filter((a,e)=>l[e]).length,n=s.title.trim();return t.jsxs("div",{className:"flex h-full w-full flex-col",children:[t.jsxs("div",{className:"mb-1 flex shrink-0 items-baseline justify-between gap-2",children:[n&&t.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:n}),t.jsxs("div",{className:"caption text-soft shrink-0 tabular-nums",children:[d,"/",s.items.length]})]}),t.jsx("div",{className:`min-h-0 flex-1 ${b}`,children:s.items.map((a,e)=>t.jsxs("button",{type:"button",onClick:()=>h(e),className:"flex w-full items-center gap-2 py-1 text-left",children:[t.jsx("span",{className:"caption flex h-4 w-4 shrink-0 items-center justify-center rounded border leading-none",style:{borderColor:l[e]?"var(--color-highlight)":"rgba(255,255,255,0.2)",background:l[e]?"var(--color-highlight)":"transparent",color:l[e]?"#0b0e14":"transparent"},children:"✓"}),t.jsx("span",{className:`body-sm ${l[e]?"text-disabled line-through":"text-normal"}`,children:a})]},e))})]})}const v=p({...o,component:f});export{v as checklistFrame};
1
+ import{r as x,j as t}from"./react-qoZPGuNy.js";import{f as p,bP as o,m as u}from"./index-kB-TyxKi.js";import{s as b}from"./ui-Bq3RQsdJ.js";o.schema;function f({config:s}){const r=u(),[i,m]=x.useState(s.checked),l=r?s.checked:i,h=a=>{const e=s.items.map((k,c)=>c===a?!l[c]:!!l[c]);r?r({checked:e}):m(e)},d=s.items.filter((a,e)=>l[e]).length,n=s.title.trim();return t.jsxs("div",{className:"flex h-full w-full flex-col",children:[t.jsxs("div",{className:"mb-1 flex shrink-0 items-baseline justify-between gap-2",children:[n&&t.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:n}),t.jsxs("div",{className:"caption text-soft shrink-0 tabular-nums",children:[d,"/",s.items.length]})]}),t.jsx("div",{className:`min-h-0 flex-1 ${b}`,children:s.items.map((a,e)=>t.jsxs("button",{type:"button",onClick:()=>h(e),className:"flex w-full items-center gap-2 py-1 text-left",children:[t.jsx("span",{className:"caption flex h-4 w-4 shrink-0 items-center justify-center rounded border leading-none",style:{borderColor:l[e]?"var(--color-highlight)":"rgba(255,255,255,0.2)",background:l[e]?"var(--color-highlight)":"transparent",color:l[e]?"#0b0e14":"transparent"},children:"✓"}),t.jsx("span",{className:`body-sm ${l[e]?"text-disabled line-through":"text-normal"}`,children:a})]},e))})]})}const v=p({...o,component:f});export{v as checklistFrame};
@@ -1 +1 @@
1
- import{r as s,j as o}from"./react-qoZPGuNy.js";import{f as R,q as y}from"./index-DyvZokhk.js";import{F as b}from"./ui-Bq3RQsdJ.js";import{u as m}from"./use-countdown-BmcF-qdL.js";y.schema;function u(e){const r={hour:"",minute:"",second:"",fractional:"",period:""};for(const n of e.formatToParts(new Date))n.type==="hour"?r.hour=n.value:n.type==="minute"?r.minute=n.value:n.type==="second"?r.second=n.value:n.type==="fractionalSecond"?r.fractional=n.value:n.type==="dayPeriod"&&(r.period=n.value);return r}function j({config:e}){const r=s.useRef(null),n=s.useRef(null),f=s.useRef(null),p=s.useRef(null),h=s.useRef(null),a=e.timezone.trim()||void 0,c=e.showSeconds||e.showMillis,t=s.useMemo(()=>{var l;try{const z=new Intl.DateTimeFormat(void 0,{timeZone:a,hour:"2-digit",minute:"2-digit",second:c?"2-digit":void 0,fractionalSecondDigits:e.showMillis?3:void 0,hour12:e.hour12}),v=e.showDate?new Intl.DateTimeFormat(void 0,{timeZone:a,weekday:"short",month:"short",day:"numeric"}):null;let x="";return e.showTimezone&&(x=((l=new Intl.DateTimeFormat(void 0,{timeZone:a,hour:"2-digit",timeZoneName:"short"}).formatToParts(new Date).find(D=>D.type==="timeZoneName"))==null?void 0:l.value)??""),{time:z,date:v,zone:x,error:null}}catch{return{time:null,date:null,zone:"",error:a??"invalid timezone"}}},[a,c,e.showMillis,e.hour12,e.showDate,e.showTimezone]);if(m({ref:r,getRemainingMs:()=>Date.now(),format:()=>{if(!t.time)return"";const l=u(t.time);return`${l.hour}:${l.minute}`}}),m({ref:n,getRemainingMs:()=>Date.now(),format:()=>t.time?`:${u(t.time).second}`:""}),m({ref:f,getRemainingMs:()=>Date.now(),format:()=>t.time?`.${u(t.time).fractional}`:""}),m({ref:p,getRemainingMs:()=>Date.now(),format:()=>t.time?u(t.time).period:""}),m({ref:h,getRemainingMs:()=>Date.now(),format:()=>t.date?t.date.format(new Date):""}),t.error)return o.jsxs(b,{children:["unknown timezone: ",t.error]});const i=u(t.time),d="var(--color-highlight)",w="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)";return o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[o.jsxs("div",{className:"text-strong inline-flex max-w-full items-baseline justify-center whitespace-nowrap font-dmsans font-extrabold leading-none tracking-[-0.01em] tabular-nums",style:{fontSize:"clamp(1.6rem, 37cqmin, 5.5rem)"},children:[o.jsx("span",{ref:r,suppressHydrationWarning:!0,children:`${i.hour}:${i.minute}`}),c&&o.jsx("span",{ref:n,suppressHydrationWarning:!0,className:"font-bold",style:{fontSize:"0.46em",color:d,textShadow:w},children:`:${i.second}`}),e.showMillis&&o.jsx("span",{ref:f,suppressHydrationWarning:!0,className:"font-semibold",style:{fontSize:"0.3em",color:d,opacity:.65},children:`.${i.fractional}`}),e.hour12&&o.jsx("span",{ref:p,suppressHydrationWarning:!0,className:"text-soft ml-[0.3em] self-center font-semibold uppercase",style:{fontSize:"0.3em",letterSpacing:"0.08em"},children:i.period})]}),e.showDate&&t.date&&o.jsx("div",{ref:h,suppressHydrationWarning:!0,className:"caption text-soft tabular-nums",children:t.date.format(new Date)}),(e.label||t.zone)&&o.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[o.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:d,boxShadow:w}}),e.label&&t.zone?`${e.label} · ${t.zone}`:e.label||t.zone]})]})}const k=R({...y,component:j});export{k as clockFrame};
1
+ import{r as s,j as o}from"./react-qoZPGuNy.js";import{f as R,q as y}from"./index-kB-TyxKi.js";import{F as b}from"./ui-Bq3RQsdJ.js";import{u as m}from"./use-countdown-BmcF-qdL.js";y.schema;function u(e){const r={hour:"",minute:"",second:"",fractional:"",period:""};for(const n of e.formatToParts(new Date))n.type==="hour"?r.hour=n.value:n.type==="minute"?r.minute=n.value:n.type==="second"?r.second=n.value:n.type==="fractionalSecond"?r.fractional=n.value:n.type==="dayPeriod"&&(r.period=n.value);return r}function j({config:e}){const r=s.useRef(null),n=s.useRef(null),f=s.useRef(null),p=s.useRef(null),h=s.useRef(null),a=e.timezone.trim()||void 0,c=e.showSeconds||e.showMillis,t=s.useMemo(()=>{var l;try{const z=new Intl.DateTimeFormat(void 0,{timeZone:a,hour:"2-digit",minute:"2-digit",second:c?"2-digit":void 0,fractionalSecondDigits:e.showMillis?3:void 0,hour12:e.hour12}),v=e.showDate?new Intl.DateTimeFormat(void 0,{timeZone:a,weekday:"short",month:"short",day:"numeric"}):null;let x="";return e.showTimezone&&(x=((l=new Intl.DateTimeFormat(void 0,{timeZone:a,hour:"2-digit",timeZoneName:"short"}).formatToParts(new Date).find(D=>D.type==="timeZoneName"))==null?void 0:l.value)??""),{time:z,date:v,zone:x,error:null}}catch{return{time:null,date:null,zone:"",error:a??"invalid timezone"}}},[a,c,e.showMillis,e.hour12,e.showDate,e.showTimezone]);if(m({ref:r,getRemainingMs:()=>Date.now(),format:()=>{if(!t.time)return"";const l=u(t.time);return`${l.hour}:${l.minute}`}}),m({ref:n,getRemainingMs:()=>Date.now(),format:()=>t.time?`:${u(t.time).second}`:""}),m({ref:f,getRemainingMs:()=>Date.now(),format:()=>t.time?`.${u(t.time).fractional}`:""}),m({ref:p,getRemainingMs:()=>Date.now(),format:()=>t.time?u(t.time).period:""}),m({ref:h,getRemainingMs:()=>Date.now(),format:()=>t.date?t.date.format(new Date):""}),t.error)return o.jsxs(b,{children:["unknown timezone: ",t.error]});const i=u(t.time),d="var(--color-highlight)",w="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)";return o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[o.jsxs("div",{className:"text-strong inline-flex max-w-full items-baseline justify-center whitespace-nowrap font-dmsans font-extrabold leading-none tracking-[-0.01em] tabular-nums",style:{fontSize:"clamp(1.6rem, 37cqmin, 5.5rem)"},children:[o.jsx("span",{ref:r,suppressHydrationWarning:!0,children:`${i.hour}:${i.minute}`}),c&&o.jsx("span",{ref:n,suppressHydrationWarning:!0,className:"font-bold",style:{fontSize:"0.46em",color:d,textShadow:w},children:`:${i.second}`}),e.showMillis&&o.jsx("span",{ref:f,suppressHydrationWarning:!0,className:"font-semibold",style:{fontSize:"0.3em",color:d,opacity:.65},children:`.${i.fractional}`}),e.hour12&&o.jsx("span",{ref:p,suppressHydrationWarning:!0,className:"text-soft ml-[0.3em] self-center font-semibold uppercase",style:{fontSize:"0.3em",letterSpacing:"0.08em"},children:i.period})]}),e.showDate&&t.date&&o.jsx("div",{ref:h,suppressHydrationWarning:!0,className:"caption text-soft tabular-nums",children:t.date.format(new Date)}),(e.label||t.zone)&&o.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[o.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:d,boxShadow:w}}),e.label&&t.zone?`${e.label} · ${t.zone}`:e.label||t.zone]})]})}const k=R({...y,component:j});export{k as clockFrame};
@@ -1 +1 @@
1
- import{r as p,j as r}from"./react-qoZPGuNy.js";import{M as l}from"./mover-row-Dg96EIqq.js";import{f as h,b5 as t,b6 as x}from"./index-DyvZokhk.js";import{F as n}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";t.schema;function u({config:e}){const{entries:o,isLoading:c}=x(),{gainers:i,losers:m}=p.useMemo(()=>{const s=o.filter(a=>a.rank<=e.minRank&&a.volume24hUsd>0).map(a=>({symbol:a.symbol,price:a.priceUsd,chg:a.changePct[e.window]??0})).sort((a,d)=>d.chg-a.chg);return{gainers:s.slice(0,e.count),losers:s.slice(-e.count).reverse()}},[o,e.window,e.count,e.minRank]);return c?r.jsx(n,{loading:!0,children:"loading movers…"}):i.length===0?r.jsx(n,{children:"no mover data yet"}):r.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["gainers · ",e.window]}),i.map(s=>r.jsx(l,{symbol:s.symbol,label:s.symbol,price:s.price,changePct:s.chg},s.symbol))]}),r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["losers · ",e.window]}),m.map(s=>r.jsx(l,{symbol:s.symbol,label:s.symbol,price:s.price,changePct:s.chg},s.symbol))]})]})}const f=h({...t,component:u});export{f as coinMoversFrame};
1
+ import{r as p,j as r}from"./react-qoZPGuNy.js";import{M as l}from"./mover-row-CUd1i2yt.js";import{f as h,b5 as t,b6 as x}from"./index-kB-TyxKi.js";import{F as n}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";t.schema;function u({config:e}){const{entries:o,isLoading:c}=x(),{gainers:i,losers:m}=p.useMemo(()=>{const s=o.filter(a=>a.rank<=e.minRank&&a.volume24hUsd>0).map(a=>({symbol:a.symbol,price:a.priceUsd,chg:a.changePct[e.window]??0})).sort((a,d)=>d.chg-a.chg);return{gainers:s.slice(0,e.count),losers:s.slice(-e.count).reverse()}},[o,e.window,e.count,e.minRank]);return c?r.jsx(n,{loading:!0,children:"loading movers…"}):i.length===0?r.jsx(n,{children:"no mover data yet"}):r.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["gainers · ",e.window]}),i.map(s=>r.jsx(l,{symbol:s.symbol,label:s.symbol,price:s.price,changePct:s.chg},s.symbol))]}),r.jsxs("div",{className:"flex flex-col gap-1.5",children:[r.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["losers · ",e.window]}),m.map(s=>r.jsx(l,{symbol:s.symbol,label:s.symbol,price:s.price,changePct:s.chg},s.symbol))]})]})}const f=h({...t,component:u});export{f as coinMoversFrame};
@@ -1 +1 @@
1
- import{r,j as t}from"./react-qoZPGuNy.js";import{f as z,aE as F}from"./index-DyvZokhk.js";import{F as S}from"./ui-Bq3RQsdJ.js";import{u as g}from"./use-countdown-BmcF-qdL.js";F.schema;const v=864e5,b=36e5,D=6e4;function f(n){let s=Math.max(0,n);const l=Math.floor(s/v);s-=l*v;const m=Math.floor(s/b);s-=m*b;const u=Math.floor(s/D);s-=u*D;const o=Math.floor(s/1e3);return{days:l,hours:m,minutes:u,seconds:o}}const y="var(--color-highlight)",N="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",c=n=>String(n).padStart(2,"0");function T({config:n}){const s=r.useRef(null),l=r.useRef(null),m=r.useRef(null),u=r.useRef(null),o=n.target.trim(),a=r.useMemo(()=>{if(!o)return null;const e=new Date(o).getTime();return Number.isFinite(e)?e:NaN},[o]),i=a!=null&&!Number.isNaN(a),[p,x]=r.useState(i&&a<=Date.now());r.useEffect(()=>{if(!i)return;const e=a-Date.now();if(e<=0){x(!0);return}x(!1);const w=window.setTimeout(()=>x(!0),e);return()=>window.clearTimeout(w)},[i,a]);const d=()=>i?a-Date.now():0;g({ref:s,getRemainingMs:d,format:e=>String(f(e).days)}),g({ref:l,getRemainingMs:d,format:e=>c(f(e).hours)}),g({ref:m,getRemainingMs:d,format:e=>c(f(e).minutes)}),g({ref:u,getRemainingMs:d,format:e=>c(f(e).seconds)});const R=r.useMemo(()=>i?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(a)):"",[i,a]);if(!o)return t.jsx(S,{children:"set a target date & time"});if(!i)return t.jsxs(S,{children:["invalid target date: ",o]});const h=f(d()),k=[[s,String(h.days),"days"],[l,c(h.hours),"hrs"],[m,c(h.minutes),"min"],[u,c(h.seconds),"sec"]];return t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[n.label&&t.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[t.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:y,boxShadow:N}}),n.label]}),t.jsx("div",{className:"flex items-start justify-center gap-[0.5em] leading-none tabular-nums",style:{fontSize:"clamp(0.9rem, 20cqmin, 2.8rem)"},children:k.map(([e,w,j],M)=>t.jsxs("div",{className:"flex flex-col items-center gap-[0.25em]",children:[t.jsx("span",{ref:e,suppressHydrationWarning:!0,className:"text-strong font-dmsans font-extrabold tracking-[-0.01em]",style:{fontSize:"1em",color:M===3&&!p?y:void 0,textShadow:M===3&&!p?N:void 0},children:w}),t.jsx("span",{className:"text-soft uppercase tracking-[0.12em]",style:{fontSize:"0.26em"},children:j})]},j))}),p?t.jsx("div",{className:"caption font-semibold uppercase tracking-[0.2em]",style:{color:y,textShadow:N},children:"reached"}):n.showTarget&&R&&t.jsx("div",{className:"caption text-soft tabular-nums",children:R})]})}const q=z({...F,component:T});export{q as countdownFrame};
1
+ import{r,j as t}from"./react-qoZPGuNy.js";import{f as z,aE as F}from"./index-kB-TyxKi.js";import{F as S}from"./ui-Bq3RQsdJ.js";import{u as g}from"./use-countdown-BmcF-qdL.js";F.schema;const v=864e5,b=36e5,D=6e4;function f(n){let s=Math.max(0,n);const l=Math.floor(s/v);s-=l*v;const m=Math.floor(s/b);s-=m*b;const u=Math.floor(s/D);s-=u*D;const o=Math.floor(s/1e3);return{days:l,hours:m,minutes:u,seconds:o}}const y="var(--color-highlight)",N="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",c=n=>String(n).padStart(2,"0");function T({config:n}){const s=r.useRef(null),l=r.useRef(null),m=r.useRef(null),u=r.useRef(null),o=n.target.trim(),a=r.useMemo(()=>{if(!o)return null;const e=new Date(o).getTime();return Number.isFinite(e)?e:NaN},[o]),i=a!=null&&!Number.isNaN(a),[p,x]=r.useState(i&&a<=Date.now());r.useEffect(()=>{if(!i)return;const e=a-Date.now();if(e<=0){x(!0);return}x(!1);const w=window.setTimeout(()=>x(!0),e);return()=>window.clearTimeout(w)},[i,a]);const d=()=>i?a-Date.now():0;g({ref:s,getRemainingMs:d,format:e=>String(f(e).days)}),g({ref:l,getRemainingMs:d,format:e=>c(f(e).hours)}),g({ref:m,getRemainingMs:d,format:e=>c(f(e).minutes)}),g({ref:u,getRemainingMs:d,format:e=>c(f(e).seconds)});const R=r.useMemo(()=>i?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(a)):"",[i,a]);if(!o)return t.jsx(S,{children:"set a target date & time"});if(!i)return t.jsxs(S,{children:["invalid target date: ",o]});const h=f(d()),k=[[s,String(h.days),"days"],[l,c(h.hours),"hrs"],[m,c(h.minutes),"min"],[u,c(h.seconds),"sec"]];return t.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[n.label&&t.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[t.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:y,boxShadow:N}}),n.label]}),t.jsx("div",{className:"flex items-start justify-center gap-[0.5em] leading-none tabular-nums",style:{fontSize:"clamp(0.9rem, 20cqmin, 2.8rem)"},children:k.map(([e,w,j],M)=>t.jsxs("div",{className:"flex flex-col items-center gap-[0.25em]",children:[t.jsx("span",{ref:e,suppressHydrationWarning:!0,className:"text-strong font-dmsans font-extrabold tracking-[-0.01em]",style:{fontSize:"1em",color:M===3&&!p?y:void 0,textShadow:M===3&&!p?N:void 0},children:w}),t.jsx("span",{className:"text-soft uppercase tracking-[0.12em]",style:{fontSize:"0.26em"},children:j})]},j))}),p?t.jsx("div",{className:"caption font-semibold uppercase tracking-[0.2em]",style:{color:y,textShadow:N},children:"reached"}):n.showTarget&&R&&t.jsx("div",{className:"caption text-soft tabular-nums",children:R})]})}const q=z({...F,component:T});export{q as countdownFrame};
@@ -1 +1 @@
1
- import{j as s}from"./react-qoZPGuNy.js";import{a as i}from"./indicators-CogwjDn9.js";import{M as f}from"./mini-line-chart-CHM5UBjJ.js";const x="#cbd5e1",u="#f5a524";function h({caption:e,headline:n,headlineColor:a,zone:o,sub:t,sparkline:r,sparkColor:l}){const c=i(r);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-2",children:[s.jsx("div",{className:"caption text-soft",children:e}),s.jsx("div",{className:"metric-xl leading-none",style:{color:a,textShadow:`0 0 24px ${a}44`},children:n}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"caption rounded-full px-2 py-0.5 font-semibold",style:{color:o.color,background:`${o.color}1f`},children:o.label}),t!=null&&s.jsx("span",{className:"caption text-soft truncate",children:t})]}),c.length>1&&s.jsx(f,{data:c,width:280,height:44,color:l,className:"w-full"})]})}function N(e,n,a){for(const o of n){const t=o.upTo===void 0||e<o.upTo,r=o.from===void 0||e>=o.from;if(t&&r)return o.zone}return a}export{h as M,x as Z,u as a,N as z};
1
+ import{j as s}from"./react-qoZPGuNy.js";import{a as i}from"./indicators-CogwjDn9.js";import{M as f}from"./mini-line-chart-QWeuTPfP.js";const x="#cbd5e1",u="#f5a524";function h({caption:e,headline:n,headlineColor:a,zone:o,sub:t,sparkline:r,sparkColor:l}){const c=i(r);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-2",children:[s.jsx("div",{className:"caption text-soft",children:e}),s.jsx("div",{className:"metric-xl leading-none",style:{color:a,textShadow:`0 0 24px ${a}44`},children:n}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"caption rounded-full px-2 py-0.5 font-semibold",style:{color:o.color,background:`${o.color}1f`},children:o.label}),t!=null&&s.jsx("span",{className:"caption text-soft truncate",children:t})]}),c.length>1&&s.jsx(f,{data:c,width:280,height:44,color:l,className:"w-full"})]})}function N(e,n,a){for(const o of n){const t=o.upTo===void 0||e<o.upTo,r=o.from===void 0||e>=o.from;if(t&&r)return o.zone}return a}export{h as M,x as Z,u as a,N as z};
@@ -1 +1 @@
1
- import{r as T,j as e}from"./react-qoZPGuNy.js";import{D as _,U as $}from"./format-CfAcS4D8.js";import{Z as A}from"./cycle-shared-BOGcJDzT.js";import{s as g,r as B,e as H}from"./indicators-CogwjDn9.js";import{f as W,bl as E,b8 as q,bb as z,be as G}from"./index-DyvZokhk.js";import{M as J}from"./metric-row-BVVhjsjK.js";import{F,s as K}from"./ui-Bq3RQsdJ.js";import"./mini-line-chart-CHM5UBjJ.js";import"./d3-xK4fOkBU.js";import"./utils-DaT-yT0k.js";E.schema;function p(f){for(let i=f.length-1;i>=0;i--)if(f[i]!==null)return f[i];return null}function Q({config:f}){const{valuation:i,isLoading:U}=q(),{extras:d}=z(),{history:N,isLoading:Z}=G("btc"),h=f.mode==="peak",y=T.useMemo(()=>{if(!i)return[];const l=N.map(t=>t.value),C=l.at(-1)??null,L=p(g(l,200)),o=C!==null&&L?C/L:null,a=p(B(l,14)),S=p(g(l,111)),V=p(g(l,350)),M=S!==null&&V?S/(2*V):null,I=H(l,150).at(-1)??null,O=p(g(l,471)),j=I!==null&&O?I/O:null,r=(d==null?void 0:d.puell)??null,{mvrv:c,mvrvZScore:m,nupl:u}=i,n=(t,x,D,k,w)=>({name:t,value:x,display:D,threshold:k,fired:x!==null&&w}),P=t=>t!==null?`${(t*100).toFixed(0)}%`:"—",s=(t,x=2)=>t!==null?t.toFixed(x):"—";return h?[n("MVRV",c,s(c),"≥ 3",(c??0)>=3),n("MVRV Z-Score",m,s(m),"≥ 7",(m??0)>=7),n("NUPL",u,P(u),"≥ 75%",(u??0)>=.75),n("Mayer Multiple",o,s(o),"≥ 2.4",(o??0)>=2.4),n("Puell Multiple",r,s(r),"≥ 4",(r??0)>=4),n("RSI (14)",a,s(a,0),"≥ 80",(a??0)>=80),n("Pi Cycle Top",M,s(M),"≥ 1",(M??0)>=1)]:[n("MVRV",c,s(c),"≤ 1",(c??1/0)<=1),n("MVRV Z-Score",m,s(m),"≤ 0",(m??1/0)<=0),n("NUPL",u,P(u),"≤ 0%",(u??1/0)<=0),n("Mayer Multiple",o,s(o),"≤ 0.8",(o??1/0)<=.8),n("Puell Multiple",r,s(r),"≤ 0.5",(r??1/0)<=.5),n("RSI (14)",a,s(a,0),"≤ 30",(a??1/0)<=30),n("Pi Cycle Bottom",j,s(j),"≥ 0.745",(j??0)>=.745)]},[i,d,N,h]);if((U||Z)&&y.length===0)return e.jsx(F,{loading:!0,children:"loading cycle signals…"});if(y.length===0)return e.jsx(F,{children:"no on-chain data yet"});const R=y.filter(l=>l.value!==null),b=R.filter(l=>l.fired).length,v=h?_:$;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"caption text-soft",children:h?"Cycle-top signals":"Cycle-bottom signals"}),e.jsxs("span",{className:"metric-md",style:{color:b>0?v:A},children:[b,e.jsxs("span",{className:"text-soft",children:["/",R.length]})]})]}),e.jsx("div",{className:`${K} flex flex-col`,children:y.map(l=>e.jsx(J,{label:l.name,meta:`fires ${l.threshold}`,value:e.jsxs("span",{style:{color:l.fired?v:void 0},children:[l.fired?"● ":"",l.display]})},l.name))})]})}const rl=W({...E,component:Q});export{rl as cycleSignalsFrame};
1
+ import{r as T,j as e}from"./react-qoZPGuNy.js";import{D as _,U as $}from"./format-CfAcS4D8.js";import{Z as A}from"./cycle-shared-pyXzkgt1.js";import{s as g,r as B,e as H}from"./indicators-CogwjDn9.js";import{f as W,bl as E,b8 as q,bb as z,be as G}from"./index-kB-TyxKi.js";import{M as J}from"./metric-row-BVVhjsjK.js";import{F,s as K}from"./ui-Bq3RQsdJ.js";import"./mini-line-chart-QWeuTPfP.js";import"./d3-Dr3MHXm3.js";import"./utils-DxneYyA_.js";E.schema;function p(f){for(let i=f.length-1;i>=0;i--)if(f[i]!==null)return f[i];return null}function Q({config:f}){const{valuation:i,isLoading:U}=q(),{extras:d}=z(),{history:N,isLoading:Z}=G("btc"),h=f.mode==="peak",y=T.useMemo(()=>{if(!i)return[];const l=N.map(t=>t.value),C=l.at(-1)??null,L=p(g(l,200)),o=C!==null&&L?C/L:null,a=p(B(l,14)),S=p(g(l,111)),V=p(g(l,350)),M=S!==null&&V?S/(2*V):null,I=H(l,150).at(-1)??null,O=p(g(l,471)),j=I!==null&&O?I/O:null,r=(d==null?void 0:d.puell)??null,{mvrv:c,mvrvZScore:m,nupl:u}=i,n=(t,x,D,k,w)=>({name:t,value:x,display:D,threshold:k,fired:x!==null&&w}),P=t=>t!==null?`${(t*100).toFixed(0)}%`:"—",s=(t,x=2)=>t!==null?t.toFixed(x):"—";return h?[n("MVRV",c,s(c),"≥ 3",(c??0)>=3),n("MVRV Z-Score",m,s(m),"≥ 7",(m??0)>=7),n("NUPL",u,P(u),"≥ 75%",(u??0)>=.75),n("Mayer Multiple",o,s(o),"≥ 2.4",(o??0)>=2.4),n("Puell Multiple",r,s(r),"≥ 4",(r??0)>=4),n("RSI (14)",a,s(a,0),"≥ 80",(a??0)>=80),n("Pi Cycle Top",M,s(M),"≥ 1",(M??0)>=1)]:[n("MVRV",c,s(c),"≤ 1",(c??1/0)<=1),n("MVRV Z-Score",m,s(m),"≤ 0",(m??1/0)<=0),n("NUPL",u,P(u),"≤ 0%",(u??1/0)<=0),n("Mayer Multiple",o,s(o),"≤ 0.8",(o??1/0)<=.8),n("Puell Multiple",r,s(r),"≤ 0.5",(r??1/0)<=.5),n("RSI (14)",a,s(a,0),"≤ 30",(a??1/0)<=30),n("Pi Cycle Bottom",j,s(j),"≥ 0.745",(j??0)>=.745)]},[i,d,N,h]);if((U||Z)&&y.length===0)return e.jsx(F,{loading:!0,children:"loading cycle signals…"});if(y.length===0)return e.jsx(F,{children:"no on-chain data yet"});const R=y.filter(l=>l.value!==null),b=R.filter(l=>l.fired).length,v=h?_:$;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"caption text-soft",children:h?"Cycle-top signals":"Cycle-bottom signals"}),e.jsxs("span",{className:"metric-md",style:{color:b>0?v:A},children:[b,e.jsxs("span",{className:"text-soft",children:["/",R.length]})]})]}),e.jsx("div",{className:`${K} flex flex-col`,children:y.map(l=>e.jsx(J,{label:l.name,meta:`fires ${l.threshold}`,value:e.jsxs("span",{style:{color:l.fired?v:void 0},children:[l.fired?"● ":"",l.display]})},l.name))})]})}const rl=W({...E,component:Q});export{rl as cycleSignalsFrame};