zframes 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1385 -124
- package/package.json +2 -2
- package/runtime/assets/bitcoin-dominance-DVZsIJ3y.js +1 -0
- package/runtime/assets/breakeven-lskbHkqb.js +1 -0
- package/runtime/assets/breathing-BeUkCUAJ.js +1 -0
- package/runtime/assets/btc-blocks-fXBgGo4z.js +1 -0
- package/runtime/assets/btc-difficulty-BwyxgI0e.js +1 -0
- package/runtime/assets/btc-fees-Bg1rcXtN.js +1 -0
- package/runtime/assets/btc-hashrate-Xg8QNlTO.js +1 -0
- package/runtime/assets/btc-mempool-8Mfa77fO.js +1 -0
- package/runtime/assets/btc-shared-DeqDaCze.js +1 -0
- package/runtime/assets/calculator-CiXyJA9p.js +1 -0
- package/runtime/assets/chart-utils-BYIZMM9J.js +1 -0
- package/runtime/assets/checklist-D0dKSdmf.js +1 -0
- package/runtime/assets/clock-CNQTNh4L.js +1 -0
- package/runtime/assets/coin-movers-DulAF_oo.js +1 -0
- package/runtime/assets/content-shared-BZ1XzrJx.js +1 -0
- package/runtime/assets/countdown-BzZ2L6bw.js +1 -0
- package/runtime/assets/{d3-B3esOK0k.js → d3-xK4fOkBU.js} +1 -1
- package/runtime/assets/daily-analysis-RyI5KL4T.js +1 -0
- package/runtime/assets/day-meter-2bAj77Kz.js +1 -0
- package/runtime/assets/dex-volume-chart-DDPf1YAN.js +1 -0
- package/runtime/assets/dex-volume-treemap-jZCgRREu.js +1 -0
- package/runtime/assets/dice-wg979Skm.js +1 -0
- package/runtime/assets/dino-game-DlACWmE_.js +1 -0
- package/runtime/assets/divider-Chz1UsWJ.js +1 -0
- package/runtime/assets/drawdy-Ce7P47cx.js +1 -0
- package/runtime/assets/editor-BlGZ_tel.js +68 -0
- package/runtime/assets/editor-CHAAJRb1.css +1 -0
- package/runtime/assets/fear-greed-CENzXdIk.js +1 -0
- package/runtime/assets/feed-row-mVg1d5Zj.js +1 -0
- package/runtime/assets/filings-feed-2aIKzUUY.js +1 -0
- package/runtime/assets/financial-stress--ezsCpfR.js +1 -0
- package/runtime/assets/flappy-bird-DDe-IXt9.js +1 -0
- package/runtime/assets/format-CfAcS4D8.js +1 -0
- package/runtime/assets/fundamentals-v8f81ZNS.js +1 -0
- package/runtime/assets/funding-heatmap-DUoeFNGr.js +1 -0
- package/runtime/assets/funding-rate-chart-CjDA4nj7.js +1 -0
- package/runtime/assets/fx-board-CmXYQZi4.js +1 -0
- package/runtime/assets/game-ui-Dy_QYsPr.js +1 -0
- package/runtime/assets/heading-DMxdj9LK.js +1 -0
- package/runtime/assets/holiday-calendar-DxB-fxG5.js +1 -0
- package/runtime/assets/image-DLg33JpH.js +1 -0
- package/runtime/assets/index-C_O7gp2F.js +822 -0
- package/runtime/assets/index-DRTPEQtR.css +1 -0
- package/runtime/assets/index-XGtH5pVY.css +1 -0
- package/runtime/assets/index-jnySFpSv.js +1 -0
- package/runtime/assets/inflation-pulse-gcw-84PM.js +1 -0
- package/runtime/assets/journal-log-BX5Z_yte.js +1 -0
- package/runtime/assets/journal-open-XFQGIRkw.js +1 -0
- package/runtime/assets/journal-results-J1WCmyH2.js +1 -0
- package/runtime/assets/journal-score-CKhBSfYY.js +1 -0
- package/runtime/assets/journal-store-KCRoPnI_.js +1 -0
- package/runtime/assets/journal-ui-Cogk2Wkt.js +1 -0
- package/runtime/assets/labor-market-BV20Rl-4.js +1 -0
- package/runtime/assets/lightning-stats-h4fquhAg.js +1 -0
- package/runtime/assets/link-grid-a6NWj1Hu.js +1 -0
- package/runtime/assets/market-cap-treemap-CAi49oc_.js +1 -0
- package/runtime/assets/market-data-CvmpLFSo.js +1 -0
- package/runtime/assets/market-hours-6srwf0-r.js +1 -0
- package/runtime/assets/marquee-DDurk6bj.js +28 -0
- package/runtime/assets/metric-row-BVVhjsjK.js +1 -0
- package/runtime/assets/mini-line-chart-D-i1QqSe.js +1 -0
- package/runtime/assets/mining-pools-BPjCy4ZW.js +1 -0
- package/runtime/assets/mover-row-kQ9xt3Sp.js +1 -0
- package/runtime/assets/national-debt-DkOnmfd1.js +1 -0
- package/runtime/assets/news-feed-CFWKKqrH.js +1 -0
- package/runtime/assets/note-_cGEXAru.js +1 -0
- package/runtime/assets/open-interest-fxHh_T-V.js +1 -0
- package/runtime/assets/options-iv-CDArg1Op.js +1 -0
- package/runtime/assets/options-oi-strike-D_XIgUkk.js +1 -0
- package/runtime/assets/options-put-call-DG4RXjzD.js +1 -0
- package/runtime/assets/pomodoro-B-Jk-51G.js +1 -0
- package/runtime/assets/portfolio-allocation-BJepNj1X.js +1 -0
- package/runtime/assets/portfolio-common-D5L06PNC.js +1 -0
- package/runtime/assets/portfolio-holdings-DSkAZALG.js +1 -0
- package/runtime/assets/portfolio-value-BJw2csWV.js +1 -0
- package/runtime/assets/price-chart-khxI-9vJ.js +1 -0
- package/runtime/assets/price-compare-C-uEckke.js +1 -0
- package/runtime/assets/price-liveline-BDesEIbL.js +1 -0
- package/runtime/assets/price-ticker-BXSeNYf9.js +1 -0
- package/runtime/assets/protocol-fees-treemap-YtWbL1Kn.js +1 -0
- package/runtime/assets/protocol-tvl-chart-CEjUOIY5.js +1 -0
- package/runtime/assets/protocol-tvl-treemap-b31QlpnS.js +1 -0
- package/runtime/assets/quote-cehyepdm.js +1 -0
- package/runtime/assets/rates-board-Du4k0z1i.js +1 -0
- package/runtime/assets/returns-projector-DXnRFAES.js +1 -0
- package/runtime/assets/risk-reward-DZWyCrbv.js +1 -0
- package/runtime/assets/rules-card-BXJjNTqj.js +1 -0
- package/runtime/assets/session-progress-bA45Q3wk.js +1 -0
- package/runtime/assets/short-volume-C6cWknyR.js +1 -0
- package/runtime/assets/snake-DYTa97hl.js +1 -0
- package/runtime/assets/spotify-embed-BaH6UHeG.js +1 -0
- package/runtime/assets/stopwatch-CS6n0bY9.js +1 -0
- package/runtime/assets/top-movers-CQNx9EH5.js +1 -0
- package/runtime/assets/treasury-auctions-CGM8hAuU.js +1 -0
- package/runtime/assets/treemap-leaf-DLQawrx4.js +1 -0
- package/runtime/assets/tvl-treemap-C3SUFzdj.js +1 -0
- package/runtime/assets/ui-Bq3RQsdJ.js +1 -0
- package/runtime/assets/unicorn-scene-DcohHRPZ.js +1 -0
- package/runtime/assets/use-countdown-BmcF-qdL.js +1 -0
- package/runtime/assets/utils-DaT-yT0k.js +1 -0
- package/runtime/assets/video-WCnvLwQ_.js +1 -0
- package/runtime/assets/yield-curve-CpitTQ9L.js +1 -0
- package/runtime/index.html +2 -4
- package/runtime/widget-icons/breakeven.png +0 -0
- package/runtime/widget-icons/breathing.png +0 -0
- package/runtime/widget-icons/btc-blocks.png +0 -0
- package/runtime/widget-icons/btc-difficulty.png +0 -0
- package/runtime/widget-icons/btc-fees.png +0 -0
- package/runtime/widget-icons/btc-hashrate.png +0 -0
- package/runtime/widget-icons/btc-mempool.png +0 -0
- package/runtime/widget-icons/calculator.png +0 -0
- package/runtime/widget-icons/checklist.png +0 -0
- package/runtime/widget-icons/coin-movers.png +0 -0
- package/runtime/widget-icons/countdown.png +0 -0
- package/runtime/widget-icons/day-meter.png +0 -0
- package/runtime/widget-icons/dex-volume-chart.png +0 -0
- package/runtime/widget-icons/dex-volume-treemap.png +0 -0
- package/runtime/widget-icons/dice.png +0 -0
- package/runtime/widget-icons/divider.png +0 -0
- package/runtime/widget-icons/drawdy.png +0 -0
- package/runtime/widget-icons/filings-feed.png +0 -0
- package/runtime/widget-icons/financial-stress.png +0 -0
- package/runtime/widget-icons/flappy-bird.png +0 -0
- package/runtime/widget-icons/fundamentals.png +0 -0
- package/runtime/widget-icons/holiday-calendar.png +0 -0
- package/runtime/widget-icons/journal-log.png +0 -0
- package/runtime/widget-icons/journal-open.png +0 -0
- package/runtime/widget-icons/journal-results.png +0 -0
- package/runtime/widget-icons/journal-score.png +0 -0
- package/runtime/widget-icons/labor-market.png +0 -0
- package/runtime/widget-icons/lightning-stats.png +0 -0
- package/runtime/widget-icons/link-grid.png +0 -0
- package/runtime/widget-icons/market-cap-treemap.png +0 -0
- package/runtime/widget-icons/marquee.png +0 -0
- package/runtime/widget-icons/mining-pools.png +0 -0
- package/runtime/widget-icons/national-debt.png +0 -0
- package/runtime/widget-icons/news-feed.png +0 -0
- package/runtime/widget-icons/open-interest.png +0 -0
- package/runtime/widget-icons/options-iv.png +0 -0
- package/runtime/widget-icons/options-oi-strike.png +0 -0
- package/runtime/widget-icons/options-put-call.png +0 -0
- package/runtime/widget-icons/pomodoro.png +0 -0
- package/runtime/widget-icons/portfolio-allocation.png +0 -0
- package/runtime/widget-icons/portfolio-holdings.png +0 -0
- package/runtime/widget-icons/portfolio-value.png +0 -0
- package/runtime/widget-icons/protocol-fees-treemap.png +0 -0
- package/runtime/widget-icons/protocol-tvl-chart.png +0 -0
- package/runtime/widget-icons/protocol-tvl-treemap.png +0 -0
- package/runtime/widget-icons/quote.png +0 -0
- package/runtime/widget-icons/returns-projector.png +0 -0
- package/runtime/widget-icons/risk-reward.png +0 -0
- package/runtime/widget-icons/rules-card.png +0 -0
- package/runtime/widget-icons/session-progress.png +0 -0
- package/runtime/widget-icons/short-volume.png +0 -0
- package/runtime/widget-icons/snake.png +0 -0
- package/runtime/widget-icons/spotify-embed.png +0 -0
- package/runtime/widget-icons/stopwatch.png +0 -0
- package/runtime/widget-icons/treasury-auctions.png +0 -0
- package/runtime/widget-icons/video.png +0 -0
- package/runtime/widget-icons/yield-curve.png +0 -0
- package/runtime/assets/editor-CY2XpG9x.js +0 -68
- package/runtime/assets/editor-DinyMxo6.css +0 -1
- package/runtime/assets/index-Bpmi3x1d.js +0 -597
- package/runtime/assets/index-CsheOEUr.css +0 -1
- package/runtime/assets/index-DPlG_EDx.js +0 -35727
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as e}from"./react-qoZPGuNy.js";import{i as S}from"./content-shared-BZ1XzrJx.js";import{D as h,U as f,a as y,d as v}from"./format-CfAcS4D8.js";import{f as M,aJ as R}from"./index-C_O7gp2F.js";import{s as O}from"./ui-Bq3RQsdJ.js";R.schema;const P="var(--color-highlight)";function b(s){const a=Number(s);return Number.isFinite(a)?a:0}function g({label:s,value:a,onChange:n}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:s}),e.jsxs("span",{className:`flex items-center px-2 py-1.5 ${S}`,children:[e.jsx("span",{className:"body-sm text-soft",children:"$"}),e.jsx("input",{type:"number",inputMode:"decimal",value:a,onChange:c=>n(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"})]})]})}function L({value:s,onChange:a}){return e.jsx("div",{className:`flex gap-1 p-1 ${S}`,children:["long","short"].map(n=>{const c=n===s;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`caption flex-1 rounded px-2 py-1 text-center uppercase tracking-[0.12em] transition-colors ${c?"bg-white/[0.06] font-semibold":"text-soft"}`,style:c?{color:P}:void 0,children:n},n)})})}function T({config:s}){const[a,n]=l.useState(String(s.entry)),[c,j]=l.useState(String(s.stop)),[m,N]=l.useState(String(s.target)),[o,k]=l.useState(s.direction);l.useEffect(()=>n(String(s.entry)),[s.entry]),l.useEffect(()=>j(String(s.stop)),[s.stop]),l.useEffect(()=>N(String(s.target)),[s.target]),l.useEffect(()=>k(s.direction),[s.direction]);const t=l.useMemo(()=>{const r=b(a),p=b(c),x=b(m),i=Math.abs(r-p),d=Math.abs(x-r),D=i>0?d/i:0,E=r!==0?i/r*100:0,$=r!==0?d/r*100:0,u=i+d,U=u>0?i/u*100:50,F=o==="long"?p<r&&r<x:x<r&&r<p;return{riskPerUnit:i,rewardPerUnit:d,rr:D,riskPct:E,rewardPct:$,riskShare:U,hasRisk:i>0,hasData:u>0,valid:F}},[a,c,m,o]),C=t.hasData?t.hasRisk?`1 : ${t.rr.toFixed(t.rr>=10?0:1)}`:"∞":"—",w=s.label.trim();return e.jsxs("div",{className:`${O} flex flex-col gap-3`,children:[w&&e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:w}),e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx(g,{label:"Entry",value:a,onChange:n}),e.jsx(g,{label:"Stop",value:c,onChange:j}),e.jsx(g,{label:"Target",value:m,onChange:N})]}),e.jsx(L,{value:o,onChange:k}),e.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Risk : Reward"}),e.jsx("span",{className:"metric-md",style:{color:t.hasData?P:void 0},children:C})]}),e.jsxs("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-white/[0.06]",children:[e.jsx("span",{className:"h-full",style:{width:`${t.riskShare}%`,background:h}}),e.jsx("span",{className:"h-full",style:{width:`${100-t.riskShare}%`,background:f}})]}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex min-w-0 flex-col",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:h},children:"Risk"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:h},children:y(-t.riskPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.riskPerUnit)," / unit"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col items-end text-right",children:[e.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:f},children:"Reward"}),e.jsx("span",{className:"body-sm tabular-nums",style:{color:f},children:y(t.rewardPct)}),e.jsxs("span",{className:"caption text-soft tabular-nums",children:[v(t.rewardPerUnit)," / unit"]})]})]}),t.hasData&&!t.valid&&e.jsxs("span",{className:"caption text-soft",children:["⚠ Prices don't bracket entry for a ",o," setup."]})]})]})}const z=M({...R,component:T});export{z as riskRewardFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./react-qoZPGuNy.js";import{f as m,bb as n}from"./index-C_O7gp2F.js";import{F as i,s as o}from"./ui-Bq3RQsdJ.js";n.schema;function c({config:l}){const r=l.rules.filter(e=>e.trim()),a=l.title.trim();return r.length===0?s.jsx(i,{children:"no rules yet"}):s.jsxs("div",{className:"flex h-full w-full flex-col",children:[a&&s.jsx("div",{className:"body-sm text-strong mb-1 shrink-0 font-semibold",children:a}),s.jsx("ol",{className:`min-h-0 flex-1 ${o}`,children:r.map((e,t)=>s.jsxs("li",{className:"flex gap-2 py-1",children:[s.jsx("span",{className:"caption text-highlight shrink-0 tabular-nums",children:t+1}),s.jsx("span",{className:"body-sm text-normal",children:e})]},t))})]})}const u=m({...n,component:c});export{u as rulesCardFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as e}from"./react-qoZPGuNy.js";import{E as u,e as w,f as h}from"./market-data-CvmpLFSo.js";import{f as N,aL as f}from"./index-C_O7gp2F.js";import{F as v}from"./ui-Bq3RQsdJ.js";f.schema;function x(s){const[o,r]=s.split(":").map(Number);return o*60+r}function b(s){return Math.min(1,Math.max(0,s))}function M({config:s}){const[o,r]=d.useState(()=>new Date);d.useEffect(()=>{const j=setInterval(()=>r(new Date),3e4);return()=>clearInterval(j)},[]);const n=u[s.exchange]??u.NYSE;if(!n)return e.jsx(v,{children:"unknown exchange"});const t=w(n,o),a=t.status==="open",c=s.label.trim(),l=x(t.close)-x(t.open),i=a&&l>0?b((l-t.nextChangeMin)/l):0,p=Math.round(i*100),g=t.status==="holiday"?"Holiday":a?`${p}%`:"Closed",m=a?`closes in ${h(t.nextChangeMin)}`:s.showCountdown?`opens in ${h(t.nextChangeMin)}`:null;return e.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2",children:[e.jsxs("div",{className:"caption text-soft flex items-center gap-1.5 uppercase tracking-[0.14em]",children:[e.jsx("span",{className:"text-normal font-semibold",children:n.mark}),e.jsx("span",{children:n.code}),c&&e.jsxs("span",{className:"text-disabled truncate tracking-normal normal-case",children:["· ",c]})]}),e.jsx("div",{className:`metric-md leading-none ${a?"text-strong":"text-soft"}`,children:g}),e.jsx("div",{className:"bg-surface h-2 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${i*100}%`,background:"var(--color-highlight)"}})}),m&&e.jsx("div",{className:"caption text-soft",children:m})]})}const $=N({...f,component:M});export{$ as sessionProgressFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u,j as s}from"./react-qoZPGuNy.js";import{f as x,ad as h,ae as f,A as p}from"./index-C_O7gp2F.js";import{b,e as i}from"./format-CfAcS4D8.js";import{F as c,s as j}from"./ui-Bq3RQsdJ.js";h.schema;const d=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function y({symbol:e,entry:o}){const l=e.includes(":")?e:`xyz:${o.symbol}`,r=Math.max(0,Math.min(100,o.shortPct));return s.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[s.jsx(p,{symbol:l,size:20}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[s.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:o.symbol}),s.jsx("span",{className:"body-md text-strong font-bold tabular-nums",children:b(r,1)})]}),s.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:s.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:d(.85),boxShadow:`0 0 8px ${d(.5)}`}})}),s.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",i(o.shortVolume)," /"," ",i(o.totalVolume)]})]})]})}function v({config:e}){const{data:o,isLoading:l}=f(e.symbols),r=u.useMemo(()=>{const a=e.symbols.map(t=>({symbol:t,entry:o[t]})).filter(t=>!!t.entry);return a.sort((t,n)=>e.sort==="symbol"?t.entry.symbol.localeCompare(n.entry.symbol):e.sort==="volume"?n.entry.totalVolume-t.entry.totalVolume:n.entry.shortPct-t.entry.shortPct),a},[o,e.symbols,e.sort]);if(l)return s.jsx(c,{loading:!0,children:"loading short volume…"});if(r.length===0)return s.jsx(c,{children:"no FINRA short-volume data yet"});const m=r[0].entry.date;return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),s.jsx("div",{className:"body-sm text-normal",children:m?`FINRA · ${m}`:"FINRA"})]}),s.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",s.jsx("br",{}),"not short interest"]})]}),s.jsx("div",{className:j,children:r.map(({symbol:a,entry:t})=>s.jsx(y,{symbol:a,entry:t},a))})]})}const F=x({...h,component:v});export{F as shortVolumeFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,j as L}from"./react-qoZPGuNy.js";import{a as H,G as M,d as I}from"./game-ui-Dy_QYsPr.js";import{f as j,ay as z}from"./index-C_O7gp2F.js";import"./format-CfAcS4D8.js";const g=18,P=14,W=0,N={snakeHead:"rgba(255, 255, 255, 0.95)",food:"hsla(347, 100%, 62%, 1)"};function O(s,r,l,u,f){s.fillStyle=u,s.fillRect(r.originX+l.x*g+f,r.originY+l.y*g+f,g-f*2,g-f*2)}function q(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),O(r,l,l.food,N.food,3),l.snake.forEach((d,C)=>O(r,l,d,C===0?N.snakeHead:y,2)),I(s,r,u,f,y)}function X(s,r,l,u,f,y){r.clearRect(0,0,s.width,s.height),r.textAlign="center",l==="idle"?(r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText("Arrow keys or swipe to start",s.width/2,s.height/2)):(r.fillStyle=M.gameOver,r.font='bold 20px "DM Sans", sans-serif',r.fillText("GAME OVER",s.width/2,s.height/2-30),r.fillStyle=M.text,r.font='bold 14px "DM Sans", sans-serif',r.fillText(`Score: ${u}`,s.width/2,s.height/2),r.fillStyle=M.textSoft,r.fillText("Press an arrow or tap to play again",s.width/2,s.height/2+28)),r.textAlign="left",I(s,r,u,f,y)}function v(){const s=a.useRef(null),r=a.useRef(null),[l,u]=a.useState("idle"),[f,y]=a.useState(0),[d,C]=a.useState(()=>{if(typeof window<"u"){const e=localStorage.getItem("zframes-snake-high-score");return e?parseInt(e,10):0}return 0}),[,K]=a.useState(!1),h=a.useRef(0),S=a.useRef(d),x=a.useRef(l),A=a.useRef(null),b=a.useRef(H(null));a.useEffect(()=>{S.current=d,d>0&&localStorage.setItem("zframes-snake-high-score",String(d))},[d]),a.useEffect(()=>{x.current=l},[l]);const w=a.useRef({snake:[],dir:{x:1,y:0},pendingDir:{x:1,y:0},food:{x:0,y:0},cols:0,rows:0,originX:0,originY:0,stepCounter:0}),D=a.useCallback(()=>{const e=w.current;if(e.cols<=0||e.rows<=0)return;let t,o=0;do t={x:Math.floor(Math.random()*e.cols),y:Math.floor(Math.random()*e.rows)},o++;while(e.snake.some(i=>i.x===t.x&&i.y===t.y)&&o<400);e.food=t},[]),T=a.useCallback(()=>{const e=w.current,t=Math.floor(e.cols/2),o=Math.floor(e.rows/2);e.snake=[{x:t,y:o},{x:t-1,y:o},{x:t-2,y:o}],e.dir={x:1,y:0},e.pendingDir={x:1,y:0},e.stepCounter=0,D(),h.current=0,y(0)},[D]),p=a.useCallback(()=>{w.current.cols<=0||(T(),u("playing"))},[T]),m=a.useCallback((e,t)=>{const o=w.current;o.dir.x===-e&&o.dir.y===-t||(o.pendingDir={x:e,y:t})},[]);a.useEffect(()=>{const e=o=>{const i=o.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)return;const c=x.current==="playing";let n=!0;switch(o.code){case"ArrowUp":case"KeyW":c?m(0,-1):p();break;case"ArrowDown":case"KeyS":c?m(0,1):p();break;case"ArrowLeft":case"KeyA":c?m(-1,0):p();break;case"ArrowRight":case"KeyD":c?m(1,0):p();break;case"Space":c||p();break;default:n=!1}n&&o.preventDefault()},t=r.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[m,p]),a.useLayoutEffect(()=>{const e=s.current;if(!e)return;const t=()=>{const i=e.parentElement;if(i&&i.clientWidth>0&&i.clientHeight>0){e.width=i.clientWidth,e.height=i.clientHeight-W,b.current=H(e);const c=w.current;c.cols=Math.max(5,Math.floor(e.width/g)),c.rows=Math.max(5,Math.floor(e.height/g)),c.originX=Math.floor((e.width-c.cols*g)/2),c.originY=Math.floor((e.height-c.rows*g)/2);const n=e.getContext("2d");n&&x.current!=="playing"&&X(e,n,x.current,h.current,S.current,b.current),K(E=>!E)}};t();const o=new ResizeObserver(t);return o.observe(e.parentElement),()=>o.disconnect()},[]),a.useEffect(()=>{if(l!=="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");if(!e||!t)return;let o;const i=()=>{h.current>S.current&&(S.current=h.current,C(h.current)),u("gameover")},c=()=>{const n=w.current;if(n.stepCounter++,n.stepCounter>=P){n.stepCounter=0,n.dir=n.pendingDir;const E=n.snake[0],k=E.x+n.dir.x,R=E.y+n.dir.y;if(k<0||R<0||k>=n.cols||R>=n.rows){i();return}const G=k===n.food.x&&R===n.food.y;if((G?n.snake:n.snake.slice(0,-1)).some(F=>F.x===k&&F.y===R)){i();return}n.snake.unshift({x:k,y:R}),G?(h.current+=1,y(h.current),D()):n.snake.pop()}q(e,t,n,h.current,S.current,b.current),o=requestAnimationFrame(c)};return o=requestAnimationFrame(c),()=>cancelAnimationFrame(o)},[l]),a.useEffect(()=>{if(l==="playing")return;const e=s.current,t=e==null?void 0:e.getContext("2d");!e||!t||X(e,t,l,f,d,b.current)},[l,f,d]);const U=e=>{const t=e.touches[0];t&&(A.current={x:t.clientX,y:t.clientY})},Y=e=>{var n;const t=A.current;A.current=null;const o=e.changedTouches[0];if((n=r.current)==null||n.focus(),x.current!=="playing"){p();return}if(!t||!o)return;const i=o.clientX-t.x,c=o.clientY-t.y;Math.abs(i)<12&&Math.abs(c)<12||(Math.abs(i)>Math.abs(c)?m(i>0?1:-1,0):m(0,c>0?1:-1))};return L.jsx("div",{ref:r,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onTouchStart:U,onTouchEnd:Y,onClick:()=>{var e;return(e=r.current)==null?void 0:e.focus()},role:"application","aria-label":"Snake game. Use the arrow keys or swipe to steer.",children:L.jsx("canvas",{ref:s,className:"h-full w-full"})})}const Q=j({...z,component:v});export{Q as snakeFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as l}from"./react-qoZPGuNy.js";import{f as p,bd as i}from"./index-C_O7gp2F.js";import{F as o}from"./ui-Bq3RQsdJ.js";i.schema;const c=["track","album","playlist","artist","episode","show"];function d(t){let a;try{a=new URL(t.trim())}catch{return null}if(a.hostname.replace(/^www\./,"")!=="open.spotify.com")return null;const r=a.pathname.split("/").filter(Boolean),e=r.findIndex(n=>c.includes(n));return e===-1||!r[e+1]?null:`https://open.spotify.com/embed/${r[e]}/${r[e+1]}`}function m({config:t}){const[a,r]=s.useState("loading"),e=s.useMemo(()=>d(t.url),[t.url]);return e?a==="error"?l.jsx(o,{children:"player unavailable"}):l.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[a==="loading"&&l.jsx("div",{className:"absolute inset-0 z-10",children:l.jsx(o,{loading:!0,children:"loading player…"})}),l.jsx("iframe",{src:e,title:"Spotify player",className:"w-full",height:t.compact?152:"100%",style:{border:0,height:t.compact?152:"100%"},loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",onLoad:()=>r("loaded"),onError:()=>r("error")},e+String(t.compact))]}):l.jsx(o,{children:"paste a Spotify track / album / playlist URL"})}const h=p({...i,component:m});export{h as spotifyEmbedFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as s}from"./react-qoZPGuNy.js";import{i as h}from"./content-shared-BZ1XzrJx.js";import{f as y,aK as f,m as S}from"./index-C_O7gp2F.js";f.schema;const p="var(--color-highlight)",x="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",i=t=>String(t).padStart(2,"0");function g(t){const e=Math.floor(Math.max(0,t)/1e3),c=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return c>0?`${c}:${i(n)}:${i(o)}`:`${i(n)}:${i(o)}`}function k({config:t}){const e=S(),[c,n]=l.useState({startedAt:t.startedAt,accumulatedMs:t.accumulatedMs}),o=e?t.startedAt:c.startedAt,w=e?t.accumulatedMs:c.accumulatedMs,a=o!==0,d=l.useCallback(r=>{e?e(r):n(m=>({...m,...r}))},[e]),[,b]=l.useState(0);l.useEffect(()=>{if(!a)return;const r=window.setInterval(()=>b(m=>m+1),250);return()=>window.clearInterval(r)},[a]);const u=w+(a?Date.now()-o:0),v=()=>d({startedAt:Date.now()}),M=()=>d({startedAt:0,accumulatedMs:u}),j=()=>d({startedAt:0,accumulatedMs:0});return s.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center",children:[t.label&&s.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[s.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:p,boxShadow:a?x:void 0}}),t.label]}),s.jsx("div",{className:"metric-lg text-strong leading-none",style:a?{color:p,textShadow:x}:void 0,children:g(u)}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("button",{type:"button",onClick:a?M:v,className:`caption text-normal px-3 py-1 uppercase tracking-[0.12em] ${h}`,style:a?void 0:{color:p},children:a?"Pause":"Start"}),s.jsx("button",{type:"button",onClick:j,disabled:!a&&u===0,className:`caption text-soft px-3 py-1 uppercase tracking-[0.12em] transition-opacity disabled:opacity-40 ${h}`,children:"Reset"})]})]})}const E=y({...f,component:k});export{E as stopwatchFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as s}from"./react-qoZPGuNy.js";import{f,af as m,a7 as g,h as l}from"./index-C_O7gp2F.js";import{M as i}from"./mover-row-kQ9xt3Sp.js";import{F as n}from"./ui-Bq3RQsdJ.js";import"./format-CfAcS4D8.js";m.schema;const h=["xyz:*"];function u({config:t}){const{stats:c,isLoading:p}=g(h,6e4),{gainers:o,losers:x}=d.useMemo(()=>{const e=Object.entries(c).map(([a,r])=>({symbol:a,...r})).filter(a=>a.symbol.includes(":")&&a.markPx>0&&a.prevDayPx>0).sort((a,r)=>r.changePct-a.changePct);return{gainers:e.slice(0,t.count),losers:e.slice(-t.count).reverse()}},[c,t.count]);return p?s.jsx(n,{loading:!0,children:"loading movers…"}):o.length===0?s.jsx(n,{children:"no mover data yet"}):s.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"gainers"}),o.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]}),s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"losers"}),x.map(e=>s.jsx(i,{symbol:e.symbol,label:l(e.symbol),price:e.markPx,changePct:e.changePct},e.symbol))]})]})}const M=f({...m,component:u});export{M as topMoversFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./react-qoZPGuNy.js";import{b as c}from"./format-CfAcS4D8.js";import{M as m}from"./metric-row-BVVhjsjK.js";import{f as u,P as a,Q as d}from"./index-C_O7gp2F.js";import{F as i,s as x}from"./ui-Bq3RQsdJ.js";a.schema;function f({auction:e}){const t=[e.securityTerm,e.securityType].filter(Boolean).join(" ");return s.jsx(m,{label:t||e.securityType,meta:e.auctionDate+(e.bidToCover!==null?` · ${e.bidToCover.toFixed(2)}× bid-to-cover`:""),value:e.rate!==null?c(e.rate):"—"})}function p({config:e}){const{auctions:t,isLoading:o}=d(e.count);if(o)return s.jsx(i,{loading:!0,children:"loading auctions…"});if(!t.length)return s.jsx(i,{children:"no auction data yet"});const n=t.slice(0,e.count);return s.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"caption text-soft uppercase",children:"treasury auctions"}),s.jsx("div",{className:"body-sm text-normal",children:"high yield · bid-to-cover"})]}),s.jsx("div",{className:"caption text-soft text-right",children:"results"})]}),s.jsx("div",{className:x,children:n.map((r,l)=>s.jsx(f,{auction:r},`${r.auctionDate}-${r.securityType}-${r.securityTerm}-${l}`))})]})}const T=u({...a,component:p});export{T as treasuryAuctionsFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as T}from"./react-qoZPGuNy.js";import{c as P}from"./utils-DaT-yT0k.js";import{w as $,x as z,y as H}from"./d3-xK4fOkBU.js";const E="4px",S="4px",k=2.5,U=(b,v,y,g,B)=>{const R=b.children;if(!R||R.length===0)return;const I=(s,i,n,e,l)=>{if(e===0)return 1/0;const c=i/e*l;if(c===0)return 1/0;let r=0;for(const u of s){const o=(u.value||0)/i*n,x=c/o,h=Math.abs(x-k);r=Math.max(r,h)}return r},L=(s,i,n,e,l,c,r)=>{const u=i/n*l;let a=r;for(const o of s){const h=(o.value||0)/i*e;o.x0=c,o.y0=a,o.x1=c+u,o.y1=a+h,a+=h}return u},_=g-v,p=B-y,C=R.reduce((s,i)=>s+(i.value||0),0);if(C===0)return;let w=[...R],m=v,j=_,M=C;for(;w.length>0;){let s=[],i=0;for(let e=0;e<w.length;e++){const l=w[e],c=l.value||0,r=[...s,l],u=i+c;if(s.length===0)s=r,i=u;else{const a=I(s,i,p,M,j);if(I(r,u,p,M,j)<=a)s=r,i=u;else break}}const n=L(s,i,M,p,j,m,y);w=w.slice(s.length),m+=n,j-=n,M-=i}};function F({data:b,className:v,LeafComponent:y,getColorValue:g,tileMode:B="squarify"}){const R=d.useRef(null),I=d.useRef(null),L=d.useRef(null),_=d.useRef(null),p=d.useRef(null),C=d.useRef(null),[,w]=d.useTransition(),[m,j]=d.useState({width:0,height:0});d.useEffect(()=>{const n=R.current;if(n){const e=new ResizeObserver(()=>{w(()=>{j({width:n.offsetWidth,height:n.offsetHeight})})});return e.observe(n),()=>{e.disconnect()}}},[]),d.useEffect(()=>{const n=I.current;if(n){const e=n.children;let l=e[0],c=e[0],r=e[0],u=e[0];for(let a=0;a<e.length;a++){const o=e[a],{x,y:h}=o.getBoundingClientRect(),N=l.getBoundingClientRect(),W=c.getBoundingClientRect(),t=r.getBoundingClientRect(),f=u.getBoundingClientRect();x<=N.x&&h<=N.y&&(l=o),x<=W.x&&h>=W.y&&(c=o),x>=t.x&&h<=t.y&&(r=o),x>=f.x&&h>=f.y&&(u=o)}L.current&&(L.current.style.borderTopLeftRadius=E),L.current=l,L.current.style.borderTopLeftRadius=S,_.current&&(_.current.style.borderBottomLeftRadius=E),_.current=c,_.current.style.borderBottomLeftRadius=S,p.current&&(p.current.style.borderTopRightRadius=E),p.current=r,p.current.style.borderTopRightRadius=S,C.current&&(C.current.style.borderBottomRightRadius=E),C.current=u,C.current.style.borderBottomRightRadius=S}},[m]);const M=d.useMemo(()=>{switch(B){case"vertical-rectangle":return U;case"squarify":default:return $}},[B]),s=d.useMemo(()=>z().size([m.width,m.height]).tile(M).paddingInner(4)(H({id:"root",value:0,children:b}).sum(n=>n.value).sort((n,e)=>e.data.value-n.data.value)),[b,m.width,m.height,M]),i=d.useMemo(()=>{const n=s.leaves(),e=n.map(t=>g?g(t.data):t.data.value),l=e.filter(t=>t>=0),c=e.filter(t=>t<0),r=l.length>0?Math.min(...l):0,u=l.length>0?Math.max(...l):0,a=c.length>0?Math.min(...c):0,o=c.length>0?Math.max(...c):0,x=t=>t<0?o===a?1:(t-o)/(a-o):u===r?1:(t-r)/(u-r),h=(t,f)=>{if(f>=0){const q=Math.round(34+t*16);return`hsl(152 ${Math.round(42+t*20)}% ${q}%)`}const D=Math.round(36+t*15);return`hsl(350 ${Math.round(48+t*22)}% ${D}%)`},N=[...new Set(n.map(t=>t.x0))].sort((t,f)=>t-f),W=new Map(N.map((t,f)=>[t,f]));return n.map(t=>{const f=t.x1-t.x0,D=t.y1-t.y0,V=g?g(t.data):t.data.value,q=x(V),A=W.get(t.x0)??0,O=h(q,V);return T.jsx("div",{className:"group absolute cursor-pointer rounded-sm border border-transparent hover:bg-[radial-gradient(146.13%_118.42%_at_50%_-15.5%,rgba(255,255,255,0.1)_0%,rgba(255,255,255,0)_99.59%)] hover:bg-gradient-to-t",style:{left:t.x0,top:t.y0,width:f,height:D,borderRadius:E,backgroundColor:O},children:T.jsx(y,{width:f,height:D,data:t.data,columnIndex:A})},`${t.data.id}-box`)})},[s,y,g]);return T.jsx("div",{className:P("h-full w-full",v),ref:R,children:T.jsx("div",{className:"relative overflow-hidden rounded-lg",style:{height:m.height,width:m.width},ref:I,children:i})})}const J=F;function K({width:b,height:v,label:y,secondary:g,title:B}){if(b<48||v<30)return null;const R=b<70||v<44;return T.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center overflow-hidden p-1 text-center",title:B,children:[T.jsx("span",{className:"body-sm truncate font-bold text-strong",children:y}),!R&&g&&T.jsx("span",{className:"caption text-soft",children:g})]})}export{J as T,K as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as s}from"./react-qoZPGuNy.js";import{f as l}from"./format-CfAcS4D8.js";import{f as p,ag as n,ah as f}from"./index-C_O7gp2F.js";import{T as u,a as c}from"./treemap-leaf-DLQawrx4.js";import{F as m}from"./ui-Bq3RQsdJ.js";import"./utils-DaT-yT0k.js";import"./d3-xK4fOkBU.js";n.schema;function d({width:r,height:o,data:e}){const t=l(e.tvl);return s.jsx(c,{width:r,height:o,label:e.id,secondary:t,title:`${e.id} · ${t}`})}function v({config:r}){const{entries:o,isLoading:e}=f(),t=i.useMemo(()=>o.slice(0,r.topN).map(a=>({id:a.name,value:a.tvl,tvl:a.tvl})),[o,r.topN]);return e?s.jsx(m,{loading:!0,children:"loading TVL…"}):t.length===0?s.jsx(m,{children:"no TVL data"}):s.jsx(u,{data:t,LeafComponent:d,getColorValue:a=>a.tvl})}const F=p({...n,component:v});export{F as tvlTreemapFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./react-qoZPGuNy.js";const t="min-h-0 flex-1 overflow-y-auto pr-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/[0.08] hover:[&::-webkit-scrollbar-thumb]:bg-white/15",r="min-w-0 overflow-x-auto pb-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/[0.08] hover:[&::-webkit-scrollbar-thumb]:bg-white/15";function i({loading:a=!1,children:s}){return a?e.jsx("div",{className:"flex h-full min-h-[72px] w-full items-center justify-center overflow-hidden rounded-md",role:"status","aria-live":"polite","aria-busy":"true",children:e.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"relative h-2.5 w-2.5 shrink-0 rounded-full",style:{background:"hsl(var(--zf-accent-hue, 242) 90% 76%)",boxShadow:"0 0 12px hsl(var(--zf-accent-hue, 242) 90% 76% / 0.72)"},children:e.jsx("span",{className:"absolute inset-0 animate-ping rounded-full opacity-60",style:{background:"hsl(var(--zf-accent-hue, 242) 90% 76%)"}})}),e.jsx("span",{className:"body-sm text-soft truncate",children:s})]}),e.jsxs("div",{className:"grid min-h-0 grid-cols-4 gap-2",children:[e.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.07]"}),e.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.05]"}),e.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.08]"}),e.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.04]"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"h-2.5 w-11/12 animate-pulse rounded-full bg-white/[0.07]"}),e.jsx("span",{className:"h-2.5 w-7/12 animate-pulse rounded-full bg-white/[0.05]"})]})]})}):e.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:s})}export{i as F,r as a,t as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,j as E}from"./react-qoZPGuNy.js";const w=new Map;function x(n){var i;if(typeof window>"u"||(i=window.UnicornStudio)!=null&&i.addScene)return Promise.resolve();const a=w.get(n);if(a)return a;const r=new Promise((d,s)=>{const u=document.querySelector(`script[src="${n}"]`),t=u??document.createElement("script"),l=()=>{var f;(f=window.UnicornStudio)!=null&&f.addScene?d():s(new Error("UnicornStudio global missing after script load"))};t.addEventListener("load",l),t.addEventListener("error",()=>s(new Error("UnicornStudio SDK failed to load"))),u||(t.src=n,t.async=!0,document.head.appendChild(t))}).catch(d=>{throw w.delete(n),d});return w.set(n,r),r}let U=0;function v({projectId:n,sdkUrl:a,width:r="100%",height:i="100%",scale:d,dpi:s}){var f;const u=p.useRef(null),[t,l]=p.useState(typeof window<"u"&&!!((f=window.UnicornStudio)!=null&&f.addScene));return p.useEffect(()=>{let o=!1;return x(a).then(()=>{o||l(!0)}).catch(()=>{o||l(!1)}),()=>{o=!0}},[a]),p.useEffect(()=>{var m;const o=u.current;if(!t||!o||!((m=window.UnicornStudio)!=null&&m.addScene))return;o.id||(o.id=`zf-unicorn-${U+=1}`);let c=null,S=!1;return window.UnicornStudio.addScene({elementId:o.id,projectId:n,scale:d??1,dpi:s??1.5,fps:60,lazyLoad:!0,production:!0}).then(e=>{var y;if(S){(y=e==null?void 0:e.destroy)==null||y.call(e);return}c=e}).catch(()=>{}),()=>{var e;S=!0,(e=c==null?void 0:c.destroy)==null||e.call(c)}},[t,n,d,s]),E.jsx("div",{ref:u,"aria-hidden":!0,style:{position:"relative",width:typeof r=="number"?`${r}px`:r,height:typeof i=="number"?`${i}px`:i}})}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i}from"./react-qoZPGuNy.js";let l=typeof window<"u"?window.scrollY:0,w=typeof window<"u"?window.innerHeight:0,r;typeof window<"u"&&(window.addEventListener("scroll",()=>{r!=null&&(window.clearTimeout(r),r=void 0),r=window.setTimeout(()=>{l=window.scrollY},200)},{passive:!0}),window.addEventListener("resize",()=>{w=window.innerHeight},{passive:!0}));const s={_callbacks:[],register(e){this._callbacks.push(e)},unregister(e){this._callbacks=this._callbacks.filter(t=>t!==e)},tick(){setInterval(()=>{this._callbacks.forEach(t=>t())},1e3/24)}};typeof window<"u"&&s.tick();function p({ref:e,getRemainingMs:t,format:c}){const o=i.useRef({getRemainingMs:t,format:c});o.current={getRemainingMs:t,format:c};const u=i.useRef(0);i.useLayoutEffect(()=>{const n=()=>{e.current&&(u.current=e.current.getBoundingClientRect().top+window.scrollY)};return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}},[e]),i.useEffect(()=>{const n=()=>{if(!e.current)return;const d=u.current-l;if(d>w||d<0)return;const a=o.current.getRemainingMs();e.current&&(e.current.textContent=o.current.format(a))};return s.register(n),()=>{s.unregister(n)}},[e])}export{p as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function ye(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ye(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Ne(){for(var e,t,r=0,o="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ye(e))&&(o&&(o+=" "),o+=t);return o}const We=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Ee=(e,t)=>({classGroupId:e,validator:t}),ve=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),H="-",fe=[],Ve="arbitrary..",Fe=e=>{const t=Be(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return _e(l);const b=l.split(H),u=b[0]===""&&b.length>1?1:0;return ze(b,u,t)},getConflictingClassGroupIds:(l,b)=>{if(b){const u=o[l],m=r[l];return u?m?We(m,u):u:m||fe}return r[l]||fe}}},ze=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],d=r.nextPart.get(i);if(d){const m=ze(e,t+1,d);if(m)return m}const l=r.validators;if(l===null)return;const b=t===0?e.join(H):e.slice(t).join(H),u=l.length;for(let m=0;m<u;m++){const h=l[m];if(h.validator(b))return h.classGroupId}},_e=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Ve+o:void 0})(),Be=e=>{const{theme:t,classGroups:r}=e;return $e(r,t)},$e=(e,t)=>{const r=ve();for(const o in e){const i=e[o];ne(i,r,o,t)}return r},ne=(e,t,r,o)=>{const i=e.length;for(let d=0;d<i;d++){const l=e[d];Ue(l,t,r,o)}},Ue=(e,t,r,o)=>{if(typeof e=="string"){De(e,t,r);return}if(typeof e=="function"){Ye(e,t,r,o);return}qe(e,t,r,o)},De=(e,t,r)=>{const o=e===""?t:Ce(t,e);o.classGroupId=r},Ye=(e,t,r,o)=>{if(Xe(e)){ne(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Ee(r,e))},qe=(e,t,r,o)=>{const i=Object.entries(e),d=i.length;for(let l=0;l<d;l++){const[b,u]=i[l];ne(u,Ce(t,b),r,o)}},Ce=(e,t)=>{let r=e;const o=t.split(H),i=o.length;for(let d=0;d<i;d++){const l=o[d];let b=r.nextPart.get(l);b||(b=ve(),r.nextPart.set(l,b)),r=b}return r},Xe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Je=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const i=(d,l)=>{r[d]=l,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(d){let l=r[d];if(l!==void 0)return l;if((l=o[d])!==void 0)return i(d,l),l},set(d,l){d in r?r[d]=l:i(d,l)}}},se="!",ge=":",Qe=[],he=(e,t,r,o,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:i}),He=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=i=>{const d=[];let l=0,b=0,u=0,m;const h=i.length;for(let y=0;y<h;y++){const C=i[y];if(l===0&&b===0){if(C===ge){d.push(i.slice(u,y)),u=y+1;continue}if(C==="/"){m=y;continue}}C==="["?l++:C==="]"?l--:C==="("?b++:C===")"&&b--}const k=d.length===0?i:i.slice(u);let T=k,S=!1;k.endsWith(se)?(T=k.slice(0,-1),S=!0):k.startsWith(se)&&(T=k.slice(1),S=!0);const _=m&&m>u?m-u:void 0;return he(d,S,T,_)};if(t){const i=t+ge,d=o;o=l=>l.startsWith(i)?d(l.slice(i.length)):he(Qe,!1,l,void 0,!0)}if(r){const i=o;o=d=>r({className:d,parseClassName:i})}return o},Ke=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let i=[];for(let d=0;d<r.length;d++){const l=r[d],b=l[0]==="[",u=t.has(l);b||u?(i.length>0&&(i.sort(),o.push(...i),i=[]),o.push(l)):i.push(l)}return i.length>0&&(i.sort(),o.push(...i)),o}},Ze=e=>({cache:Je(e.cacheSize),parseClassName:He(e),sortModifiers:Ke(e),postfixLookupClassGroupIds:eo(e),...Fe(e)}),eo=e=>{const t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let o=0;o<r.length;o++)t[r[o]]=!0;return t},oo=/\s+/,ro=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:d,postfixLookupClassGroupIds:l}=t,b=[],u=e.trim().split(oo);let m="";for(let h=u.length-1;h>=0;h-=1){const k=u[h],{isExternal:T,modifiers:S,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:C}=r(k);if(T){m=k+(m.length>0?" "+m:m);continue}let L=!!C,v;if(L){const R=y.substring(0,C);v=o(R);const a=v&&l[v]?o(y):void 0;a&&a!==v&&(v=a,L=!1)}else v=o(y);if(!v){if(!L){m=k+(m.length>0?" "+m:m);continue}if(v=o(y),!v){m=k+(m.length>0?" "+m:m);continue}L=!1}const B=S.length===0?"":S.length===1?S[0]:d(S).join(":"),W=_?B+se:B,E=W+v;if(b.indexOf(E)>-1)continue;b.push(E);const V=i(v,L);for(let R=0;R<V.length;++R){const a=V[R];b.push(W+a)}m=k+(m.length>0?" "+m:m)}return m},to=(...e)=>{let t=0,r,o,i="";for(;t<e.length;)(r=e[t++])&&(o=Ae(r))&&(i&&(i+=" "),i+=o);return i},Ae=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Ae(e[o]))&&(r&&(r+=" "),r+=t);return r},so=(e,...t)=>{let r,o,i,d;const l=u=>{const m=t.reduce((h,k)=>k(h),e());return r=Ze(m),o=r.cache.get,i=r.cache.set,d=b,b(u)},b=u=>{const m=o(u);if(m)return m;const h=ro(u,r);return i(u,h),h};return d=l,(...u)=>d(to(...u))},no=[],f=e=>{const t=r=>r[e]||no;return t.isThemeGetter=!0,t},Se=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ie=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ao=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,io=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,po=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,M=e=>ao.test(e),p=e=>!!e&&!Number.isNaN(Number(e)),I=e=>!!e&&Number.isInteger(Number(e)),te=e=>e.endsWith("%")&&p(e.slice(0,-1)),G=e=>io.test(e),Re=()=>!0,bo=e=>lo.test(e)&&!co.test(e),ae=()=>!1,uo=e=>mo.test(e),fo=e=>po.test(e),go=e=>!s(e)&&!n(e),ho=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ko=e=>P(e,Pe,ae),s=e=>Se.test(e),j=e=>P(e,Te,bo),ke=e=>P(e,So,p),xo=e=>P(e,Oe,Re),wo=e=>P(e,Le,ae),xe=e=>P(e,Ge,ae),yo=e=>P(e,Me,fo),J=e=>P(e,je,uo),n=e=>Ie.test(e),$=e=>N(e,Te),vo=e=>N(e,Le),we=e=>N(e,Ge),zo=e=>N(e,Pe),Co=e=>N(e,Me),Q=e=>N(e,je,!0),Ao=e=>N(e,Oe,!0),P=(e,t,r)=>{const o=Se.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},N=(e,t,r=!1)=>{const o=Ie.exec(e);return o?o[1]?t(o[1]):r:!1},Ge=e=>e==="position"||e==="percentage",Me=e=>e==="image"||e==="url",Pe=e=>e==="length"||e==="size"||e==="bg-size",Te=e=>e==="length",So=e=>e==="number",Le=e=>e==="family-name",Oe=e=>e==="number"||e==="weight",je=e=>e==="shadow",Io=()=>{const e=f("color"),t=f("font"),r=f("text"),o=f("font-weight"),i=f("tracking"),d=f("leading"),l=f("breakpoint"),b=f("container"),u=f("spacing"),m=f("radius"),h=f("shadow"),k=f("inset-shadow"),T=f("text-shadow"),S=f("drop-shadow"),_=f("blur"),y=f("perspective"),C=f("aspect"),L=f("ease"),v=f("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...W(),n,s],V=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],a=()=>[n,s,u],z=()=>[M,"full","auto",...a()],ie=()=>[I,"none","subgrid",n,s],le=()=>["auto",{span:["full",I,n,s]},I,n,s],U=()=>[I,"auto",n,s],ce=()=>["auto","min","max","fr",n,s],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...a()],O=()=>[M,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...a()],Z=()=>[M,"screen","full","dvw","lvw","svw","min","max","fit",...a()],ee=()=>[M,"screen","full","lh","dvh","lvh","svh","min","max","fit",...a()],c=()=>[e,n,s],de=()=>[...W(),we,xe,{position:[n,s]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],pe=()=>["auto","cover","contain",zo,ko,{size:[n,s]}],oe=()=>[te,$,j],x=()=>["","none","full",m,n,s],w=()=>["",p,$,j],D=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],g=()=>[p,te,we,xe],ue=()=>["","none",_,n,s],Y=()=>["none",p,n,s],q=()=>["none",p,n,s],re=()=>[p,n,s],X=()=>[M,"full",...a()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[Re],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[go],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",p],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",M,s,n,C]}],container:["container"],"container-type":[{"@container":["","normal","size",n,s]}],"container-named":[ho],columns:[{columns:[p,s,n,b]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{"inset-s":z(),start:z()}],end:[{"inset-e":z(),end:z()}],"inset-bs":[{"inset-bs":z()}],"inset-be":[{"inset-be":z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[I,"auto",n,s]}],basis:[{basis:[M,"full","auto",b,...a()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[p,M,"auto","initial","none",s]}],grow:[{grow:["",p,n,s]}],shrink:[{shrink:["",p,n,s]}],order:[{order:[I,"first","last","none",n,s]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:a()}],"gap-x":[{"gap-x":a()}],"gap-y":[{"gap-y":a()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:a()}],px:[{px:a()}],py:[{py:a()}],ps:[{ps:a()}],pe:[{pe:a()}],pbs:[{pbs:a()}],pbe:[{pbe:a()}],pt:[{pt:a()}],pr:[{pr:a()}],pb:[{pb:a()}],pl:[{pl:a()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":a()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":a()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[b,"screen",...O()]}],"min-w":[{"min-w":[b,"screen","none",...O()]}],"max-w":[{"max-w":[b,"screen","none","prose",{screen:[l]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",r,$,j]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ao,xo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",te,s]}],"font-family":[{font:[vo,wo,t]}],"font-features":[{"font-features":[s]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,n,s]}],"line-clamp":[{"line-clamp":[p,"none",n,ke]}],leading:[{leading:[d,...a()]}],"list-image":[{"list-image":["none",n,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",n,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:c()}],"text-color":[{text:c()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[p,"from-font","auto",n,j]}],"text-decoration-color":[{decoration:c()}],"underline-offset":[{"underline-offset":[p,"auto",n,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:a()}],"tab-size":[{tab:[I,n,s]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",n,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",n,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:de()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:pe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},I,n,s],radial:["",n,s],conic:[I,n,s]},Co,yo]}],"bg-color":[{bg:c()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:c()}],"gradient-via":[{via:c()}],"gradient-to":[{to:c()}],rounded:[{rounded:x()}],"rounded-s":[{"rounded-s":x()}],"rounded-e":[{"rounded-e":x()}],"rounded-t":[{"rounded-t":x()}],"rounded-r":[{"rounded-r":x()}],"rounded-b":[{"rounded-b":x()}],"rounded-l":[{"rounded-l":x()}],"rounded-ss":[{"rounded-ss":x()}],"rounded-se":[{"rounded-se":x()}],"rounded-ee":[{"rounded-ee":x()}],"rounded-es":[{"rounded-es":x()}],"rounded-tl":[{"rounded-tl":x()}],"rounded-tr":[{"rounded-tr":x()}],"rounded-br":[{"rounded-br":x()}],"rounded-bl":[{"rounded-bl":x()}],"border-w":[{border:w()}],"border-w-x":[{"border-x":w()}],"border-w-y":[{"border-y":w()}],"border-w-s":[{"border-s":w()}],"border-w-e":[{"border-e":w()}],"border-w-bs":[{"border-bs":w()}],"border-w-be":[{"border-be":w()}],"border-w-t":[{"border-t":w()}],"border-w-r":[{"border-r":w()}],"border-w-b":[{"border-b":w()}],"border-w-l":[{"border-l":w()}],"divide-x":[{"divide-x":w()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":w()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"hidden","none"]}],"border-color":[{border:c()}],"border-color-x":[{"border-x":c()}],"border-color-y":[{"border-y":c()}],"border-color-s":[{"border-s":c()}],"border-color-e":[{"border-e":c()}],"border-color-bs":[{"border-bs":c()}],"border-color-be":[{"border-be":c()}],"border-color-t":[{"border-t":c()}],"border-color-r":[{"border-r":c()}],"border-color-b":[{"border-b":c()}],"border-color-l":[{"border-l":c()}],"divide-color":[{divide:c()}],"outline-style":[{outline:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[p,n,s]}],"outline-w":[{outline:["",p,$,j]}],"outline-color":[{outline:c()}],shadow:[{shadow:["","none",h,Q,J]}],"shadow-color":[{shadow:c()}],"inset-shadow":[{"inset-shadow":["none",k,Q,J]}],"inset-shadow-color":[{"inset-shadow":c()}],"ring-w":[{ring:w()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:c()}],"ring-offset-w":[{"ring-offset":[p,j]}],"ring-offset-color":[{"ring-offset":c()}],"inset-ring-w":[{"inset-ring":w()}],"inset-ring-color":[{"inset-ring":c()}],"text-shadow":[{"text-shadow":["none",T,Q,J]}],"text-shadow-color":[{"text-shadow":c()}],opacity:[{opacity:[p,n,s]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[p]}],"mask-image-linear-from-pos":[{"mask-linear-from":g()}],"mask-image-linear-to-pos":[{"mask-linear-to":g()}],"mask-image-linear-from-color":[{"mask-linear-from":c()}],"mask-image-linear-to-color":[{"mask-linear-to":c()}],"mask-image-t-from-pos":[{"mask-t-from":g()}],"mask-image-t-to-pos":[{"mask-t-to":g()}],"mask-image-t-from-color":[{"mask-t-from":c()}],"mask-image-t-to-color":[{"mask-t-to":c()}],"mask-image-r-from-pos":[{"mask-r-from":g()}],"mask-image-r-to-pos":[{"mask-r-to":g()}],"mask-image-r-from-color":[{"mask-r-from":c()}],"mask-image-r-to-color":[{"mask-r-to":c()}],"mask-image-b-from-pos":[{"mask-b-from":g()}],"mask-image-b-to-pos":[{"mask-b-to":g()}],"mask-image-b-from-color":[{"mask-b-from":c()}],"mask-image-b-to-color":[{"mask-b-to":c()}],"mask-image-l-from-pos":[{"mask-l-from":g()}],"mask-image-l-to-pos":[{"mask-l-to":g()}],"mask-image-l-from-color":[{"mask-l-from":c()}],"mask-image-l-to-color":[{"mask-l-to":c()}],"mask-image-x-from-pos":[{"mask-x-from":g()}],"mask-image-x-to-pos":[{"mask-x-to":g()}],"mask-image-x-from-color":[{"mask-x-from":c()}],"mask-image-x-to-color":[{"mask-x-to":c()}],"mask-image-y-from-pos":[{"mask-y-from":g()}],"mask-image-y-to-pos":[{"mask-y-to":g()}],"mask-image-y-from-color":[{"mask-y-from":c()}],"mask-image-y-to-color":[{"mask-y-to":c()}],"mask-image-radial":[{"mask-radial":[n,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":g()}],"mask-image-radial-to-pos":[{"mask-radial-to":g()}],"mask-image-radial-from-color":[{"mask-radial-from":c()}],"mask-image-radial-to-color":[{"mask-radial-to":c()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":W()}],"mask-image-conic-pos":[{"mask-conic":[p]}],"mask-image-conic-from-pos":[{"mask-conic-from":g()}],"mask-image-conic-to-pos":[{"mask-conic-to":g()}],"mask-image-conic-from-color":[{"mask-conic-from":c()}],"mask-image-conic-to-color":[{"mask-conic-to":c()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:de()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:pe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",n,s]}],filter:[{filter:["","none",n,s]}],blur:[{blur:ue()}],brightness:[{brightness:[p,n,s]}],contrast:[{contrast:[p,n,s]}],"drop-shadow":[{"drop-shadow":["","none",S,Q,J]}],"drop-shadow-color":[{"drop-shadow":c()}],grayscale:[{grayscale:["",p,n,s]}],"hue-rotate":[{"hue-rotate":[p,n,s]}],invert:[{invert:["",p,n,s]}],saturate:[{saturate:[p,n,s]}],sepia:[{sepia:["",p,n,s]}],"backdrop-filter":[{"backdrop-filter":["","none",n,s]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[p,n,s]}],"backdrop-contrast":[{"backdrop-contrast":[p,n,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",p,n,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p,n,s]}],"backdrop-invert":[{"backdrop-invert":["",p,n,s]}],"backdrop-opacity":[{"backdrop-opacity":[p,n,s]}],"backdrop-saturate":[{"backdrop-saturate":[p,n,s]}],"backdrop-sepia":[{"backdrop-sepia":["",p,n,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":a()}],"border-spacing-x":[{"border-spacing-x":a()}],"border-spacing-y":[{"border-spacing-y":a()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",n,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[p,"initial",n,s]}],ease:[{ease:["linear","initial",L,n,s]}],delay:[{delay:[p,n,s]}],animate:[{animate:["none",v,n,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,n,s]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[n,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],zoom:[{zoom:[I,n,s]}],accent:[{accent:c()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:c()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",n,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":c()}],"scrollbar-track-color":[{"scrollbar-track":c()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":a()}],"scroll-mx":[{"scroll-mx":a()}],"scroll-my":[{"scroll-my":a()}],"scroll-ms":[{"scroll-ms":a()}],"scroll-me":[{"scroll-me":a()}],"scroll-mbs":[{"scroll-mbs":a()}],"scroll-mbe":[{"scroll-mbe":a()}],"scroll-mt":[{"scroll-mt":a()}],"scroll-mr":[{"scroll-mr":a()}],"scroll-mb":[{"scroll-mb":a()}],"scroll-ml":[{"scroll-ml":a()}],"scroll-p":[{"scroll-p":a()}],"scroll-px":[{"scroll-px":a()}],"scroll-py":[{"scroll-py":a()}],"scroll-ps":[{"scroll-ps":a()}],"scroll-pe":[{"scroll-pe":a()}],"scroll-pbs":[{"scroll-pbs":a()}],"scroll-pbe":[{"scroll-pbe":a()}],"scroll-pt":[{"scroll-pt":a()}],"scroll-pr":[{"scroll-pr":a()}],"scroll-pb":[{"scroll-pb":a()}],"scroll-pl":[{"scroll-pl":a()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",n,s]}],fill:[{fill:["none",...c()]}],"stroke-w":[{stroke:[p,$,j,ke]}],stroke:[{stroke:["none",...c()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ro=so(Io);function Go(...e){return Ro(Ne(e))}export{Go as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as o}from"./react-qoZPGuNy.js";import{f as u,aA as s}from"./index-C_O7gp2F.js";import{F as i}from"./ui-Bq3RQsdJ.js";s.schema;function c(a){let e;try{e=new URL(a.trim())}catch{return null}const r=e.hostname.replace(/^www\./,"");if(r==="youtu.be"){const t=e.pathname.slice(1).split("/")[0];return t?`https://www.youtube.com/embed/${t}`:null}if(r==="youtube.com"||r==="m.youtube.com"){if(e.pathname==="/watch"){const n=e.searchParams.get("v");return n?`https://www.youtube.com/embed/${n}`:null}const t=e.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null}if(r==="vimeo.com"){const t=e.pathname.split("/").filter(Boolean)[0];return t&&/^\d+$/.test(t)?`https://player.vimeo.com/video/${t}`:null}return r==="player.vimeo.com"||e.protocol==="https:"?e.toString():null}function m({config:a}){const[e,r]=l.useState("loading"),t=l.useMemo(()=>c(a.url),[a.url]);return l.useEffect(()=>r("loading"),[t]),t?e==="error"?o.jsx(i,{children:"video unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[e==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(i,{loading:!0,children:"loading video…"})}),o.jsx("iframe",{src:t,title:a.title,className:`h-full w-full border-0 transition-opacity duration-300 ${e==="loaded"?"opacity-100":"opacity-0"}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,onLoad:()=>r("loaded"),onError:()=>r("error")},t)]}):o.jsx(i,{children:"invalid video URL"})}const f=u({...s,component:m});export{f as videoFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./react-qoZPGuNy.js";import{c as x,b as v}from"./format-CfAcS4D8.js";import{f as j,ai as p,aj as g}from"./index-C_O7gp2F.js";import{F as u}from"./ui-Bq3RQsdJ.js";p.schema;const h=(n=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${n})`;function y({rates:n}){const a=Math.min(...n),m=Math.max(...n),r=Math.max(.01,m-a),o=n.length,c=i=>100*i/(o-1),t=i=>4+32*(1-(i-a)/r),d=n.map((i,s)=>`${s?"L":"M"}${c(s).toFixed(2)},${t(i).toFixed(2)}`).join(" ");return e.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[e.jsx("path",{d:`${d} L100,40 L0,40 Z`,fill:h(.14)}),e.jsx("path",{d,fill:"none",stroke:h(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function N({config:n}){const{curve:a,isLoading:m}=g();if(m)return e.jsx(u,{loading:!0,children:"loading yield curve…"});if(!a||a.points.length<2)return e.jsx(u,{children:"no yield-curve data yet"});const r=s=>{var l;return(l=a.points.find(f=>f.label===s))==null?void 0:l.rate},o=r("2Y"),c=r("10Y"),t=o!=null&&c!=null?Math.round((c-o)*100):null,d=t!=null&&t<0,i=n.maturities;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),e.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",a.date]})]}),e.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),t!=null&&e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsxs("span",{className:"metric-md leading-none",style:{color:x(t),textShadow:`0 0 24px ${x(t)}44`},children:[t>=0?"+":"",t," bps"]}),e.jsxs("span",{className:"caption text-soft",children:["2s10s · ",d?"inverted":"normal"]})]}),e.jsx(y,{rates:a.points.map(s=>s.rate)}),e.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${i.length}, minmax(0, 1fr))`},children:i.map(s=>{const l=r(s);return e.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[e.jsx("div",{className:"caption text-soft",children:s}),e.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:l!=null?v(l):"—"})]},s)})})]})}const M=j({...p,component:N});export{M as yieldCurveFrame};
|
package/runtime/index.html
CHANGED
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
|
|
9
9
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
10
10
|
<title>zframes runtime</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-C_O7gp2F.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/react-qoZPGuNy.js">
|
|
13
|
-
<link rel="
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/liveline-C5zt2WuS.js">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-CsheOEUr.css">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DRTPEQtR.css">
|
|
16
14
|
</head>
|
|
17
15
|
<body>
|
|
18
16
|
<div id="root"></div>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import{r as a,c as st,j as e,a as De}from"./react-qoZPGuNy.js";import{G as Te}from"./gridstack-BxxvPIFU.js";import{u as rt,F as nt,a as at,b as it,c as ct,t as ve}from"./index-Bpmi3x1d.js";import"./d3-B3esOK0k.js";import"./liveline-C5zt2WuS.js";/**
|
|
2
|
-
* @license lucide-react v1.21.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const _e=(...t)=>t.filter((s,n,i)=>!!s&&s.trim()!==""&&i.indexOf(s)===n).join(" ").trim();/**
|
|
7
|
-
* @license lucide-react v1.21.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const lt=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
12
|
-
* @license lucide-react v1.21.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ot=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
|
|
17
|
-
* @license lucide-react v1.21.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Oe=t=>{const s=ot(t);return s.charAt(0).toUpperCase()+s.slice(1)};/**
|
|
22
|
-
* @license lucide-react v1.21.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var pe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
27
|
-
* @license lucide-react v1.21.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const ut=t=>{for(const s in t)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},mt=a.createContext({}),dt=()=>a.useContext(mt),ft=a.forwardRef(({color:t,size:s,strokeWidth:n,absoluteStrokeWidth:i,className:v="",children:c,iconNode:d,...o},x)=>{const{size:f=24,strokeWidth:l=2,absoluteStrokeWidth:b=!1,color:N="currentColor",className:z=""}=dt()??{},k=i??b?Number(n??l)*24/Number(s??f):n??l;return a.createElement("svg",{ref:x,...pe,width:s??f??pe.width,height:s??f??pe.height,stroke:t??N,strokeWidth:k,className:_e("lucide",z,v),...!c&&!ut(o)&&{"aria-hidden":"true"},...o},[...d.map(([A,R])=>a.createElement(A,R)),...Array.isArray(c)?c:[c]])});/**
|
|
32
|
-
* @license lucide-react v1.21.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const q=(t,s)=>{const n=a.forwardRef(({className:i,...v},c)=>a.createElement(ft,{ref:c,iconNode:s,className:_e(`lucide-${lt(Oe(t))}`,`lucide-${t}`,i),...v}));return n.displayName=Oe(t),n};/**
|
|
37
|
-
* @license lucide-react v1.21.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const ht=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],pt=q("check",ht);/**
|
|
42
|
-
* @license lucide-react v1.21.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const xt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gt=q("chevron-down",xt);/**
|
|
47
|
-
* @license lucide-react v1.21.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const bt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yt=q("plus",bt);/**
|
|
52
|
-
* @license lucide-react v1.21.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const zt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],jt=q("search",zt);/**
|
|
57
|
-
* @license lucide-react v1.21.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const vt=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Nt=q("sliders-horizontal",vt);/**
|
|
62
|
-
* @license lucide-react v1.21.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const kt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],te=q("x",kt),We=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:GOOGL","xyz:AMD","xyz:META","xyz:AMZN","xyz:NFLX","xyz:AVGO","xyz:MSTR","xyz:COIN","xyz:HOOD","xyz:PLTR","BTC","ETH","SOL","HYPE","BNB","XRP","DOGE","LINK","AVAX","SUI"],Ue=new Map(We.map((t,s)=>[t,s]));function X(t){const s=t.indexOf(":");return(s===-1?t:t.slice(s+1)).toUpperCase()}function Ne(t){return t.includes(":")?"Stock":"Crypto"}function Ct(t){const s=t.indexOf(":");if(s!==-1){const n=t.slice(s+1);return`https://assets.parqet.com/logos/symbol/${encodeURIComponent(n)}?format=png`}return`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}function St(t){const s=t.trim().replace(/\s+/g,"");if(!s)return"";const n=s.indexOf(":");return n===-1?s.toUpperCase():`${s.slice(0,n).toLowerCase()}:${s.slice(n+1).toUpperCase()}`}function be(t,s,n=Ue.get(t)??1e4){return{symbol:t,ticker:X(t),kind:Ne(t),markPx:s==null?void 0:s.markPx,changePct:s==null?void 0:s.changePct,rank:n}}function Ge(t){if(!Number.isFinite(t))return"";const s=t;return s>=1e3?`$${s.toLocaleString(void 0,{maximumFractionDigits:0})}`:s>=100?`$${s.toFixed(2)}`:s>=1?`$${s.toFixed(3)}`:`$${s.toPrecision(3)}`}function wt(t){if(!Number.isFinite(t))return"";const s=t;return`${s>=0?"+":""}${s.toFixed(2)}%`}function qe(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function w(t,s){return t!=null&&t.type?Array.isArray(t.type)?t.type.includes(s):t.type===s:!1}function Ke(t){const s=t==null?void 0:t.items;return!!s&&w(t,"array")&&w(s,"string")}function At(t){var s,n,i;try{const c=ve(t.schema,{io:"input"}).properties??{};if(w(c.symbol,"string"))return{kind:"single"};if(Ke(c.symbols))return{kind:"symbols",minItems:(s=c.symbols)==null?void 0:s.minItems,maxItems:(n=c.symbols)==null?void 0:n.maxItems};const d=c.holdings,o=((i=d==null?void 0:d.items)==null?void 0:i.properties)??{};if(w(d,"array")&&w(o.symbol,"string"))return{kind:"holdings",minItems:d==null?void 0:d.minItems,maxItems:d==null?void 0:d.maxItems}}catch{}return t.name==="price-chart"?{kind:"single"}:["price-liveline","price-ticker","funding-rate-chart","funding-heatmap","price-compare"].includes(t.name)?{kind:"symbols"}:t.name==="allocation"?{kind:"holdings"}:null}function Rt(t,s){return t.kind==="single"?typeof s.symbol=="string"&&s.symbol?[s.symbol]:[]:t.kind==="symbols"?Array.isArray(s.symbols)?s.symbols.filter(n=>typeof n=="string"):[]:Array.isArray(s.holdings)?s.holdings.map(n=>qe(n)&&typeof n.symbol=="string"?n.symbol:"").filter(Boolean):[]}const Mt=new Set(["symbol","symbols","holdings"]);function ke(t){const s=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return s?s.charAt(0).toUpperCase()+s.slice(1):t}function Et(t){let s;try{s=ve(t.schema,{io:"input"})}catch{return[]}return Object.entries(s.properties??{}).filter(([n])=>!Mt.has(n)).map(([n,i])=>({key:n,label:ke(n),shape:i}))}const Pe=["xyz:TSLA","xyz:NVDA","xyz:AAPL","xyz:MSFT","xyz:META","xyz:AMD","xyz:GOOGL","xyz:AMZN"];function Lt(t,s){return t==="symbol"?Pe[s%Pe.length]:t==="url"?"https://":t==="text"?"New note":t==="title"?"Heading":ke(t)||"value"}function ye(t,s,n=0){var i;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0];if(w(t,"string"))return Lt(s,n);if(w(t,"number")||w(t,"integer"))return t.exclusiveMinimum!==void 0?t.exclusiveMinimum+1:t.minimum??0;if(w(t,"boolean"))return!1;if(w(t,"array")){const v=t.items??{},c=s==="symbols"?"symbol":s;return Array.from({length:t.minItems??0},(d,o)=>ye(v,c,o))}if(w(t,"object")){const v={};for(const c of t.required??[]){const d=(i=t.properties)==null?void 0:i[c];d&&(v[c]=ye(d,c,n))}return v}return null}function $t(t){const s=t.schema.safeParse({});if(s.success)return s.data;let n;try{n=ve(t.schema,{io:"input"})}catch{return{}}const i={},v=new Set(n.required??[]);for(const[d,o]of Object.entries(n.properties??{}))v.has(d)&&(i[d]=ye(o,d));const c=t.schema.safeParse(i);return c.success?c.data:i}const It='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>';function Ft(t,s){const n=a.useMemo(()=>t.find(x=>x.capabilities.includes("day-stats")),[t]),[i,v]=a.useState({}),[c,d]=a.useState(!1);return a.useEffect(()=>{if(!s||!(n!=null&&n.getDayStats)){d(!1);return}let x=!1;return d(!0),Promise.allSettled([n.getDayStats(),n.getDayStats(["xyz:*"])]).then(f=>{if(x)return;const l={};for(const b of f)b.status==="fulfilled"&&Object.assign(l,b.value);v(l)}).finally(()=>{x||d(!1)}),()=>{x=!0}},[s,n]),{options:a.useMemo(()=>{const x=new Map;return We.forEach((f,l)=>{x.set(f,be(f,i[f],l))}),Object.entries(i).forEach(([f,l])=>{x.set(f,be(f,l,Ue.get(f)??1e4))}),[...x.values()].sort((f,l)=>f.rank!==l.rank?f.rank-l.rank:f.kind!==l.kind?f.kind==="Stock"?-1:1:f.ticker.localeCompare(l.ticker))},[i]),loading:c}}function Yt({spec:t,registry:s,onSave:n,customiseButtonTarget:i,onAccentHueChange:v}){const c=rt(),d=a.useRef(null),o=a.useRef(null),x=a.useRef(!1),f=a.useRef(new Map),l=a.useRef(new Map),b=a.useRef(new Map),N=a.useRef([]),z=a.useRef(t.theme.accentHue),k=a.useRef(t.theme.accentSat),A=a.useRef(t.grid.gap),R=a.useRef(t.appearance.radius),g=a.useRef(t.appearance.borderStrength),y=a.useRef(t.appearance.surfaceOpacity),C=a.useRef(t.appearance.density),_=a.useRef(t.appearance.elevation),K=a.useRef(0),[S,se]=a.useState(!1),Ye=Ft(c,S),[Wt,V]=a.useState(t.frames.length),[M,re]=a.useState(t.theme.accentHue),[$,ne]=a.useState(t.theme.accentSat),[E,ae]=a.useState(t.grid.gap),[I,ie]=a.useState(t.appearance.radius),[F,ce]=a.useState(t.appearance.borderStrength),[D,le]=a.useState(t.appearance.surfaceOpacity),[T,oe]=a.useState(t.appearance.density),[O,ue]=a.useState(t.appearance.elevation),[P,Ce]=a.useState("cosmetics"),[me,H]=a.useState(null),Se=a.useRef(null);Se.current=me,a.useEffect(()=>{v==null||v(M)},[M,v]),a.useEffect(()=>{var r;(r=o.current)==null||r.margin(E/2)},[E]);const we=a.useRef(c);we.current=c;const G=a.useRef(s);G.current=s;const Ae=a.useMemo(()=>[...s.values()].sort((r,m)=>r.name.localeCompare(m.name)),[s]),de=a.useCallback(r=>r?$t(r):{},[]),fe=a.useCallback(r=>{let m=`${r}-${++K.current}`;for(;f.current.has(m);)m=`${r}-${++K.current}`;return m},[]),J=a.useRef(null),B=a.useCallback(r=>{const m=b.current.get(r),h=f.current.get(r);if(!m||!h)return;let u=l.current.get(r);u||(m.innerHTML="",u=st.createRoot(m),l.current.set(r,u)),u.render(e.jsx(nt,{providers:we.current,children:e.jsx(at.Provider,{value:p=>{var j;return(j=J.current)==null?void 0:j.call(J,r,p)},children:e.jsx(it,{instance:h,registry:G.current,className:"zf-fill"})})}))},[]),Ze=a.useCallback((r,m)=>{const h=f.current.get(r);h&&(f.current.set(r,{...h,config:{...h.config,...m}}),B(r))},[B]);J.current=Ze;const Re=a.useCallback(r=>{var u;const m=o.current;if(!m)return;const h=r.getAttribute("gs-id");h&&((u=l.current.get(h))==null||u.unmount(),l.current.delete(h),b.current.delete(h),f.current.delete(h),Se.current===h&&H(null)),m.removeWidget(r,!0),V(m.getGridItems().length)},[]),Y=a.useCallback(r=>{if(!r.querySelector(".zf-cfg-btn")){const m=document.createElement("button");m.className="zf-cfg-btn",m.type="button",m.title="Edit frame",m.setAttribute("aria-label","Edit frame"),m.innerHTML=It,m.addEventListener("click",h=>{h.stopPropagation();const u=r.getAttribute("gs-id");u&&H(u)}),r.appendChild(m)}if(!r.querySelector(".zf-del-btn")){const m=document.createElement("button");m.className="zf-del-btn",m.type="button",m.title="Remove frame",m.innerHTML="×",m.addEventListener("click",h=>{h.stopPropagation(),Re(r)}),r.appendChild(m)}},[Re]),Me=a.useCallback(r=>{var m,h;(m=r.querySelector(".zf-cfg-btn"))==null||m.remove(),(h=r.querySelector(".zf-del-btn"))==null||h.remove()},[]),Q=a.useCallback((r,m=!1)=>{const h=G.current.get(r.frame),u=h==null?void 0:h.layout,p=document.createElement("div");p.className="grid-stack-item",p.setAttribute("gs-id",r.id),p.setAttribute("data-frame",r.frame),m?p.setAttribute("gs-auto-position","true"):(p.setAttribute("gs-x",String(r.position.x)),p.setAttribute("gs-y",String(r.position.y))),p.setAttribute("gs-w",String(r.position.w)),p.setAttribute("gs-h",String(r.position.h)),u!=null&&u.minW&&p.setAttribute("gs-min-w",String(u.minW)),u!=null&&u.minH&&p.setAttribute("gs-min-h",String(u.minH)),u!=null&&u.maxW&&p.setAttribute("gs-max-w",String(u.maxW)),u!=null&&u.maxH&&p.setAttribute("gs-max-h",String(u.maxH));const j=document.createElement("div");return j.className="grid-stack-item-content",p.appendChild(j),b.current.set(r.id,j),p},[]),Z=a.useCallback(r=>{const m=o.current;if(m){l.current.forEach(h=>h.unmount()),l.current.clear(),b.current.clear(),f.current=new Map(r.map(h=>[h.id,h])),m.removeAll(!0),m.el.querySelectorAll(".grid-stack-item").forEach(h=>h.remove()),m.batchUpdate();for(const h of r){const u=Q(h);m.el.appendChild(u),m.makeWidget(u),B(h.id)}m.batchUpdate(!1),V(r.length)}},[Q,B]),Ee=a.useCallback(r=>{var W,L;const m=o.current;if(!m)return;const h=G.current.get(r),u=fe(r),p={id:u,frame:r,position:{x:0,y:0,w:((W=h==null?void 0:h.layout)==null?void 0:W.w)??4,h:((L=h==null?void 0:h.layout)==null?void 0:L.h)??3},config:de(h)};f.current.set(u,p);const j=Q(p,!0);m.el.appendChild(j),m.makeWidget(j),B(u),Y(j),V(m.getGridItems().length),H(u)},[Q,Y,de,B,fe]);a.useEffect(()=>{if(!d.current||x.current)return;x.current=!0;const r=Te.init({column:t.grid.columns,cellHeight:t.grid.rowHeight,margin:t.grid.gap/2,float:!1,animate:!0,acceptWidgets:!0,disableDrag:!0,disableResize:!0},d.current);return o.current=r,Z(t.frames),r.on("dropped",(m,h,u)=>{var Ie,Fe;const p=u==null?void 0:u.el;if(!p)return;const j=p.querySelector(".grid-stack-item-content"),W=p.getAttribute("data-frame");if(!j||!W)return;const L=p.getAttribute("gs-id")||fe(W);p.setAttribute("gs-id",L);const U=G.current.get(W),tt={id:L,frame:W,position:{x:(u==null?void 0:u.x)??0,y:(u==null?void 0:u.y)??0,w:(u==null?void 0:u.w)??((Ie=U==null?void 0:U.layout)==null?void 0:Ie.w)??4,h:(u==null?void 0:u.h)??((Fe=U==null?void 0:U.layout)==null?void 0:Fe.h)??3},config:de(U)};f.current.set(L,tt),b.current.set(L,j),B(L),Y(p),V(r.getGridItems().length),H(L)}),r.on("removed",()=>V(r.getGridItems().length)),()=>{r.off("dropped"),r.off("removed"),l.current.forEach(m=>m.unmount()),l.current.clear(),b.current.clear(),r.destroy(!1),o.current=null,x.current=!1}},[]),a.useEffect(()=>{const r=o.current;r&&(r.enableMove(S),r.enableResize(S),S?r.getGridItems().forEach(Y):r.getGridItems().forEach(Me))},[S,Y,Me]),a.useEffect(()=>{!S||P!=="frames"||!o.current||Te.setupDragIn(".zf-newwidget",{appendTo:"body",helper:r=>{const h=(r.closest(".zf-newwidget")??r).dataset.frame??"",u=G.current.get(h),p=u==null?void 0:u.layout,j=document.createElement("div");return j.className="grid-stack-item",j.setAttribute("data-frame",h),j.setAttribute("gs-w",String((p==null?void 0:p.w)??4)),j.setAttribute("gs-h",String((p==null?void 0:p.h)??3)),p!=null&&p.minW&&j.setAttribute("gs-min-w",String(p.minW)),p!=null&&p.minH&&j.setAttribute("gs-min-h",String(p.minH)),p!=null&&p.maxW&&j.setAttribute("gs-max-w",String(p.maxW)),p!=null&&p.maxH&&j.setAttribute("gs-max-h",String(p.maxH)),j.innerHTML=`<div class="grid-stack-item-content" data-frame="${h}"></div>`,j}})},[S,P,Ae]);const ee=a.useCallback(()=>{const r=o.current,m=[];if(r)for(const h of r.getGridItems()){const u=h.getAttribute("gs-id");if(!u)continue;const p=f.current.get(u);if(!p)continue;const j=h.gridstackNode;m.push({...p,position:{x:(j==null?void 0:j.x)??p.position.x,y:(j==null?void 0:j.y)??p.position.y,w:(j==null?void 0:j.w)??p.position.w,h:(j==null?void 0:j.h)??p.position.h}})}return m.sort((h,u)=>h.position.y-u.position.y||h.position.x-u.position.x),{...t,grid:{...t.grid,gap:E},theme:{...t.theme,accentHue:M,accentSat:$},appearance:{...t.appearance,radius:I,borderStrength:F,surfaceOpacity:D,density:T,elevation:O},frames:m}},[t,M,$,E,I,F,D,T,O]),Le=a.useCallback(r=>{const m=new Blob([`${JSON.stringify(r,null,2)}
|
|
67
|
-
`],{type:"application/json"}),h=URL.createObjectURL(m),u=document.createElement("a");u.href=h,u.download="dashboard.json",u.click(),setTimeout(()=>URL.revokeObjectURL(h),0)},[]),Xe=a.useCallback(()=>{N.current=ee().frames,z.current=M,k.current=$,A.current=E,R.current=I,g.current=F,y.current=D,C.current=T,_.current=O,se(!0)},[ee,M,$,E,I,F,D,T,O]),Je=a.useCallback(()=>{Z(N.current),re(z.current),ne(k.current),ae(A.current),ie(R.current),ce(g.current),le(y.current),oe(C.current),ue(_.current),H(null),se(!1)},[Z]),Qe=a.useCallback(()=>{window.confirm("Remove all frames from the dashboard?")&&(Z([]),H(null))},[Z]),et=a.useCallback(async()=>{const r=ee();se(!1),H(null),n?await n(r):Le(r)},[ee,n,Le]),$e=()=>e.jsx("button",{type:"button",className:"zf-btn zf-btn--icon",onClick:Xe,"aria-label":"Customise",title:"Customise",children:e.jsx(Nt,{size:18,"aria-hidden":"true"})}),he=S&&me?f.current.get(me):void 0;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ct}),i&&!S?De.createPortal($e(),i):null,e.jsxs("div",{className:S?"zf-editor zf-customise":"zf-editor",style:{"--zf-accent-hue":M,"--zf-accent-sat":`${$}%`,"--zf-frame-radius":`${I}px`,"--zf-border-alpha":F,"--zf-surface-opacity":D,"--zf-density":T,"--zf-elevation":O},children:[(S||!i)&&e.jsxs("div",{className:"zf-editor-bar",children:[S&&e.jsx("span",{className:"zf-editor-hint",children:"drag to move · drag a corner to resize · hover to delete"}),e.jsx("div",{className:"zf-editor-bar-spacer"}),S?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"zf-btn zf-btn--danger",onClick:Qe,children:"Clear"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--ghost",onClick:Je,children:"Cancel"}),e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:et,children:"Save"})]}):$e()]}),e.jsxs("div",{className:"zf-editor-main",children:[e.jsx("div",{className:"zf-editor-grid",children:e.jsx("div",{ref:d,className:"grid-stack"})}),e.jsx("aside",{className:"zf-rail","aria-hidden":!S,inert:!S,children:e.jsxs("div",{className:"zf-rail-inner",children:[e.jsxs("div",{className:"zf-rail-tabs",role:"tablist","aria-label":"Customise",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":P==="cosmetics",className:P==="cosmetics"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>Ce("cosmetics"),children:"Cosmetics"}),e.jsx("button",{type:"button",role:"tab","aria-selected":P==="frames",className:P==="frames"?"zf-rail-tab is-active":"zf-rail-tab",onClick:()=>Ce("frames"),children:"Frames"})]}),P==="cosmetics"&&e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",style:{margin:0},children:"Accent"}),e.jsxs("div",{className:"zf-theme-row",style:{margin:"10px 0 0"},children:[e.jsxs("span",{className:"zf-theme-val",children:[e.jsx("span",{className:"zf-theme-swatch"}),"Hue ",M,"°"]}),M!==242&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>re(242),children:"Reset"})]}),e.jsx("input",{type:"range",className:"zf-hue-slider",min:0,max:360,value:M,"aria-label":"Accent hue",onChange:r=>re(Number(r.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Saturation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[$!==90&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ne(90),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[$,"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:100,value:$,"aria-label":"Accent saturation",onChange:r=>ne(Number(r.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Layout"}),e.jsxs("div",{className:"zf-theme-row",children:[e.jsx("span",{className:"zf-theme-val",children:"Frame gap"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[E!==12&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ae(12),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[E,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:12,value:E,"aria-label":"Frame gap",onChange:r=>ae(Number(r.target.value))})]}),e.jsxs("section",{className:"zf-theme",children:[e.jsx("h3",{className:"zf-rail-title",children:"Appearance"}),e.jsxs("div",{className:"zf-theme-row",children:[e.jsx("span",{className:"zf-theme-val",children:"Corner radius"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[I!==18&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ie(18),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[I,"px"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:32,value:I,"aria-label":"Corner radius",onChange:r=>ie(Number(r.target.value))}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Border"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[F!==.22&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ce(.22),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(F*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:1,step:.01,value:F,"aria-label":"Border strength",onChange:r=>ce(Math.round(Number(r.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Card opacity"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[D!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>le(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(D*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.3,max:1,step:.05,value:D,"aria-label":"Card opacity",onChange:r=>le(Math.round(Number(r.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Density"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[T!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>oe(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[Math.round(T*100),"%"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:.6,max:1.4,step:.05,value:T,"aria-label":"Card density",onChange:r=>oe(Math.round(Number(r.target.value)*100)/100)}),e.jsxs("div",{className:"zf-theme-row",style:{marginTop:13},children:[e.jsx("span",{className:"zf-theme-val",children:"Elevation"}),e.jsxs("span",{className:"zf-theme-knob-end",children:[O!==1&&e.jsx("button",{type:"button",className:"zf-theme-reset",onClick:()=>ue(1),children:"Reset"}),e.jsxs("span",{className:"zf-theme-val",children:[O.toFixed(1),"×"]})]})]}),e.jsx("input",{type:"range",className:"zf-range",min:0,max:2,step:.1,value:O,"aria-label":"Card elevation",onChange:r=>ue(Math.round(Number(r.target.value)*10)/10)})]})]}),P==="frames"&&e.jsxs("section",{children:[e.jsx("h3",{className:"zf-rail-title",children:"Add a frame"}),e.jsx("p",{className:"zf-palette-hint",children:"Click to add, or drag onto the grid."}),e.jsx("div",{className:"zf-palette",children:Ae.map(r=>e.jsxs("div",{className:"zf-newwidget","data-frame":r.name,role:"button",tabIndex:0,title:`Add ${r.name.replace(/-/g," ")}`,onClick:()=>Ee(r.name),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),Ee(r.name))},children:[r.iconUrl&&e.jsx("img",{className:"zf-newwidget-icon",src:r.iconUrl,alt:"",loading:"lazy",draggable:!1}),e.jsxs("div",{className:"zf-newwidget-copy",children:[e.jsx("div",{className:"zf-newwidget-name",children:r.name.replace(/-/g," ")}),e.jsx("div",{className:"zf-newwidget-desc",children:r.description})]})]},r.name))})]})]})})]})]}),he?De.createPortal(e.jsx(Dt,{instance:he,registry:s,instancesRef:f,symbolUniverse:Ye,accentHue:M,onApply:r=>B(r),onClose:()=>H(null)},he.id),document.body):null]})}function Dt({instance:t,registry:s,instancesRef:n,symbolUniverse:i,accentHue:v,onApply:c,onClose:d}){const o=s.get(t.frame),x=a.useMemo(()=>o?At(o):null,[o]),f=a.useMemo(()=>o?Et(o):[],[o]),[l,b]=a.useState(()=>({...t.config??{}})),[N,z]=a.useState(null),k=t.id,A=a.useCallback(y=>{if(b(y),o){const _=o.schema.safeParse(y);if(!_.success){z(_.error.issues.map(K=>`${K.path.join(".")||"(root)"}: ${K.message}`).join(`
|
|
68
|
-
`));return}}z(null);const C=n.current.get(k);C&&(n.current.set(k,{...C,config:y}),c(k))},[o,k,n,c]);a.useEffect(()=>{const y=C=>{C.key==="Escape"&&d()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[d]);const R=(y,C)=>A({...l,[y]:C}),g=t.frame.replace(/-/g," ");return e.jsx("div",{className:"zf-dialog-backdrop",style:{"--zf-accent-hue":v},onMouseDown:y=>{y.target===y.currentTarget&&d()},children:e.jsxs("div",{className:"zf-dialog",role:"dialog","aria-modal":"true","aria-label":`Configure ${g}`,children:[e.jsxs("header",{className:"zf-dialog-head",children:[e.jsxs("h3",{className:"zf-dialog-title",children:["Configure · ",g]}),e.jsx("button",{type:"button",className:"zf-dialog-close",onClick:d,"aria-label":"Close",title:"Close",children:e.jsx(te,{size:16,"aria-hidden":"true"})})]}),e.jsxs("div",{className:"zf-dialog-body",children:[x&&e.jsx(Bt,{control:x,config:l,loading:i.loading,options:i.options,onChangeSymbol:y=>A({...l,symbol:y}),onChangeSymbols:y=>A({...l,symbols:y}),onChangeHoldings:y=>A({...l,holdings:y})}),f.map(y=>e.jsx(Tt,{field:y,value:l[y.key],onChange:C=>R(y.key,C)},y.key)),!x&&f.length===0&&e.jsx("p",{className:"zf-rail-empty",children:"This frame has no settings."}),N&&e.jsx("div",{className:"zf-config-error",children:N})]}),e.jsx("footer",{className:"zf-dialog-foot",children:e.jsx("button",{type:"button",className:"zf-btn zf-btn--primary",onClick:d,children:"Done"})})]})})}function Tt({field:t,value:s,onChange:n}){const{key:i,label:v,shape:c}=t,d=`zf-cfg-${i}`,o=c.description;if(w(c,"boolean")){const f=typeof s=="boolean"?s:!!c.default;return e.jsxs("label",{className:"zf-checkbox",title:o,children:[e.jsx("input",{type:"checkbox",checked:f,onChange:l=>n(l.target.checked)}),v]})}const x=Array.isArray(c.enum)&&c.enum.every(f=>typeof f=="string")?c.enum:null;if(x&&x.length>0){const f=typeof c.default=="string"?c.default:x[0],l=typeof s=="string"&&x.includes(s)?s:f;return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:d,title:o,children:v}),e.jsx("select",{id:d,className:"zf-select",value:l,onChange:b=>n(b.target.value),children:x.map(b=>e.jsx("option",{value:b,children:ke(b)},b))})]})}return w(c,"integer")||w(c,"number")?e.jsx(Ot,{id:d,field:t,value:s,onChange:n}):Ke(c)?e.jsx(Ht,{id:d,field:t,value:s,onChange:n}):e.jsx(Pt,{id:d,field:t,value:s,onChange:n})}function Ot({id:t,field:s,value:n,onChange:i}){const{label:v,shape:c}=s,d=c.description,o=typeof c.minimum=="number"?c.minimum:void 0,x=typeof c.maximum=="number"?c.maximum:void 0,f=w(c,"integer"),l=f?1:"any",b=typeof c.default=="number"?c.default:o??0,N=typeof n=="number"&&Number.isFinite(n)?n:void 0;if(o!==void 0&&x!==void 0){const z=N??b;return e.jsxs("div",{className:"zf-field",children:[e.jsxs("div",{className:"zf-field-row",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),e.jsx("span",{className:"zf-field-num",children:z})]}),e.jsx("input",{id:t,type:"range",className:"zf-range",min:o,max:x,step:l,value:z,onChange:k=>i(f?Math.round(Number(k.target.value)):Number(k.target.value))})]})}return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),e.jsx("input",{id:t,type:"number",className:"zf-input",min:o,max:x,step:l,value:n==null?"":String(n),onChange:z=>i(z.target.value===""?"":Number(z.target.value))})]})}function Pt({id:t,field:s,value:n,onChange:i}){const{key:v,label:c,shape:d}=s,o=d.description,x=typeof n=="string"?n:"",f=typeof d.default=="string"?d.default:"",l=typeof d.default=="string"&&/^#[0-9a-f]{6}$/i.test(d.default)?d.default:null;if(v==="color"||l){const b=/^#[0-9a-f]{6}$/i.test(x)?x:l??"#8b8df9";return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsxs("div",{className:"zf-color-row",children:[e.jsx("input",{type:"color",className:"zf-color",value:b,"aria-label":`${c} swatch`,onChange:N=>i(N.target.value)}),e.jsx("input",{id:t,className:"zf-input",value:x,placeholder:f,spellCheck:!1,onChange:N=>i(N.target.value)})]})]})}return v==="text"?e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsx("textarea",{id:t,className:"zf-textarea zf-textarea--prose",value:x,placeholder:f,onChange:b=>i(b.target.value)})]}):e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:o,children:c}),e.jsx("input",{id:t,className:"zf-input",value:x,placeholder:f,spellCheck:!1,onChange:b=>i(b.target.value)})]})}function Ht({id:t,field:s,value:n,onChange:i}){const{label:v,shape:c}=s,d=c.description,o=Array.isArray(n)?n.filter(z=>typeof z=="string"):[],[x,f]=a.useState(""),l=typeof c.maxItems=="number"?c.maxItems:void 0,b=l!==void 0&&o.length>=l,N=z=>{const k=z.trim().toUpperCase();f(""),!(!k||o.includes(k)||b)&&i([...o,k])};return e.jsxs("div",{className:"zf-field",children:[e.jsx("label",{htmlFor:t,title:d,children:v}),o.length>0&&e.jsx("div",{className:"zf-taglist",children:o.map(z=>e.jsxs("span",{className:"zf-tag",children:[z,e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${z}`,onClick:()=>i(o.filter(k=>k!==z)),children:e.jsx(te,{size:12,"aria-hidden":"true"})})]},z))}),e.jsx("input",{id:t,className:"zf-input",value:x,disabled:b,spellCheck:!1,placeholder:b?"Maximum reached":"Type a code, Enter to add",onChange:z=>f(z.target.value),onBlur:()=>N(x),onKeyDown:z=>{z.key==="Enter"||z.key===","?(z.preventDefault(),N(x)):z.key==="Backspace"&&x===""&&o.length>0&&i(o.slice(0,-1))}})]})}function Bt({control:t,config:s,loading:n,options:i,onChangeSymbol:v,onChangeSymbols:c,onChangeHoldings:d}){const o=Rt(t,s);if(t.kind==="single"){const l=o[0]??"";return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Ticker",detail:l?X(l):"None",loading:n}),l?e.jsx(je,{symbol:l,option:ze(l,i)}):null,e.jsx(ge,{loading:n,options:i,selectedSymbols:l?[l]:[],placeholder:"Search TSLA, BTC...",onSelect:v})]})}if(t.kind==="symbols"){const l=typeof t.maxItems=="number"&&o.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Tickers",detail:He(o.length,t),loading:n}),e.jsx(_t,{symbols:o,options:i,onRemove:b=>c(o.filter(N=>N!==b))}),e.jsx(ge,{disabled:l,loading:n,options:i,selectedSymbols:o,placeholder:l?"Maximum tickers added":"Add ticker",keepOpenOnSelect:!0,onSelect:b=>{o.includes(b)||l||c([...o,b])}})]})}const x=Array.isArray(s.holdings)?s.holdings.filter(qe):[],f=typeof t.maxItems=="number"&&x.length>=t.maxItems;return e.jsxs("div",{className:"zf-symbol-editor",children:[e.jsx(xe,{title:"Holding tickers",detail:He(x.length,t),loading:n}),e.jsx("div",{className:"zf-holding-list",children:x.map((l,b)=>{const N=typeof l.symbol=="string"?l.symbol:"";return e.jsxs("div",{className:"zf-holding-row",children:[e.jsxs("div",{className:"zf-holding-main",children:[N?e.jsx(je,{symbol:N,option:ze(N,i),compact:!0}):e.jsx("span",{className:"zf-symbol-empty",children:"No ticker"}),typeof l.amount=="number"&&e.jsxs("span",{className:"zf-holding-amount",children:["x ",l.amount]})]}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${N||"holding"}`,onClick:()=>{d(x.filter((z,k)=>k!==b))},children:e.jsx(te,{size:13,"aria-hidden":"true"})})]},`${N}-${b}`)})}),e.jsx(ge,{disabled:f,loading:n,options:i,selectedSymbols:o,placeholder:f?"Maximum holdings added":"Add holding",keepOpenOnSelect:!0,onSelect:l=>{f||d([...x,{symbol:l,amount:1}])}})]})}function xe({title:t,detail:s,loading:n}){return e.jsxs("div",{className:"zf-symbol-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"zf-symbol-label",children:t}),e.jsx("div",{className:"zf-symbol-detail",children:s})]}),e.jsx("span",{className:n?"zf-symbol-source is-loading":"zf-symbol-source",children:n?"Loading":"Live list"})]})}function He(t,s){return typeof s.maxItems=="number"?`${t}/${s.maxItems}`:typeof s.minItems=="number"&&t<s.minItems?`${t}/${s.minItems}+`:String(t)}function ze(t,s){return s.find(n=>n.symbol===t)??be(t)}function _t({symbols:t,options:s,onRemove:n}){return t.length===0?e.jsx("div",{className:"zf-symbol-empty",children:"No tickers selected"}):e.jsx("div",{className:"zf-symbol-chips",children:t.map(i=>e.jsxs("span",{className:"zf-symbol-chip",children:[e.jsx(je,{symbol:i,option:ze(i,s),compact:!0}),e.jsx("button",{type:"button",className:"zf-symbol-remove","aria-label":`Remove ${i}`,onClick:()=>n(i),children:e.jsx(te,{size:13,"aria-hidden":"true"})})]},i))})}function je({symbol:t,option:s,compact:n=!1}){return e.jsxs("span",{className:n?"zf-selected-symbol is-compact":"zf-selected-symbol",children:[e.jsx(Ve,{symbol:t}),e.jsxs("span",{className:"zf-selected-symbol-text",children:[e.jsx("strong",{children:X(t)}),!n&&e.jsx("em",{children:t})]}),!n&&s.markPx!==void 0&&e.jsx("span",{className:"zf-selected-symbol-price",children:Ge(s.markPx)})]})}function ge({disabled:t=!1,loading:s,options:n,selectedSymbols:i,placeholder:v,keepOpenOnSelect:c=!1,onSelect:d}){const[o,x]=a.useState(""),[f,l]=a.useState(!1),b=a.useMemo(()=>new Set(i),[i]),N=a.useMemo(()=>new Set(n.map(g=>g.symbol)),[n]),z=St(o),k=a.useMemo(()=>{const g=o.trim().toLowerCase();return(g?n.filter(C=>C.ticker.toLowerCase().includes(g)||C.symbol.toLowerCase().includes(g)):n.slice(0,28)).slice().sort((C,_)=>Be(C,g)-Be(_,g)).slice(0,36)},[n,o]),A=a.useMemo(()=>{if(!z)return[];const g=z.includes(":")?[z]:[`xyz:${z}`,z];return g.filter((y,C)=>g.indexOf(y)===C&&!N.has(y)&&!b.has(y))},[N,z,b]),R=g=>{!g||c&&b.has(g)||(d(g),x(""),l(c))};return e.jsxs("div",{className:"zf-symbol-combo",onBlur:g=>{g.currentTarget.contains(g.relatedTarget)||l(!1)},children:[e.jsxs("div",{className:t?"zf-symbol-search is-disabled":"zf-symbol-search",children:[e.jsx(jt,{size:14,"aria-hidden":"true"}),e.jsx("input",{value:o,disabled:t,placeholder:v,"aria-label":v,role:"combobox","aria-expanded":f,onFocus:()=>l(!0),onChange:g=>{x(g.target.value),l(!0)},onKeyDown:g=>{var y;g.key==="Enter"&&(g.preventDefault(),R(((y=k[0])==null?void 0:y.symbol)??A[0]??z))}}),e.jsx(gt,{size:14,"aria-hidden":"true"})]}),f&&!t&&e.jsxs("div",{className:"zf-symbol-menu",role:"listbox",children:[s&&e.jsx("div",{className:"zf-symbol-menu-status",children:"Loading live universe..."}),k.map(g=>{const y=b.has(g.symbol);return e.jsxs("button",{type:"button",className:y?"zf-symbol-option is-selected":"zf-symbol-option",disabled:c&&y,role:"option","aria-selected":y,onMouseDown:C=>{C.preventDefault(),R(g.symbol)},onClick:C=>{C.detail===0&&R(g.symbol)},children:[e.jsx(Ve,{symbol:g.symbol}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:g.ticker}),e.jsx("em",{children:g.symbol})]}),e.jsxs("span",{className:"zf-symbol-option-meta",children:[e.jsx("span",{children:Ge(g.markPx)||g.kind}),g.changePct!==void 0&&e.jsx("span",{className:g.changePct>=0?"zf-symbol-change is-up":"zf-symbol-change is-down",children:wt(g.changePct)})]}),y&&e.jsx(pt,{size:14,"aria-hidden":"true"})]},g.symbol)}),A.map(g=>e.jsxs("button",{type:"button",className:"zf-symbol-option zf-symbol-option--custom",onMouseDown:y=>{y.preventDefault(),R(g)},onClick:y=>{y.detail===0&&R(g)},children:[e.jsx("span",{className:"zf-symbol-custom-icon",children:e.jsx(yt,{size:13,"aria-hidden":"true"})}),e.jsxs("span",{className:"zf-symbol-option-main",children:[e.jsx("strong",{children:X(g)}),e.jsx("em",{children:g})]}),e.jsx("span",{className:"zf-symbol-option-meta",children:e.jsx("span",{children:Ne(g)})})]},g)),!s&&k.length===0&&A.length===0&&e.jsx("div",{className:"zf-symbol-menu-status",children:"No matches"})]})]})}function Be(t,s){if(!s)return t.rank;const n=t.ticker.toLowerCase(),i=t.symbol.toLowerCase();return n===s||i===s?-40+t.rank/1e4:n.startsWith(s)?-20+t.rank/1e4:i.startsWith(s)?-10+t.rank/1e4:t.rank}function Ve({symbol:t}){const s=Ne(t).toLowerCase(),[n,i]=a.useState(!1);return a.useEffect(()=>i(!1),[t]),n?e.jsx("span",{className:`zf-symbol-avatar zf-symbol-avatar--${s}`,children:X(t).slice(0,2)}):e.jsx("img",{className:`zf-symbol-avatar zf-symbol-avatar--logo zf-symbol-avatar--${s}`,src:Ct(t),alt:"","aria-hidden":"true",draggable:!1,loading:"lazy",onError:()=>i(!0)})}export{Yt as DashboardEditor};
|