zframes 0.3.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 +533 -84
- package/package.json +5 -5
- 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/assets/editor-DVTcqJo4.js +0 -68
- package/runtime/assets/editor-DnV0I9s-.css +0 -1
- package/runtime/assets/index-DEGnog6Q.css +0 -1
- package/runtime/assets/index-DPlG_EDx.js +0 -35727
- package/runtime/assets/index-KRy1feFG.js +0 -761
|
@@ -1,761 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DPlG_EDx.js","assets/react-qoZPGuNy.js","assets/editor-DVTcqJo4.js","assets/gridstack-BxxvPIFU.js","assets/gridstack-FIb_WQSt.css","assets/liveline-C5zt2WuS.js","assets/d3-B3esOK0k.js","assets/editor-DnV0I9s-.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var hl=Object.defineProperty;var pl=(e,t,n)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>pl(e,typeof t!="symbol"?t+"":t,n);import{r as f,j as o,R as gl,c as bl}from"./react-qoZPGuNy.js";import{L as Lr}from"./liveline-C5zt2WuS.js";import{s as xl,i as yl,h as vl,l as Fr,a as Ve,m as wl,b as kl,t as hr,c as Sl,d as qo,e as pr,f as Ko,g as us,j as Jo,k as gr,n as jl,o as br,p as Nl,q as Cl,r as ds,u as zl,v as _l,w as ms,x as Tl,y as El}from"./d3-B3esOK0k.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Ml="modulepreload",Al=function(e){return"/"+e},fs={},Qo=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),l=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=i(n.map(u=>{if(u=Al(u),u in fs)return;fs[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Ml,d||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((p,x)=>{m.addEventListener("load",p),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(i){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=i,window.dispatchEvent(c),!c.defaultPrevented)throw i}return s.then(i=>{for(const c of i||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})},ek=[{key:"markets",label:"Prices & Markets",description:"Live price charts, tickers, and market movers across stocks and crypto."},{key:"crypto",label:"Crypto & On-chain",description:"Crypto market structure and DeFi/on-chain activity — dominance, market caps, TVL, DEX volume, and fees."},{key:"bitcoin",label:"Bitcoin Network",description:"Bitcoin chain health — fees, mempool, blocks, hashrate, difficulty, mining pools, and Lightning."},{key:"derivatives",label:"Derivatives & Options",description:"Perp funding, open interest, and options positioning and volatility."},{key:"macro",label:"Macro & Rates",description:"Official macro data — rates, the yield curve, inflation, jobs, debt, Treasury auctions, and financial stress."},{key:"equities",label:"Equities & Filings",description:"Single-company fundamentals, SEC filings, and short-sale volume."},{key:"sentiment",label:"Sentiment & News",description:"Market-mood gauges and news headline feeds."},{key:"portfolio",label:"Portfolio",description:"Your own holdings and their live allocation."},{key:"journal",label:"Decision Journal",description:"Your decision journal — log market calls, watch them play out, see them graded, and track how calibrated your judgment is over time."},{key:"tools",label:"Tools & Utility",description:"Clocks, countdowns, calculators, link grids, and the daily brief."},{key:"layout",label:"Layout & Media",description:"Structural and decorative frames — headings, dividers, notes, images, video, and quotes."},{key:"games",label:"Games",description:"Idle canvas games for when the market is quiet."}];function Pl(e){return new Map(e.map(t=>[t.name,t]))}var hs;function T(e,t,n){function r(c,l){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,l);const u=i.prototype,d=Object.keys(u);for(let h=0;h<d.length;h++){const m=d[h];m in c||(c[m]=u[m].bind(c))}}const s=(n==null?void 0:n.Parent)??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function i(c){var l;const u=n!=null&&n.Parent?new a:this;r(u,c),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>{var l,u;return n!=null&&n.Parent&&c instanceof n.Parent?!0:(u=(l=c==null?void 0:c._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ea extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(hs=globalThis).__zod_globalConfig??(hs.__zod_globalConfig={});const Or=globalThis.__zod_globalConfig;function Qe(e){return Or}function ta(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function xr(e,t){return typeof t=="bigint"?t.toString():t}function Ur(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Br(e){return e==null}function Hr(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Rl(e,t){const n=e/t,r=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<s?0:n-r}const ps=Symbol("evaluating");function re(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ps)return r===void 0&&(r=ps,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function vt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function lt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function gs(e){return JSON.stringify(e)}function $l(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const na="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function kn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Dl=Ur(()=>{var e;if(Or.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Et(e){if(kn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(kn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ra(e){return Et(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Il=new Set(["string","number","symbol"]);function Pn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ut(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Z(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ll(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Fl={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ol(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=lt(e._zod.def,{get shape(){const i={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(i[c]=n.shape[c])}return vt(this,"shape",i),i},checks:[]});return ut(e,a)}function Ul(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=lt(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete i[c]}return vt(this,"shape",i),i},checks:[]});return ut(e,a)}function Bl(e,t){if(!Et(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=lt(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return vt(this,"shape",a),a}});return ut(e,s)}function Hl(e,t){if(!Et(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=lt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return vt(this,"shape",r),r}});return ut(e,n)}function Vl(e,t){var r;if((r=e._zod.def.checks)!=null&&r.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=lt(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return vt(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ut(e,n)}function Zl(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=lt(t._zod.def,{get shape(){const c=t._zod.def.shape,l={...c};if(n)for(const u in n){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=e?new e({type:"optional",innerType:c[u]}):c[u])}else for(const u in c)l[u]=e?new e({type:"optional",innerType:c[u]}):c[u];return vt(this,"shape",l),l},checks:[]});return ut(t,i)}function Wl(e,t,n){const r=lt(t._zod.def,{get shape(){const s=t._zod.def.shape,a={...s};if(n)for(const i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)a[i]=new e({type:"nonoptional",innerType:s[i]});return vt(this,"shape",a),a}});return ut(t,r)}function Nt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Yl(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Ct(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Qt(e){return typeof e=="string"?e:e==null?void 0:e.message}function et(e,t,n){var l,u,d,h,m,p;const r=e.message?e.message:Qt((d=(u=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:u.error)==null?void 0:d.call(u,e))??Qt((h=t==null?void 0:t.error)==null?void 0:h.call(t,e))??Qt((m=n.customError)==null?void 0:m.call(n,e))??Qt((p=n.localeError)==null?void 0:p.call(n,e))??"Invalid input",{inst:s,continue:a,input:i,...c}=e;return c.path??(c.path=[]),c.message=r,t!=null&&t.reportInput&&(c.input=i),c}function Vr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Wt(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const sa=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,xr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oa=T("$ZodError",sa),aa=T("$ZodError",sa,{Parent:Error});function Gl(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function Xl(e,t=n=>n.message){const n={_errors:[]},r=(s,a=[])=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>r({issues:c},[...a,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...a,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...a,...i.path]);else{const c=[...a,...i.path];if(c.length===0)n._errors.push(t(i));else{let l=n,u=0;for(;u<c.length;){const d=c[u];u===c.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(i))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}}};return r(e),n}const Zr=e=>(t,n,r,s)=>{const a=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new _t;if(i.issues.length){const c=new((s==null?void 0:s.Err)??e)(i.issues.map(l=>et(l,a,Qe())));throw na(c,s==null?void 0:s.callee),c}return i.value},Wr=e=>async(t,n,r,s)=>{const a=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const c=new((s==null?void 0:s.Err)??e)(i.issues.map(l=>et(l,a,Qe())));throw na(c,s==null?void 0:s.callee),c}return i.value},Rn=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new _t;return a.issues.length?{success:!1,error:new(e??oa)(a.issues.map(i=>et(i,s,Qe())))}:{success:!0,data:a.value}},ql=Rn(aa),$n=e=>async(t,n,r)=>{const s=r?{...r,async:!0}:{async:!0};let a=t._zod.run({value:n,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>et(i,s,Qe())))}:{success:!0,data:a.value}},Kl=$n(aa),Jl=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Zr(e)(t,n,s)},Ql=e=>(t,n,r)=>Zr(e)(t,n,r),eu=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Wr(e)(t,n,s)},tu=e=>async(t,n,r)=>Wr(e)(t,n,r),nu=e=>(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return Rn(e)(t,n,s)},ru=e=>(t,n,r)=>Rn(e)(t,n,r),su=e=>async(t,n,r)=>{const s=r?{...r,direction:"backward"}:{direction:"backward"};return $n(e)(t,n,s)},ou=e=>async(t,n,r)=>$n(e)(t,n,r),au=/^[cC][0-9a-z]{6,}$/,iu=/^[0-9a-z]+$/,cu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,lu=/^[0-9a-vA-V]{20}$/,uu=/^[A-Za-z0-9]{27}$/,du=/^[a-zA-Z0-9_-]{21}$/,mu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,bs=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,hu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function gu(){return new RegExp(pu,"u")}const bu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,yu=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ia=/^[A-Za-z0-9_-]*$/,ku=/^https?$/,Su=/^\+[1-9]\d{6,14}$/,ca="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ju=new RegExp(`^${ca}$`);function la(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Nu(e){return new RegExp(`^${la(e)}$`)}function Cu(e){const t=la({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ca}T(?:${r})$`)}const zu=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_u=/^-?\d+$/,ua=/^-?\d+(?:\.\d+)?$/,Tu=/^(?:true|false)$/i,Eu=/^[^A-Z]*$/,Mu=/^[^a-z]*$/,De=T("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),da={number:"number",bigint:"bigint",object:"date"},ma=T("$ZodCheckLessThan",(e,t)=>{De.init(e,t);const n=da[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fa=T("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);const n=da[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Au=T("$ZodCheckMultipleOf",(e,t)=>{De.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Rl(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Pu=T("$ZodCheckNumberFormat",(e,t)=>{var i;De.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[s,a]=Fl[t.format];e._zod.onattach.push(c=>{const l=c._zod.bag;l.format=t.format,l.minimum=s,l.maximum=a,n&&(l.pattern=_u)}),e._zod.check=c=>{const l=c.value;if(n){if(!Number.isInteger(l)){c.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<s&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),l>a&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Ru=T("$ZodCheckMaxLength",(e,t)=>{var n;De.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Br(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const i=Vr(s);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),$u=T("$ZodCheckMinLength",(e,t)=>{var n;De.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Br(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const i=Vr(s);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Du=T("$ZodCheckLengthEquals",(e,t)=>{var n;De.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Br(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,a=s.length;if(a===t.length)return;const i=Vr(s),c=a>t.length;r.issues.push({origin:i,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Dn=T("$ZodCheckStringFormat",(e,t)=>{var n,r;De.init(e,t),e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Iu=T("$ZodCheckRegex",(e,t)=>{Dn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Lu=T("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Eu),Dn.init(e,t)}),Fu=T("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mu),Dn.init(e,t)}),Ou=T("$ZodCheckIncludes",(e,t)=>{De.init(e,t);const n=Pn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Uu=T("$ZodCheckStartsWith",(e,t)=>{De.init(e,t);const n=new RegExp(`^${Pn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Bu=T("$ZodCheckEndsWith",(e,t)=>{De.init(e,t);const n=new RegExp(`.*${Pn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Hu=T("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Vu{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
3
|
-
`).filter(i=>i),s=Math.min(...r.map(i=>i.length-i.trimStart().length)),a=r.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,n=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(a=>` ${a}`)];return new t(...n,s.join(`
|
|
4
|
-
`))}}const Zu={major:4,minor:4,patch:3},pe=T("$ZodType",(e,t)=>{var s;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zu;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const a of r)for(const i of a._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const a=(c,l,u)=>{let d=Nt(c),h;for(const m of l){if(m._zod.def.when){if(Yl(c)||!m._zod.def.when(c))continue}else if(d)continue;const p=c.issues.length,x=m._zod.check(c);if(x instanceof Promise&&(u==null?void 0:u.async)===!1)throw new _t;if(h||x instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await x,c.issues.length!==p&&(d||(d=Nt(c,p)))});else{if(c.issues.length===p)continue;d||(d=Nt(c,p))}}return h?h.then(()=>c):c},i=(c,l,u)=>{if(Nt(c))return c.aborted=!0,c;const d=a(l,r,u);if(d instanceof Promise){if(u.async===!1)throw new _t;return d.then(h=>e._zod.parse(h,u))}return e._zod.parse(d,u)};e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){const d=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(h=>i(h,c,l)):i(d,c,l)}const u=e._zod.parse(c,l);if(u instanceof Promise){if(l.async===!1)throw new _t;return u.then(d=>a(d,r,l))}return a(u,r,l)}}re(e,"~standard",()=>({validate:a=>{var i;try{const c=ql(e,a);return c.success?{value:c.data}:{issues:(i=c.error)==null?void 0:i.issues}}catch{return Kl(e,a).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),Yr=T("$ZodString",(e,t)=>{var n;pe.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??zu(e._zod.bag),e._zod.parse=(r,s)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ue=T("$ZodStringFormat",(e,t)=>{Dn.init(e,t),Yr.init(e,t)}),Wu=T("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=fu),ue.init(e,t)}),Yu=T("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=bs(r))}else t.pattern??(t.pattern=bs());ue.init(e,t)}),Gu=T("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hu),ue.init(e,t)}),Xu=T("$ZodURL",(e,t)=>{ue.init(e,t),e._zod.check=n=>{var r;try{const s=n.value.trim();if(!t.normalize&&((r=t.protocol)==null?void 0:r.source)===ku.source&&!/^https?:\/\//i.test(s)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const a=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=a.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qu=T("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=gu()),ue.init(e,t)}),Ku=T("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=du),ue.init(e,t)}),Ju=T("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=au),ue.init(e,t)}),Qu=T("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iu),ue.init(e,t)}),ed=T("$ZodULID",(e,t)=>{t.pattern??(t.pattern=cu),ue.init(e,t)}),td=T("$ZodXID",(e,t)=>{t.pattern??(t.pattern=lu),ue.init(e,t)}),nd=T("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=uu),ue.init(e,t)}),rd=T("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Cu(t)),ue.init(e,t)}),sd=T("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ju),ue.init(e,t)}),od=T("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Nu(t)),ue.init(e,t)}),ad=T("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mu),ue.init(e,t)}),id=T("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=bu),ue.init(e,t),e._zod.bag.format="ipv4"}),cd=T("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xu),ue.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ld=T("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=yu),ue.init(e,t)}),ud=T("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vu),ue.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,a]=r;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ha(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dd=T("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wu),ue.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ha(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function md(e){if(!ia.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ha(n)}const fd=T("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ia),ue.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{md(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),hd=T("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Su),ue.init(e,t)});function pd(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const gd=T("$ZodJWT",(e,t)=>{ue.init(e,t),e._zod.check=n=>{pd(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),pa=T("$ZodNumber",(e,t)=>{pe.init(e,t),e._zod.pattern=e._zod.bag.pattern??ua,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),n}}),bd=T("$ZodNumberFormat",(e,t)=>{Pu.init(e,t),pa.init(e,t)}),xd=T("$ZodBoolean",(e,t)=>{pe.init(e,t),e._zod.pattern=Tu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),yd=T("$ZodUnknown",(e,t)=>{pe.init(e,t),e._zod.parse=n=>n}),vd=T("$ZodNever",(e,t)=>{pe.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xs(e,t,n){e.issues.length&&t.issues.push(...Ct(n,e.issues)),t.value[n]=e.value}const wd=T("$ZodArray",(e,t)=>{pe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const a=[];for(let i=0;i<s.length;i++){const c=s[i],l=t.element._zod.run({value:c,issues:[]},r);l instanceof Promise?a.push(l.then(u=>xs(u,n,i))):xs(l,n,i)}return a.length?Promise.all(a).then(()=>n):n}});function Sn(e,t,n,r,s,a){const i=n in r;if(e.issues.length){if(s&&a&&!i)return;t.issues.push(...Ct(n,e.issues))}if(!i&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function ga(e){var r,s,a,i;const t=Object.keys(e.shape);for(const c of t)if(!((i=(a=(s=(r=e.shape)==null?void 0:r[c])==null?void 0:s._zod)==null?void 0:a.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const n=Ll(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ba(e,t,n,r,s,a){const i=[],c=s.keySet,l=s.catchall._zod,u=l.def.type,d=l.optin==="optional",h=l.optout==="optional";for(const m in t){if(m==="__proto__"||c.has(m))continue;if(u==="never"){i.push(m);continue}const p=l.run({value:t[m],issues:[]},r);p instanceof Promise?e.push(p.then(x=>Sn(x,n,m,t,d,h))):Sn(p,n,m,t,d,h)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const kd=T("$ZodObject",(e,t)=>{pe.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...c};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=Ur(()=>ga(t));re(e._zod,"propValues",()=>{const c=t.shape,l={};for(const u in c){const d=c[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(const h of d.values)l[u].add(h)}}return l});const s=kn,a=t.catchall;let i;e._zod.parse=(c,l)=>{i??(i=r.value);const u=c.value;if(!s(u))return c.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),c;c.value={};const d=[],h=i.shape;for(const m of i.keys){const p=h[m],x=p._zod.optin==="optional",b=p._zod.optout==="optional",y=p._zod.run({value:u[m],issues:[]},l);y instanceof Promise?d.push(y.then(g=>Sn(g,c,m,u,x,b))):Sn(y,c,m,u,x,b)}return a?ba(d,u,c,l,r.value,e):d.length?Promise.all(d).then(()=>c):c}}),Sd=T("$ZodObjectJIT",(e,t)=>{kd.init(e,t);const n=e._zod.parse,r=Ur(()=>ga(t)),s=m=>{var S,z;const p=new Vu(["shape","payload","ctx"]),x=r.value,b=j=>{const C=gs(j);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};p.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const j of x.keys)y[j]=`key_${g++}`;p.write("const newResult = {};");for(const j of x.keys){const C=y[j],k=gs(j),w=m[j],N=((S=w==null?void 0:w._zod)==null?void 0:S.optin)==="optional",E=((z=w==null?void 0:w._zod)==null?void 0:z.optout)==="optional";p.write(`const ${C} = ${b(j)};`),N&&E?p.write(`
|
|
5
|
-
if (${C}.issues.length) {
|
|
6
|
-
if (${k} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
8
|
-
...iss,
|
|
9
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
10
|
-
})));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${C}.value === undefined) {
|
|
15
|
-
if (${k} in input) {
|
|
16
|
-
newResult[${k}] = undefined;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
newResult[${k}] = ${C}.value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`):N?p.write(`
|
|
23
|
-
if (${C}.issues.length) {
|
|
24
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
27
|
-
})));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (${C}.value === undefined) {
|
|
31
|
-
if (${k} in input) {
|
|
32
|
-
newResult[${k}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${k}] = ${C}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`):p.write(`
|
|
39
|
-
const ${C}_present = ${k} in input;
|
|
40
|
-
if (${C}.issues.length) {
|
|
41
|
-
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
42
|
-
...iss,
|
|
43
|
-
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
44
|
-
})));
|
|
45
|
-
}
|
|
46
|
-
if (!${C}_present && !${C}.issues.length) {
|
|
47
|
-
payload.issues.push({
|
|
48
|
-
code: "invalid_type",
|
|
49
|
-
expected: "nonoptional",
|
|
50
|
-
input: undefined,
|
|
51
|
-
path: [${k}]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (${C}_present) {
|
|
56
|
-
if (${C}.value === undefined) {
|
|
57
|
-
newResult[${k}] = undefined;
|
|
58
|
-
} else {
|
|
59
|
-
newResult[${k}] = ${C}.value;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
`)}p.write("payload.value = newResult;"),p.write("return payload;");const v=p.compile();return(j,C)=>v(m,j,C)};let a;const i=kn,c=!Or.jitless,u=c&&Dl.value,d=t.catchall;let h;e._zod.parse=(m,p)=>{h??(h=r.value);const x=m.value;return i(x)?c&&u&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(a||(a=s(t.shape)),m=a(m,p),d?ba([],x,m,p,h,e):m):n(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m)}});function ys(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const s=e.filter(a=>!Nt(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>et(i,r,Qe())))}),t)}const jd=T("$ZodUnion",(e,t)=>{pe.init(e,t),re(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),re(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),re(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),re(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>Hr(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let a=!1;const i=[];for(const c of t.options){const l=c._zod.run({value:r.value,issues:[]},s);if(l instanceof Promise)i.push(l),a=!0;else{if(l.issues.length===0)return l;i.push(l)}}return a?Promise.all(i).then(c=>ys(c,r,e,s)):ys(i,r,e,s)}}),Nd=T("$ZodIntersection",(e,t)=>{pe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,a=t.left._zod.run({value:s,issues:[]},r),i=t.right._zod.run({value:s,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([l,u])=>vs(n,l,u)):vs(n,a,i)}});function yr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Et(e)&&Et(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),s={...e,...t};for(const a of r){const i=yr(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};s[a]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],a=t[r],i=yr(s,a);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function vs(e,t,n){const r=new Map;let s;for(const c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(const l of c.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const l of c.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),Nt(e))return e;const i=yr(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Cd=T("$ZodRecord",(e,t)=>{pe.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Et(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const a=[],i=t.keyType._zod.values;if(i){n.value={};const c=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){c.add(typeof u=="number"?u.toString():u);const d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(p=>et(p,r,Qe())),input:u,path:[u],inst:e});continue}const h=d.value,m=t.valueType._zod.run({value:s[u],issues:[]},r);m instanceof Promise?a.push(m.then(p=>{p.issues.length&&n.issues.push(...Ct(u,p.issues)),n.value[h]=p.value})):(m.issues.length&&n.issues.push(...Ct(u,m.issues)),n.value[h]=m.value)}let l;for(const u in s)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l})}else{n.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&ua.test(c)&&l.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[c]=s[c]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>et(h,r,Qe())),input:c,path:[c],inst:e});continue}const d=t.valueType._zod.run({value:s[c],issues:[]},r);d instanceof Promise?a.push(d.then(h=>{h.issues.length&&n.issues.push(...Ct(c,h.issues)),n.value[l.value]=h.value})):(d.issues.length&&n.issues.push(...Ct(c,d.issues)),n.value[l.value]=d.value)}}return a.length?Promise.all(a).then(()=>n):n}}),zd=T("$ZodEnum",(e,t)=>{pe.init(e,t);const n=ta(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>Il.has(typeof s)).map(s=>typeof s=="string"?Pn(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{const i=s.value;return r.has(i)||s.issues.push({code:"invalid_value",values:n,input:i,inst:e}),s}}),_d=T("$ZodTransform",(e,t)=>{pe.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ea(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(n.value=i,n.fallback=!0,n));if(s instanceof Promise)throw new _t;return n.value=s,n.fallback=!0,n}});function ws(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const xa=T("$ZodOptional",(e,t)=>{pe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Hr(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(i=>ws(i,s)):ws(a,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Td=T("$ZodExactOptional",(e,t)=>{xa.init(e,t),re(e._zod,"values",()=>t.innerType._zod.values),re(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Ed=T("$ZodNullable",(e,t)=>{pe.init(e,t),re(e._zod,"optin",()=>t.innerType._zod.optin),re(e._zod,"optout",()=>t.innerType._zod.optout),re(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Hr(n.source)}|null)$`):void 0}),re(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Md=T("$ZodDefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(a=>ks(a,t)):ks(s,t)}});function ks(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ad=T("$ZodPrefault",(e,t)=>{pe.init(e,t),e._zod.optin="optional",re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Pd=T("$ZodNonOptional",(e,t)=>{pe.init(e,t),re(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(a=>Ss(a,e)):Ss(s,e)}});function Ss(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Rd=T("$ZodCatch",(e,t)=>{pe.init(e,t),e._zod.optin="optional",re(e._zod,"optout",()=>t.innerType._zod.optout),re(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>et(i,r,Qe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(a=>et(a,r,Qe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),ya=T("$ZodPipe",(e,t)=>{pe.init(e,t),re(e._zod,"values",()=>t.in._zod.values),re(e._zod,"optin",()=>t.in._zod.optin),re(e._zod,"optout",()=>t.out._zod.optout),re(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(i=>en(i,t.in,r)):en(a,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(a=>en(a,t.out,r)):en(s,t.out,r)}});function en(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const $d=T("$ZodPreprocess",(e,t)=>{ya.init(e,t)}),Dd=T("$ZodReadonly",(e,t)=>{pe.init(e,t),re(e._zod,"propValues",()=>t.innerType._zod.propValues),re(e._zod,"values",()=>t.innerType._zod.values),re(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),re(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(js):js(s)}});function js(e){return e.value=Object.freeze(e.value),e}const Id=T("$ZodCustom",(e,t)=>{De.init(e,t),pe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(a=>Ns(a,n,r,e));Ns(s,n,r,e)}});function Ns(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Wt(s))}}var Cs;class Ld{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Fd(){return new Ld}(Cs=globalThis).__zod_globalRegistry??(Cs.__zod_globalRegistry=Fd());const Ht=globalThis.__zod_globalRegistry;function Od(e,t){return new e({type:"string",...Z(t)})}function Ud(e,t){return new e({type:"string",coerce:!0,...Z(t)})}function Bd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Z(t)})}function zs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Z(t)})}function Hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Z(t)})}function Vd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Z(t)})}function Zd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Z(t)})}function Wd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Z(t)})}function Yd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}function Gd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Z(t)})}function Xd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Z(t)})}function qd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Z(t)})}function Kd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Z(t)})}function Jd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Z(t)})}function Qd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Z(t)})}function em(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Z(t)})}function tm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Z(t)})}function nm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Z(t)})}function rm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Z(t)})}function sm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Z(t)})}function om(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Z(t)})}function am(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Z(t)})}function im(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Z(t)})}function cm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Z(t)})}function lm(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Z(t)})}function um(e,t){return new e({type:"string",format:"date",check:"string_format",...Z(t)})}function dm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Z(t)})}function mm(e,t){return new e({type:"string",format:"duration",check:"string_format",...Z(t)})}function fm(e,t){return new e({type:"number",checks:[],...Z(t)})}function hm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}function pm(e,t){return new e({type:"boolean",...Z(t)})}function gm(e){return new e({type:"unknown"})}function bm(e,t){return new e({type:"never",...Z(t)})}function _s(e,t){return new ma({check:"less_than",...Z(t),value:e,inclusive:!1})}function Vn(e,t){return new ma({check:"less_than",...Z(t),value:e,inclusive:!0})}function Ts(e,t){return new fa({check:"greater_than",...Z(t),value:e,inclusive:!1})}function Zn(e,t){return new fa({check:"greater_than",...Z(t),value:e,inclusive:!0})}function Es(e,t){return new Au({check:"multiple_of",...Z(t),value:e})}function va(e,t){return new Ru({check:"max_length",...Z(t),maximum:e})}function jn(e,t){return new $u({check:"min_length",...Z(t),minimum:e})}function wa(e,t){return new Du({check:"length_equals",...Z(t),length:e})}function xm(e,t){return new Iu({check:"string_format",format:"regex",...Z(t),pattern:e})}function ym(e){return new Lu({check:"string_format",format:"lowercase",...Z(e)})}function vm(e){return new Fu({check:"string_format",format:"uppercase",...Z(e)})}function wm(e,t){return new Ou({check:"string_format",format:"includes",...Z(t),includes:e})}function km(e,t){return new Uu({check:"string_format",format:"starts_with",...Z(t),prefix:e})}function Sm(e,t){return new Bu({check:"string_format",format:"ends_with",...Z(t),suffix:e})}function At(e){return new Hu({check:"overwrite",tx:e})}function jm(e){return At(t=>t.normalize(e))}function Nm(){return At(e=>e.trim())}function Cm(){return At(e=>e.toLowerCase())}function zm(){return At(e=>e.toUpperCase())}function _m(){return At(e=>$l(e))}function Tm(e,t,n){return new e({type:"array",element:t,...Z(n)})}function Em(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Z(n)})}function Mm(e,t){const n=Am(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Wt(s,r.value,n._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=n),a.continue??(a.continue=!n._zod.def.abort),r.issues.push(Wt(a))}},e(r.value,r)),t);return n}function Am(e,t){const n=new De({check:"custom",...Z(t)});return n._zod.check=e,n}function Nn(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ht,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function oe(e,t,n={path:[],schemaPath:[]}){var d,h;var r;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const c=(h=(d=e._zod).toJSONSchema)==null?void 0:h.call(d);if(c)i.schema=c;else{const m={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const x=i.schema,b=t.processors[s.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);b(e,t,x,m)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),oe(p,t,m),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(i.schema,l),t.io==="input"&&Te(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Cn(e,t){var i,c,l,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const h=(i=e.metadataRegistry.get(d[0]))==null?void 0:i.id;if(h){const m=r.get(h);if(m&&m!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const s=d=>{var b;const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=(b=e.external.registry.get(d[0]))==null?void 0:b.id,g=e.external.uri??(S=>S);if(y)return{ref:g(y)};const v=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=v,{defId:v,ref:`${g("__shared")}#/${h}/${v}`}}if(d[1]===n)return{ref:"#"};const p=`#/${h}/`,x=d[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:p+x}},a=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:m,defId:p}=s(d);h.def={...h.schema},p&&(h.defId=p);const x=h.schema;for(const b in x)delete x[b];x.$ref=m};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${(c=h.cycle)==null?void 0:c.join("/")}/<root>
|
|
64
|
-
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=d[1];if(t===d[0]){a(d);continue}if(e.external){const p=(l=e.external.registry.get(d[0]))==null?void 0:l.id;if(t!==d[0]&&p){a(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){a(d);continue}if(h.cycle){a(d);continue}if(h.count>1&&e.reused==="ref"){a(d);continue}}}function zn(e,t){var c,l,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=h=>{const m=e.seen.get(h);if(m.ref===null)return;const p=m.def??m.schema,x={...p},b=m.ref;if(m.ref=null,b){r(b);const g=e.seen.get(b),v=g.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(v)):Object.assign(p,v),Object.assign(p,x),h._zod.parent===b)for(const z in p)z==="$ref"||z==="allOf"||z in x||delete p[z];if(v.$ref&&g.def)for(const z in p)z==="$ref"||z==="allOf"||z in g.def&&JSON.stringify(p[z])===JSON.stringify(g.def[z])&&delete p[z]}const y=h._zod.parent;if(y&&y!==b){r(y);const g=e.seen.get(y);if(g!=null&&g.schema.$ref&&(p.$ref=g.schema.$ref,g.def))for(const v in p)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(p[v])===JSON.stringify(g.def[v])&&delete p[v]}e.override({zodSchema:h,jsonSchema:p,path:m.path??[]})};for(const h of[...e.seen.entries()].reverse())r(h[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const h=(l=e.external.registry.get(t))==null?void 0:l.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(h)}Object.assign(s,n.def??n.schema);const a=(u=e.metadataRegistry.get(t))==null?void 0:u.id;a!==void 0&&s.id===a&&delete s.id;const i=((d=e.external)==null?void 0:d.defs)??{};for(const h of e.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,i[m.defId]=m.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:_n(t,"input",e.processors),output:_n(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Te(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Te(r.element,n);if(r.type==="set")return Te(r.valueType,n);if(r.type==="lazy")return Te(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Te(r.innerType,n);if(r.type==="intersection")return Te(r.left,n)||Te(r.right,n);if(r.type==="record"||r.type==="map")return Te(r.keyType,n)||Te(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Te(r.in,n)||Te(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Te(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Te(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Te(s,n))return!0;return!!(r.rest&&Te(r.rest,n))}return!1}const Pm=(e,t={})=>n=>{const r=Nn({...n,processors:t});return oe(e,r),Cn(r,e),zn(r,e)},_n=(e,t,n={})=>r=>{const{libraryOptions:s,target:a}=r??{},i=Nn({...s??{},target:a,io:t,processors:n});return oe(e,i),Cn(i,e),zn(i,e)},Rm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ka=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:a,maximum:i,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof i=="number"&&(s.maxLength=i),c&&(s.format=Rm[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),u&&(s.contentEncoding=u),l&&l.size>0){const d=[...l];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Sa=(e,t,n,r)=>{const s=n,{minimum:a,maximum:i,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number";const h=typeof d=="number"&&d>=(a??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";h?p?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof a=="number"&&(s.minimum=a),m?p?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u:typeof i=="number"&&(s.maximum=i),typeof l=="number"&&(s.multipleOf=l)},ja=(e,t,n,r)=>{n.type="boolean"},$m=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Dm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Im=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Lm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Fm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Na=(e,t,n,r)=>{n.not={}},Om=(e,t,n,r)=>{},Ca=(e,t,n,r)=>{},Um=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},za=(e,t,n,r)=>{const s=e._zod.def,a=ta(s.entries);a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),n.enum=a},Bm=(e,t,n,r)=>{const s=e._zod.def,a=[];for(const i of s.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(i))}else a.push(i);if(a.length!==0)if(a.length===1){const i=a[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),a.every(i=>typeof i=="boolean")&&(n.type="boolean"),a.every(i=>i===null)&&(n.type="null"),n.enum=a},Hm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Vm=(e,t,n,r)=>{const s=n,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},Zm=(e,t,n,r)=>{const s=n,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:l}=e._zod.bag;i!==void 0&&(a.minLength=i),c!==void 0&&(a.maxLength=c),l?l.length===1?(a.contentMediaType=l[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(s,a)},Wm=(e,t,n,r)=>{n.type="boolean"},_a=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ym=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ta=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Xm=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ea=(e,t,n,r)=>{const s=n,a=e._zod.def,{minimum:i,maximum:c}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=oe(a.element,t,{...r,path:[...r.path,"items"]})},Ma=(e,t,n,r)=>{var u;const s=n,a=e._zod.def;s.type="object",s.properties={};const i=a.shape;for(const d in i)s.properties[d]=oe(i[d],t,{...r,path:[...r.path,"properties",d]});const c=new Set(Object.keys(i)),l=new Set([...c].filter(d=>{const h=a.shape[d]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));l.size>0&&(s.required=Array.from(l)),((u=a.catchall)==null?void 0:u._zod.def.type)==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=oe(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Aa=(e,t,n,r)=>{const s=e._zod.def,a=s.inclusive===!1,i=s.options.map((c,l)=>oe(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",l]}));a?n.oneOf=i:n.anyOf=i},Pa=(e,t,n,r)=>{const s=e._zod.def,a=oe(s.left,t,{...r,path:[...r.path,"allOf",0]}),i=oe(s.right,t,{...r,path:[...r.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,l=[...c(a)?a.allOf:[a],...c(i)?i.allOf:[i]];n.allOf=l},qm=(e,t,n,r)=>{const s=n,a=e._zod.def;s.type="array";const i=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=a.items.map((m,p)=>oe(m,t,{...r,path:[...r.path,i,p]})),u=a.rest?oe(a.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=l,u&&(s.items=u)):t.target==="openapi-3.0"?(s.items={anyOf:l},u&&s.items.anyOf.push(u),s.minItems=l.length,u||(s.maxItems=l.length)):(s.items=l,u&&(s.additionalItems=u));const{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(s.minItems=d),typeof h=="number"&&(s.maxItems=h)},Ra=(e,t,n,r)=>{const s=n,a=e._zod.def;s.type="object";const i=a.keyType,c=i._zod.bag,l=c==null?void 0:c.patterns;if(a.mode==="loose"&&l&&l.size>0){const d=oe(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const h of l)s.patternProperties[h.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=oe(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=oe(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=i._zod.values;if(u){const d=[...u].filter(h=>typeof h=="string"||typeof h=="number");d.length>0&&(s.required=d)}},$a=(e,t,n,r)=>{const s=e._zod.def,a=oe(s.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},Da=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType},Ia=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},La=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Fa=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},Oa=(e,t,n,r)=>{const s=e._zod.def,a=s.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?a?s.out:s.in:s.out;oe(i,t,r);const c=t.seen.get(e);c.ref=i},Ua=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType,n.readOnly=!0},Km=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType},Gr=(e,t,n,r)=>{const s=e._zod.def;oe(s.innerType,t,r);const a=t.seen.get(e);a.ref=s.innerType},Jm=(e,t,n,r)=>{const s=e._zod.innerType;oe(s,t,r);const a=t.seen.get(e);a.ref=s},Ms={string:ka,number:Sa,boolean:ja,bigint:$m,symbol:Dm,null:Im,undefined:Lm,void:Fm,never:Na,any:Om,unknown:Ca,date:Um,enum:za,literal:Bm,nan:Hm,template_literal:Vm,file:Zm,success:Wm,custom:_a,function:Ym,transform:Ta,map:Gm,set:Xm,array:Ea,object:Ma,union:Aa,intersection:Pa,tuple:qm,record:Ra,nullable:$a,nonoptional:Da,default:Ia,prefault:La,catch:Fa,pipe:Oa,readonly:Ua,promise:Km,optional:Gr,lazy:Jm};function tk(e,t){if("_idmap"in e){const r=e,s=Nn({...t,processors:Ms}),a={};for(const l of r._idmap.entries()){const[u,d]=l;oe(d,s)}const i={},c={registry:r,uri:t==null?void 0:t.uri,defs:a};s.external=c;for(const l of r._idmap.entries()){const[u,d]=l;Cn(s,d),i[u]=zn(s,d)}if(Object.keys(a).length>0){const l=s.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[l]:a}}return{schemas:i}}const n=Nn({...t,processors:Ms});return oe(e,n),Cn(n,e),zn(n,e)}const Qm=T("ZodISODateTime",(e,t)=>{rd.init(e,t),me.init(e,t)});function ef(e){return lm(Qm,e)}const tf=T("ZodISODate",(e,t)=>{sd.init(e,t),me.init(e,t)});function nf(e){return um(tf,e)}const rf=T("ZodISOTime",(e,t)=>{od.init(e,t),me.init(e,t)});function sf(e){return dm(rf,e)}const of=T("ZodISODuration",(e,t)=>{ad.init(e,t),me.init(e,t)});function af(e){return mm(of,e)}const cf=(e,t)=>{oa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Xl(e,n)},flatten:{value:n=>Gl(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,xr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,xr,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ue=T("ZodError",cf,{Parent:Error}),lf=Zr(Ue),uf=Wr(Ue),df=Rn(Ue),mf=$n(Ue),ff=Jl(Ue),hf=Ql(Ue),pf=eu(Ue),gf=tu(Ue),bf=nu(Ue),xf=ru(Ue),yf=su(Ue),vf=ou(Ue),As=new WeakMap;function Jt(e,t,n){const r=Object.getPrototypeOf(e);let s=As.get(r);if(s||(s=new Set,As.set(r,s)),!s.has(t)){s.add(t);for(const a in n){const i=n[a];Object.defineProperty(r,a,{configurable:!0,enumerable:!1,get(){const c=i.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}const ge=T("ZodType",(e,t)=>(pe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:_n(e,"input"),output:_n(e,"output")}}),e.toJSONSchema=Pm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>lf(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>df(e,n,r),e.parseAsync=async(n,r)=>uf(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>mf(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>ff(e,n,r),e.decode=(n,r)=>hf(e,n,r),e.encodeAsync=async(n,r)=>pf(e,n,r),e.decodeAsync=async(n,r)=>gf(e,n,r),e.safeEncode=(n,r)=>bf(e,n,r),e.safeDecode=(n,r)=>xf(e,n,r),e.safeEncodeAsync=async(n,r)=>yf(e,n,r),e.safeDecodeAsync=async(n,r)=>vf(e,n,r),Jt(e,"ZodType",{check(...n){const r=this.def;return this.clone(lt(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return ut(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(uh(n,r))},superRefine(n,r){return this.check(dh(n,r))},overwrite(n){return this.check(At(n))},optional(){return Is(this)},exactOptional(){return Kf(this)},nullable(){return Ls(this)},nullish(){return Is(Ls(this))},nonoptional(n){return rh(this,n)},array(){return he(this)},or(n){return Wf([this,n])},and(n){return Gf(this,n)},transform(n){return Fs(this,Za(n))},default(n){return eh(this,n)},prefault(n){return nh(this,n)},catch(n){return oh(this,n)},pipe(n){return Fs(this,n)},readonly(){return ch(this)},describe(n){const r=this.clone();return Ht.add(r,{description:n}),r},meta(...n){if(n.length===0)return Ht.get(this);const r=this.clone();return Ht.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){var n;return(n=Ht.get(e))==null?void 0:n.description},configurable:!0}),e)),Ba=T("_ZodString",(e,t)=>{Yr.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,s,a)=>ka(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Jt(e,"_ZodString",{regex(...r){return this.check(xm(...r))},includes(...r){return this.check(wm(...r))},startsWith(...r){return this.check(km(...r))},endsWith(...r){return this.check(Sm(...r))},min(...r){return this.check(jn(...r))},max(...r){return this.check(va(...r))},length(...r){return this.check(wa(...r))},nonempty(...r){return this.check(jn(1,...r))},lowercase(r){return this.check(ym(r))},uppercase(r){return this.check(vm(r))},trim(){return this.check(Nm())},normalize(...r){return this.check(jm(...r))},toLowerCase(){return this.check(Cm())},toUpperCase(){return this.check(zm())},slugify(){return this.check(_m())}})}),Ha=T("ZodString",(e,t)=>{Yr.init(e,t),Ba.init(e,t),e.email=n=>e.check(Bd(wf,n)),e.url=n=>e.check(Yd(kf,n)),e.jwt=n=>e.check(cm(If,n)),e.emoji=n=>e.check(Gd(Sf,n)),e.guid=n=>e.check(zs(Ps,n)),e.uuid=n=>e.check(Hd(tn,n)),e.uuidv4=n=>e.check(Vd(tn,n)),e.uuidv6=n=>e.check(Zd(tn,n)),e.uuidv7=n=>e.check(Wd(tn,n)),e.nanoid=n=>e.check(Xd(jf,n)),e.guid=n=>e.check(zs(Ps,n)),e.cuid=n=>e.check(qd(Nf,n)),e.cuid2=n=>e.check(Kd(Cf,n)),e.ulid=n=>e.check(Jd(zf,n)),e.base64=n=>e.check(om(Rf,n)),e.base64url=n=>e.check(am($f,n)),e.xid=n=>e.check(Qd(_f,n)),e.ksuid=n=>e.check(em(Tf,n)),e.ipv4=n=>e.check(tm(Ef,n)),e.ipv6=n=>e.check(nm(Mf,n)),e.cidrv4=n=>e.check(rm(Af,n)),e.cidrv6=n=>e.check(sm(Pf,n)),e.e164=n=>e.check(im(Df,n)),e.datetime=n=>e.check(ef(n)),e.date=n=>e.check(nf(n)),e.time=n=>e.check(sf(n)),e.duration=n=>e.check(af(n))});function B(e){return Od(Ha,e)}const me=T("ZodStringFormat",(e,t)=>{ue.init(e,t),Ba.init(e,t)}),wf=T("ZodEmail",(e,t)=>{Gu.init(e,t),me.init(e,t)}),Ps=T("ZodGUID",(e,t)=>{Wu.init(e,t),me.init(e,t)}),tn=T("ZodUUID",(e,t)=>{Yu.init(e,t),me.init(e,t)}),kf=T("ZodURL",(e,t)=>{Xu.init(e,t),me.init(e,t)}),Sf=T("ZodEmoji",(e,t)=>{qu.init(e,t),me.init(e,t)}),jf=T("ZodNanoID",(e,t)=>{Ku.init(e,t),me.init(e,t)}),Nf=T("ZodCUID",(e,t)=>{Ju.init(e,t),me.init(e,t)}),Cf=T("ZodCUID2",(e,t)=>{Qu.init(e,t),me.init(e,t)}),zf=T("ZodULID",(e,t)=>{ed.init(e,t),me.init(e,t)}),_f=T("ZodXID",(e,t)=>{td.init(e,t),me.init(e,t)}),Tf=T("ZodKSUID",(e,t)=>{nd.init(e,t),me.init(e,t)}),Ef=T("ZodIPv4",(e,t)=>{id.init(e,t),me.init(e,t)}),Mf=T("ZodIPv6",(e,t)=>{cd.init(e,t),me.init(e,t)}),Af=T("ZodCIDRv4",(e,t)=>{ld.init(e,t),me.init(e,t)}),Pf=T("ZodCIDRv6",(e,t)=>{ud.init(e,t),me.init(e,t)}),Rf=T("ZodBase64",(e,t)=>{dd.init(e,t),me.init(e,t)}),$f=T("ZodBase64URL",(e,t)=>{fd.init(e,t),me.init(e,t)}),Df=T("ZodE164",(e,t)=>{hd.init(e,t),me.init(e,t)}),If=T("ZodJWT",(e,t)=>{gd.init(e,t),me.init(e,t)}),Va=T("ZodNumber",(e,t)=>{pa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,s,a)=>Sa(e,r,s),Jt(e,"ZodNumber",{gt(r,s){return this.check(Ts(r,s))},gte(r,s){return this.check(Zn(r,s))},min(r,s){return this.check(Zn(r,s))},lt(r,s){return this.check(_s(r,s))},lte(r,s){return this.check(Vn(r,s))},max(r,s){return this.check(Vn(r,s))},int(r){return this.check(Rs(r))},safe(r){return this.check(Rs(r))},positive(r){return this.check(Ts(0,r))},nonnegative(r){return this.check(Zn(0,r))},negative(r){return this.check(_s(0,r))},nonpositive(r){return this.check(Vn(0,r))},multipleOf(r,s){return this.check(Es(r,s))},step(r,s){return this.check(Es(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function D(e){return fm(Va,e)}const Lf=T("ZodNumberFormat",(e,t)=>{bd.init(e,t),Va.init(e,t)});function Rs(e){return hm(Lf,e)}const Ff=T("ZodBoolean",(e,t)=>{xd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ja(e,n,r)});function we(e){return pm(Ff,e)}const Of=T("ZodUnknown",(e,t)=>{yd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ca()});function vr(){return gm(Of)}const Uf=T("ZodNever",(e,t)=>{vd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Na(e,n,r)});function Bf(e){return bm(Uf,e)}const Hf=T("ZodArray",(e,t)=>{wd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ea(e,n,r,s),e.element=t.element,Jt(e,"ZodArray",{min(n,r){return this.check(jn(n,r))},nonempty(n){return this.check(jn(1,n))},max(n,r){return this.check(va(n,r))},length(n,r){return this.check(wa(n,r))},unwrap(){return this.element}})});function he(e,t){return Tm(Hf,e,t)}const Vf=T("ZodObject",(e,t)=>{Sd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ma(e,n,r,s),re(e,"shape",()=>t.shape),Jt(e,"ZodObject",{keyof(){return Q(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:vr()})},loose(){return this.clone({...this._zod.def,catchall:vr()})},strict(){return this.clone({...this._zod.def,catchall:Bf()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Bl(this,n)},safeExtend(n){return Hl(this,n)},merge(n){return Vl(this,n)},pick(n){return Ol(this,n)},omit(n){return Ul(this,n)},partial(...n){return Zl(Wa,this,n[0])},required(...n){return Wl(Ya,this,n[0])}})});function P(e,t){const n={type:"object",shape:e??{},...Z(t)};return new Vf(n)}const Zf=T("ZodUnion",(e,t)=>{jd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Aa(e,n,r,s),e.options=t.options});function Wf(e,t){return new Zf({type:"union",options:e,...Z(t)})}const Yf=T("ZodIntersection",(e,t)=>{Nd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Pa(e,n,r,s)});function Gf(e,t){return new Yf({type:"intersection",left:e,right:t})}const $s=T("ZodRecord",(e,t)=>{Cd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ra(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function Ds(e,t,n){return!t||!t._zod?new $s({type:"record",keyType:B(),valueType:e,...Z(t)}):new $s({type:"record",keyType:e,valueType:t,...Z(n)})}const wr=T("ZodEnum",(e,t)=>{zd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(r,s,a)=>za(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const a={};for(const i of r)if(n.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new wr({...t,checks:[],...Z(s),entries:a})},e.exclude=(r,s)=>{const a={...t.entries};for(const i of r)if(n.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new wr({...t,checks:[],...Z(s),entries:a})}});function Q(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new wr({type:"enum",entries:n,...Z(t)})}const Xf=T("ZodTransform",(e,t)=>{_d.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ta(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ea(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Wt(a,n.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Wt(i))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(a=>(n.value=a,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function Za(e){return new Xf({type:"transform",transform:e})}const Wa=T("ZodOptional",(e,t)=>{xa.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Gr(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Is(e){return new Wa({type:"optional",innerType:e})}const qf=T("ZodExactOptional",(e,t)=>{Td.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Gr(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Kf(e){return new qf({type:"optional",innerType:e})}const Jf=T("ZodNullable",(e,t)=>{Ed.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>$a(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Ls(e){return new Jf({type:"nullable",innerType:e})}const Qf=T("ZodDefault",(e,t)=>{Md.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ia(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eh(e,t){return new Qf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ra(t)}})}const th=T("ZodPrefault",(e,t)=>{Ad.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>La(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function nh(e,t){return new th({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ra(t)}})}const Ya=T("ZodNonOptional",(e,t)=>{Pd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Da(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function rh(e,t){return new Ya({type:"nonoptional",innerType:e,...Z(t)})}const sh=T("ZodCatch",(e,t)=>{Rd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Fa(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oh(e,t){return new sh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ga=T("ZodPipe",(e,t)=>{ya.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Oa(e,n,r,s),e.in=t.in,e.out=t.out});function Fs(e,t){return new Ga({type:"pipe",in:e,out:t})}const ah=T("ZodPreprocess",(e,t)=>{Ga.init(e,t),$d.init(e,t)}),ih=T("ZodReadonly",(e,t)=>{Dd.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ua(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function ch(e){return new ih({type:"readonly",innerType:e})}const lh=T("ZodCustom",(e,t)=>{Id.init(e,t),ge.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_a(e,n)});function uh(e,t={}){return Em(lh,e,t)}function dh(e,t){return Mm(e,t)}function mh(e,t){return new ah({type:"pipe",in:Za(e),out:t})}function fh(e){return Ud(Ha,e)}const Os=P({x:D().int().min(0).describe("Column offset, 0-based"),y:D().int().min(0).describe("Row offset, 0-based"),w:D().int().min(1).describe("Width in grid columns"),h:D().int().min(1).describe("Height in grid rows")}),hh=P({id:B().describe("Unique instance id within the dashboard"),frame:B().describe("Name of a registered frame"),title:B().optional().describe(`Card title shown in the frame's chrome. Overrides the default (the frame type name) — set a meaningful per-instance label, e.g. the ticker on a price-chart ("TSLA"). Ignored by chrome-less frames like heading.`),position:Os,layouts:Ds(B(),Os).optional().describe('Per-mode layout overrides keyed by grid.mode (e.g. "flow-horizontal"). `position` is the canonical flow-vertical layout; this holds the other modes\' placements so each layout mode keeps its own independent arrangement. Editor-managed — agents only need to set `position`.'),config:Ds(B(),vr()).default({}).describe("Frame config; validated against the frame's own schema at render time")}),ph=P({type:Q(["none","gradient","unicorn"]).default("gradient").describe("Background style: 'gradient' (built-in dark glow), 'unicorn' (animated Unicorn Studio scene), or 'none'."),projectId:B().optional().describe("Unicorn Studio public project id — required when type is 'unicorn'."),scale:D().min(.1).max(2).default(1).describe("Unicorn scene render scale."),dpi:D().min(.5).max(3).default(1.5).describe("Unicorn scene device-pixel-ratio cap (perf vs sharpness)."),opacity:D().min(0).max(1).default(.16).describe("Opacity of the unicorn scene (0–1). Keep moderate (~0.15) so the animation reads as a living backdrop in the gutters without competing with the (opaque) dashboard cards.")}).describe("Visual background rendered behind the whole dashboard."),gh=P({accentHue:D().int().min(0).max(360).default(242).describe("Brand accent hue in degrees on the HSL color wheel (0–360). Rotates the dashboard's accent — card rims, title dots, chart highlights, loading states — across the spectrum. 242 is the default zframes indigo; rough anchors: 0 red, 35 orange, 50 amber, 150 green, 190 teal, 210 blue, 280 violet, 330 pink. Semantic up/down green/red, asset logos, and per-frame chart colors stay fixed."),accentSat:D().min(0).max(100).default(90).describe("Accent saturation as an HSL percentage (0–100). 90 is the default vivid zframes accent; lower it for muted/pastel rims and dots, 0 for a near-grayscale monochrome accent. Pairs with accentHue — hue picks the color, saturation picks how vivid it is."),baseHue:D().int().min(0).max(360).default(233).describe("Hue of the dark card surface itself, in degrees (0–360). 233 is the default near-black indigo-navy; rotate it to re-temperature every card — e.g. 30 warms toward charcoal-brown, 150 toward deep forest, 210 toward cool slate. The surface stays dark (lightness is fixed); only its tint moves. Independent of accentHue, which only colours rims/highlights."),baseSat:D().min(0).max(100).default(20).describe("Saturation of the dark card surface as an HSL percentage (0–100). 20 is the default subtle navy tint; raise it for a richer coloured-black surface, drop it toward 0 for a neutral graphite/black with no colour cast. Pairs with baseHue."),upColor:B().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #3fd08f").default("#3fd08f").describe("Semantic colour for gains / positive change / bullish (up). 6-digit hex; default #3fd08f (green). Tints every gain delta, mover row, up-candle, and 'long'/'call' marker. Set this and downColor to a non-green/red pair (e.g. blue/orange) for a colourblind-friendly dashboard. Distinct from the accent (which is brand colour, not meaning) and from the error red."),downColor:B().regex(/^#[0-9a-fA-F]{6}$/,"must be a 6-digit hex colour like #ff6b81").default("#ff6b81").describe("Semantic colour for losses / negative change / bearish (down). 6-digit hex; default #ff6b81 (red). The counterpart to upColor — tints every loss delta, mover row, down-candle, and 'short'/'put' marker.")}).describe("Dashboard-wide colour identity — accent (rims/highlights), the dark card-surface tint (base), and the semantic up/down (gain/loss) colours."),bh=P({fontFamily:Q(["sans","mono","serif"]).default("sans").describe("Type family for all dashboard text. 'sans' is the default DM Sans (clean, modern); 'mono' switches to a monospaced system stack (a Bloomberg/terminal feel, numbers in fixed columns); 'serif' uses a system serif (editorial). Affects card titles, labels, and readouts alike."),numericStyle:Q(["proportional","tabular"]).default("proportional").describe("How digits are spaced everywhere on the dashboard. 'proportional' is the default (natural widths); 'tabular' forces fixed-width figures (font-variant-numeric: tabular-nums) so live prices and tickers stop shifting sideways as digits change — recommended for number-dense dashboards. Hero stat numerals are always tabular regardless."),scale:D().min(.85).max(1.25).default(1).describe("Global text-size multiplier (0.85–1.25). 1 is the default. Scales all dashboard text together by setting the root font size, so chart labels, readouts, and titles grow or shrink as one — raise it for legibility on a large display, lower it to pack more in. Distinct from appearance.density, which scales card padding, not text. Grid cell heights are in pixels and stay fixed, so text can overflow a small card at high scale.")}).describe("Dashboard-wide typography — font family, numeric digit style, and global text scale."),xh={sans:'"DM Sans", sans-serif',mono:'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace',serif:'ui-serif, Georgia, "Times New Roman", serif'},yh={proportional:"normal",tabular:"tabular-nums"},vh=P({radius:D().min(0).default(18).describe("Frame corner radius in pixels, applied to every card via --zf-frame-radius. 0 squares the corners; the editor's Appearance rail exposes this as a slider."),borderStrength:D().min(0).max(1).default(.22).describe("Opacity of each card's accent rim (0–1) via --zf-border-alpha. 0 = borderless flat cards, 1 = a solid outlined rim; 0.22 is the default soft edge. Hover lifts it a notch automatically."),surfaceOpacity:D().min(.3).max(1).default(1).describe("Opacity of the card surface (0.3–1) via --zf-surface-opacity. 1 = opaque cards (default); lower it toward 0.5 for frosted/glassy cards that let the dashboard background show through. Kept ≥0.3 so card content stays legible."),density:D().min(.6).max(1.4).default(1).describe("Card padding scale (0.6–1.4) via --zf-density. 1 = the comfortable default; <1 tightens padding for information-dense dashboards, >1 gives roomier breathing space."),elevation:D().min(0).max(2).default(1).describe("Card shadow depth (0–2) via --zf-elevation. 0 = flat (no drop shadow), 1 = the default resting shadow, 2 = a heavier floating lift. Scales the card's drop shadow only.")}).describe("Card surface treatment — corners, border, opacity, padding density, and shadow depth. Distinct from `grid` (geometry) and `theme` (accent color)."),wh=mh(e=>{if(!e||typeof e!="object")return e;const t=e,n=t.grid;if(n&&typeof n=="object"&&"radius"in n){const{radius:r,...s}=n;return{...t,grid:s,appearance:{radius:r,...t.appearance??{}}}}return e},P({version:fh().default("1.0.0").describe('Spec version, a semver-style string like package.json\'s ("1.0.0"). A legacy numeric `1` from an older spec is coerced to "1".'),title:B().describe("Dashboard name, like package.json's name."),author:B().optional().describe(`Who made this dashboard — a free-form credit, like package.json's author ("You" or "You <you@example.com>"). Optional.`),grid:P({mode:Q(["flow-vertical","flow-horizontal","canvas"]).default("flow-vertical").describe("Layout model. 'flow-vertical' (default): a fixed number of columns fill the viewport width; the board grows downward and scrolls vertically — the classic dashboard. 'flow-horizontal': a fixed number of rows fill the viewport height; the board grows rightward and scrolls horizontally — suited to ultrawide and wall displays. 'canvas': an unbounded pan/zoom plane (not yet implemented; rendered as flow-vertical for now)."),columns:D().int().min(1).default(12).describe("Number of columns the grid is divided into across the viewport width (flow-vertical). A frame's `position` x/w are in these column units."),rowHeight:D().min(8).default(96).describe("Pixel height of each grid row (flow-vertical). A frame's `position` y/h are in these row units."),rows:D().int().min(1).default(6).describe('Number of height-bounded rows the horizontal board (flow-horizontal) fills before it scrolls sideways. A frame\'s `layouts["flow-horizontal"]` y/h are in these row units. Ignored in flow-vertical.'),gap:D().min(0).default(12).describe("Pixels of space between frames (the grid gutter). 0 makes the cards flush; the editor's Layout rail exposes this as a slider.")}).default({mode:"flow-vertical",columns:12,rowHeight:96,rows:6,gap:12}),background:ph.default({type:"gradient",scale:1,dpi:1.5,opacity:.16}),theme:gh.default({accentHue:242,accentSat:90,baseHue:233,baseSat:20,upColor:"#3fd08f",downColor:"#ff6b81"}),typography:bh.default({fontFamily:"sans",numericStyle:"proportional",scale:1}),appearance:vh.default({radius:18,borderStrength:.22,surfaceOpacity:1,density:1,elevation:1}),frames:he(hh)})),Xa=f.createContext([]);function kh({providers:e,children:t}){const n=Array.isArray(e)?e:[e];return o.jsx(Xa.Provider,{value:n,children:t})}function In(){return f.useContext(Xa)}function q(e){return In().find(n=>n.capabilities.includes(e))??null}function K(e,t,n,r){const[s,a]=f.useState(t),[i,c]=f.useState(!0);return f.useEffect(()=>{if(!e){c(!1);return}let l=!1;a(t),c(!0);const u=()=>{e().then(m=>{l||(a(m),c(!1))}).catch(()=>{l||c(!1)})};u();let d;const h=()=>{d=setTimeout(()=>{u(),h()},r*(.85+Math.random()*.3))};return h(),()=>{l=!0,clearTimeout(d)}},n),{data:s,isLoading:i}}function qa(e){const t=q("quote-stream"),[n,r]=f.useState({}),[s,a]=f.useState(!0),i=e.join(",");return f.useEffect(()=>{const c=i.split(",").filter(Boolean);if(r({}),!(t!=null&&t.subscribeMids)||c.length===0){a(!1);return}let l=!1,u=!1;a(!0);const d=setTimeout(()=>{!l&&!u&&a(!1)},8e3),h=t.subscribeMids(m=>{l||(u=!0,clearTimeout(d),a(!1),r(p=>{let x=!1;const b={};for(const y of c){const g=m[y];g!==void 0&&(b[y]=g,g!==p[y]&&(x=!0))}return Object.keys(p).length!==Object.keys(b).length&&(x=!0),x?b:p}))},c);return()=>{l=!0,clearTimeout(d),h()}},[t,i]),{mids:n,isLoading:s}}function Pt(e){return qa(e).mids}function Xr(e,t=3e4){const n=q("day-stats"),r=e?e.join(","):"*",s=r==="*"?void 0:r.split(",").filter(Boolean),{data:a,isLoading:i}=K(n!=null&&n.getDayStats?()=>n.getDayStats(s):null,{},[n,r,t],t);return{stats:a,isLoading:i}}function Yt(e,t=3e4){return Xr(e,t).stats}function Ka(e,t,n=5*6e4){const r=q("funding-history"),s=e.join(","),a=s.split(",").filter(Boolean),{data:i,isLoading:c}=K(r!=null&&r.getFundingHistory&&a.length>0?()=>r.getFundingHistory(a,t):null,{},[r,s,t,n],n);return{history:i,isLoading:c}}function Sh(e,t,n,r=6e4){const s=q("ohlcv"),{data:a,isLoading:i}=K(s!=null&&s.getCandles&&e?()=>s.getCandles(e,t,n):null,[],[s,e,t,n,r],r);return{candles:a,isLoading:i}}function jh(e,t,n,r=6e4){const s=q("ohlcv"),a=e.join(","),i=a.split(",").filter(Boolean),{data:c,isLoading:l}=K(s!=null&&s.getCandles&&i.length>0?async()=>{const u=await Promise.all(i.map(d=>s.getCandles(d,t,n).then(h=>[d,h]).catch(()=>[d,[]])));return Object.fromEntries(u)}:null,{},[s,a,t,n,r],r);return{candles:c,isLoading:l}}function Nh(e=10*6e4){const t=q("tvl"),{data:n,isLoading:r}=K(t!=null&&t.getTvlByChain?()=>t.getTvlByChain():null,[],[t,e],e);return{entries:n,isLoading:r}}function Ch(e=10*6e4){const t=q("dex-volume"),{data:n,isLoading:r}=K(t!=null&&t.getDexVolume?()=>t.getDexVolume():null,[],[t,e],e);return{entries:n,isLoading:r}}function zh(e,t=5*6e4){const n=q("dex-volume"),r=e.join(","),s=r.split(",").filter(Boolean),{data:a,isLoading:i}=K(n!=null&&n.getDexVolumeHistory&&s.length>0?()=>n.getDexVolumeHistory(s):null,{},[n,r,t],t);return{history:a,isLoading:i}}function _h(e=10*6e4){const t=q("protocol-tvl"),{data:n,isLoading:r}=K(t!=null&&t.getProtocolTvl?()=>t.getProtocolTvl():null,[],[t,e],e);return{entries:n,isLoading:r}}function Th(e,t=5*6e4){const n=q("protocol-tvl"),r=e.join(","),s=r.split(",").filter(Boolean),{data:a,isLoading:i}=K(n!=null&&n.getProtocolTvlHistory&&s.length>0?()=>n.getProtocolTvlHistory(s):null,{},[n,r,t],t);return{history:a,isLoading:i}}function Eh(e=10*6e4){const t=q("protocol-fees"),{data:n,isLoading:r}=K(t!=null&&t.getProtocolFees?()=>t.getProtocolFees():null,[],[t,e],e);return{entries:n,isLoading:r}}function Mh(e=10*6e4){const t=q("coin-markets"),{data:n,isLoading:r}=K(t!=null&&t.getCoinMarkets?()=>t.getCoinMarkets():null,[],[t,e],e);return{entries:n,isLoading:r}}function Ah(e=300,t=15*6e4){const n=q("coin-movers"),{data:r,isLoading:s}=K(n!=null&&n.getCoinMovers?()=>n.getCoinMovers(e):null,[],[n,e,t],t);return{entries:r,isLoading:s}}function Ph(e,t=3e4){const n=q("open-interest"),r=e?e.join(","):"*",s=r==="*"?void 0:r.split(",").filter(Boolean),{data:a,isLoading:i}=K(n!=null&&n.getOpenInterest?()=>n.getOpenInterest(s):null,[],[n,r,t],t);return{entries:a,isLoading:i}}function Rh(e=15*6e4){const t=q("global-market"),{data:n,isLoading:r}=K(t!=null&&t.getGlobalMarket?()=>t.getGlobalMarket():null,null,[t,e],e);return{market:n,isLoading:r}}function $h(e=30,t=60*6e4){const n=q("sentiment"),{data:r,isLoading:s}=K(n!=null&&n.getFearGreed?()=>n.getFearGreed(e):null,[],[n,e,t],t);return{points:r,isLoading:s}}function Dh(e=15*6e4){const t=q("reference-rates"),{data:n,isLoading:r}=K(t!=null&&t.getReferenceRates?()=>t.getReferenceRates():null,[],[t,e],e);return{rates:n,isLoading:r}}function Ih(e=360*6e4){const t=q("treasury-rates"),{data:n,isLoading:r}=K(t!=null&&t.getTreasuryAverageRates?()=>t.getTreasuryAverageRates():null,[],[t,e],e);return{rates:n,isLoading:r}}function Lh(e=360*6e4){const t=q("yield-curve"),{data:n,isLoading:r}=K(t!=null&&t.getYieldCurve?()=>t.getYieldCurve():null,null,[t,e],e);return{curve:n,isLoading:r}}function Fh(e=8,t=360*6e4){const n=q("treasury-auctions"),{data:r,isLoading:s}=K(n!=null&&n.getTreasuryAuctions?()=>n.getTreasuryAuctions(e):null,[],[n,e,t],t);return{auctions:r,isLoading:s}}function Oh(e=180,t=360*6e4){const n=q("national-debt"),{data:r,isLoading:s}=K(n!=null&&n.getNationalDebt?()=>n.getNationalDebt(e):null,null,[n,e,t],t);return{debt:r,isLoading:s}}function Uh(e=360*6e4){const t=q("financial-stress"),{data:n,isLoading:r}=K(t!=null&&t.getFinancialStress?()=>t.getFinancialStress():null,null,[t,e],e);return{stress:n,isLoading:r}}function kr(e,t,n,r=720*6e4){const s=q("macro-series"),{data:a,isLoading:i}=K(s!=null&&s.getMacroSeries&&e?()=>s.getMacroSeries(e,t,n):null,null,[s,e,t,n,r],r);return{series:a,isLoading:i}}function Bh(e,t=30*6e4){const n=q("filings"),{data:r,isLoading:s}=K(n!=null&&n.getCompanyFilings&&e?()=>n.getCompanyFilings(e):null,null,[n,e,t],t);return{data:r,isLoading:s}}function Hh(e,t=720*6e4){const n=q("fundamentals"),{data:r,isLoading:s}=K(n!=null&&n.getCompanyFacts&&e?()=>n.getCompanyFacts(e):null,null,[n,e,t],t);return{data:r,isLoading:s}}function Vh(e,t=360*6e4){const n=q("short-volume"),r=e.join(","),s=r.split(",").filter(Boolean),{data:a,isLoading:i}=K(n!=null&&n.getShortVolume&&s.length>0?()=>n.getShortVolume(s):null,{},[n,r,t],t);return{data:a,isLoading:i}}function Zh(e,t,n,r=5*6e4){const s=q("news"),a=t?t.join(","):"",{data:i,isLoading:c}=K(s!=null&&s.getNews&&e?()=>s.getNews({feed:e,symbols:a?a.split(","):void 0,limit:n}):null,[],[s,e,a,n,r],r);return{items:i,isLoading:c}}function Wh(e=3e4){const t=q("btc-fees"),{data:n,isLoading:r}=K(t!=null&&t.getBtcFees?()=>t.getBtcFees():null,null,[t,e],e);return{fees:n,isLoading:r}}function Yh(e=15e3){const t=q("btc-mempool"),{data:n,isLoading:r}=K(t!=null&&t.getMempoolState?()=>t.getMempoolState():null,null,[t,e],e);return{state:n,isLoading:r}}function Gh(e=8,t=3e4){const n=q("btc-blocks"),{data:r,isLoading:s}=K(n!=null&&n.getBtcBlocks?()=>n.getBtcBlocks(e):null,[],[n,e,t],t);return{blocks:r,isLoading:s}}function Xh(e="1y",t=30*6e4){const n=q("btc-hashrate"),{data:r,isLoading:s}=K(n!=null&&n.getNetworkHashrate?()=>n.getNetworkHashrate(e):null,null,[n,e,t],t);return{data:r,isLoading:s}}function qh(e=6e4){const t=q("btc-difficulty"),{data:n,isLoading:r}=K(t!=null&&t.getDifficultyAdjustment?()=>t.getDifficultyAdjustment():null,null,[t,e],e);return{adjustment:n,isLoading:r}}function Kh(e="1w",t=5*6e4){const n=q("mining-pools"),{data:r,isLoading:s}=K(n!=null&&n.getMiningPools?()=>n.getMiningPools(e):null,null,[n,e,t],t);return{pools:r,isLoading:s}}function Jh(e=30*6e4){const t=q("lightning-stats"),{data:n,isLoading:r}=K(t!=null&&t.getLightningStats?()=>t.getLightningStats():null,null,[t,e],e);return{stats:n,isLoading:r}}function Ja(e,t=5*6e4){const n=q("options-summary"),r=(e||"BTC").toUpperCase(),{data:s,isLoading:a}=K(n!=null&&n.getOptionsSummary?()=>n.getOptionsSummary(r):null,null,[n,r,t],t);return{summary:s,isLoading:a}}function Qh(e,t=6e4){const n=In(),r=e?n.find(c=>{var l;return!!c.getPortfolio&&c.capabilities.includes("portfolio")&&(((l=c.portfolioKinds)==null?void 0:l.includes(e.kind))??!0)})??null:null,s=e?`${e.kind}:${e.address??""}`:"",{data:a,isLoading:i}=K(r&&e?()=>r.getPortfolio(e):null,null,[r,s,t],t);return{portfolio:a,isLoading:i}}function ep(e,t,n=43200,r=10*6e4){const s=q("volatility-index"),a=(e||"BTC").toUpperCase(),{data:i,isLoading:c}=K(s!=null&&s.getVolatilityIndex?()=>s.getVolatilityIndex(a,t,n):null,[],[s,a,t,n,r],r);return{points:i,isLoading:c}}const tp=f.createContext(null);function Ln(){return f.useContext(tp)}const np=`
|
|
66
|
-
.zf-grid {
|
|
67
|
-
display: grid;
|
|
68
|
-
gap: var(--zf-gap, 12px);
|
|
69
|
-
grid-template-columns: repeat(var(--zf-cols, 12), minmax(0, 1fr));
|
|
70
|
-
grid-auto-rows: var(--zf-row-h, 96px);
|
|
71
|
-
/* Bridge the type family onto the dashboard subtree: redefine --font-dmsans
|
|
72
|
-
HERE (where --zf-font-family is set inline) so the chart utilities and frame
|
|
73
|
-
titles that read var(--font-dmsans) pick up the chosen family. Declaring it
|
|
74
|
-
on this container — not at :root — is what makes the var() substitution see
|
|
75
|
-
the inline --zf-font-family. (The editor mirrors this on .zf-editor.) */
|
|
76
|
-
--font-dmsans: var(--zf-font-family, "DM Sans", sans-serif);
|
|
77
|
-
}
|
|
78
|
-
/* flow-horizontal: the board is bounded to the viewport height as --zf-h-rows
|
|
79
|
-
equal bands and grows rightward, scrolling sideways. The vertical position
|
|
80
|
-
can't be honoured here (its y runs to 100+ rows), so each frame uses its own
|
|
81
|
-
stored horizontal layout instead: the renderer emits real --zf-col/row-start
|
|
82
|
-
for a frame that HAS a horizontal layout (explicit placement, via the base
|
|
83
|
-
.zf-frame rule), and OMITS them for one that doesn't (the auto var-fallback)
|
|
84
|
-
so grid-auto-flow: column dense packs it by w/h size — the fallback for
|
|
85
|
-
un-edited / agent-generated specs. Column tracks reuse the vertical row height
|
|
86
|
-
(--zf-row-h) so cells stay roughly square. Gated above the phone breakpoint so
|
|
87
|
-
phones keep the single-column reflow below. */
|
|
88
|
-
@media (min-width: 641px) {
|
|
89
|
-
.zf-grid.zf-flow-horizontal {
|
|
90
|
-
grid-template-columns: none;
|
|
91
|
-
grid-template-rows: repeat(var(--zf-h-rows, 6), minmax(0, 1fr));
|
|
92
|
-
grid-auto-flow: column dense;
|
|
93
|
-
grid-auto-columns: var(--zf-row-h, 96px);
|
|
94
|
-
height: var(--zf-h-height, calc(100vh - 220px));
|
|
95
|
-
min-height: 420px;
|
|
96
|
-
overflow-x: auto;
|
|
97
|
-
overflow-y: hidden;
|
|
98
|
-
align-content: stretch;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
.zf-frame {
|
|
102
|
-
grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
|
|
103
|
-
grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
|
|
104
|
-
position: relative;
|
|
105
|
-
display: flex;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
min-height: 0;
|
|
108
|
-
overflow: hidden;
|
|
109
|
-
padding: calc(16px * var(--zf-density, 1)) calc(18px * var(--zf-density, 1));
|
|
110
|
-
/* Digit spacing for everything inside the card. Default \`normal\` is a no-op;
|
|
111
|
-
spec.typography.numericStyle="tabular" sets --zf-numeric so live prices stop
|
|
112
|
-
jittering. Hero numerals carry their own tabular-nums regardless. */
|
|
113
|
-
font-variant-numeric: var(--zf-numeric, normal);
|
|
114
|
-
/* Card surface. The three dark stops are expressed off --zf-base-hue /
|
|
115
|
-
--zf-base-sat (spec.theme) with their lightness baked, so the default
|
|
116
|
-
hsl(233 20% …) reproduces the original navy to within ~1/255, while the base
|
|
117
|
-
knobs let the whole surface warm, cool, or desaturate toward black. */
|
|
118
|
-
background: var(--zf-frame-bg, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / calc(0.82 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / calc(0.86 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / calc(0.9 * var(--zf-surface-opacity, 1))) 100%));
|
|
119
|
-
border: 1px solid var(--zf-frame-border, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / var(--zf-border-alpha, 0.22)));
|
|
120
|
-
border-radius: var(--zf-frame-radius, 18px);
|
|
121
|
-
box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(18px * var(--zf-elevation, 1)) calc(44px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.9));
|
|
122
|
-
transition:
|
|
123
|
-
border-color 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
124
|
-
background 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
125
|
-
box-shadow 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
126
|
-
transform 0.25s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
127
|
-
/* Frames arrive in a soft top-down cascade on first paint. The translate
|
|
128
|
-
property (not transform) carries the motion, so the hover lift stays
|
|
129
|
-
independent; the backwards fill holds the hidden state through the stagger
|
|
130
|
-
delay, then hands transform back to :hover once the entrance settles. */
|
|
131
|
-
animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
|
|
132
|
-
animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
|
|
133
|
-
}
|
|
134
|
-
/* Hover lift is pointer-only — on touch it would stick after a tap. */
|
|
135
|
-
@media (hover: hover) {
|
|
136
|
-
.zf-frame:hover {
|
|
137
|
-
border-color: var(--zf-frame-border-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / calc(var(--zf-border-alpha, 0.22) + 0.2)));
|
|
138
|
-
background: var(--zf-frame-bg-hover, linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 16.5% / calc(0.88 * var(--zf-surface-opacity, 1))) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 9% / calc(0.9 * var(--zf-surface-opacity, 1))) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 6.3% / calc(0.92 * var(--zf-surface-opacity, 1))) 100%));
|
|
139
|
-
box-shadow: var(--zf-frame-shadow-hover, inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 1px 2px rgba(0, 0, 0, 0.4), 0 calc(26px * var(--zf-elevation, 1)) calc(56px * var(--zf-elevation, 1)) -26px rgba(0, 0, 0, 0.92), 0 0 0 1px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.12), 0 calc(20px * var(--zf-elevation, 1)) calc(60px * var(--zf-elevation, 1)) -28px hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.4)));
|
|
140
|
-
transform: translateY(-2px);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/* Top edge sheen — inset past the corner radius so the bright line never
|
|
144
|
-
pokes outside the rounded border (which read as a clipped corner). */
|
|
145
|
-
.zf-frame::before {
|
|
146
|
-
content: '';
|
|
147
|
-
position: absolute;
|
|
148
|
-
top: 0;
|
|
149
|
-
left: 18px;
|
|
150
|
-
right: 18px;
|
|
151
|
-
height: 1px;
|
|
152
|
-
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
|
|
153
|
-
pointer-events: none;
|
|
154
|
-
z-index: 2;
|
|
155
|
-
}
|
|
156
|
-
.zf-frame-title {
|
|
157
|
-
position: relative;
|
|
158
|
-
z-index: 1;
|
|
159
|
-
display: flex;
|
|
160
|
-
align-items: center;
|
|
161
|
-
gap: 7px;
|
|
162
|
-
margin-bottom: 12px;
|
|
163
|
-
font-family: var(--font-dmsans, inherit);
|
|
164
|
-
/* rem (not px) so spec.typography.scale — applied as the root font size by the
|
|
165
|
-
host — grows the card title along with the rem-based chart text it sits above.
|
|
166
|
-
0.625rem = 10px at the default root size, so scale 1 is a no-op. */
|
|
167
|
-
font-size: 0.625rem;
|
|
168
|
-
font-weight: 700;
|
|
169
|
-
letter-spacing: 0.14em;
|
|
170
|
-
text-transform: uppercase;
|
|
171
|
-
color: var(--zf-frame-title, rgba(255, 255, 255, 0.5));
|
|
172
|
-
flex: none;
|
|
173
|
-
}
|
|
174
|
-
.zf-frame-title::before {
|
|
175
|
-
content: '';
|
|
176
|
-
width: 5px;
|
|
177
|
-
height: 5px;
|
|
178
|
-
border-radius: 9999px;
|
|
179
|
-
background: var(--zf-frame-title-dot, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%));
|
|
180
|
-
box-shadow: 0 0 8px var(--zf-frame-title-dot-glow, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76% / 0.9));
|
|
181
|
-
}
|
|
182
|
-
/* A title with a leading icon (e.g. an asset logo) drops the status dot — the
|
|
183
|
-
logo is the card's identity marker. */
|
|
184
|
-
.zf-frame-title--icon::before { display: none; }
|
|
185
|
-
/* The title label takes the remaining width and truncates so a long title
|
|
186
|
-
never shoves the source credit off the card. */
|
|
187
|
-
.zf-frame-title-text {
|
|
188
|
-
min-width: 0;
|
|
189
|
-
overflow: hidden;
|
|
190
|
-
text-overflow: ellipsis;
|
|
191
|
-
white-space: nowrap;
|
|
192
|
-
}
|
|
193
|
-
/* Data-source credit — a clickable provider link pinned to the right of the
|
|
194
|
-
title row. Brand casing is preserved (text-transform reset) so DeFiLlama /
|
|
195
|
-
alternative.me read correctly against the uppercase title. */
|
|
196
|
-
.zf-frame-source {
|
|
197
|
-
margin-left: auto;
|
|
198
|
-
padding-left: 10px;
|
|
199
|
-
display: inline-flex;
|
|
200
|
-
align-items: center;
|
|
201
|
-
gap: 5px;
|
|
202
|
-
flex: none;
|
|
203
|
-
text-transform: none;
|
|
204
|
-
letter-spacing: 0;
|
|
205
|
-
font-weight: 600;
|
|
206
|
-
}
|
|
207
|
-
.zf-frame-source a {
|
|
208
|
-
color: var(--zf-frame-source, rgba(255, 255, 255, 0.42));
|
|
209
|
-
text-decoration: none;
|
|
210
|
-
transition: color 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
211
|
-
white-space: nowrap;
|
|
212
|
-
}
|
|
213
|
-
@media (hover: hover) {
|
|
214
|
-
.zf-frame-source a:hover {
|
|
215
|
-
color: var(--zf-frame-source-hover, hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 80%));
|
|
216
|
-
text-decoration: underline;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
.zf-frame-source-sep { color: rgba(255, 255, 255, 0.22); }
|
|
220
|
-
.zf-frame-body {
|
|
221
|
-
position: relative;
|
|
222
|
-
z-index: 1;
|
|
223
|
-
flex: 1;
|
|
224
|
-
min-height: 0;
|
|
225
|
-
display: flex;
|
|
226
|
-
flex-direction: column;
|
|
227
|
-
}
|
|
228
|
-
.zf-frame-body > * {
|
|
229
|
-
flex: 1;
|
|
230
|
-
min-height: 0;
|
|
231
|
-
}
|
|
232
|
-
/* ── Error cards ────────────────────────────────────────────────────────────
|
|
233
|
-
Unknown frame / missing capability / invalid config / runtime crash all share
|
|
234
|
-
one centered empty-state: an alert glyph, a headline naming what's wrong, the
|
|
235
|
-
frame's name, then the specific detail. Centered (not top-left) so the card
|
|
236
|
-
reads as a deliberate state instead of a raw debug dump floating in a void —
|
|
237
|
-
and a faint red top-bloom signals "error" across the whole surface, not just
|
|
238
|
-
the 1px border. This is also the generating agent's feedback surface, so the
|
|
239
|
-
detail stays precise (field paths, the exact missing capability/provider). */
|
|
240
|
-
.zf-frame--error {
|
|
241
|
-
border-color: var(--zf-frame-error-border, rgba(242, 21, 83, 0.42));
|
|
242
|
-
background: var(
|
|
243
|
-
--zf-frame-error-bg,
|
|
244
|
-
radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
|
|
245
|
-
linear-gradient(165deg, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 12.5% / 0.82) 0%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 7% / 0.86) 60%, hsl(var(--zf-base-hue, 233) var(--zf-base-sat, 20%) 5.3% / 0.9) 100%)
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
@media (hover: hover) {
|
|
249
|
-
.zf-frame--error:hover {
|
|
250
|
-
border-color: var(--zf-frame-error-border-hover, rgba(242, 21, 83, 0.6));
|
|
251
|
-
background: var(
|
|
252
|
-
--zf-frame-error-bg,
|
|
253
|
-
radial-gradient(125% 80% at 50% -12%, rgba(242, 21, 83, 0.13), transparent 60%),
|
|
254
|
-
linear-gradient(165deg, rgba(26, 27, 38, 0.82) 0%, rgba(14, 15, 22, 0.86) 60%, rgba(10, 11, 17, 0.9) 100%)
|
|
255
|
-
);
|
|
256
|
-
box-shadow: var(--zf-frame-shadow, inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px -26px rgba(0, 0, 0, 0.9)), 0 0 0 1px rgba(242, 21, 83, 0.14), 0 20px 56px -30px rgba(242, 21, 83, 0.4);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
/* The centered stack. flex:1 lets it claim the whole card; the inner content
|
|
260
|
-
stays its natural height and is centered around the card's middle, so a 2×1
|
|
261
|
-
card and a 6×4 card both read as composed rather than top-anchored. */
|
|
262
|
-
.zf-error {
|
|
263
|
-
flex: 1;
|
|
264
|
-
min-height: 0;
|
|
265
|
-
display: flex;
|
|
266
|
-
flex-direction: column;
|
|
267
|
-
align-items: center;
|
|
268
|
-
justify-content: center;
|
|
269
|
-
gap: 8px;
|
|
270
|
-
padding: 4px 2px;
|
|
271
|
-
text-align: center;
|
|
272
|
-
overflow: auto;
|
|
273
|
-
}
|
|
274
|
-
.zf-error-icon {
|
|
275
|
-
flex: none;
|
|
276
|
-
width: 38px;
|
|
277
|
-
height: 38px;
|
|
278
|
-
display: grid;
|
|
279
|
-
place-items: center;
|
|
280
|
-
border-radius: 12px;
|
|
281
|
-
color: var(--zf-frame-error-text, #ff8b9d);
|
|
282
|
-
background: rgba(242, 21, 83, 0.12);
|
|
283
|
-
box-shadow: inset 0 0 0 1px rgba(242, 21, 83, 0.32),
|
|
284
|
-
0 0 24px -8px rgba(242, 21, 83, 0.6);
|
|
285
|
-
}
|
|
286
|
-
.zf-error-icon svg {
|
|
287
|
-
display: block;
|
|
288
|
-
width: 20px;
|
|
289
|
-
height: 20px;
|
|
290
|
-
}
|
|
291
|
-
.zf-error-headline {
|
|
292
|
-
font-family: var(--font-dmsans, inherit);
|
|
293
|
-
font-size: 13px;
|
|
294
|
-
font-weight: 700;
|
|
295
|
-
letter-spacing: 0.01em;
|
|
296
|
-
color: var(--zf-frame-error-headline, rgba(255, 255, 255, 0.92));
|
|
297
|
-
}
|
|
298
|
-
.zf-error-frame {
|
|
299
|
-
margin-top: -3px;
|
|
300
|
-
font-size: 10px;
|
|
301
|
-
font-weight: 700;
|
|
302
|
-
letter-spacing: 0.14em;
|
|
303
|
-
text-transform: uppercase;
|
|
304
|
-
color: var(--zf-frame-error-text, #ff8b9d);
|
|
305
|
-
}
|
|
306
|
-
.zf-error-detail {
|
|
307
|
-
margin: 2px 0 0;
|
|
308
|
-
max-width: 44ch;
|
|
309
|
-
font-size: 12px;
|
|
310
|
-
line-height: 1.5;
|
|
311
|
-
color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.6));
|
|
312
|
-
}
|
|
313
|
-
.zf-error-detail code {
|
|
314
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
315
|
-
font-size: 0.92em;
|
|
316
|
-
}
|
|
317
|
-
/* Per-issue rows for invalid config: the field path as a code chip, the Zod
|
|
318
|
-
message beside it. Block-centered but left-aligned inside, so a one-field
|
|
319
|
-
error sits dead-centre and a multi-field one reads as a tidy list. */
|
|
320
|
-
.zf-error-issues {
|
|
321
|
-
list-style: none;
|
|
322
|
-
margin: 2px 0 0;
|
|
323
|
-
padding: 0;
|
|
324
|
-
max-width: 100%;
|
|
325
|
-
display: flex;
|
|
326
|
-
flex-direction: column;
|
|
327
|
-
gap: 6px;
|
|
328
|
-
text-align: left;
|
|
329
|
-
}
|
|
330
|
-
.zf-error-issue {
|
|
331
|
-
display: flex;
|
|
332
|
-
flex-wrap: wrap;
|
|
333
|
-
align-items: baseline;
|
|
334
|
-
gap: 7px;
|
|
335
|
-
padding: 6px 10px;
|
|
336
|
-
border-radius: 9px;
|
|
337
|
-
background: rgba(0, 0, 0, 0.22);
|
|
338
|
-
border: 1px solid rgba(242, 21, 83, 0.18);
|
|
339
|
-
}
|
|
340
|
-
.zf-error-field {
|
|
341
|
-
flex: none;
|
|
342
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
343
|
-
font-size: 11px;
|
|
344
|
-
font-weight: 700;
|
|
345
|
-
color: var(--zf-frame-error-text, #ff8b9d);
|
|
346
|
-
background: rgba(242, 21, 83, 0.14);
|
|
347
|
-
padding: 1px 6px;
|
|
348
|
-
border-radius: 5px;
|
|
349
|
-
}
|
|
350
|
-
.zf-error-msg {
|
|
351
|
-
min-width: 0;
|
|
352
|
-
font-size: 12px;
|
|
353
|
-
line-height: 1.4;
|
|
354
|
-
color: var(--zf-frame-error-detail, rgba(255, 255, 255, 0.68));
|
|
355
|
-
}
|
|
356
|
-
/* Registered-frame list under an "unknown frame" card — quiet, it's reference. */
|
|
357
|
-
.zf-error-list {
|
|
358
|
-
margin-top: 4px;
|
|
359
|
-
font-size: 11px;
|
|
360
|
-
line-height: 1.5;
|
|
361
|
-
color: rgba(255, 255, 255, 0.4);
|
|
362
|
-
}
|
|
363
|
-
/* Bare frames (headings) divide a dashboard into zones — positioned slot,
|
|
364
|
-
no card chrome, no auto-title. */
|
|
365
|
-
.zf-bare {
|
|
366
|
-
grid-column: var(--zf-col-start, auto) / span var(--zf-col-span, 1);
|
|
367
|
-
grid-row: var(--zf-row-start, auto) / span var(--zf-row-span, 1);
|
|
368
|
-
display: flex;
|
|
369
|
-
align-items: flex-end;
|
|
370
|
-
min-height: 0;
|
|
371
|
-
overflow: hidden;
|
|
372
|
-
animation: zf-enter 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) backwards;
|
|
373
|
-
animation-delay: min(calc((var(--zf-enter-i, 0) + 1) * 35ms), 350ms);
|
|
374
|
-
}
|
|
375
|
-
/* Phones: the absolute x/y/w grid can't shrink below ~30px columns, so collapse
|
|
376
|
-
to a single full-width column. Frames flow in spec order and keep their row
|
|
377
|
-
span (height), but ignore horizontal placement. */
|
|
378
|
-
@media (max-width: 640px) {
|
|
379
|
-
.zf-grid {
|
|
380
|
-
grid-template-columns: 1fr;
|
|
381
|
-
}
|
|
382
|
-
.zf-frame,
|
|
383
|
-
.zf-bare {
|
|
384
|
-
grid-column: 1 / -1;
|
|
385
|
-
grid-row: auto / span var(--zf-row-span, 1);
|
|
386
|
-
}
|
|
387
|
-
.zf-frame {
|
|
388
|
-
padding: calc(12px * var(--zf-density, 1)) calc(14px * var(--zf-density, 1));
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
@keyframes zf-enter {
|
|
392
|
-
from { opacity: 0; translate: 0 10px; }
|
|
393
|
-
to { opacity: 1; translate: 0 0; }
|
|
394
|
-
}
|
|
395
|
-
/* Reduced-motion entrance: same timing + stagger, but a plain fade with no
|
|
396
|
-
positional movement (motion is what triggers vestibular discomfort). */
|
|
397
|
-
@keyframes zf-fade {
|
|
398
|
-
from { opacity: 0; }
|
|
399
|
-
to { opacity: 1; }
|
|
400
|
-
}
|
|
401
|
-
@media (prefers-reduced-motion: reduce) {
|
|
402
|
-
.zf-frame,
|
|
403
|
-
.zf-bare {
|
|
404
|
-
animation-name: zf-fade;
|
|
405
|
-
}
|
|
406
|
-
.zf-frame:hover {
|
|
407
|
-
transform: none;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
`,Qa=()=>o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z"}),o.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),o.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});function Wn({outerClassName:e,style:t,headline:n,frame:r,children:s}){return o.jsx("div",{className:e,style:t,children:o.jsxs("div",{className:"zf-error",children:[o.jsx("span",{className:"zf-error-icon",children:o.jsx(Qa,{})}),o.jsx("div",{className:"zf-error-headline",children:n}),o.jsx("div",{className:"zf-error-frame",children:r}),s]})})}function rp({sources:e}){return e.length===0?null:o.jsx("span",{className:"zf-frame-source",children:e.map((t,n)=>o.jsxs(f.Fragment,{children:[n>0&&o.jsx("span",{className:"zf-frame-source-sep",children:"·"}),o.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer noopener",title:`Data source: ${t.name}`,onMouseDown:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),children:t.name})]},t.url))})}class Us extends f.Component{constructor(){super(...arguments);Y(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){return this.state.error?o.jsxs("div",{className:"zf-error",children:[o.jsx("span",{className:"zf-error-icon",children:o.jsx(Qa,{})}),o.jsx("div",{className:"zf-error-headline",children:"Frame crashed"}),o.jsx("p",{className:"zf-error-detail",children:this.state.error.message})]}):this.props.children}}function sp({instance:e,registry:t,style:n,className:r=""}){const s=In(),a=t.get(e.frame),i=(...p)=>p.filter(Boolean).join(" ");if(!a)return o.jsxs(Wn,{outerClassName:i("zf-frame","zf-frame--error",r),style:n,headline:"Unknown frame",frame:e.frame,children:[o.jsxs("p",{className:"zf-error-detail",children:[o.jsx("code",{children:e.frame})," isn’t a registered frame."]}),o.jsxs("p",{className:"zf-error-list",children:["Available: ",[...t.keys()].join(", ")]})]});const c=new Set(s.flatMap(p=>[...p.capabilities])),l=a.capabilities.filter(p=>!c.has(p));if(l.length>0)return o.jsx(Wn,{outerClassName:i("zf-frame","zf-frame--error",r),style:n,headline:"No data source",frame:e.frame,children:o.jsxs("p",{className:"zf-error-detail",children:["No registered provider supplies"," ",l.map((p,x)=>o.jsxs(f.Fragment,{children:[x>0&&", ",o.jsx("code",{children:p})]},p)),"."]})});const u=a.schema.safeParse(e.config);if(!u.success)return o.jsx(Wn,{outerClassName:i("zf-frame","zf-frame--error",r),style:n,headline:"Invalid configuration",frame:e.frame,children:o.jsx("ul",{className:"zf-error-issues",children:u.error.issues.map((p,x)=>o.jsxs("li",{className:"zf-error-issue",children:[o.jsx("code",{className:"zf-error-field",children:p.path.join(".")||"(root)"}),o.jsx("span",{className:"zf-error-msg",children:p.message.replace(/^Invalid input:\s*/i,"")})]},x))})});const d=a.component,h=a.titleIcon,m=a.source?Array.isArray(a.source)?a.source:[a.source]:[];return a.chrome==="bare"?o.jsx("div",{className:i("zf-bare",r),style:n,children:o.jsx(Us,{children:o.jsx(d,{config:u.data})})}):o.jsxs("div",{className:i("zf-frame",r),style:n,children:[o.jsxs("div",{className:i("zf-frame-title",h?"zf-frame-title--icon":""),children:[h?o.jsx(h,{config:u.data}):null,o.jsx("span",{className:"zf-frame-title-text",children:e.title??e.frame.replace(/-/g," ")}),o.jsx(rp,{sources:m})]}),o.jsx("div",{className:"zf-frame-body",children:o.jsx(Us,{children:o.jsx(d,{config:u.data})})})]})}function op(e,t,n,r){var u;const s={"--zf-enter-i":t};if(n){const d=(u=e.layouts)==null?void 0:u["flow-horizontal"];return d?{...s,"--zf-col-start":d.x+1,"--zf-col-span":d.w,"--zf-row-start":d.y+1,"--zf-row-span":Math.min(d.h,r)}:{...s,"--zf-col-span":e.position.w,"--zf-row-span":Math.min(e.position.h,r)}}const{x:a,y:i,w:c,h:l}=e.position;return{...s,"--zf-col-start":a+1,"--zf-col-span":c,"--zf-row-start":i+1,"--zf-row-span":l}}function Bs({spec:e,registry:t}){const n=e.grid.mode==="flow-horizontal";return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:np}),o.jsx("div",{className:n?"zf-grid zf-flow-horizontal":"zf-grid",style:{"--zf-cols":e.grid.columns,"--zf-row-h":`${e.grid.rowHeight}px`,"--zf-h-rows":e.grid.rows,"--zf-gap":`${e.grid.gap}px`,"--zf-accent-hue":e.theme.accentHue,"--zf-accent-sat":`${e.theme.accentSat}%`,"--zf-base-hue":e.theme.baseHue,"--zf-base-sat":`${e.theme.baseSat}%`,"--zf-up":e.theme.upColor,"--zf-down":e.theme.downColor,"--zf-font-family":xh[e.typography.fontFamily],"--zf-numeric":yh[e.typography.numericStyle],"--zf-frame-radius":`${e.appearance.radius}px`,"--zf-border-alpha":e.appearance.borderStrength,"--zf-surface-opacity":e.appearance.surfaceOpacity,"--zf-density":e.appearance.density,"--zf-elevation":e.appearance.elevation},children:e.frames.map((r,s)=>o.jsx(sp,{instance:r,registry:t,style:op(r,s,n,e.grid.rows)},r.id))})]})}const ap="/__zframes/dashboard.json",ip="/__zframes/dashboard",cp="/__zframes/proxy",lp="/__zframes/account/portfolio",ei="/__zframes/account/credentials",up="/__zframes/agents",dp="/__zframes/ask";function ae(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function ti(e){return e.includes(":")}function ni(e){const t=ae(e);return ti(e)?`https://assets.parqet.com/logos/symbol/${encodeURIComponent(t)}?format=png`:`https://assets.coincap.io/assets/icons/${t.toLowerCase()}@2x.png`}const Hs=["#5b6cff","#9b59ff","#e0608f","#e08a3c","#3fb6a8","#4f93e8","#7a8c52","#c0556b"];function mp(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Hs[Math.abs(t)%Hs.length]}function Fe({symbol:e,size:t=18,className:n=""}){const r=ae(e),s=ti(e),[a,i]=f.useState(!1);f.useEffect(()=>i(!1),[e]);const c=s?"rounded-[5px]":"rounded-full",l={width:t,height:t};return a?o.jsx("span",{"aria-hidden":!0,className:`inline-flex shrink-0 items-center justify-center font-bold leading-none text-white ${c} ${n}`,style:{...l,background:mp(r),fontSize:Math.round(t*.42)},children:r.slice(0,2).toUpperCase()}):o.jsx("img",{src:ni(e),width:t,height:t,alt:"","aria-hidden":!0,draggable:!1,loading:"lazy",onError:()=>i(!0),className:`shrink-0 object-contain ${c} ${s?"bg-white p-px":""} ${n}`,style:l})}function ze(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}function ye(e){return`${e>=0?"+":""}${e.toFixed(2)}%`}function je(e,t=2){return`${e.toFixed(t)}%`}function ri(e){return`${e>=0?"+":""}${e.toFixed(4)}%`}const fe="var(--zf-up, #3fd08f)",_e="var(--zf-down, #ff6b81)",si="#ff6b81";function Ce(e){return e>=0?fe:_e}function Ze(e){const t=Math.abs(e),n=e<0?"-":"";return t>=1e12?`${n}${(t/1e12).toFixed(2)}T`:t>=1e9?`${n}${(t/1e9).toFixed(2)}B`:t>=1e6?`${n}${(t/1e6).toFixed(2)}M`:t>=1e3?`${n}${(t/1e3).toFixed(1)}K`:`${n}${t.toFixed(0)}`}function le(e){return e<0?`-$${Ze(-e)}`:`$${Ze(e)}`}function oi(e){return e.split(/[-_]/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ai(e){const t=e/1e8;return t>=100?`${t.toFixed(0)} BTC`:t>=1?`${t.toFixed(2)} BTC`:t>=.001?`${t.toFixed(4)} BTC`:`${Math.round(e).toLocaleString("en-US")} sats`}function fp(e){const t=["H/s","kH/s","MH/s","GH/s","TH/s","PH/s","EH/s","ZH/s"];let n=e,r=0;for(;n>=1e3&&r<t.length-1;)n/=1e3,r++;return`${n.toFixed(n>=100?0:n>=10?1:2)} ${t[r]}`}function qr(e){const t=Math.max(0,Math.round((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.round(t/60);if(n<60)return`${n}m`;const r=Math.round(n/60);if(r<24)return`${r}h`;const s=Math.round(r/24);if(s<7)return`${s}d`;const a=Math.round(s/7);return a<5?`${a}w`:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}const xe="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",hp="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 M({loading:e=!1,children:t}){return e?o.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:o.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.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:o.jsx("span",{className:"absolute inset-0 animate-ping rounded-full opacity-60",style:{background:"hsl(var(--zf-accent-hue, 242) 90% 76%)"}})}),o.jsx("span",{className:"body-sm text-soft truncate",children:t})]}),o.jsxs("div",{className:"grid min-h-0 grid-cols-4 gap-2",children:[o.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.07]"}),o.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.05]"}),o.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.08]"}),o.jsx("span",{className:"h-11 animate-pulse rounded bg-white/[0.04]"})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("span",{className:"h-2.5 w-11/12 animate-pulse rounded-full bg-white/[0.07]"}),o.jsx("span",{className:"h-2.5 w-7/12 animate-pulse rounded-full bg-white/[0.05]"})]})]})}):o.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:t})}function pp(e){if(e.source==="wallet"){const t=(e.address??"").trim();return t?{kind:"wallet",address:t}:null}return{kind:"binance"}}const gp={WETH:"ETH",WBTC:"BTC"};function Vs(e){return gp[e.toUpperCase()]??e}function Kr(e){const t=e??[],n=t.map(s=>Vs(s.symbol)),r=Pt(n);return f.useMemo(()=>{const s=t.map(i=>{const c=r[Vs(i.symbol)],l=c!==void 0?i.amount*c:i.valueUsd;return{...i,value:l}}),a=s.reduce((i,c)=>i+(c.value??0),0);return{priced:s,total:a}},[e,r])}function Jr({portfolio:e,config:t,className:n=""}){var a;const r=e.label??(t.source==="wallet"?"wallet":"portfolio"),s=(a=t.address)==null?void 0:a.trim();return t.source==="wallet"&&s?o.jsx("a",{href:`https://etherscan.io/address/${encodeURIComponent(s)}`,target:"_blank",rel:"noopener noreferrer",title:"View on Etherscan",className:`hover:text-white hover:underline ${n}`,onClick:i=>i.stopPropagation(),onPointerDown:i=>i.stopPropagation(),children:r}):o.jsx("span",{className:n,children:r})}function bp(e,t){const n=(e==null?void 0:e.kind)==="binance",[r,s]=f.useState({loading:n,connected:!1,keyMasked:null});return f.useEffect(()=>{if(!n||!e){s({loading:!1,connected:!1,keyMasked:null});return}let a=!1;return s(i=>({...i,loading:!0})),fetch(`${ei}?source=${e.kind}`,{headers:{accept:"application/json"}}).then(i=>i.ok?i.json():{connected:!1,keyMasked:null}).then(i=>{a||s({loading:!1,connected:!!i.connected,keyMasked:i.keyMasked??null})}).catch(()=>{a||s({loading:!1,connected:!1,keyMasked:null})}),()=>{a=!0}},[n,e==null?void 0:e.kind,t]),r}function xp(e){const[t,n]=f.useState(0),r=f.useCallback(()=>n(h=>h+1),[]),s=pp(e),a=bp(s,t),i=(s==null?void 0:s.kind)==="binance",c=!!s&&(!i||a.connected),{portfolio:l,isLoading:u}=Qh(c?s:null);let d;return s?i&&a.loading?d={state:"checking"}:i&&!a.connected?d={state:"needs-connect",source:s}:u&&!l?d={state:"loading"}:l?l.holdings.length===0?d={state:"empty",portfolio:l}:d={state:"live",portfolio:l}:d={state:"error"}:d={state:"needs-address"},{view:d,refresh:r}}const Sr="w-full rounded-md border border-white/10 bg-white/[0.04] px-2 py-1.5 text-xs text-white/90 outline-none focus:border-white/25 placeholder:text-white/30",ii="rounded-md bg-[hsl(var(--zf-accent-hue,242)_90%_60%)] px-3 py-1.5 text-xs font-semibold text-white disabled:opacity-50";function yp({onConnected:e}){const[t,n]=f.useState(""),[r,s]=f.useState(""),[a,i]=f.useState(!1),[c,l]=f.useState(null),u=async()=>{i(!0),l(null);try{const d=await fetch(ei,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({source:"binance",key:t.trim(),secret:r.trim()})}),h=await d.json().catch(()=>({}));if(!d.ok||!h.ok)throw new Error(h.error??`HTTP ${d.status}`);n(""),s(""),e()}catch(d){l(d instanceof Error?d.message:String(d))}finally{i(!1)}};return o.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fe,{symbol:"BNB",size:18}),o.jsx("span",{className:"text-strong text-sm font-bold",children:"Connect Binance"})]}),o.jsxs("p",{className:"caption text-soft",children:["Use a ",o.jsx("strong",{children:"read-only"})," key + secret — create them in Binance"," ",o.jsx("a",{href:"https://www.binance.com/en/my/settings/api-management",target:"_blank",rel:"noopener noreferrer",className:"text-[hsl(var(--zf-accent-hue,242)_90%_72%)] underline underline-offset-2 hover:text-white",onClick:d=>d.stopPropagation(),onPointerDown:d=>d.stopPropagation(),children:"API Management"})," ","(enable Reading only). Both stay on your machine, never shared."]}),o.jsx("input",{className:Sr,placeholder:"API key",value:t,autoComplete:"off",onChange:d=>n(d.target.value),onPointerDown:d=>d.stopPropagation()}),o.jsx("input",{className:Sr,placeholder:"API secret",type:"password",value:r,autoComplete:"off",onChange:d=>s(d.target.value),onPointerDown:d=>d.stopPropagation()}),c?o.jsx("p",{className:"caption text-[#ff6b81]",children:c}):null,o.jsx("button",{type:"button",className:ii,disabled:a||!t.trim()||!r.trim(),onClick:d=>{d.stopPropagation(),u()},onPointerDown:d=>d.stopPropagation(),children:a?"Verifying…":"Connect"})]})}function vp({current:e}){const t=Ln(),[n,r]=f.useState(e??"");return o.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2 px-1",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fe,{symbol:"ETH",size:18}),o.jsx("span",{className:"text-strong text-sm font-bold",children:"Track a wallet"})]}),o.jsx("p",{className:"caption text-soft",children:"Enter a public Ethereum address or ENS name. No keys — it’s public on-chain data. Sharing this dashboard reveals the holdings."}),o.jsx("input",{className:Sr,placeholder:"0x… or name.eth",value:n,autoComplete:"off",onChange:s=>r(s.target.value),onPointerDown:s=>s.stopPropagation()}),t?o.jsx("button",{type:"button",className:ii,disabled:!n.trim(),onClick:s=>{s.stopPropagation(),t({address:n.trim()})},onPointerDown:s=>s.stopPropagation(),children:"Track"}):o.jsx("p",{className:"caption text-soft",children:"Set the address in the frame’s config to start tracking."})]})}function Qr({config:e,loadingLabel:t="loading portfolio…",children:n}){const{view:r,refresh:s}=xp(e);switch(r.state){case"needs-address":case"needs-connect":return o.jsx(wp,{view:r,config:e,onConnected:s});case"checking":case"loading":return o.jsx(M,{loading:!0,children:t});case"error":return o.jsx(M,{children:"couldn’t load — check the address or try again"});case"empty":return o.jsx(M,{children:"no holdings to show"});case"live":return o.jsx(o.Fragment,{children:n(r.portfolio)})}}function wp({view:e,config:t,onConnected:n}){return e.state==="needs-connect"&&e.source.kind==="binance"?o.jsx(yp,{onConnected:n}):o.jsx(vp,{current:t.address})}const $=e=>`/widget-icons/${e}.png`,G={hyperliquid:{name:"Hyperliquid",url:"https://hyperliquid.xyz"},defillama:{name:"DeFiLlama",url:"https://defillama.com"},coingecko:{name:"CoinGecko",url:"https://www.coingecko.com"},alternativeMe:{name:"alternative.me",url:"https://alternative.me/crypto/fear-and-greed-index/"},bls:{name:"BLS",url:"https://www.bls.gov"},nyFed:{name:"NY Fed",url:"https://www.newyorkfed.org/markets/reference-rates"},treasury:{name:"U.S. Treasury",url:"https://fiscaldata.treasury.gov"},secEdgar:{name:"SEC EDGAR",url:"https://www.sec.gov/edgar"},finra:{name:"FINRA",url:"https://www.finra.org/finra-data/browse-catalog/short-sale-volume-data"},ofr:{name:"OFR",url:"https://www.financialresearch.gov/financial-stress-index/"},mempool:{name:"mempool.space",url:"https://mempool.space"},deribit:{name:"Deribit",url:"https://www.deribit.com"},coinpaprika:{name:"Coinpaprika",url:"https://coinpaprika.com"}},ci={name:"clock",category:"tools",iconUrl:$("clock"),layout:{w:3,h:2,minW:2,minH:1},description:"Digital clock showing the current time, ticking every second. Configurable IANA timezone (defaults to the viewer's local zone), 12/24-hour format, optional seconds and date, the timezone abbreviation, and a caption label. Drop several with different timezones for a trading-desk world clock. Needs no data provider.",capabilities:[],schema:P({timezone:B().default("").describe(`IANA timezone, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", "UTC". Empty = the viewer's local timezone.`),label:B().default("").describe('Caption under the time, e.g. "New York" or "Local". Empty hides it.'),hour12:we().default(!1).describe("12-hour clock with AM/PM (true) or 24-hour (false)."),showSeconds:we().default(!0).describe("Show seconds (HH:MM:SS) instead of just HH:MM."),showMillis:we().default(!1).describe("Show milliseconds (HH:MM:SS.mmm), updated smoothly each animation frame. Implies seconds."),showDate:we().default(!1).describe("Show the weekday and date under the time."),showTimezone:we().default(!0).describe('Show the timezone abbreviation (e.g. "EST", "GMT+7", "UTC") in the caption. Combines with the label when set, e.g. "New York · EST".')})},li={name:"market-hours",category:"tools",iconUrl:$("market-hours"),layout:{w:4,h:4,minW:3,minH:3},description:"Which world stock exchanges are open right now — each row shows an open / closed / holiday status dot and a live countdown to the next open or close. Computed entirely client-side from each exchange's timezone and regular trading hours (no API); a bundled 2026 holiday list keeps the major Western exchanges accurate on market holidays. Intraday lunch breaks and half-day early closes are not modelled. Needs no data provider.",capabilities:[],schema:P({exchanges:he(B()).default([]).describe('Exchange codes to show, e.g. ["NYSE","LSE","TSE","HKEX","SET"]. Empty = a global default set. Known codes: NYSE, NASDAQ, TSX, B3, LSE, XETRA, EURONEXT, SIX, TSE, HKEX, SSE, NSE, KRX, SGX, SET, ASX, JSE, TADAWUL.'),sort:Q(["region","status","name"]).default("region").describe("Order rows by world region (Americas → Europe → Asia-Pacific → Middle East/Africa), by status (open first), or alphabetically by name.")})},ui={name:"fear-greed",category:"sentiment",iconUrl:$("fear-greed"),layout:{w:3,h:3,minW:2,minH:2},description:"Crypto Fear & Greed index (0 = extreme fear, 100 = extreme greed) with a recent-history sparkline. A one-number market mood gauge from alternative.me.",capabilities:["sentiment"],source:G.alternativeMe,schema:P({sparklineDays:D().int().min(7).max(90).default(30).describe("How many days of index history to show in the sparkline.")})},di={name:"funding-rate-chart",category:"derivatives",iconUrl:$("funding-rate-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart comparing hourly perp funding rates across symbols over a configurable lookback window. Positive funding = longs pay shorts. Useful for spotting crowded trades.",capabilities:["funding-history"],source:G.hyperliquid,schema:P({symbols:he(B()).min(1).max(6).describe('Hyperliquid symbols to compare funding for, e.g. ["xyz:TSLA", "xyz:NVDA"]. Up to 6.'),lookback:Q(["24h","7D","1M"]).default("7D").describe("History window for the funding chart.")})},mi={name:"note",category:"layout",iconUrl:$("note"),layout:{w:4,h:3,minW:2,minH:2},description:"Free-form text note pinned to the dashboard — trading plans, reminders, watch levels. Needs no data provider.",capabilities:[],schema:P({text:B().min(1).describe("The note's text content. Plain text; newlines are preserved."),align:Q(["left","center"]).default("left").describe("Text alignment inside the card.")})},fi={name:"price-chart",category:"markets",iconUrl:$("price-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Live animated price chart (candlestick or line) for one symbol — canvas-rendered at 60fps via liveline, streaming live off the Hyperliquid WebSocket. Works for HIP-3 stock perps (xyz:TSLA) and crypto (BTC). The centerpiece frame.",capabilities:["ohlcv","quote-stream"],source:G.hyperliquid,schema:P({symbol:B().min(1).describe('Hyperliquid symbol to chart. Stocks/HIP-3: "xyz:TSLA", "xyz:NVDA", "xyz:AAPL". Crypto: "BTC", "ETH".'),interval:Q(["1m","5m","15m","1h","4h","1d"]).default("1h").describe("Candle interval."),mode:Q(["candle","line"]).default("candle").describe("Candlestick or smooth line rendering."),color:B().default("#8b8df9").describe("Accent color (hex). The whole palette derives from it.")})},hi={name:"price-liveline",category:"markets",iconUrl:$("price-liveline"),layout:{w:6,h:3,minW:4,minH:2},description:"Multi-asset live price liveline — several Hyperliquid symbols streaming in one canvas chart. Defaults to normalized % movement so stocks and crypto can share one axis, while the legend still shows each asset's live raw price. Use when the dashboard needs one compact live race view instead of several single-symbol charts.",capabilities:["quote-stream","day-stats"],source:G.hyperliquid,schema:P({symbols:he(B()).min(2).max(8).describe('Hyperliquid symbols to stream together, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"] or ["BTC", "ETH", "SOL"]. 2 to 8.'),windowSec:D().int().min(10).max(300).default(30).describe("Rolling live window in seconds. 30 mirrors the zhive liveline view; use 60–300 for slower dashboards."),normalize:we().default(!0).describe("Show each asset as % movement from its first live tick (recommended when prices differ). Off = raw price overlay.")})},pi={name:"price-ticker",category:"markets",iconUrl:$("price-ticker"),layout:{w:3,h:3,minW:2,minH:2},description:"Live watchlist streaming mid prices over the Hyperliquid WebSocket with 24h change per symbol. The bread-and-butter frame for any dashboard.",capabilities:["quote-stream","day-stats"],source:G.hyperliquid,schema:P({symbols:he(B()).min(1).describe('Hyperliquid symbols to track, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"]. Crypto works too: "BTC", "ETH".')})},gi={name:"top-movers",category:"markets",iconUrl:$("top-movers"),layout:{w:5,h:3,minW:3,minH:3},description:"Today's biggest stock and commodity HIP-3 gainers and losers (no bare crypto), side by side with current price and 24h change.",capabilities:["day-stats"],source:G.hyperliquid,schema:P({count:D().int().min(3).max(10).default(5).describe("How many gainers and losers to list (each).")})},bi={name:"tvl-treemap",category:"crypto",iconUrl:$("tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of total value locked (TVL) across the largest blockchain ecosystems, sized by TVL. Data from DeFiLlama. Good single-glance answer to 'where does on-chain capital live right now'.",capabilities:["tvl"],source:G.defillama,schema:P({topN:D().int().min(3).max(30).default(12).describe("How many of the largest chains to show in the treemap.")})},xi={name:"bitcoin-dominance",category:"crypto",iconUrl:$("bitcoin-dominance"),layout:{w:4,h:2,minW:3,minH:2},description:"BTC / ETH / Others market-cap dominance as a segmented bar, with optional total marketcap line. Shifts in BTC dominance hint at where the market rotates next.",capabilities:["global-market"],source:G.coingecko,schema:P({showTotalMarketCap:we().default(!0).describe("Show total crypto marketcap and its 24h change below the bar.")})},yi={name:"rates-board",category:"macro",iconUrl:$("rates-board"),layout:{w:4,h:4,minW:3,minH:3},description:"Official US rates board from free public APIs: New York Fed reference rates (SOFR, effective fed funds, repo rates) plus Treasury average interest rates by security class. Daily/reference data, not a real-time stock quote feed.",capabilities:["reference-rates","treasury-rates"],source:[G.nyFed,G.treasury],schema:P({maxReferenceRates:D().int().min(2).max(8).default(5).describe("How many New York Fed reference rates to show."),showTreasuryAverageRates:we().default(!0).describe("Also show Treasury average interest rates by security class from Fiscal Data."),maxTreasuryRates:D().int().min(1).max(8).default(4).describe("How many Treasury average-rate rows to show.")})},vi={name:"inflation-pulse",category:"macro",iconUrl:$("inflation-pulse"),layout:{w:4,h:3,minW:3,minH:2},description:"BLS CPI pulse from the public no-key API: latest CPI-U all-items index with month-over-month and year-over-year changes plus a small trend sparkline. Monthly macro context for stock dashboards; not a live price feed.",capabilities:["macro-series"],source:G.bls,schema:P({months:D().int().min(13).max(36).default(18).describe("How many monthly CPI observations to show in the trend.")})},wi={name:"financial-stress",category:"macro",iconUrl:$("financial-stress"),layout:{w:4,h:3,minW:3,minH:2},description:"The OFR Financial Stress Index — a daily, market-based gauge of systemic financial stress from the U.S. Office of Financial Research. One headline value where 0 is the long-run average (positive = elevated stress, negative = calmer than normal), an optional breakdown of the five contributing categories (credit, equity valuation, safe assets, funding, volatility), and a trend line. Keyless official data, updated each business day; needs the zframes runtime's data proxy (ships with `zframes serve` / `vite dev`). Not a price feed.",capabilities:["financial-stress"],source:G.ofr,schema:P({trendDays:D().int().min(20).max(90).default(60).describe("How many recent daily readings to plot in the trend line."),showCategories:we().default(!0).describe("Show the five category contributions (credit, equity valuation, safe assets, funding, volatility) under the headline.")})},ki={name:"national-debt",category:"macro",iconUrl:$("national-debt"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. total public debt outstanding from the Treasury's keyless 'Debt to the Penny' dataset — the headline total in trillions, the change over the chosen window, an optional split into debt held by the public vs intragovernmental holdings, and a trend line. Official data updated each business day; CORS-safe (no proxy needed). Macro context, not a live price feed.",capabilities:["national-debt"],source:G.treasury,schema:P({trendDays:D().int().min(30).max(365).default(180).describe("How many business days of history to load for the trend and the change figure."),showSplit:we().default(!0).describe("Show the debt-held-by-the-public vs intragovernmental-holdings split.")})},Si={name:"labor-market",category:"macro",iconUrl:$("labor-market"),layout:{w:4,h:3,minW:3,minH:2},description:"U.S. labor-market snapshot from the BLS keyless public API: the headline unemployment rate, the latest monthly change in nonfarm payrolls (jobs added or lost), the total payroll level, and an unemployment-rate trend line. Monthly macro context for stock dashboards; updates on the BLS jobs-report schedule, not a live feed.",capabilities:["macro-series"],source:G.bls,schema:P({months:D().int().min(13).max(36).default(18).describe("How many monthly observations to show in the trend.")})},ji={name:"treasury-auctions",category:"macro",iconUrl:$("treasury-auctions"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent completed U.S. Treasury auctions from the keyless Fiscal Data API — each row shows the security (bill/note/bond + term), the high awarded yield, and the bid-to-cover ratio (demand: total bids ÷ amount accepted; higher = stronger). Newest first. Official market-plumbing data, CORS-safe; updates as auctions settle, not a live price feed.",capabilities:["treasury-auctions"],source:G.treasury,schema:P({count:D().int().min(3).max(20).default(8).describe("How many recent auctions to list (newest first).")})},Ni={name:"filings-feed",category:"equities",iconUrl:$("filings-feed"),layout:{w:5,h:4,minW:3,minH:3},description:"Recent SEC EDGAR filings for one US-listed company — each row shows the form type (10-K, 10-Q, 8-K, Form 4…), a plain-English label, the filing date, and a click-through to the document on sec.gov, under a header with the company name, exchange, and filer category. Official data from SEC's free, CORS-safe submissions endpoint; event-driven (updates when the company files), not a price feed. Resolve by ticker (a bundled snapshot of the ~500 largest US issuers) or by raw SEC CIK for anything else.",capabilities:["filings"],source:G.secEdgar,schema:P({symbol:B().min(1).describe('Company to show filings for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:TSLA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.'),forms:Q(["important","all","insider"]).default("important").describe('Which filings to surface: "important" = periodic & material reports (10-K, 10-Q, 8-K, S-1, proxies, 13D/G…); "insider" = ownership forms (3/4/5/144); "all" = unfiltered. Always newest first.'),count:D().int().min(3).max(25).default(8).describe("How many filings to list (newest first).")})},Ci={name:"yield-curve",category:"macro",iconUrl:$("yield-curve"),layout:{w:4,h:3,minW:3,minH:3},description:"The U.S. Treasury daily par yield curve — a line from 1-month to 30-year yields, the headline 2s10s spread (10Y minus 2Y; negative = inverted, the classic recession signal), and a configurable row of key maturities. Keyless official data from the U.S. Treasury, updated each business day; not a live intraday feed.",capabilities:["yield-curve"],source:G.treasury,schema:P({maturities:he(Q(["1M","2M","3M","4M","6M","1Y","2Y","3Y","5Y","7Y","10Y","20Y","30Y"])).min(2).max(8).default(["3M","2Y","5Y","10Y","30Y"]).describe("Maturities to show as labelled cells under the curve (the full curve line always shows every maturity).")})},zi={name:"fundamentals",category:"equities",iconUrl:$("fundamentals"),layout:{w:4,h:3,minW:3,minH:3},description:"Headline financials for one US-listed company from SEC EDGAR XBRL company facts — revenue, net income, total assets, shareholders' equity, diluted EPS, and shares outstanding, each labelled with its fiscal period. Income-statement figures are the latest full fiscal year; balance-sheet figures are the latest reported quarter. Keyless official data that updates only when the company files (annual/quarterly), not a live feed. Requires the zframes runtime's data proxy (it ships with `zframes serve` / `vite dev`); resolve by ticker (bundled top-500 map) or raw SEC CIK.",capabilities:["fundamentals"],source:G.secEdgar,schema:P({symbol:B().min(1).describe('Company to show financials for — a ticker ("AAPL", "NVDA"), a HIP-3 symbol ("xyz:NVDA"), or a raw SEC CIK ("320193"). Tickers outside the bundled top-500 map need a CIK.')})},_i={name:"short-volume",category:"equities",iconUrl:$("short-volume"),layout:{w:5,h:4,minW:3,minH:3},description:"Daily reported short-sale volume for a watchlist of US-listed stocks, from FINRA's free consolidated file — each row shows the % of the day's reported volume that was sold short, with a bar and the raw short/total share counts. IMPORTANT: this is reported short volume (sell-side short flow, which includes market-maker hedging), NOT short interest (outstanding short positions), and is not a directional signal on its own. Daily data published the next business day; not a live feed. US equities only.",capabilities:["short-volume"],source:G.finra,schema:P({symbols:he(B()).min(1).max(12).describe('US-listed stock tickers to show, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Crypto has no SEC/FINRA short-volume and is ignored.'),sort:Q(["shortPct","volume","symbol"]).default("shortPct").describe("Order rows by short % of volume (highest first), by total volume (highest first), or alphabetically by symbol.")})},Ti={name:"funding-heatmap",category:"derivatives",iconUrl:$("funding-heatmap"),layout:{w:6,h:3,minW:4,minH:3},description:"Heatmap of perp funding rates — symbols as rows, daily average over the last 7 days as columns, green positive / red negative. Spots persistent funding regimes at a glance.",capabilities:["funding-history"],source:G.hyperliquid,schema:P({symbols:he(B()).min(2).max(8).describe('Hyperliquid symbols as heatmap rows — at least 2, since the heatmap compares funding across symbols, e.g. ["xyz:TSLA", "xyz:NVDA", "xyz:AAPL"].')})},kp={name:"dino-game",category:"games",iconUrl:$("dino-game"),layout:{w:4,h:3,minW:3,minH:3},description:"Chrome-dino style runner game on canvas — jump cacti with SPACE or tap. High score persists locally. For when the market is boring. Needs no data provider.",capabilities:[],schema:P({})},Ei={name:"image",category:"layout",iconUrl:$("image"),layout:{w:3,h:3,minW:1,minH:1},description:"Displays an image from a URL — logos, memes, chart screenshots, banners. Needs no data provider.",capabilities:[],schema:P({url:B().min(1).describe("Image URL (https)."),alt:B().default("").describe("Alt text for accessibility."),fit:Q(["cover","contain"]).default("cover").describe("How the image fills the frame: cover crops, contain letterboxes.")})},Mi={name:"heading",category:"layout",iconUrl:$("heading"),layout:{w:12,h:1,minW:2,minH:1,maxH:1},description:"Section divider that titles a region of the dashboard ('Markets', 'On-chain', 'Desk'). Renders as a label with a hairline rule — no card. Use to group frames into zones: place full-width (w: 12) and 1 row tall (h: 1) above each group. Needs no data provider.",capabilities:[],chrome:"bare",schema:P({title:B().min(1).describe("The heading text."),subtitle:B().optional().describe("Smaller supporting line under the title.")})},Ai={name:"daily-analysis",category:"tools",iconUrl:$("daily-analysis"),layout:{w:6,h:3,minW:3,minH:2},description:"Daily market brief written by the /zframes-brief loop — a dated analysis of the symbols on your dashboard, the calls it is making today, and how yesterday's calls scored (with a running hit-rate). Reads a local log file the loop appends to; needs no market data provider. Add one per dashboard.",capabilities:[],schema:P({src:B().default("/daily-analysis.json").describe("URL of the analysis log the loop writes, served from the app's public/ dir. Leave as the default unless you renamed the file."),entries:D().int().min(1).max(5).default(1).describe("How many of the most recent daily entries to show (newest first)."),refreshSec:D().int().min(30).default(300).describe("How often (seconds) to re-fetch the log so a fresh brief appears without a manual reload.")})},Pi={name:"journal-log",category:"journal",iconUrl:$("journal-log"),layout:{w:4,h:5,minW:3,minH:4},source:G.hyperliquid,description:"Log a market read in seconds: pick a supported ticker (with its live Hyperliquid price), Long or Short, the reason (a quick pick + optional note), and how sure you are (a slider). That's it — a falsifiable call, captured at the live price, that the Open/Results frames then track and grade. The simple front door to your decision journal; pairs with the zAI orb for conversational capture. Add one alongside Journal · Open and Journal · Results.",capabilities:["quote-stream","day-stats"],schema:P({})},Ri={name:"journal-open",category:"journal",iconUrl:$("journal-open"),layout:{w:4,h:4,minW:3,minH:3},description:"Your open calls from the decision journal, each marking to the live Hyperliquid price — direction, confidence, unrealized % return, a live entry→target track, and a countdown. Calls auto-grade at their horizon (or close one early). The 'watch it play out' frame. Reads the journal you write with Journal · Log.",source:G.hyperliquid,capabilities:["quote-stream"],schema:P({max:D().int().min(1).max(20).default(8).describe("How many open calls to show (newest first).")})},$i={name:"journal-results",category:"journal",iconUrl:$("journal-results"),layout:{w:4,h:4,minW:3,minH:3},description:"Your resolved calls from the decision journal, graded on TWO axes: did it hit, AND did the thesis actually play out — so a lucky hit reads differently from earned skill, and a near-miss from a clean miss. The reflection frame. Reads the journal you write with Journal · Log.",capabilities:[],schema:P({max:D().int().min(1).max(20).default(8).describe("How many resolved calls to show (newest first).")})},Di={name:"journal-score",category:"journal",iconUrl:$("journal-score"),layout:{w:4,h:2,minW:3,minH:2},description:"The decision-journal scoreboard — a story, not a spreadsheet: where your judgment has an edge, where it leaks, and how calibrated your confidence is, plus a one-line read from zAI. Aggregates the calls logged via Journal · Log.",capabilities:[],schema:P({})},Ii={name:"price-compare",category:"markets",iconUrl:$("price-compare"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart overlaying the price history of several symbols over a lookback window — see how TSLA, NVDA and BTC moved against each other. Normalized by default to % change from the window start so symbols at very different price levels (BTC vs a $20 stock) stay comparable on one axis. Candles from Hyperliquid.",capabilities:["ohlcv"],source:G.hyperliquid,schema:P({symbols:he(B()).min(2).max(6).describe('Hyperliquid symbols to overlay, e.g. ["xyz:TSLA", "xyz:NVDA", "BTC"]. 2 to 6.'),lookback:Q(["24h","7D","1M"]).default("7D").describe("History window for the comparison."),normalize:we().default(!0).describe("Rebase each series to % change from the window start (recommended — lets symbols at different price levels share one axis). Off = raw price, only sensible when comparing similarly-priced symbols.")})},es={source:Q(["binance","wallet"]).default("binance").describe('Where the holdings come from: "binance" (a connected Binance account — a read-only API key is entered in-app and stored locally, never in this file) or "wallet" (a public on-chain address, keyless).'),address:B().default("").describe('For source "wallet": the public Ethereum address (0x…) or ENS name to track. Public on-chain data, no keys. Ignored for "binance".')},Li={name:"portfolio-value",category:"portfolio",iconUrl:$("portfolio-value"),layout:{w:5,h:4,minW:3,minH:3},description:"Your connected portfolio's total USD value as a live equity line, ticking with the market. Source is a connected Binance account (read-only key, entered in-app) or a public on-chain wallet address. Shows total value + session change. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:P({...es,windowSec:D().int().positive().default(300).describe("Seconds of live history the equity line shows; it accumulates from when the dashboard opens.")})},Fi={name:"portfolio-allocation",category:"portfolio",iconUrl:$("portfolio-allocation"),layout:{w:4,h:4,minW:3,minH:3},description:"Donut of your connected portfolio's allocation — each slice sized by live USD value, total in the center. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:P({...es})},Oi={name:"portfolio-holdings",category:"portfolio",iconUrl:$("portfolio-holdings"),layout:{w:4,h:4,minW:3,minH:3},description:"Table of your connected portfolio's positions — asset, amount, live USD value, share of total, 24h change. Source is a connected Binance account (read-only key, in-app) or a public on-chain wallet address. Renders a connect prompt until a source is set.",capabilities:["portfolio","quote-stream"],account:!0,schema:P({...es})},Ui={name:"news-feed",category:"sentiment",iconUrl:$("news-feed"),layout:{w:4,h:4,minW:3,minH:3},description:'Scrolling feed of the latest news headlines from a chosen outlet — each row is a clickable headline with its publish time, newest first. Free, keyless RSS sources: crypto press (CoinDesk, Cointelegraph, Decrypt), broad markets/macro (CNBC, Nasdaq), or — source "stocks" — per-company headlines (via Google News) scoped to the specific tickers in `symbols`. IMPORTANT: news feeds are CORS-blocked, so this frame reads them through the zframes runtime\'s data proxy (it ships with `zframes serve` / `vite dev`); on a fully static host with no runtime it shows an empty state.',capabilities:["news"],schema:P({source:Q(["coindesk","cointelegraph","decrypt","cnbc","nasdaq","stocks"]).default("coindesk").describe('Which feed to show. Crypto press: "coindesk", "cointelegraph", "decrypt". Markets/macro: "cnbc", "nasdaq". "stocks" = per-company headlines (Google News) for the tickers in `symbols`.'),symbols:he(B()).default([]).describe('Only used when source is "stocks": stock tickers to pull headlines for, e.g. ["TSLA","NVDA","AAPL"]. HIP-3 symbols ("xyz:TSLA") work too — the dex prefix is stripped. Ignored for the other sources.'),count:D().int().min(3).max(20).default(8).describe("How many headlines to list (newest first).")})},Bi={name:"dex-volume-treemap",category:"crypto",iconUrl:$("dex-volume-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of decentralized-exchange (DEX) protocols sized by trailing-24h trading volume, tiles colored green/red by 1-day change. Data from DeFiLlama. One-glance read on where on-chain trading flow is concentrated right now.",capabilities:["dex-volume"],source:G.defillama,schema:P({topN:D().int().min(3).max(30).default(12).describe("How many of the highest-volume DEX protocols to show.")})},Hi={name:"dex-volume-chart",category:"crypto",iconUrl:$("dex-volume-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of daily DEX trading volume for several protocols over a lookback window — compare how Uniswap, PancakeSwap, Aerodrome etc. trend against each other. Data from DeFiLlama (daily granularity).",capabilities:["dex-volume"],source:G.defillama,schema:P({protocols:he(B()).min(1).max(6).describe('DeFiLlama DEX protocol slugs (lowercase, hyphenated), e.g. ["uniswap", "pancakeswap", "aerodrome-slipstream"]. 1 to 6.'),lookback:Q(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},Vi={name:"protocol-tvl-treemap",category:"crypto",iconUrl:$("protocol-tvl-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of DeFi protocols sized by current total value locked (TVL), tiles colored green/red by 1-day change. Data from DeFiLlama. Unlike tvl-treemap (which groups by blockchain), this ranks individual protocols (Lido, Aave, EigenLayer…).",capabilities:["protocol-tvl"],source:G.defillama,schema:P({topN:D().int().min(3).max(30).default(12).describe("How many of the largest protocols by TVL to show.")})},Zi={name:"protocol-tvl-chart",category:"crypto",iconUrl:$("protocol-tvl-chart"),layout:{w:6,h:3,minW:3,minH:2},description:"Multi-series line chart of total value locked (TVL) for several DeFi protocols over a lookback window. Data from DeFiLlama (daily granularity).",capabilities:["protocol-tvl"],source:G.defillama,schema:P({protocols:he(B()).min(1).max(6).describe('DeFiLlama protocol slugs (lowercase, hyphenated), e.g. ["lido", "aave", "eigenlayer"]. 1 to 6.'),lookback:Q(["7D","1M","3M"]).default("1M").describe("History window for the chart.")})},Wi={name:"protocol-fees-treemap",category:"crypto",iconUrl:$("protocol-fees-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of protocols sized by the fees they generated in the last 24h, tiles colored green/red by 1-day change. Data from DeFiLlama. Shows where on-chain users are actually paying for blockspace and services right now.",capabilities:["protocol-fees"],source:G.defillama,schema:P({topN:D().int().min(3).max(30).default(12).describe("How many of the highest fee-earning protocols to show.")})},Yi={name:"market-cap-treemap",category:"crypto",iconUrl:$("market-cap-treemap"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of the largest cryptocurrencies sized by market capitalisation, tiles colored green/red by 24h price change. Data from CoinGecko (free tier). A heat-map of the whole crypto market at a glance.",capabilities:["coin-markets"],source:G.coingecko,schema:P({topN:D().int().min(5).max(50).default(12).describe("How many of the largest coins by market cap to show (up to 50).")})},Gi={name:"open-interest",category:"derivatives",iconUrl:$("open-interest"),layout:{w:4,h:3,minW:3,minH:2},description:'Live open interest across a watchlist of Hyperliquid perps — each symbol is a horizontal bar sized by USD notional, largest first, refreshed on a ~30s poll. Single-venue (Hyperliquid only), so read it as a relative gauge across your symbols, not a market-wide total. Stocks (HIP-3, e.g. "xyz:TSLA") and crypto both work.',capabilities:["open-interest"],source:G.hyperliquid,schema:P({symbols:he(B()).min(1).max(20).describe(`Hyperliquid symbols to compare open interest for, e.g. ["BTC", "ETH", "xyz:TSLA"]. A "<dex>:*" wildcard (e.g. "xyz:*") pulls that dex's entire universe.`)})},Sp={name:"snake",category:"games",iconUrl:$("snake"),layout:{w:4,h:4,minW:3,minH:3},description:"Classic snake game on canvas — steer with the arrow keys (or swipe), eat dots to grow, avoid the walls and your own tail. High score persists locally. For when the market is flat. Needs no data provider.",capabilities:[],schema:P({})},jp={name:"flappy-bird",category:"games",iconUrl:$("flappy-bird"),layout:{w:4,h:4,minW:3,minH:3},description:"Flappy-bird style game on canvas — tap or press SPACE to flap through the gaps between pipes. High score persists locally. Needs no data provider.",capabilities:[],schema:P({})},Xi={name:"video",category:"layout",iconUrl:$("video"),layout:{w:4,h:3,minW:2,minH:2},description:"Embeds a video from a YouTube or Vimeo link (or any direct embed URL) as an iframe — a livestream, a market-news clip, a focus playlist. Needs no data provider.",capabilities:[],schema:P({url:B().min(1).describe("Video URL — a YouTube watch/share link, a Vimeo link, or a direct embeddable URL (https)."),title:B().default("Video").describe("Accessible title for the embedded player (iframe title).")})},Np={name:"drawdy",category:"layout",iconUrl:$("drawdy"),layout:{w:8,h:6,minW:2,minH:2},description:"Embeds drawdy.io as an interactive whiteboard canvas. No configuration needed.",capabilities:[],schema:P({})},qi={name:"countdown",category:"tools",iconUrl:$("countdown"),layout:{w:3,h:2,minW:2,minH:1},description:"Live countdown to a target date and time — FOMC decisions, CPI prints, options expiry, earnings, a token unlock, the next market open. Counts down in days / hours / minutes / seconds, ticking every second, and flips to a 'reached' state once the moment passes. Needs no data provider.",capabilities:[],schema:P({target:B().default("").describe(`The moment to count down to, as an ISO 8601 string. Add a timezone for an unambiguous instant, e.g. "2026-07-30T18:00:00-04:00" or "2026-12-31T23:59:59Z"; a bare "2026-07-30T18:00" is read in the viewer's local timezone. Empty shows a "set a target" prompt.`),label:B().default("").describe('Caption above the countdown, e.g. "FOMC Decision". Empty hides it.'),showTarget:we().default(!0).describe("Show the formatted target date and time under the countdown.")})},Ki={name:"link-grid",category:"tools",iconUrl:$("link-grid"),layout:{w:3,h:2,minW:2,minH:1},description:"A grid of quick-launch tiles linking to your favourite sites — TradingView, exchanges, news, docs, your own dashboards. Each tile opens in a new tab and shows the destination site's favicon by default (fetched keyless from a public favicon service), with an optional per-link icon override and a first-letter fallback. Needs no data provider.",capabilities:[],schema:P({links:he(P({label:B().min(1).describe('Tile caption, e.g. "TradingView".'),url:B().min(1).describe("Destination URL (https). Opens in a new tab."),icon:B().default("").describe(`Optional icon override: an emoji (e.g. "📈") or an https image URL. Empty uses the destination site's favicon, falling back to the label's first letter.`)})).min(1).default([{label:"TradingView",url:"https://www.tradingview.com",icon:"📈"},{label:"Hyperliquid",url:"https://app.hyperliquid.xyz",icon:"⚡"}]).describe("The links to show as tiles. At least one."),columns:D().int().min(1).max(4).default(2).describe("How many tiles per row.")})},Ji={name:"calculator",category:"tools",iconUrl:$("calculator"),layout:{w:3,h:3,minW:2,minH:2},description:"Position-size & risk calculator. Enter account size, risk-per-trade %, entry and stop price; it computes the dollars at risk, the per-unit risk, the position size (units) that respects that risk budget, the resulting position value, and whether the setup is long or short. All math runs client-side — no data provider. Inputs are editable live; the configured values are the starting point.",capabilities:[],schema:P({account:D().positive().default(1e4).describe("Account size used as the risk base, in the quote currency."),riskPct:D().positive().max(100).default(1).describe("Percent of the account risked on the trade, e.g. 1 = 1%."),entry:D().positive().default(100).describe("Entry price."),stop:D().positive().default(95).describe("Stop-loss price. Its distance from entry sets the per-unit risk; below entry = long, above = short."),currency:B().default("$").describe("Currency symbol shown next to money values.")})},Qi={name:"quote",category:"layout",iconUrl:$("quote"),layout:{w:4,h:2,minW:2,minH:1},description:'Displays a market or trading quote, centered — set one or rotate through several. A calm bit of wall-art for the dashboard: trading maxims, reminders of your own rules, mantras. Write any attribution into the text itself (e.g. "… — Buffett"). Needs no data provider.',capabilities:[],schema:P({quotes:he(B().min(1)).min(1).default(["Be fearful when others are greedy, and greedy when others are fearful. — Warren Buffett","The trend is your friend until the end when it bends.","Plan the trade, trade the plan."]).describe("One or more quotes. With more than one, the frame rotates through them."),intervalSec:D().int().min(0).default(12).describe("Seconds between rotations when there are multiple quotes. 0 shows the first quote, fixed.")})},ec={name:"divider",category:"layout",iconUrl:$("divider"),layout:{w:12,h:1,minW:1,minH:1},description:"A plain rule that separates regions of the dashboard, with an optional centered label. Renders chrome-less (no card) — lighter than a heading. Use a horizontal divider full-width between stacked zones, or set orientation to vertical for a 1-column-wide column separator. Needs no data provider.",capabilities:[],chrome:"bare",schema:P({label:B().default("").describe("Optional text shown in the middle of the rule. Empty = a clean line."),orientation:Q(["horizontal","vertical"]).default("horizontal").describe("Horizontal rule (spans the width) or vertical rule (spans the height)."),style:Q(["solid","dashed","dotted"]).default("solid").describe("Line style.")})},tc={name:"dice",category:"tools",iconUrl:$("dice"),layout:{w:2,h:2,minW:1,minH:1},description:"A click-to-decide widget — a random decision-maker with no data provider. Flip a coin (heads/tails), roll a die (1–6), or pick at random from your own list of options. Click the surface to re-roll. Use it to break a tie, pick what to trade, or settle any small decision.",capabilities:[],schema:P({mode:Q(["coin","dice","list"]).default("coin").describe("coin = heads/tails, dice = 1–6, list = random pick from options."),options:he(B()).default(["Yes","No"]).describe("Choices used in list mode."),label:B().default("").describe("Optional caption, e.g. the question being decided.")})},nc={name:"risk-reward",category:"tools",iconUrl:$("risk-reward"),layout:{w:3,h:3,minW:2,minH:2},description:"Risk:reward planner. Enter entry, stop-loss and profit-target prices; it computes the per-unit risk and reward, their percentages of entry, and the resulting R:R ratio, shown large above a two-segment bar (red risk leg vs green reward leg, sized to scale). Pure client-side math — no data provider. Complements the calculator frame by adding the target/reward leg the position sizer leaves out.",capabilities:[],schema:P({entry:D().default(100).describe("Planned entry price."),stop:D().default(95).describe("Stop-loss price."),target:D().default(115).describe("Profit target price."),direction:Q(["long","short"]).default("long").describe("Trade direction. Long expects stop < entry < target; short expects target < entry < stop — used for labels and to flag a mismatched setup."),label:B().default("").describe("Optional caption.")})},rc={name:"marquee",category:"layout",iconUrl:$("marquee"),layout:{w:6,h:1,minW:2,minH:1},description:"A chrome-less scrolling banner that glides custom text continuously right-to-left across the frame (think stadium ticker / news crawl). Renders with no card — it fills the whole frame. Use for a slogan, a reminder, or a hype line. Needs no data provider.",capabilities:[],chrome:"bare",schema:P({text:B().default("LFG").describe("The text that scrolls across the banner."),speed:Q(["slow","normal","fast"]).default("normal").describe("Scroll speed."),accent:we().default(!0).describe("Tint the text with the dashboard accent color.")})},sc={name:"stopwatch",layout:{w:3,h:2,minW:2,minH:1},category:"tools",iconUrl:$("stopwatch"),description:"A count-up stopwatch — time-in-trade, a focus session, how long a setup has been live. Start / Pause / Reset, ticking up in H:MM:SS, and it persists across reloads (the running state is saved into the dashboard, so it keeps counting where it left off). Runs entirely client-side — needs no data provider.",capabilities:[],schema:P({label:B().default("Session").describe("Caption above the timer."),startedAt:D().default(0).describe("Epoch ms when the timer was last started; 0 = paused. Persisted automatically by the frame."),accumulatedMs:D().default(0).describe("Milliseconds banked before the current run. Persisted automatically by the frame.")})},oc={name:"session-progress",category:"tools",iconUrl:$("session-progress"),layout:{w:3,h:2,minW:2,minH:1},description:"A horizontal progress bar showing how far through today's trading session an exchange is — fills from open to close with a percent readout, and a 'closes in …' / 'opens in …' countdown. Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); sessions are computed client-side from the exchange's timezone and hours, so it needs no data provider.",capabilities:[],schema:P({exchange:B().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),label:B().default("").describe("Optional caption shown by the exchange code."),showCountdown:we().default(!0).describe("Show the time-to-open / time-to-close countdown.")})},ac={name:"holiday-calendar",category:"tools",iconUrl:$("holiday-calendar"),layout:{w:3,h:4,minW:2,minH:2},description:"Upcoming market holidays (full closures) for a chosen exchange — the next few dates with their weekday and a countdown ('in 9d'). Pick any exchange code (NYSE, NASDAQ, LSE, TSX, B3, …); dates come from a bundled holiday table and are computed client-side, so it needs no data provider. Note: the bundled table currently covers 2026.",capabilities:[],schema:P({exchange:B().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),count:D().int().min(1).max(20).default(5).describe("How many upcoming holidays to list."),label:B().default("").describe("Optional caption shown above the list.")})},ic={name:"day-meter",category:"tools",iconUrl:$("day-meter"),layout:{w:4,h:2,minW:2,minH:1},description:"A strip of the current week's days for a chosen exchange — today highlighted, market holidays flagged in amber, and (optionally) non-trading days greyed. Computed client-side from the exchange's trading days + a bundled holiday table; needs no data provider.",capabilities:[],schema:P({exchange:B().default("NYSE").describe("Exchange code: NYSE, NASDAQ, LSE, TSX, B3, …"),weekdaysOnly:we().default(!0).describe("Show only the exchange's trading days; off shows the full 7-day week with weekends greyed."),label:B().default("").describe("Optional caption shown by the strip.")})},cc={name:"returns-projector",category:"tools",iconUrl:$("returns-projector"),layout:{w:3,h:4,minW:2,minH:3},description:"A compound-growth projector — enter a starting principal, a percent return per period, the number of periods, and an optional per-period contribution; it charts the projected balance curve and shows the ending value and total gain. Pure client-side math, no data provider; complements the position-size/risk `calculator`.",capabilities:[],schema:P({principal:D().default(1e3).describe("Starting balance."),ratePct:D().default(5).describe("Return per period, in percent (e.g. 5 = 5%)."),periods:D().int().min(1).max(600).default(12).describe("Number of compounding periods to project."),contribution:D().default(0).describe("Amount added at the end of each period."),label:B().default("").describe("Optional caption.")})},lc={name:"breakeven",category:"tools",iconUrl:$("breakeven"),layout:{w:3,h:4,minW:2,minH:2},description:"A break-even / average-cost calculator — add your fills (price + size) and it computes the size-weighted average entry; set an optional current price to see the unrealized P&L %. Pure client-side math, no data provider.",capabilities:[],schema:P({fills:he(P({price:D().describe("Fill price."),size:D().describe("Fill size, in units.")})).default([{price:100,size:1}]).describe("Your entry fills; their size-weighted average is the break-even."),currentPrice:D().default(0).describe("Optional current price; greater than 0 shows the unrealized P&L %."),label:B().default("").describe("Optional caption.")})},uc={name:"checklist",category:"tools",iconUrl:$("checklist"),layout:{w:3,h:3,minW:2,minH:2},description:"A tickable checklist — a pre-trade routine, a daily ritual, anything. Tap items to check them off; the checked state persists across reloads (saved into the dashboard). Client-side only, no data provider.",capabilities:[],schema:P({title:B().default("Pre-trade checklist").describe("Heading shown above the list."),items:he(B()).default(["Trend & bias aligned","Stop level set","Risk sized correctly"]).describe("The checklist items, top to bottom."),checked:he(we()).default([]).describe("Per-item checked state (by index); persisted automatically by the frame.")})},dc={name:"pomodoro",category:"tools",iconUrl:$("pomodoro"),layout:{w:3,h:3,minW:2,minH:2},description:"A Pomodoro focus timer — alternating work and break intervals with Start / Pause / Reset and a cycle counter, counting down in MM:SS. Runs entirely client-side with no data provider; timer state is in-session (not persisted).",capabilities:[],schema:P({workMin:D().min(1).max(180).default(25).describe("Work interval length, in minutes."),breakMin:D().min(1).max(120).default(5).describe("Break interval length, in minutes."),cycles:D().int().min(1).max(20).default(4).describe("Work/break cycles before the counter loops."),label:B().default("").describe("Optional caption.")})},mc={name:"rules-card",category:"layout",iconUrl:$("rules-card"),layout:{w:3,h:3,minW:2,minH:2},description:"A pinned, auto-numbered list of your trading rules (or any principles) — always fully visible, unlike the rotating `quote` frame. Static text, client-side, no data provider.",capabilities:[],schema:P({title:B().default("My rules").describe("Heading shown above the list."),rules:he(B()).default(["Cut losers fast, let winners run","No trade without a stop","One setup at a time"]).describe("The rules, in order; rendered as a numbered list.")})},fc={name:"breathing",category:"layout",iconUrl:$("breathing"),chrome:"bare",layout:{w:2,h:2,minW:1,minH:1},description:"A chrome-less breathing pacer — a circle that expands and contracts through configurable inhale / hold / exhale / hold phases to steady your breathing between trades. Renders with no card; client-side only, no data provider.",capabilities:[],schema:P({inhale:D().min(1).max(60).default(4).describe("Inhale seconds."),hold:D().min(0).max(60).default(4).describe("Hold-after-inhale seconds."),exhale:D().min(1).max(60).default(4).describe("Exhale seconds."),holdAfter:D().min(0).max(60).default(4).describe("Hold-after-exhale seconds.")})},hc={name:"spotify-embed",category:"layout",iconUrl:$("spotify-embed"),layout:{w:3,h:4,minW:2,minH:2},description:"Embeds a Spotify track, album, playlist, artist, or show from its public open.spotify.com share link (same embed approach as the `video` frame), using Spotify's official keyless iframe player. Needs an internet connection to play.",capabilities:[],schema:P({url:B().default("https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M").describe("A Spotify share URL (open.spotify.com/track|album|playlist|artist/…)."),compact:we().default(!1).describe("Use Spotify's compact (single-row) player height.")})},pc={name:"btc-fees",category:"bitcoin",iconUrl:$("btc-fees"),layout:{w:3,h:2,minW:2,minH:2},description:"Recommended Bitcoin on-chain fee rates (sat/vB) from mempool.space — the next-block ('fastest'), ~30-minute, ~1-hour, economy, and minimum tiers, as a compact gauge. Live mempool data, keyless; updates every ~30s.",capabilities:["btc-fees"],source:G.mempool,schema:P({tiers:he(Q(["fastest","halfHour","hour","economy","minimum"])).min(1).max(5).default(["fastest","halfHour","hour","economy"]).describe('Which fee tiers to show, in order. "fastest" = next block, "halfHour"/"hour" = within ~30/60 min, "economy"/"minimum" = cheapest relayable.')})},gc={name:"btc-mempool",category:"bitcoin",iconUrl:$("btc-mempool"),layout:{w:5,h:3,minW:3,minH:2},description:"Bitcoin mempool congestion at a glance — unconfirmed transaction count, total pending vsize, and a row of projected ('template') blocks the network will likely mine next, each labelled with its median fee rate (sat/vB) and tx count. Live mempool data from mempool.space, keyless.",capabilities:["btc-mempool"],source:G.mempool,schema:P({projectedBlocks:D().int().min(1).max(8).default(5).describe("How many projected (yet-to-be-mined) blocks to show, next-to-mine first.")})},bc={name:"btc-blocks",category:"bitcoin",iconUrl:$("btc-blocks"),layout:{w:5,h:4,minW:3,minH:3},description:"Feed of the most recently mined Bitcoin blocks — each row shows the height, how long ago it was mined, transaction count, the mining pool that found it, total fees (BTC), and size. Live data from mempool.space, keyless; newest first.",capabilities:["btc-blocks"],source:G.mempool,schema:P({count:D().int().min(3).max(15).default(8).describe("How many recent blocks to list (newest first).")})},xc={name:"btc-hashrate",category:"bitcoin",iconUrl:$("btc-hashrate"),layout:{w:6,h:3,minW:3,minH:2},description:"Bitcoin network hashrate over time as a line chart, with the current hashrate (EH/s) and difficulty as headline figures. Shows the long-run security trend of the network. Data from mempool.space (daily granularity), keyless.",capabilities:["btc-hashrate"],source:G.mempool,schema:P({window:Q(["1y","2y","3y"]).default("1y").describe("History window for the hashrate line.")})},yc={name:"btc-difficulty",category:"bitcoin",iconUrl:$("btc-difficulty"),layout:{w:4,h:3,minW:3,minH:2},description:"Countdown to the next Bitcoin difficulty adjustment — a progress bar through the current 2016-block epoch, the estimated change (+ = mining gets harder), blocks remaining, and the estimated retarget date. Also shows the previous adjustment. Data from mempool.space, keyless.",capabilities:["btc-difficulty"],source:G.mempool,schema:P({showPrevious:we().default(!0).describe("Also show the percentage change applied at the previous retarget.")})},vc={name:"mining-pools",category:"bitcoin",iconUrl:$("mining-pools"),layout:{w:6,h:4,minW:3,minH:3},description:"Treemap of Bitcoin mining-pool dominance over a window — each tile is a pool sized by the share of blocks it mined, so you can see how concentrated hashpower is right now (Foundry, AntPool, ViaBTC…). Data from mempool.space, keyless.",capabilities:["mining-pools"],source:G.mempool,schema:P({window:Q(["24h","3d","1w","1m"]).default("1w").describe("Window over which to measure each pool's block share."),topN:D().int().min(3).max(25).default(12).describe("How many of the largest pools to show; the rest fold into 'Other'.")})},wc={name:"lightning-stats",category:"bitcoin",iconUrl:$("lightning-stats"),layout:{w:4,h:3,minW:3,minH:2},description:"Bitcoin Lightning Network snapshot — public node count, channel count, and total network capacity (BTC), with a day-over-day delta and the Tor/clearnet node split. Data from mempool.space, keyless; updates roughly daily.",capabilities:["lightning-stats"],source:G.mempool,schema:P({showSplit:we().default(!0).describe("Show the Tor vs clearnet node split under the headline stats.")})},kc={name:"options-put-call",category:"derivatives",iconUrl:$("options-put-call"),layout:{w:4,h:3,minW:3,minH:2},description:"Deribit options put/call ratio for BTC or ETH — the headline ratio (by open interest or 24h volume), a call-vs-put open-interest split bar, and the open-interest-weighted average implied volatility. A ratio above 1 means puts outweigh calls (defensive positioning). Keyless Deribit market data.",capabilities:["options-summary"],source:G.deribit,schema:P({currency:Q(["BTC","ETH"]).default("BTC").describe("Which Deribit options book to summarise — BTC or ETH (the only deeply liquid books)."),basis:Q(["oi","volume"]).default("oi").describe('Headline put/call ratio basis: "oi" = by open interest (positioning), "volume" = by 24h traded volume (flow). The other is shown smaller.')})},Sc={name:"options-iv",category:"derivatives",iconUrl:$("options-iv"),layout:{w:6,h:3,minW:3,minH:2},description:"Deribit DVOL implied-volatility index for BTC or ETH over time — the crypto equivalent of the VIX, as a line chart with the current reading and its change over the window. Rising DVOL = the market is pricing bigger expected swings. Keyless Deribit market data.",capabilities:["volatility-index"],source:G.deribit,schema:P({currency:Q(["BTC","ETH"]).default("BTC").describe("Which DVOL volatility index to plot — BTC or ETH."),lookback:Q(["7D","1M","3M"]).default("1M").describe("History window for the volatility-index line.")})},jc={name:"options-oi-strike",category:"derivatives",iconUrl:$("options-oi-strike"),layout:{w:6,h:4,minW:4,minH:3},description:"Open interest by strike for the nearest Deribit options expiry (BTC or ETH) — a grouped histogram of call vs put open interest across strikes, with the current spot marked. Surfaces the strike 'walls' where positioning is concentrated. Keyless Deribit market data.",capabilities:["options-summary"],source:G.deribit,schema:P({currency:Q(["BTC","ETH"]).default("BTC").describe("Which Deribit options book — BTC or ETH."),strikes:D().int().min(6).max(30).default(14).describe("How many strikes nearest the current spot to show (centered on the underlying price).")})},Nc={name:"coin-movers",category:"markets",iconUrl:$("coin-movers"),layout:{w:5,h:4,minW:3,minH:3},description:"Broad-market crypto gainers and losers across the top ~300 coins by market cap, over a selectable window (1h / 24h / 7d / 30d) — the biggest movers side by side with price and % change. Unlike a top-coins heatmap, this surfaces mid- and small-caps that ripped or dumped, not just the megacaps. Keyless data from Coinpaprika. Crypto only.",capabilities:["coin-movers"],source:G.coinpaprika,schema:P({window:Q(["1h","24h","7d","30d"]).default("24h").describe("Which price-change window ranks the movers: 1h (intraday momentum), 24h (daily), 7d (weekly), 30d (monthly)."),count:D().int().min(3).max(15).default(6).describe("How many gainers and how many losers to list (each side)."),minRank:D().int().min(20).max(300).default(150).describe("Only consider coins ranked at or above this market-cap rank — a liquidity floor that keeps illiquid micro-cap dust (which posts absurd % moves on no volume) out of the list. Lower = stricter (megacaps only); higher = includes more small-caps.")})},Zs=720,Cp=1e3,Yn=3,zp={top:12,right:66,bottom:28,left:8};Li.schema;function _p(){return typeof document>"u"?"hsl(242 90% 66%)":`hsl(${getComputedStyle(document.documentElement).getPropertyValue("--zf-accent-hue").trim()||"242"} 90% 66%)`}function Tp({portfolio:e,config:t,windowSec:n}){var p;const{total:r}=Kr(e.holdings),s=f.useMemo(()=>_p(),[]),[a,i]=f.useState([]),c=f.useRef(r);f.useEffect(()=>{c.current=r},[r]);const l=f.useCallback(()=>{const x=c.current;if(!Number.isFinite(x)||x<=0)return;const b=Date.now()/1e3;i(y=>{const g=y[y.length-1];if(g&&Math.abs(b-g.time)<.5&&g.value===x)return y;const v=y.length===0?[{time:b-Yn,value:x},{time:b,value:x}]:[...y,{time:b,value:x}];return v.length>Zs?v.slice(-Zs):v})},[]);f.useEffect(()=>{l()},[l,r]),f.useEffect(()=>{const x=window.setInterval(l,Cp);return()=>window.clearInterval(x)},[l]);const u=(p=a[0])==null?void 0:p.value,d=u&&r?(r/u-1)*100:0,h=f.useMemo(()=>a.length===0?[]:[{id:"equity",label:"Portfolio",color:s,data:a,value:r}],[a,r,s]),m=f.useMemo(()=>{if(a.length===0)return Yn;const x=a[a.length-1].time-a[0].time;return Math.min(n,Math.max(Yn,Math.ceil(x)))},[a,n]);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o.jsxs("div",{className:"flex flex-none items-baseline justify-between border-b border-white/[0.06] pb-2",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx(Jr,{portfolio:e,config:t,className:"caption text-soft"}),o.jsx("span",{className:"metric-md text-strong",children:le(r)})]}),o.jsxs("span",{className:"body-sm font-semibold tabular-nums",style:{color:Ce(d)},children:[ye(d)," ",o.jsx("span",{className:"caption text-soft",children:"session"})]})]}),o.jsx("div",{className:"min-h-0 flex-1 [&>div[style*='align-items']]:!hidden",children:o.jsx(Lr,{data:[],value:r,series:h,theme:"dark",window:m,grid:!0,loading:a.length<=1,scrub:!1,badge:!1,formatValue:le,padding:zp,style:{width:"100%",height:"100%"}})})]})}function Ep({config:e}){return o.jsx(Qr,{config:e,loadingLabel:"loading portfolio…",children:t=>o.jsx(Tp,{portfolio:t,config:e,windowSec:e.windowSec})})}const Mp={...Li,component:Ep};function Cc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Cc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ap(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Cc(e))&&(r&&(r+=" "),r+=t);return r}const Pp=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Rp=(e,t)=>({classGroupId:e,validator:t}),zc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Tn="-",Ws=[],$p="arbitrary..",Dp=e=>{const t=Lp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ip(i);const c=i.split(Tn),l=c[0]===""&&c.length>1?1:0;return _c(c,l,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const l=r[i],u=n[i];return l?u?Pp(u,l):l:u||Ws}return n[i]||Ws}}},_c=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const u=_c(e,t+1,a);if(u)return u}const i=n.validators;if(i===null)return;const c=t===0?e.join(Tn):e.slice(t).join(Tn),l=i.length;for(let u=0;u<l;u++){const d=i[u];if(d.validator(c))return d.classGroupId}},Ip=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?$p+r:void 0})(),Lp=e=>{const{theme:t,classGroups:n}=e;return Fp(n,t)},Fp=(e,t)=>{const n=zc();for(const r in e){const s=e[r];ts(s,n,r,t)}return n},ts=(e,t,n,r)=>{const s=e.length;for(let a=0;a<s;a++){const i=e[a];Op(i,t,n,r)}},Op=(e,t,n,r)=>{if(typeof e=="string"){Up(e,t,n);return}if(typeof e=="function"){Bp(e,t,n,r);return}Hp(e,t,n,r)},Up=(e,t,n)=>{const r=e===""?t:Tc(t,e);r.classGroupId=n},Bp=(e,t,n,r)=>{if(Vp(e)){ts(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Rp(n,e))},Hp=(e,t,n,r)=>{const s=Object.entries(e),a=s.length;for(let i=0;i<a;i++){const[c,l]=s[i];ts(l,Tc(t,c),n,r)}},Tc=(e,t)=>{let n=e;const r=t.split(Tn),s=r.length;for(let a=0;a<s;a++){const i=r[a];let c=n.nextPart.get(i);c||(c=zc(),n.nextPart.set(i,c)),n=c}return n},Vp=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Zp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(a,i)=>{n[a]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let i=n[a];if(i!==void 0)return i;if((i=r[a])!==void 0)return s(a,i),i},set(a,i){a in n?n[a]=i:s(a,i)}}},jr="!",Ys=":",Wp=[],Gs=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Yp=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let i=0,c=0,l=0,u;const d=s.length;for(let b=0;b<d;b++){const y=s[b];if(i===0&&c===0){if(y===Ys){a.push(s.slice(l,b)),l=b+1;continue}if(y==="/"){u=b;continue}}y==="["?i++:y==="]"?i--:y==="("?c++:y===")"&&c--}const h=a.length===0?s:s.slice(l);let m=h,p=!1;h.endsWith(jr)?(m=h.slice(0,-1),p=!0):h.startsWith(jr)&&(m=h.slice(1),p=!0);const x=u&&u>l?u-l:void 0;return Gs(a,p,m,x)};if(t){const s=t+Ys,a=r;r=i=>i.startsWith(s)?a(i.slice(s.length)):Gs(Wp,!1,i,void 0,!0)}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},Gp=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let a=0;a<n.length;a++){const i=n[a],c=i[0]==="[",l=t.has(i);c||l?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(i)):s.push(i)}return s.length>0&&(s.sort(),r.push(...s)),r}},Xp=e=>({cache:Zp(e.cacheSize),parseClassName:Yp(e),sortModifiers:Gp(e),postfixLookupClassGroupIds:qp(e),...Dp(e)}),qp=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Kp=/\s+/,Jp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a,postfixLookupClassGroupIds:i}=t,c=[],l=e.trim().split(Kp);let u="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:m,modifiers:p,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:y}=n(h);if(m){u=h+(u.length>0?" "+u:u);continue}let g=!!y,v;if(g){const k=b.substring(0,y);v=r(k);const w=v&&i[v]?r(b):void 0;w&&w!==v&&(v=w,g=!1)}else v=r(b);if(!v){if(!g){u=h+(u.length>0?" "+u:u);continue}if(v=r(b),!v){u=h+(u.length>0?" "+u:u);continue}g=!1}const S=p.length===0?"":p.length===1?p[0]:a(p).join(":"),z=x?S+jr:S,j=z+v;if(c.indexOf(j)>-1)continue;c.push(j);const C=s(v,g);for(let k=0;k<C.length;++k){const w=C[k];c.push(z+w)}u=h+(u.length>0?" "+u:u)}return u},Qp=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Ec(n))&&(s&&(s+=" "),s+=r);return s},Ec=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ec(e[r]))&&(n&&(n+=" "),n+=t);return n},e0=(e,...t)=>{let n,r,s,a;const i=l=>{const u=t.reduce((d,h)=>h(d),e());return n=Xp(u),r=n.cache.get,s=n.cache.set,a=c,c(l)},c=l=>{const u=r(l);if(u)return u;const d=Jp(l,n);return s(l,d),d};return a=i,(...l)=>a(Qp(...l))},t0=[],ve=e=>{const t=n=>n[e]||t0;return t.isThemeGetter=!0,t},Mc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ac=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n0=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s0=/\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$/,o0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,a0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rt=e=>n0.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),Ye=e=>!!e&&Number.isInteger(Number(e)),Gn=e=>e.endsWith("%")&&X(e.slice(0,-1)),qe=e=>r0.test(e),Pc=()=>!0,c0=e=>s0.test(e)&&!o0.test(e),ns=()=>!1,l0=e=>a0.test(e),u0=e=>i0.test(e),d0=e=>!F(e)&&!O(e),m0=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)),f0=e=>dt(e,Dc,ns),F=e=>Mc.test(e),ht=e=>dt(e,Ic,c0),Xs=e=>dt(e,w0,X),h0=e=>dt(e,Fc,Pc),p0=e=>dt(e,Lc,ns),qs=e=>dt(e,Rc,ns),g0=e=>dt(e,$c,u0),nn=e=>dt(e,Oc,l0),O=e=>Ac.test(e),Lt=e=>wt(e,Ic),b0=e=>wt(e,Lc),Ks=e=>wt(e,Rc),x0=e=>wt(e,Dc),y0=e=>wt(e,$c),rn=e=>wt(e,Oc,!0),v0=e=>wt(e,Fc,!0),dt=(e,t,n)=>{const r=Mc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wt=(e,t,n=!1)=>{const r=Ac.exec(e);return r?r[1]?t(r[1]):n:!1},Rc=e=>e==="position"||e==="percentage",$c=e=>e==="image"||e==="url",Dc=e=>e==="length"||e==="size"||e==="bg-size",Ic=e=>e==="length",w0=e=>e==="number",Lc=e=>e==="family-name",Fc=e=>e==="number"||e==="weight",Oc=e=>e==="shadow",k0=()=>{const e=ve("color"),t=ve("font"),n=ve("text"),r=ve("font-weight"),s=ve("tracking"),a=ve("leading"),i=ve("breakpoint"),c=ve("container"),l=ve("spacing"),u=ve("radius"),d=ve("shadow"),h=ve("inset-shadow"),m=ve("text-shadow"),p=ve("drop-shadow"),x=ve("blur"),b=ve("perspective"),y=ve("aspect"),g=ve("ease"),v=ve("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...z(),O,F],C=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[O,F,l],N=()=>[rt,"full","auto",...w()],E=()=>[Ye,"none","subgrid",O,F],W=()=>["auto",{span:["full",Ye,O,F]},Ye,O,F],L=()=>[Ye,"auto",O,F],A=()=>["auto","min","max","fr",O,F],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],_=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...w()],H=()=>[rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],te=()=>[rt,"screen","full","dvw","lvw","svw","min","max","fit",...w()],se=()=>[rt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],R=()=>[e,O,F],ie=()=>[...z(),Ks,qs,{position:[O,F]}],ke=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",x0,f0,{size:[O,F]}],de=()=>[Gn,Lt,ht],J=()=>["","none","full",u,O,F],ce=()=>["",X,Lt,ht],Be=()=>["solid","dashed","dotted","double"],ft=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[X,Gn,Ks,qs],Me=()=>["","none",x,O,F],Ie=()=>["none",X,O,F],tt=()=>["none",X,O,F],He=()=>[X,O,F],Oe=()=>[rt,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[qe],breakpoint:[qe],color:[Pc],container:[qe],"drop-shadow":[qe],ease:["in","out","in-out"],font:[d0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[qe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[qe],shadow:[qe],spacing:["px",X],text:[qe],"text-shadow":[qe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rt,F,O,y]}],container:["container"],"container-type":[{"@container":["","normal","size",O,F]}],"container-named":[m0],columns:[{columns:[X,F,O,c]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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:j()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{"inset-s":N(),start:N()}],end:[{"inset-e":N(),end:N()}],"inset-bs":[{"inset-bs":N()}],"inset-be":[{"inset-be":N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[Ye,"auto",O,F]}],basis:[{basis:[rt,"full","auto",c,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[X,rt,"auto","initial","none",F]}],grow:[{grow:["",X,O,F]}],shrink:[{shrink:["",X,O,F]}],order:[{order:[Ye,"first","last","none",O,F]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[..._(),"normal"]}],"justify-self":[{"justify-self":["auto",..._()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[..._(),{baseline:["","last"]}]}],"align-self":[{self:["auto",..._(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[..._(),"baseline"]}],"place-self":[{"place-self":["auto",..._()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...se()]}],"min-block-size":[{"min-block":["auto",...se()]}],"max-block-size":[{"max-block":["none",...se()]}],w:[{w:[c,"screen",...H()]}],"min-w":[{"min-w":[c,"screen","none",...H()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Lt,ht]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,v0,h0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gn,F]}],"font-family":[{font:[b0,p0,t]}],"font-features":[{"font-features":[F]}],"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:[s,O,F]}],"line-clamp":[{"line-clamp":[X,"none",O,Xs]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",O,F]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",O,F]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Be(),"wavy"]}],"text-decoration-thickness":[{decoration:[X,"from-font","auto",O,ht]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[X,"auto",O,F]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Ye,O,F]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O,F]}],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",O,F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ke()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ye,O,F],radial:["",O,F],conic:[Ye,O,F]},y0,g0]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Be(),"hidden","none"]}],"divide-style":[{divide:[...Be(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[X,O,F]}],"outline-w":[{outline:["",X,Lt,ht]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,rn,nn]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",h,rn,nn]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[X,ht]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,rn,nn]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[X,O,F]}],"mix-blend":[{"mix-blend":[...ft(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ft()}],"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":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[O,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ke()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",O,F]}],filter:[{filter:["","none",O,F]}],blur:[{blur:Me()}],brightness:[{brightness:[X,O,F]}],contrast:[{contrast:[X,O,F]}],"drop-shadow":[{"drop-shadow":["","none",p,rn,nn]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",X,O,F]}],"hue-rotate":[{"hue-rotate":[X,O,F]}],invert:[{invert:["",X,O,F]}],saturate:[{saturate:[X,O,F]}],sepia:[{sepia:["",X,O,F]}],"backdrop-filter":[{"backdrop-filter":["","none",O,F]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[X,O,F]}],"backdrop-contrast":[{"backdrop-contrast":[X,O,F]}],"backdrop-grayscale":[{"backdrop-grayscale":["",X,O,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,O,F]}],"backdrop-invert":[{"backdrop-invert":["",X,O,F]}],"backdrop-opacity":[{"backdrop-opacity":[X,O,F]}],"backdrop-saturate":[{"backdrop-saturate":[X,O,F]}],"backdrop-sepia":[{"backdrop-sepia":["",X,O,F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",O,F]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[X,"initial",O,F]}],ease:[{ease:["linear","initial",g,O,F]}],delay:[{delay:[X,O,F]}],animate:[{animate:["none",v,O,F]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,O,F]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:Ie()}],"rotate-x":[{"rotate-x":Ie()}],"rotate-y":[{"rotate-y":Ie()}],"rotate-z":[{"rotate-z":Ie()}],scale:[{scale:tt()}],"scale-x":[{"scale-x":tt()}],"scale-y":[{"scale-y":tt()}],"scale-z":[{"scale-z":tt()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[O,F,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],zoom:[{zoom:[Ye,O,F]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",O,F]}],"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":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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",O,F]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[X,Lt,ht,Xs]}],stroke:[{stroke:["none",...R()]}],"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"]}},S0=e0(k0);function Ee(...e){return S0(Ap(e))}const Ft="4px",sn="4px",j0=2.5,N0=(e,t,n,r,s)=>{const a=e.children;if(!a||a.length===0)return;const i=(b,y,g,v,S)=>{if(v===0)return 1/0;const z=y/v*S;if(z===0)return 1/0;let j=0;for(const C of b){const w=(C.value||0)/y*g,N=z/w,E=Math.abs(N-j0);j=Math.max(j,E)}return j},c=(b,y,g,v,S,z,j)=>{const C=y/g*S;let k=j;for(const w of b){const E=(w.value||0)/y*v;w.x0=z,w.y0=k,w.x1=z+C,w.y1=k+E,k+=E}return C},l=r-t,u=s-n,d=a.reduce((b,y)=>b+(y.value||0),0);if(d===0)return;let h=[...a],m=t,p=l,x=d;for(;h.length>0;){let b=[],y=0;for(let v=0;v<h.length;v++){const S=h[v],z=S.value||0,j=[...b,S],C=y+z;if(b.length===0)b=j,y=C;else{const k=i(b,y,u,x,p);if(i(j,C,u,x,p)<=k)b=j,y=C;else break}}const g=c(b,y,x,u,p,m,n);h=h.slice(b.length),m+=g,p-=g,x-=y}};function C0({data:e,className:t,LeafComponent:n,getColorValue:r,tileMode:s="squarify"}){const a=f.useRef(null),i=f.useRef(null),c=f.useRef(null),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),[,h]=f.useTransition(),[m,p]=f.useState({width:0,height:0});f.useEffect(()=>{const g=a.current;if(g){const v=new ResizeObserver(()=>{h(()=>{p({width:g.offsetWidth,height:g.offsetHeight})})});return v.observe(g),()=>{v.disconnect()}}},[]),f.useEffect(()=>{const g=i.current;if(g){const v=g.children;let S=v[0],z=v[0],j=v[0],C=v[0];for(let k=0;k<v.length;k++){const w=v[k],{x:N,y:E}=w.getBoundingClientRect(),W=S.getBoundingClientRect(),L=z.getBoundingClientRect(),A=j.getBoundingClientRect(),U=C.getBoundingClientRect();N<=W.x&&E<=W.y&&(S=w),N<=L.x&&E>=L.y&&(z=w),N>=A.x&&E<=A.y&&(j=w),N>=U.x&&E>=U.y&&(C=w)}c.current&&(c.current.style.borderTopLeftRadius=Ft),c.current=S,c.current.style.borderTopLeftRadius=sn,l.current&&(l.current.style.borderBottomLeftRadius=Ft),l.current=z,l.current.style.borderBottomLeftRadius=sn,u.current&&(u.current.style.borderTopRightRadius=Ft),u.current=j,u.current.style.borderTopRightRadius=sn,d.current&&(d.current.style.borderBottomRightRadius=Ft),d.current=C,d.current.style.borderBottomRightRadius=sn}},[m]);const x=f.useMemo(()=>{switch(s){case"vertical-rectangle":return N0;case"squarify":default:return xl}},[s]),b=f.useMemo(()=>yl().size([m.width,m.height]).tile(x).paddingInner(4)(vl({id:"root",value:0,children:e}).sum(g=>g.value).sort((g,v)=>v.data.value-g.data.value)),[e,m.width,m.height,x]),y=f.useMemo(()=>{const g=b.leaves(),v=g.map(A=>r?r(A.data):A.data.value),S=v.filter(A=>A>=0),z=v.filter(A=>A<0),j=S.length>0?Math.min(...S):0,C=S.length>0?Math.max(...S):0,k=z.length>0?Math.min(...z):0,w=z.length>0?Math.max(...z):0,N=A=>A<0?w===k?1:(A-w)/(k-w):C===j?1:(A-j)/(C-j),E=(A,U)=>{if(U>=0){const H=Math.round(34+A*16);return`hsl(152 ${Math.round(42+A*20)}% ${H}%)`}const _=Math.round(36+A*15);return`hsl(350 ${Math.round(48+A*22)}% ${_}%)`},W=[...new Set(g.map(A=>A.x0))].sort((A,U)=>A-U),L=new Map(W.map((A,U)=>[A,U]));return g.map(A=>{const U=A.x1-A.x0,_=A.y1-A.y0,I=r?r(A.data):A.data.value,H=N(I),te=L.get(A.x0)??0,se=E(H,I);return o.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:A.x0,top:A.y0,width:U,height:_,borderRadius:Ft,backgroundColor:se},children:o.jsx(n,{width:U,height:_,data:A.data,columnIndex:te})},`${A.data.id}-box`)})},[b,n,r]);return o.jsx("div",{className:Ee("h-full w-full",t),ref:a,children:o.jsx("div",{className:"relative overflow-hidden rounded-lg",style:{height:m.height,width:m.width},ref:i,children:y})})}const Rt=C0,z0="4px",_0=6,T0=80,E0=24;function M0({data:e,className:t,CellComponent:n,getColorValue:r,gap:s=_0,showLabels:a=!1,rowLabelWidth:i=T0,columnLabelHeight:c=E0}){const l=f.useRef(null),[,u]=f.useTransition(),[d,h]=f.useState({width:0,height:0});f.useEffect(()=>{const k=l.current;if(k){const w=new ResizeObserver(()=>{u(()=>{h({width:k.offsetWidth,height:k.offsetHeight})})});return w.observe(k),()=>{w.disconnect()}}},[]);const{uniqueRows:m,uniqueColumns:p,rowToIndex:x,columnToIndex:b}=f.useMemo(()=>{const k=new Set,w=new Set,N=[],E=[];for(const A of e)k.has(A.row)||(k.add(A.row),N.push(A.row)),w.has(A.column)||(w.add(A.column),E.push(A.column));const W=new Map(N.map((A,U)=>[A,U])),L=new Map(E.map((A,U)=>[A,U]));return{uniqueRows:N,uniqueColumns:E,rowToIndex:W,columnToIndex:L}},[e]),y=f.useMemo(()=>{const k=a?i:0,w=a?c:0;return{x:k,y:w,width:Math.max(0,d.width-k),height:Math.max(0,d.height-w)}},[d,a,i,c]),g=f.useMemo(()=>{const k=p.length,w=m.length,N=k>0?Math.max(0,(y.width-s*(k-1))/k):0,E=w>0?Math.max(0,(y.height-s*(w-1))/w):0;return{cellWidth:N,cellHeight:E,columnX:A=>A*(N+s),rowY:A=>A*(E+s)}},[m.length,p.length,y,s]),v=f.useMemo(()=>{const k=e.map(_=>r?r(_):_.value),w=k.filter(_=>_>=0),N=k.filter(_=>_<0),E=w.length>0?Math.min(...w):0,W=w.length>0?Math.max(...w):0,L=N.length>0?Math.min(...N):0,A=N.length>0?Math.max(...N):0,U=_=>_<0?A===L?1:(_-A)/(L-A):W===E?1:(_-E)/(W-E);return e.map(_=>{const I=r?r(_):_.value,H=U(I),te=I>=0;return{cell:_,colorValue:I,intensity:H,isPositive:te}})},[e,r]),S=(k,w)=>{if(w){const W=Math.round(34+k*16);return`hsl(152 ${Math.round(42+k*20)}% ${W}%)`}const N=Math.round(36+k*15);return`hsl(350 ${Math.round(48+k*22)}% ${N}%)`},z=f.useMemo(()=>{const{cellWidth:k,cellHeight:w,columnX:N,rowY:E}=g;return k<=0||w<=0?null:v.map(({cell:W,intensity:L,isPositive:A})=>{const U=x.get(W.row),_=b.get(W.column);if(U===void 0||_===void 0)return null;const I=S(L,A);return o.jsx("div",{className:"group absolute cursor-pointer 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:y.x+N(_),top:y.y+E(U),width:k,height:w,borderRadius:z0,backgroundColor:I},children:o.jsx(n,{width:k,height:w,data:W,rowIndex:U,columnIndex:_,colorIntensity:L,isPositive:A})},W.id)})},[v,g,y,x,b,n]),j=f.useMemo(()=>{if(!a)return null;const{cellHeight:k,rowY:w}=g;return m.map((N,E)=>o.jsx("div",{className:"absolute flex items-center justify-end pr-2 text-xs text-white/60",style:{left:0,top:y.y+w(E),width:i,height:k},children:o.jsx("span",{className:"truncate",children:N})},`row-${N}`))},[a,m,g,y,i]),C=f.useMemo(()=>{if(!a)return null;const{cellWidth:k,columnX:w}=g;return p.map((N,E)=>o.jsx("div",{className:"absolute flex items-end justify-center pb-1 text-xs text-white/60",style:{left:y.x+w(E),top:0,width:k,height:c},children:o.jsx("span",{className:"truncate",children:N})},`col-${N}`))},[a,p,g,y,c]);return o.jsx("div",{className:Ee("h-full w-full",t),ref:l,children:o.jsxs("div",{className:"relative overflow-hidden",style:{height:d.height,width:d.width},children:[j,C,z]})})}const A0=M0,at={top:20,right:110,bottom:40,left:50},rs={sm:640},Xn={height:400,yAxisPadding:15,fontSize:12},Js={rectHeight:22,paddingX:4},P0={offsetX:80},on={ticks:6,opacity:.05,color:"#FFFFFF"},Ae={xTicks:5,xSubTicks:36,yTicks:5,tickSize:10,subTickSize:6,tickColor:"#404146",domainColor:"#FFFFFF",domainOpacity:.05,textOpacity:.5},Qs=1e12,eo=1e9,qn=1e6,Gt=e=>e==null?"-":e===0?"0":e<.001?$0(e):e<1||e<10?parseFloat(e.toPrecision(4)).toString():e<qn?e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2}):e>Qs?`${(e/Qs).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}T`:e>eo?`${(e/eo).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}B`:e>qn?`${(e/qn).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}M`:e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),R0=e=>{const t=["₀","₁","₂","₃","₄","₅","₆","₇","₈","₉"];return e.toString().split("").map(n=>t[parseInt(n)]).join("")},$0=e=>{const t=e<0,r=Math.abs(e).toFixed(20).replace(/\.?0+$/,""),s=r.match(/^0\.0+/);if(s){const a=s[0].length-2,c=r.slice(s[0].length).slice(0,3).replace(/0+$/,""),l=`0.${R0(a)}${c}`;return t?`-${l}`:l}return Number.isInteger(e)?String(e):String(Math.round(e*100)/100)},D0=({width:e,height:t=Xn.height,yDomain:n,formatValue:r,containerRef:s,svgRef:a})=>{const[i,c]=f.useState(e);f.useLayoutEffect(()=>{const x=()=>{if(s.current){const b=s.current.getBoundingClientRect();c(b.width)}};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[s]);const l=x=>{const b=Ve(a.current);if(!b.node())return at.left;const y=b.append("text").style("font-size",`${Xn.fontSize}px`).style("font-family","var(--font-dmsans)").style("font-weight","700").style("visibility","hidden"),[g,v]=x.domain(),S=[],z=5;for(let C=0;C<z;C++){const k=g+(v-g)/(z-1)*C;S.push(k)}let j=0;return S.forEach(C=>{var N;const k=r?r(C):Gt(C);y.text(k);const w=((N=y.node())==null?void 0:N.getBBox().width)||0;j=Math.max(j,w)}),y.remove(),Math.ceil(j)+Xn.yAxisPadding};let u=i??null;if(!u&&s.current){const x=s.current.getBoundingClientRect();x.width>0&&(u=x.width)}u=u||e||null;const d=t-at.top-at.bottom,h=Fr().domain(n).range([d,0]),m=u&&u>0?l(h):null,p=u&&u>0&&m&&m>0?u-m-(u>640?at.right:20):null;return{width:u,height:t,innerWidth:p,innerHeight:d,dynamicLeftMargin:m}},I0=e=>{const t=f.useMemo(()=>{const i=new Set;return e.forEach(c=>{c.seriesGroup&&i.add(c.seriesGroup)}),Array.from(i)},[e]),[n,r]=f.useState(()=>new Set(t));f.useEffect(()=>{r(i=>{const c=new Set(i);return t.forEach(l=>{c.has(l)||c.add(l)}),c})},[t]);const s=f.useMemo(()=>e.filter(i=>i.seriesGroup?n.has(i.seriesGroup):!0),[e,n]);return{seriesGroups:t,visibleGroups:n,filteredSeries:s,toggleGroup:i=>{r(c=>{const l=new Set(c);return l.has(i)?l.delete(i):l.add(i),l})}}},L0=e=>({seriesColors:f.useMemo(()=>e.reduce((n,r)=>(n[r.id]=r.color,n),{}),[e]),isColorLoading:!1}),F0=({group:e,isVisible:t,onClick:n})=>o.jsxs("button",{onClick:n,className:Ee("flex cursor-pointer items-center justify-center gap-2 text-xs font-semibold",t?"text-white":"text-white/30"),children:[o.jsx("div",{className:Ee("h-3 w-3",t?"bg-white/80":"bg-white/30")}),e]}),O0=F0;var $e=(e=>(e["30m"]="30m",e["24h"]="24h",e["3D"]="3D",e["7D"]="7D",e["1M"]="1M",e["3M"]="3M",e.YTD="YTD",e))($e||{});const U0=(e,t)=>{const n=new Date(e);return t===$e["24h"]?hr("%H:%M")(n):hr("%b %d")(n)},B0=(e,t=.1)=>{const n=e.map(l=>l.value),r=wl(n)||0,s=kl(n)||0,a=s-r,i=s+a*t;let c=r-a*t;return r>=0&&c<0&&(c=0),[c,i]},Pe=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#06B6D4","#84CC16","#F97316"],H0=(e,t)=>U0(e,t),to=(e,t)=>{const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),s=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${s}, ${t})`},V0=e=>{const t=e.flatMap(n=>n.data);return B0(t)},Z0=e=>{const t=new Set;return e.forEach(n=>{n.data.forEach(r=>t.add(r.date))}),Array.from(t).sort()},W0=(e,t)=>e.map(n=>{const r={};return t.forEach(s=>{const a=s.data.find(i=>i.date===n);r[s.id]=a?a.value:0}),{date:new Date(n),values:r}}),Y0=(e,t,n)=>{const r=t.invert(e),s=Sl(l=>l.date).left,a=s(n,r,1),i=n[a-1],c=n[a];return!i||!c?null:r.getTime()-i.date.getTime()>c.date.getTime()-r.getTime()?c:i},Nr=(e,t)=>{const n=t===e,r=t!==null&&t!==e;return n?1:r?.3:1},G0=({legendItems:e,containerWidth:t,hoveredSeriesId:n,onSeriesHover:r,onLabelClick:s,unitPrefix:a,unitSuffix:i,legendRef:c})=>t&&t>rs.sm?o.jsx("div",{className:Ee("pointer-events-none absolute left-0 top-0 w-full flex-wrap items-center gap-2 max-sm:overflow-hidden"),children:e.map(u=>o.jsx("div",{className:Ee("pointer-events-auto absolute flex h-[22px] w-fit cursor-pointer items-center justify-center gap-1 rounded-[11px] px-[5px] py-1 transition-opacity duration-200 ease-out"),style:{left:`${u.left}px`,top:`${u.top}px`,backgroundColor:to(u.color,.3),opacity:Nr(u.id,n)},onClick:()=>s==null?void 0:s(u.id),onPointerEnter:d=>{d.preventDefault(),d.stopPropagation(),r(u.id)},onPointerLeave:d=>{d.preventDefault(),d.stopPropagation(),r(null)},children:o.jsxs("div",{className:"relative flex select-none items-center justify-center gap-1",children:[u.seriesData.iconImageUrl&&o.jsx("div",{className:"size-4 rounded-full",children:o.jsx("img",{src:u.seriesData.iconImageUrl,width:16,height:16,alt:u.seriesData.name,className:"size-4 rounded-full",draggable:!1})}),o.jsxs("div",{className:"text-normal relative flex items-center justify-center whitespace-nowrap text-[11px] font-semibold leading-4",children:[o.jsx("span",{className:Ee("mr-1 max-w-12 truncate",u.seriesData.iconImageUrl?"max-w-10":"max-w-12"),children:u.displayText}),a&&o.jsx("span",{className:"mr-0.5 [&_svg]:!text-white/70",children:a}),o.jsx("span",{children:u.value}),i&&o.jsx("span",{children:i})]})]})},u.id))}):o.jsx("div",{className:Ee("pointer-events-none left-0 top-0 flex w-full flex-wrap items-center gap-1 max-sm:overflow-hidden"),ref:c,children:e.map(u=>o.jsx("div",{className:Ee("pointer-events-auto flex h-[22px] w-fit min-w-[112px] cursor-pointer items-center gap-1 rounded-[11px] px-[5px] py-1 transition-opacity duration-200 ease-out"),style:{backgroundColor:to(u.color,.3),opacity:Nr(u.id,n)},onClick:()=>s==null?void 0:s(u.id),onPointerEnter:d=>{d.preventDefault(),d.stopPropagation(),r(u.id)},onPointerLeave:d=>{d.preventDefault(),d.stopPropagation(),r(null)},children:o.jsxs("div",{className:"relative flex select-none items-center gap-1",children:[u.seriesData.iconImageUrl&&o.jsx("div",{className:"size-4 rounded-full",children:o.jsx("img",{src:u.seriesData.iconImageUrl,width:16,height:16,alt:u.seriesData.name,className:"size-4 rounded-full",draggable:!1})}),o.jsxs("div",{className:"text-normal relative flex items-center whitespace-nowrap text-[11px] font-semibold leading-none",children:[o.jsx("span",{className:Ee("mr-1 max-w-12 truncate",u.seriesData.iconImageUrl?"max-w-10":"max-w-12"),children:u.displayText}),o.jsx("span",{"data-legend-value":u.id,children:u.value}),i&&o.jsx("span",{children:i})]})]})},u.id))}),X0=G0,q0=({containerWidth:e,tooltipRef:t,series:n,seriesColors:r,unitPrefix:s,unitSuffix:a})=>e&&e>rs.sm?o.jsx("div",{ref:t,className:"pointer-events-none absolute left-0 top-0 z-50 rounded-md bg-slate-700 px-6 py-3 text-xs text-white opacity-0 transition-opacity duration-300",children:o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx("div",{className:"body-md font-semibold text-white/50","data-tooltip-date":!0}),o.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5",children:n.map(c=>o.jsxs(gl.Fragment,{children:[o.jsxs("span",{className:"text-soft flex max-w-[126px] items-center gap-1",children:[o.jsx("div",{className:"h-full w-0.5 rounded-full",style:{backgroundColor:r[c.id]}}),c.iconImageUrl&&o.jsx("img",{src:c.iconImageUrl,width:20,height:20,alt:c.name,className:"rounded-full"}),o.jsx("span",{className:"text-normal body-sm font-bold capitalize",children:c.name})]}),o.jsxs("div",{className:"font-dmsans text-normal flex flex-row items-center font-bold",children:[o.jsx("div",{className:"mr-1",children:s}),o.jsx("span",{className:"text-normal text-right text-xs font-bold","data-tooltip-value":c.id}),a]})]},c.id))})]})}):o.jsx("div",{ref:t,className:"pointer-events-none absolute left-0 top-0 z-50 min-w-[130px] rounded-md bg-slate-700 px-2 py-1 text-xs text-white opacity-0 transition-opacity duration-300 ease-out",children:o.jsx("div",{className:"flex flex-col items-center justify-center gap-3",children:o.jsx("div",{className:"caption font-semibold text-white/50","data-tooltip-date":!0})})}),K0=q0,J0=(e,t,n,r)=>{const s=qo().domain(pr(e,i=>i.date)).range([0,n]),a=Fr().domain(t).range([r,0]);return{xScale:s,yScale:a}},Q0=(e,t,n)=>{const[r,s]=t.domain(),a=[];for(let i=0;i<on.ticks;i++){const c=r+(s-r)/(on.ticks-1)*i;a.push(c)}e.append("g").attr("class","grid").call(Ko(t).tickValues(a).tickSize(-n).tickFormat(()=>"")).call(i=>i.select(".domain").remove()).selectAll("line").attr("stroke",on.color).attr("stroke-opacity",on.opacity)},eg=(e,t,n,r,s,a,i)=>{const c=i!==void 0?Math.max(2,Math.min(Ae.xTicks,Math.floor(i/70))):Ae.xTicks,l=e.append("g").attr("transform",`translate(0,${r})`).call(us(t).ticks(c).tickSize(Ae.tickSize).tickFormat(b=>b instanceof Date?H0(b.toISOString(),s):String(b))).style("font-size","12px").style("font-weight","700").style("font-family","var(--font-manrope)");l.select(".domain").attr("stroke",Ae.domainColor).attr("stroke-width",1).attr("stroke-opacity",Ae.domainOpacity),l.selectAll(".tick line").attr("stroke",Ae.tickColor).attr("transform","translate(0, 4)"),l.selectAll(".tick text").attr("dy","1.2em").style("fill",Ae.domainColor).style("opacity",Ae.textOpacity);const u=e.append("g").attr("transform",`translate(0,${r})`).call(us(t).ticks(Ae.xSubTicks).tickSize(Ae.subTickSize).tickFormat(()=>""));u.select(".domain").remove(),u.selectAll(".tick line").attr("stroke",Ae.tickColor).attr("transform","translate(0, 4)");const[d,h]=n.domain(),m=[],p=5;for(let b=0;b<p;b++){const y=d+(h-d)/(p-1)*b;m.push(y)}const x=e.append("g").call(Ko(n).tickValues(m).tickSize(Ae.yTicks).tickFormat(b=>a?a(b):Gt(b))).style("font-size","12px").style("color",Ae.domainColor).style("font-family","var(--font-dmsans)").style("opacity",Ae.textOpacity).style("font-weight","700");x.select(".domain").attr("stroke","none"),x.selectAll(".tick line").attr("stroke","none")},tg=(e,t,n,r,s)=>{const a=Jo().x(i=>r(i.date)).y(i=>s(i.value)).curve(gr);t.forEach(i=>{const c=i.data.map(h=>({date:new Date(h.date),value:h.value})),l=n[i.id],u=e.append("path").datum(c).attr("fill","none").attr("stroke",l).attr("stroke-width",1.2).attr("opacity",1).attr("data-series-id",i.id).attr("d",a),d=u.node().getTotalLength();u.attr("stroke-dasharray",d+" "+d).attr("stroke-dashoffset",d),u.transition("draw").duration(1200).ease(jl).attr("stroke-dashoffset",0).on("end",function(){Ve(this).attr("stroke-dasharray",null)})})},ng=({g:e,containerWidth:t,innerWidth:n,innerHeight:r,xScale:s,yScale:a,combinedData:i,filteredSeries:c,tooltipRef:l,containerRef:u,legendRef:d,highestValue:h,formatValue:m})=>{var U;const p=e.append("line").attr("class","hover-line").attr("stroke","white").attr("stroke-width",1).attr("stroke-dasharray","4,4").attr("stroke-opacity",.6).attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",r).attr("opacity",0),x=e.append("g").attr("class","hover-dots");let b=!0,y=((U=u.current)==null?void 0:U.getBoundingClientRect().width)||n,g=0,v=0;const S=_=>{b?(p.attr("x1",_-.75),p.attr("x2",_-.75),p.transition().duration(150).ease(br).attr("opacity",1),b=!1):p.transition().duration(100).ease(ds).attr("x1",_-.75).attr("x2",_-.75).attr("opacity",1)},z=(_,I)=>{const te=x.selectAll("g.hover-circle-group").data(c.filter(R=>_.values[R.id]!==void 0));te.exit().remove();const se=te.enter().append("g").attr("class","hover-circle-group").style("opacity",0);se.append("circle").attr("class","hover-dot-glow").attr("r",9).attr("fill","white").attr("fill-opacity",.18),se.append("circle").attr("class","hover-dot-core").attr("r",4.5).attr("fill","white").attr("stroke","rgba(10, 12, 20, 0.55)").attr("stroke-width",1.5),se.attr("transform",R=>{const ie=_.values[R.id];return`translate(${I}, ${a(ie)}) scale(0.5)`}).style("opacity",1).transition().duration(200).ease(zl).attr("transform",R=>{const ie=_.values[R.id];return`translate(${I}, ${a(ie)}) scale(1)`}),te.transition().duration(100).ease(ds).attr("transform",R=>{const ie=_.values[R.id];return`translate(${I}, ${a(ie)})`})},j=(_,I)=>{l.current&&g===0&&v===0&&(g=l.current.getBoundingClientRect().height,v=l.current.getBoundingClientRect().width);let H=_+P0.offsetX;return H+v>y&&(H=_-v),H<0&&(H=0),{x:H,y:I-g/2+20}},C=_=>{let H=_-65+at.left;const te=a(h);return _+130/2>y-at.left&&(H=y-130),H<0&&(H=0),{x:H,y:te}},k=(_,I)=>{if(!l.current)return;const H=l.current.querySelector("[data-tooltip-date]");H&&H.textContent!==_&&(H.textContent=_),c.forEach(te=>{var ke;const se=I[te.id];if(se===void 0)return;const R=(ke=l.current)==null?void 0:ke.querySelector(`[data-tooltip-value="${te.id}"]`),ie=m?m(se):Gt(se);R&&R.textContent!==ie&&(R.textContent=ie)})},w=_=>{if(!l.current)return;const I=l.current.querySelector("[data-tooltip-date]");I&&I.textContent!==_&&(I.textContent=_)},N=_=>{d.current&&c.forEach(I=>{var se;const H=_[I.id];if(H===void 0)return;const te=(se=d.current)==null?void 0:se.querySelector(`[data-legend-value="${I.id}"]`);if(te){const R=m?m(H):Gt(H);te.textContent=R}})},E=(_,I)=>{l.current&&(l.current.style.opacity="1",l.current.style.transform=`translate3d(${_}px, ${I}px, 0)`)},W=_=>{const H=window.TouchEvent&&_ instanceof TouchEvent?_.touches[0]:_,[te,se]=Cl(H,e.node()),R=Y0(te,s,i);if(!R)return;const ie=s(R.date),ke=hr("%b %d, %Y - %H:%M")(R.date);if(t>rs.sm){const V=j(te,se);E(V.x,V.y),k(ke,R.values)}else{const V=C(te);E(V.x,V.y),w(ke),N(R.values)}S(ie),z(R,ie)},L=()=>{p.transition().duration(150).ease(br).attr("opacity",0),b=!0,l.current&&(l.current.style.opacity="0"),x.selectAll("g").transition().duration(150).ease(Nl).style("opacity",0).attr("transform",(_,I,H)=>{const se=Ve(H[I]).attr("transform"),R=se.match(/translate\(([^,]+),\s*([^)]+)\)/);if(R){const ie=parseFloat(R[1]),ke=parseFloat(R[2]);return`translate(${ie}, ${ke}) scale(0.3)`}return se}).remove()},A=new ResizeObserver(()=>{u.current&&(y=u.current.getBoundingClientRect().width)});return u.current&&A.observe(u.current),{onMouseMove:W,onMouseLeave:L,destroy:()=>A.disconnect()}},rg=(e,t,{xScale:n,yScale:r},s,a,i)=>{const c=Js.rectHeight,l=Js.paddingX,u=[];return e.forEach(h=>{const m=h.data.map(p=>({date:new Date(p.date),value:p.value}));if(m.length>0){const p=m[m.length-1],x=n(p.date)+8,b=r(p.value),y=x-l;let g=b-c/2;const v=u.findLast(S=>g+c>=S.top&&g<=S.bottom);v&&(g=v.top+c),u.push({top:g,bottom:g+c,id:h.id,left:y})}}),u.reverse().reduce((h,m)=>{const p=h.find(x=>m.top+c>=x.top&&m.top<=x.bottom&&x.id!==m.id);return p&&(m.top=p.top-c),[m,...h]},[]),u.map(h=>{var b,y;const m=e.find(g=>g.id===h.id);if(!m)return null;const p=t[h.id],x=i?i(((b=m.data.at(-1))==null?void 0:b.value)??0):Gt(((y=m.data.at(-1))==null?void 0:y.value)??0);return{id:h.id,left:h.left+s,top:h.top+a,seriesData:m,color:p,value:x,displayText:m.name}}).filter(Boolean)},sg=({className:e})=>o.jsx("div",{className:Ee("relative size-8",e),children:o.jsx("div",{className:"absolute left-1/2 top-1/2 flex size-12 -translate-x-1/2 -translate-y-1/2 items-center justify-center",children:o.jsxs("div",{className:"relative h-6 w-full",children:[Array.from({length:5}).map((t,n)=>o.jsx("div",{className:"absolute size-1.5 rounded-full will-change-transform",style:{left:`${n/6*100}%`,animation:`dnaStrand1Move 2s infinite ease-in-out ${-n*.2}s, dnaStrand1Scale 2s infinite ease-in-out ${-n*.2}s, dnaStrand1Color 2s infinite ease-in-out ${-n*.2}s`}},`strand1-${n}`)),Array.from({length:5}).map((t,n)=>o.jsx("div",{className:"absolute size-1.5 rounded-full",style:{left:`${n/6*100}%`,animation:`dnaStrand2Move 2s infinite ease-in-out ${-n*.2}s, dnaStrand2Scale 2s infinite ease-in-out ${-n*.2}s, dnaStrand2Color 2s infinite ease-in-out ${-n*.2}s`}},`strand2-${n}`))]})})}),og=({series:e,width:t,height:n=400,timeframe:r,className:s,isLoading:a=!1,formatValue:i,unitPrefix:c,unitSuffix:l,onLabelClick:u})=>{const d=f.useRef(null),h=f.useRef(null),m=f.useRef(null),p=f.useRef(null),[x,b]=f.useState(null),y=f.useMemo(()=>[...e].sort((_,I)=>{const H=_.data.length>0?_.data[_.data.length-1].value:0;return(I.data.length>0?I.data[I.data.length-1].value:0)-H}),[e]),g=f.useCallback(_=>{b(_)},[]),{seriesGroups:v,visibleGroups:S,filteredSeries:z,toggleGroup:j}=I0(y),{seriesColors:C,isColorLoading:k}=L0(y),w=f.useMemo(()=>V0(y),[y]),N=D0({width:t,height:n,yDomain:w,formatValue:i,containerRef:h,svgRef:d}),E=f.useMemo(()=>Z0(y),[y]),W=f.useMemo(()=>W0(E,y),[E,y]),L=f.useMemo(()=>Math.max(...z.map(_=>_.data.map(I=>I.value)).flat().filter(_=>_!==void 0)),[z]),A=f.useMemo(()=>!N.innerWidth||!N.innerHeight?null:J0(W,w,N.innerWidth,N.innerHeight),[W,w,N.innerWidth,N.innerHeight]),U=f.useMemo(()=>!A||!N.dynamicLeftMargin?[]:rg(z,C,A,N.dynamicLeftMargin,at.top,i),[A,N.dynamicLeftMargin,z,C,i]);return f.useEffect(()=>{if(!d.current||e.length===0||k||!A||N.width===null||N.innerWidth===null||N.dynamicLeftMargin===null)return;const _=Ve(d.current),{innerWidth:I,innerHeight:H,dynamicLeftMargin:te}=N;_.selectAll("*").remove();const{xScale:se,yScale:R}=A,ie=_.append("g").attr("transform",`translate(${te},${at.top})`);Q0(ie,R,I),eg(ie,se,R,H,r,i,I),tg(ie,z,C,se,R);const{onMouseMove:ke,onMouseLeave:V,destroy:de}=ng({g:ie,containerWidth:N.width,innerWidth:I,innerHeight:N.innerHeight,xScale:se,yScale:R,combinedData:W,filteredSeries:z,tooltipRef:m,containerRef:h,legendRef:p,highestValue:L,formatValue:i}),J=ie.append("rect").attr("class","overlay").attr("width",I).attr("height",H).attr("fill","transparent").style("cursor","crosshair").style("pointer-events","all");return J.on("mousemove",ke).on("mouseleave",V).on("touchstart",ke).on("touchmove",ke).on("touchend",V),J.raise(),()=>{de(),J.on("mousemove",null).on("mouseleave",null).on("touchstart",null).on("touchmove",null).on("touchend",null),_.selectAll("*").interrupt(),_.selectAll("*").remove()}},[W,w,e.length,z,A,N.innerWidth,N.innerHeight,N.dynamicLeftMargin,n,r,k,C,i]),f.useEffect(()=>{if(!d.current||e.length===0||k)return;Ve(d.current).select("g").selectAll("path[data-series-id]").transition().duration(200).ease(br).attr("opacity",function(){const H=Ve(this).attr("data-series-id");return Nr(H,x)})},[x,e,C,k]),!a&&e.length===0?o.jsx("div",{className:Ee("relative w-full",s),children:o.jsx("div",{className:Ee("mx-auto flex w-full items-center justify-center text-sm text-gray-400"),style:{height:n},children:"No data available"})}):o.jsx("div",{ref:h,className:Ee("relative w-full",s),style:{width:t,minHeight:n},children:a?o.jsx(sg,{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"}):o.jsxs(o.Fragment,{children:[v.length>0&&o.jsx("div",{className:"mb-3 flex flex-wrap items-center justify-center gap-2",children:v.map(_=>o.jsx(O0,{group:_,isVisible:S.has(_),onClick:()=>j(_)},_))}),N.width!==null&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"relative z-20",children:o.jsx(X0,{legendRef:p,legendItems:U,containerWidth:N.width,hoveredSeriesId:x,onSeriesHover:g,onLabelClick:u,unitPrefix:c,unitSuffix:l})}),o.jsxs("div",{className:"relative select-none",children:[o.jsx("svg",{ref:d,width:N.width,height:n,className:"relative z-0",style:{maxWidth:"100%",width:"100%",display:"block",overflow:"visible"}}),o.jsx("div",{className:"z-10",children:o.jsx(K0,{containerWidth:N.width,tooltipRef:m,series:z,seriesColors:C,unitPrefix:c,unitSuffix:l})})]})]})]})})},Fn=og,ag=["#FF1F5F","#81FE90"],ig=({data:e,width:t=270,height:n=270,innerRadius:r=90,outerRadius:s=100,colors:a=ag,children:i})=>{const c=f.useRef(null);return f.useEffect(()=>{if(!c.current||!e.length)return;Ve(c.current).selectAll("*").remove();const l=Ve(c.current),u=t/2,d=n/2,h=l.append("defs");h.append("filter").attr("id","glow").append("feGaussianBlur").attr("stdDeviation","3").attr("result","coloredBlur"),h.select("#glow").append("feMerge").selectAll("feMergeNode").data(["coloredBlur","SourceGraphic"]).enter().append("feMergeNode").attr("in",v=>v),h.append("filter").attr("id","glow-layer").append("feGaussianBlur").attr("stdDeviation","6").attr("result","glowBlur"),h.select("#glow-layer").append("feColorMatrix").attr("type","matrix").attr("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0").attr("result","glowColor");const m=_l().value(v=>v.value).padAngle(.02),p=ms().innerRadius(r).outerRadius(s).cornerRadius(100),x=ms().innerRadius(r).outerRadius(s).cornerRadius(100),b=Tl().domain(e.map((v,S)=>S.toString())).range(a),g=l.append("g").attr("transform",`translate(${u}, ${d})`).selectAll("g").data(m(e)).enter().append("g");g.append("path").attr("class","glow-layer").attr("d",x).attr("fill",(v,S)=>b(S.toString())).attr("filter","url(#glow-layer)").style("opacity",0).style("pointer-events","none"),g.append("path").attr("class","main-slice").attr("d",p).attr("fill",(v,S)=>b(S.toString())).attr("stroke","none"),g.on("mouseenter",function(){Ve(this).select(".glow-layer").transition().duration(300).style("opacity",1)}).on("mouseleave",function(){Ve(this).select(".glow-layer").transition().duration(300).style("opacity",0)})},[e,t,n,r,s,a]),o.jsxs("div",{className:"relative flex flex-col items-center justify-center rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%)"},children:[o.jsx("svg",{ref:c,width:t,height:n,className:"relative z-10"}),o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:i}),o.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}}),o.jsx("div",{className:"pointer-events-none absolute inset-[10%] rounded-full",style:{background:"linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%)",maskImage:"radial-gradient(farthest-side, transparent calc(100% - 1px),#fff 0)",WebkitMaskComposite:"destination-out",maskComposite:"exclude"}})]})},mt=({data:e,width:t=120,height:n=40,color:r,className:s,variant:a="default"})=>{const i=f.useRef(null),{strokeColor:c,isPositive:l,variantType:u,customColor:d}=f.useMemo(()=>{var m,p;if(r)return{strokeColor:r,isPositive:!0,variantType:"custom",customColor:r};if(a==="auto"&&e.length>0){const x=((m=e[0])==null?void 0:m.value)??0,y=(((p=e[e.length-1])==null?void 0:p.value)??0)>=x;return{strokeColor:y?"var(--color-green-500)":"var(--color-red-500)",isPositive:y,variantType:y?"green":"red",customColor:void 0}}switch(a){case"green":return{strokeColor:"var(--color-green-500)",isPositive:!0,variantType:"green",customColor:void 0};case"red":return{strokeColor:"var(--color-red-500)",isPositive:!1,variantType:"red",customColor:void 0};case"blue":return{strokeColor:"#75A3FF",isPositive:!0,variantType:"blue",customColor:void 0};default:return{strokeColor:"var(--color-blue-600)",isPositive:!0,variantType:"blue",customColor:void 0}}},[r,a,e]),h=f.useMemo(()=>{if(!e||e.length===0)return[];const m=e.map(y=>({...y,date:new Date(y.date)})),p=Math.max(30,Math.floor(t/4));if(m.length<=p)return m;const x=Math.floor(m.length/p),b=[];for(let y=0;y<m.length;y+=x)b.push(m[y]);return b[b.length-1]!==m[m.length-1]&&b.push(m[m.length-1]),b},[e,t]);return f.useEffect(()=>{if(!i.current||!h.length)return;const m=Ve(i.current),p={top:2,right:0,bottom:2,left:0},x=t-p.left-p.right,b=n-p.top-p.bottom;m.selectAll("*").remove();const y=qo().domain(pr(h,L=>L.date)).range([0,x]),[g,v]=pr(h,L=>L.value),S=(v-g)*.4,z=Fr().domain([g-S,v]).range([b,0]),j=Jo().x(L=>y(L.date)).y(L=>z(L.value)).curve(gr),C=m.append("g").attr("transform",`translate(${p.left},${p.top})`),k=El().x(L=>y(L.date)).y0(b).y1(L=>z(L.value)).curve(gr),w=`mini-chart-gradient-${Math.random().toString(36).slice(2,11)}`,E=m.append("defs").append("linearGradient").attr("id",w).attr("x1","0%").attr("y1","0%").attr("x2","0%").attr("y2","100%"),W=(L,A)=>{if(L.startsWith("var("))return L.includes("blue")?`rgba(59, 130, 246, ${A})`:L.includes("green")?`rgba(37, 255, 205, ${A})`:L.includes("red")?`rgba(239, 68, 68, ${A})`:`rgba(59, 130, 246, ${A})`;if(L.startsWith("#")){const U=L.slice(1),_=U.length===3?parseInt(U[0]+U[0],16):parseInt(U.slice(0,2),16),I=U.length===3?parseInt(U[1]+U[1],16):parseInt(U.slice(2,4),16),H=U.length===3?parseInt(U[2]+U[2],16):parseInt(U.slice(4,6),16);return`rgba(${_}, ${I}, ${H}, ${A})`}if(L.startsWith("rgb")){const U=L.match(/\d+/g);if(U&&U.length>=3)return`rgba(${U[0]}, ${U[1]}, ${U[2]}, ${A})`}return`rgba(59, 130, 246, ${A})`};u==="custom"&&d?(E.append("stop").attr("offset","45.9%").attr("stop-color",W(d,.16)),E.append("stop").attr("offset","96.67%").attr("stop-color",W(d,0))):u==="blue"?(E.append("stop").attr("offset","45.9%").attr("stop-color","rgba(7, 77, 215, 0.3)"),E.append("stop").attr("offset","96.67%").attr("stop-color","rgba(7, 77, 215, 0.3)")):u==="green"||l&&u!=="red"?(E.append("stop").attr("offset","45.9%").attr("stop-color","rgba(63, 194, 167, 0.1)"),E.append("stop").attr("offset","96.67%").attr("stop-color","rgba(63, 194, 167, 0)")):(E.append("stop").attr("offset","0%").attr("stop-color","rgba(255, 93, 127, 0.1)"),E.append("stop").attr("offset","91.8%").attr("stop-color","rgba(255, 63, 105, 0)")),C.append("path").datum(h).attr("fill",`url(#${w})`).attr("d",k),C.append("path").datum(h).attr("fill","none").attr("stroke",c).attr("stroke-width",1).attr("stroke-linecap","round").attr("stroke-linejoin","round").attr("d",j)},[h,t,n,c,l,u,d]),!e||e.length===0?o.jsx(o.Fragment,{}):o.jsx("svg",{ref:i,width:t,height:n,viewBox:`0 0 ${t} ${n}`,className:Ee("h-auto max-w-full",s),style:{width:t,height:"auto"}})};Fi.schema;function cg({portfolio:e,config:t}){const{priced:n}=Kr(e.holdings),r=f.useMemo(()=>n.map((a,i)=>({name:ae(a.symbol),value:a.value??0,color:Pe[i%Pe.length]})).filter(a=>a.value>0).sort((a,i)=>i.value-a.value),[n]),s=r.reduce((a,i)=>a+i.value,0);return r.length===0?o.jsx(M,{children:"no live prices yet"}):o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-4",children:[o.jsx(ig,{data:r,width:200,height:200,innerRadius:58,outerRadius:92,colors:r.map(a=>a.color),children:o.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[o.jsx(Jr,{portfolio:e,config:t,className:"caption text-soft"}),o.jsx("span",{className:"metric-lg text-strong",children:le(s)})]})}),o.jsx("div",{className:"flex w-full max-w-xs flex-wrap justify-center gap-x-5 gap-y-1.5",children:r.map(a=>o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:a.color}}),o.jsx("span",{className:"body-sm text-soft",children:a.name}),o.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:je(a.value/s*100,1)}),o.jsx("span",{className:"caption text-soft tabular-nums",children:le(a.value)})]},a.name))})]})}function lg({config:e}){return o.jsx(Qr,{config:e,loadingLabel:"loading allocation…",children:t=>o.jsx(cg,{portfolio:t,config:e})})}const ug={...Fi,component:lg};Oi.schema;function dg(e){return e>=1e3?e.toLocaleString("en-US",{maximumFractionDigits:2}):e>=1?e.toFixed(4).replace(/\.?0+$/,""):e.toPrecision(4)}function mg({portfolio:e,config:t}){const{priced:n,total:r}=Kr(e.holdings),s=f.useMemo(()=>[...n].sort((a,i)=>(i.value??0)-(a.value??0)),[n]);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[o.jsxs("div",{className:"flex items-baseline justify-between border-b border-white/[0.06] pb-1.5",children:[o.jsx(Jr,{portfolio:e,config:t,className:"caption text-soft"}),o.jsx("span",{className:"metric-sm text-strong",children:le(r)})]}),o.jsx("div",{className:xe,children:o.jsx("table",{className:"w-full text-xs",children:o.jsx("tbody",{children:s.map(a=>{const i=r>0?(a.value??0)/r*100:0;return o.jsxs("tr",{className:"border-b border-white/[0.04]",children:[o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(Fe,{symbol:a.symbol,size:16}),o.jsx("span",{className:"text-normal font-semibold",children:ae(a.symbol)})]})}),o.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:dg(a.amount)}),o.jsx("td",{className:"text-normal py-1.5 text-right font-semibold tabular-nums",children:a.value!==void 0?le(a.value):"—"}),o.jsx("td",{className:"text-soft py-1.5 text-right tabular-nums",children:je(i,1)}),o.jsx("td",{className:"py-1.5 text-right tabular-nums",children:a.changePct24h!==void 0?o.jsx("span",{style:{color:Ce(a.changePct24h)},children:ye(a.changePct24h)}):o.jsx("span",{className:"text-soft",children:"·"})})]},a.symbol)})})})})]})}function fg({config:e}){return o.jsx(Qr,{config:e,loadingLabel:"loading holdings…",children:t=>o.jsx(mg,{portfolio:t,config:e})})}const hg={...Oi,component:fg};xi.schema;const no={BTC:"linear-gradient(90deg, #FF810F 0%, #FF9E37 100%)",ETH:"hsl(var(--zf-accent-hue, 242) 85% 72%)",Others:"hsl(var(--zf-accent-hue, 242) 38% 52%)"};function pg({config:e}){const{market:t,isLoading:n}=Rh(),r=f.useMemo(()=>{if(!t)return[];const a=t.dominance.btc??0,i=t.dominance.eth??0;return[{type:"BTC",value:a},{type:"ETH",value:i},{type:"Others",value:Math.max(0,100-a-i)}].sort((c,l)=>l.value-c.value)},[t]);if(n)return o.jsx(M,{loading:!0,children:"loading dominance…"});if(!t)return o.jsx(M,{children:"no market data"});const s=r[0];return o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"metric-xl text-strong",children:je(s.value,1)}),o.jsx("span",{className:"body-md text-soft",children:s.type})]}),o.jsx("div",{className:"flex h-3 w-full max-w-sm gap-1 overflow-hidden rounded-full",children:r.map((a,i)=>o.jsx("div",{className:`h-full ${i===0?"rounded-l-full":""} ${i===r.length-1?"rounded-r-full":""}`,style:{width:`${a.value}%`,background:no[a.type]}},a.type))}),o.jsx("div",{className:"grid w-full max-w-sm grid-cols-3",children:r.map(a=>o.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[o.jsx("div",{className:"h-2 w-2 flex-shrink-0 rounded-full",style:{background:no[a.type]}}),o.jsx("span",{className:"body-sm text-soft",children:a.type}),o.jsx("span",{className:"body-sm text-normal font-bold tabular-nums",children:je(a.value,1)})]},a.type))}),e.showTotalMarketCap&&o.jsxs("div",{className:"caption text-soft",children:["total mcap ",le(t.totalMarketCapUsd)," ·"," ",o.jsxs("span",{style:{color:Ce(t.marketCapChangePct24h)},children:[ye(t.marketCapChangePct24h)," 24h"]})]})]})}const gg={...xi,component:pg};let Uc=typeof window<"u"?window.scrollY:0,Bc=typeof window<"u"?window.innerHeight:0,an;typeof window<"u"&&(window.addEventListener("scroll",()=>{an!=null&&(window.clearTimeout(an),an=void 0),an=window.setTimeout(()=>{Uc=window.scrollY},200)},{passive:!0}),window.addEventListener("resize",()=>{Bc=window.innerHeight},{passive:!0}));const Cr={_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"&&Cr.tick();function Je({ref:e,getRemainingMs:t,format:n}){const r=f.useRef({getRemainingMs:t,format:n});r.current={getRemainingMs:t,format:n};const s=f.useRef(0);f.useLayoutEffect(()=>{const a=()=>{e.current&&(s.current=e.current.getBoundingClientRect().top+window.scrollY)};return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]),f.useEffect(()=>{const a=()=>{if(!e.current)return;const i=s.current-Uc;if(i>Bc||i<0)return;const c=r.current.getRemainingMs();e.current&&(e.current.textContent=r.current.format(c))};return Cr.register(a),()=>{Cr.unregister(a)}},[e])}ci.schema;function Ot(e){const t={hour:"",minute:"",second:"",fractional:"",period:""};for(const n of e.formatToParts(new Date))n.type==="hour"?t.hour=n.value:n.type==="minute"?t.minute=n.value:n.type==="second"?t.second=n.value:n.type==="fractionalSecond"?t.fractional=n.value:n.type==="dayPeriod"&&(t.period=n.value);return t}function bg({config:e}){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(null),s=f.useRef(null),a=f.useRef(null),i=e.timezone.trim()||void 0,c=e.showSeconds||e.showMillis,l=f.useMemo(()=>{var m;try{const p=new Intl.DateTimeFormat(void 0,{timeZone:i,hour:"2-digit",minute:"2-digit",second:c?"2-digit":void 0,fractionalSecondDigits:e.showMillis?3:void 0,hour12:e.hour12}),x=e.showDate?new Intl.DateTimeFormat(void 0,{timeZone:i,weekday:"short",month:"short",day:"numeric"}):null;let b="";return e.showTimezone&&(b=((m=new Intl.DateTimeFormat(void 0,{timeZone:i,hour:"2-digit",timeZoneName:"short"}).formatToParts(new Date).find(g=>g.type==="timeZoneName"))==null?void 0:m.value)??""),{time:p,date:x,zone:b,error:null}}catch{return{time:null,date:null,zone:"",error:i??"invalid timezone"}}},[i,c,e.showMillis,e.hour12,e.showDate,e.showTimezone]);if(Je({ref:t,getRemainingMs:()=>Date.now(),format:()=>{if(!l.time)return"";const m=Ot(l.time);return`${m.hour}:${m.minute}`}}),Je({ref:n,getRemainingMs:()=>Date.now(),format:()=>l.time?`:${Ot(l.time).second}`:""}),Je({ref:r,getRemainingMs:()=>Date.now(),format:()=>l.time?`.${Ot(l.time).fractional}`:""}),Je({ref:s,getRemainingMs:()=>Date.now(),format:()=>l.time?Ot(l.time).period:""}),Je({ref:a,getRemainingMs:()=>Date.now(),format:()=>l.date?l.date.format(new Date):""}),l.error)return o.jsxs(M,{children:["unknown timezone: ",l.error]});const u=Ot(l.time),d="var(--color-highlight)",h="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)";return o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[o.jsxs("div",{className:"text-strong inline-flex max-w-full items-baseline justify-center whitespace-nowrap font-dmsans font-extrabold leading-none tracking-[-0.01em] tabular-nums",style:{fontSize:"clamp(1.6rem, 37cqmin, 5.5rem)"},children:[o.jsx("span",{ref:t,suppressHydrationWarning:!0,children:`${u.hour}:${u.minute}`}),c&&o.jsx("span",{ref:n,suppressHydrationWarning:!0,className:"font-bold",style:{fontSize:"0.46em",color:d,textShadow:h},children:`:${u.second}`}),e.showMillis&&o.jsx("span",{ref:r,suppressHydrationWarning:!0,className:"font-semibold",style:{fontSize:"0.3em",color:d,opacity:.65},children:`.${u.fractional}`}),e.hour12&&o.jsx("span",{ref:s,suppressHydrationWarning:!0,className:"text-soft ml-[0.3em] self-center font-semibold uppercase",style:{fontSize:"0.3em",letterSpacing:"0.08em"},children:u.period})]}),e.showDate&&l.date&&o.jsx("div",{ref:a,suppressHydrationWarning:!0,className:"caption text-soft tabular-nums",children:l.date.format(new Date)}),(e.label||l.zone)&&o.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[o.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:d,boxShadow:h}}),e.label&&l.zone?`${e.label} · ${l.zone}`:e.label||l.zone]})]})}const xg={...ci,component:bg};Ai.schema;const Kn={bullish:fe,bearish:_e,neutral:"var(--color-soft)"},yg={hit:fe,miss:_e,partial:"#f4a259"};function vg(e){let t=0,n=0;for(const r of e)for(const s of r.grades??[])n++,s.verdict==="hit"?t+=1:s.verdict==="partial"&&(t+=.5);return{rate:n?t/n:0,n}}function wg({config:e}){const[t,n]=f.useState(null),[r,s]=f.useState(!1);if(f.useEffect(()=>{let u=!1;const d=()=>{fetch(e.src,{cache:"no-store"}).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.json()}).then(p=>{u||(n(p),s(!0))}).catch(()=>{u||s(!0)})};d();const h=()=>d();window.addEventListener("focus",h);const m=window.setInterval(d,e.refreshSec*1e3);return()=>{u=!0,window.removeEventListener("focus",h),window.clearInterval(m)}},[e.src,e.refreshSec]),!r)return o.jsx(M,{loading:!0,children:"loading brief…"});const a=(t==null?void 0:t.entries)??[];if(a.length===0)return o.jsx(M,{children:"no brief yet — run /zframes-brief"});const i=a.slice(-e.entries).reverse(),{rate:c,n:l}=vg(a);return o.jsxs("div",{className:`body-sm flex flex-col gap-3 ${xe}`,children:[l>0&&o.jsxs("div",{className:"caption text-soft flex items-center justify-between",children:[o.jsx("span",{className:"uppercase tracking-wide",children:"track record"}),o.jsxs("span",{className:"text-strong font-bold tabular-nums",children:[Math.round(c*100),"% · ",l," call",l===1?"":"s"]})]}),i.map((u,d)=>{var h,m,p,x,b,y;return o.jsxs("div",{className:"flex flex-col gap-1.5",children:[(u.date||((h=u.run)==null?void 0:h.model))&&o.jsxs("div",{className:"caption text-soft flex items-baseline justify-between gap-2",children:[o.jsx("span",{className:"uppercase tracking-wide",children:u.date}),((m=u.run)==null?void 0:m.model)&&o.jsxs("span",{className:"truncate opacity-70",title:u.run.timestamp??"",children:[u.run.model,u.run.effort?` · ${u.run.effort}`:""]})]}),u.summary&&o.jsx("div",{className:"text-normal whitespace-pre-wrap",children:u.summary}),(((p=u.calls)==null?void 0:p.length)??0)>0&&o.jsx("div",{className:"flex flex-col gap-1",children:(x=u.calls)==null?void 0:x.map((g,v)=>o.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] items-baseline gap-2",children:[o.jsx("span",{className:"caption font-bold uppercase tracking-wide",style:{color:Kn[g.direction??"neutral"]??Kn.neutral},children:g.symbol?ae(g.symbol):g.direction??"•"}),o.jsx("span",{className:"text-normal",children:g.claim})]},g.id??v))}),(((b=u.grades)==null?void 0:b.length)??0)>0&&o.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"caption text-soft uppercase tracking-wide",children:"graded"}),(y=u.grades)==null?void 0:y.map((g,v)=>o.jsx("span",{className:"caption rounded px-1.5 py-0.5 font-bold uppercase",style:{color:yg[g.verdict??""]??Kn.neutral,background:"var(--color-surface)"},title:g.note??"",children:g.verdict??"—"},g.callId??v))]})]},u.date??d)})]})}const kg={...Ai,component:wg},Ne="rounded-md border border-white/[0.08] bg-white/[0.04] transition-colors hover:bg-white/[0.06] hover:border-[var(--color-accent-line)] focus-within:border-[var(--color-accent-line)]",zt={"mean-reversion":"mean-reversion",breakout:"breakout",positioning:"positioning",macro:"macro"},Sg={BTC:67250,ETH:3540,SOL:146,HYPE:28.4,"xyz:NVDA":128.4,"xyz:TSLA":251,"xyz:AAPL":195,"xyz:MSFT":415,"xyz:AMZN":184},cn=36e5;function En(e){return e==="long"?fe:_e}function Hc(e,t){return(t-e.entry)/e.entry*100*(e.dir==="long"?1:-1)}function jg(e,t){return e.target===e.entry?0:Math.min(1,Math.max(0,(t-e.entry)/(e.target-e.entry)))}function Ng(e){const t=Math.max(0,Math.round(e/1e3));return t<3600?`${Math.max(1,Math.round(t/60))}m left`:t<86400?`${Math.round(t/3600)}h left`:`${Math.round(t/86400)}d left`}function Cg(e){const t=e.toLowerCase();return/(funding|squeeze|oversold|overbought|revert|bounce|reclaim range)/.test(t)?"mean-reversion":/(breakout|break out|reclaim|continuation|new high|momentum|runs)/.test(t)?"breakout":/(cpi|fomc|rate|macro|jobs|earnings|fed)/.test(t)?"macro":"positioning"}const Tt={"mean-reversion":{n:14,hits:9},breakout:{n:9,hits:3},positioning:{n:11,hits:6},macro:{n:6,hits:3}},zg={"mean-reversion":72*cn,breakout:168*cn,positioning:48*cn,macro:168*cn};function _g(e){return e.verdict==="hit"&&e.signalsFired?{label:"thesis played out · skill",color:fe,glyph:"✓"}:e.verdict==="hit"&&!e.signalsFired?{label:"signals never fired · luck, not skill",color:"#f4a259",glyph:"⚠"}:e.verdict==="miss"&&e.signalsFired?{label:"mechanism real, got swamped · near-miss",color:"#f4a259",glyph:"↺"}:{label:"thesis was wrong · clean miss",color:_e,glyph:"✗"}}const Tg=[{id:"r1",symbol:"ETH",dir:"long",confidence:60,claim:"Basis reset + spot bid stepping in under 3.4k.",cls:"mean-reversion",verdict:"hit",returnPct:4.2,signalsFired:!0},{id:"r2",symbol:"xyz:TSLA",dir:"long",confidence:75,claim:"Breakout over 250 holds and extends.",cls:"breakout",verdict:"miss",returnPct:-3.1,signalsFired:!1},{id:"r3",symbol:"BTC",dir:"short",confidence:58,claim:"Crowded longs flush on the funding reset.",cls:"positioning",verdict:"miss",returnPct:-2.4,signalsFired:!0},{id:"r4",symbol:"xyz:AAPL",dir:"long",confidence:65,claim:"Gap fill into the print.",cls:"breakout",verdict:"hit",returnPct:1.8,signalsFired:!1}];let xt=[],Mn=Tg,Vc={open:xt,resolved:Mn};const zr=new Set;function Zc(){Vc={open:xt,resolved:Mn};for(const e of zr)e()}function Eg(e){const t=Date.now(),n=e.cls??Cg(e.claim),r=e.entry??Sg[e.sym]??100,s=r*(e.dir==="long"?1.03:.97);xt=[{id:`u${t}`,symbol:e.sym,dir:e.dir,confidence:e.confidence,claim:e.claim,cls:n,entry:r,target:s,resolveAt:t+zg[n]},...xt],Zc()}function ro(e,t){const n=xt.find(a=>a.id===e);if(!n)return;const r=Hc(n,t),s={id:n.id,symbol:n.symbol,dir:n.dir,confidence:n.confidence,claim:n.claim,cls:n.cls,verdict:r>=0?"hit":"miss",returnPct:r};xt=xt.filter(a=>a.id!==e),Mn=[s,...Mn],Zc()}function Mg(e){return zr.add(e),()=>{zr.delete(e)}}function so(){return Vc}function ss(){return f.useSyncExternalStore(Mg,so,so)}const Ag=["xyz:*"],oo=e=>Object.entries(e).filter(([,t])=>t.markPx>0).map(([t])=>t).sort((t,n)=>ae(t).localeCompare(ae(n)));Pi.schema;const ao=[{label:"funding reset",cls:"mean-reversion"},{label:"oversold bounce",cls:"mean-reversion"},{label:"range reclaim",cls:"mean-reversion"},{label:"breakout",cls:"breakout"},{label:"momentum / trend",cls:"breakout"},{label:"positioning flush",cls:"positioning"},{label:"catalyst / earnings",cls:"macro"}];function Pg(e){var U;const[t,n]=f.useState("xyz:TSLA"),[r,s]=f.useState("long"),[a,i]=f.useState(!1),[c,l]=f.useState(""),[u,d]=f.useState(null),[h,m]=f.useState(""),[p,x]=f.useState(65),[b,y]=f.useState(!1),g=Yt(Ag,6e4),v=Yt(void 0,6e4),S=f.useMemo(()=>({...v,...g}),[v,g]),z=f.useMemo(()=>[...oo(g),...oo(v)],[g,v]),j=Pt([t]),C=_=>{var I;return j[_]??((I=S[_])==null?void 0:I.markPx)},k=C(t),w=(U=S[t])==null?void 0:U.changePct,N=u!=null?ao[u]:null,E=N?Tt[N.cls]:null,W=E?E.hits/E.n>=.55:!0,L=f.useMemo(()=>{const _=c.trim().toLowerCase();return(_?z.filter(H=>ae(H).toLowerCase().includes(_)):z).slice(0,80)},[c,z]);function A(){if(!N)return;const _=h.trim()?`${N.label} — ${h.trim()}`:N.label;Eg({sym:t,dir:r,confidence:p,claim:_,cls:N.cls,entry:k}),d(null),m(""),y(!0),window.setTimeout(()=>y(!1),1100)}return o.jsxs("div",{className:"flex h-full flex-col gap-2.5",children:[o.jsxs("div",{className:"relative",children:[o.jsxs("button",{type:"button",onClick:()=>i(_=>!_),className:`flex w-full items-center gap-2 px-2.5 py-2 ${Ne}`,children:[o.jsx(Fe,{symbol:t,size:20}),o.jsx("span",{className:"body-md text-strong font-semibold",children:ae(t)}),o.jsxs("span",{className:"ml-auto flex items-baseline gap-2 tabular-nums",children:[o.jsx("span",{className:"body-sm text-strong",children:k!=null?ze(k):"…"}),w!=null&&o.jsx("span",{className:"caption",style:{color:Ce(w)},children:ye(w)})]}),o.jsx("span",{className:"caption text-disabled ml-1",children:a?"▲":"▼"})]}),a&&o.jsxs("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 flex flex-col gap-1 rounded-md p-1.5 shadow-xl",style:{background:"hsl(248 32% 9%)",border:"1px solid var(--color-accent-line)"},children:[o.jsx("input",{autoFocus:!0,value:c,onChange:_=>l(_.target.value),placeholder:"search ticker…",className:"body-sm w-full rounded bg-white/[0.05] px-2 py-1.5 text-strong outline-none placeholder:text-disabled"}),o.jsxs("div",{className:`flex max-h-44 flex-col ${xe}`,children:[L.map(_=>o.jsxs("button",{type:"button",onClick:()=>{n(_),i(!1),l("")},className:"flex items-center gap-2 rounded px-2 py-1.5 transition-colors hover:bg-white/[0.06]",children:[o.jsx(Fe,{symbol:_,size:16}),o.jsx("span",{className:"body-sm text-normal",children:ae(_)}),o.jsx("span",{className:"caption text-soft ml-auto tabular-nums",children:C(_)!=null?ze(C(_)):"—"})]},_)),L.length===0&&o.jsx("span",{className:"caption text-disabled px-2 py-2",children:z.length===0?"loading universe…":"no Hyperliquid market for that"})]})]})]}),o.jsx("div",{className:"flex items-center gap-2",children:["long","short"].map(_=>{const I=r===_;return o.jsx("button",{type:"button",onClick:()=>s(_),className:"body-sm flex-1 rounded-md py-1.5 font-bold uppercase tracking-wide transition-colors",style:{color:I?En(_):"var(--color-soft)",background:I?"var(--color-surface)":"rgba(255,255,255,0.03)",border:`1px solid ${I?En(_)+"55":"transparent"}`},children:_},_)})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:ao.map((_,I)=>{const H=u===I;return o.jsx("button",{type:"button",onClick:()=>d(H?null:I),className:"caption rounded-full px-2.5 py-1 transition-colors",style:{color:H?"var(--color-strong)":"var(--color-soft)",background:H?"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.3)":"rgba(255,255,255,0.04)",border:`1px solid ${H?"var(--color-accent-line)":"transparent"}`},children:_.label},_.label)})}),o.jsx("input",{value:h,onChange:_=>m(_.target.value),onKeyDown:_=>_.key==="Enter"&&A(),placeholder:"add a note (optional)",className:`body-sm w-full rounded-md px-2.5 py-1.5 text-strong outline-none placeholder:text-disabled ${Ne}`}),E&&o.jsxs("span",{className:"caption",style:{color:W?fe:_e},children:["your last ",E.n," ",zt[N.cls]," calls: ",E.hits,"/",E.n,W?" · your edge":" · a leak — size down"]}),o.jsxs("div",{className:"mt-auto flex items-center gap-2.5",children:[o.jsx("span",{className:"caption text-disabled",children:"how sure"}),o.jsx("input",{type:"range",min:50,max:95,step:1,value:p,onChange:_=>x(Number(_.target.value)),className:"h-1 flex-1 cursor-pointer",style:{accentColor:"hsl(var(--zf-accent-hue, 242) 85% 68%)"}}),o.jsxs("span",{className:"body-sm text-strong w-9 tabular-nums",children:[p,"%"]}),o.jsx("button",{type:"button",onClick:A,disabled:!N,className:"caption rounded px-3 py-1.5 font-bold uppercase tracking-wide transition-opacity disabled:opacity-40",style:{color:"var(--color-strong)",background:b?fe+"55":"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.35)"},children:b?"logged ✓":"log"})]})]})}const Rg={...Pi,component:Pg};function Wc({dir:e}){return o.jsx("span",{className:"caption rounded px-1.5 py-0.5 font-bold uppercase tracking-wide",style:{color:En(e),background:"var(--color-surface)"},children:e})}function Yc({symbol:e}){return o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx(Fe,{symbol:e,size:16}),o.jsx("span",{className:"body-sm text-strong font-semibold",children:ae(e)})]})}function Jn({label:e,value:t,sub:n,color:r}){return o.jsxs("div",{className:`flex flex-col gap-0.5 px-2.5 py-2 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft uppercase tracking-wide",children:e}),o.jsx("span",{className:"metric-sm font-bold leading-none tabular-nums",style:{color:r??"var(--color-strong)"},children:t}),n&&o.jsx("span",{className:"caption text-disabled",children:n})]})}function $g({call:e,now:t,mid:n,onClose:r}){const s=En(e.dir),a=n!=null?Hc(e,n):null,i=n!=null?jg(e,n):0,c=a==null?"var(--color-soft)":a>=0?fe:_e;return o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-white/[0.06] bg-white/[0.02] px-3 py-2.5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Wc,{dir:e.dir}),o.jsx(Yc,{symbol:e.symbol}),o.jsx("span",{className:"caption text-disabled",children:"·"}),o.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),o.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:c},children:a==null?"…":ye(a)})]}),o.jsx("p",{className:"body-sm text-normal leading-snug",children:e.claim}),o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsxs("div",{className:"relative h-1.5 rounded-full bg-white/[0.06]",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full opacity-40",style:{width:`${i*100}%`,background:s}}),o.jsx("span",{className:"absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-black/30",style:{left:`${i*100}%`,background:s}})]}),o.jsxs("div",{className:"caption text-disabled flex items-center justify-between tabular-nums",children:[o.jsxs("span",{children:["entry ",ze(e.entry)]}),o.jsxs("span",{className:"text-soft",children:["now ",n!=null?ze(n):"…"]}),o.jsxs("span",{children:["target ",ze(e.target)]})]})]}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"caption text-disabled uppercase tracking-wide",children:zt[e.cls]}),o.jsxs("span",{className:"caption text-soft flex items-center gap-2 tabular-nums",children:[Ng(e.resolveAt-t),r&&o.jsx("button",{type:"button",onClick:r,disabled:n==null,className:"caption rounded px-1.5 py-0.5 uppercase tracking-wide transition-opacity hover:text-strong disabled:opacity-40",style:{background:"var(--color-surface)"},children:"close"})]})]})]})}function Dg({call:e}){const t=e.verdict==="hit"?fe:_e,n=e.signalsFired===void 0?null:_g(e);return o.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-white/[0.04] px-3 py-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Wc,{dir:e.dir}),o.jsx(Yc,{symbol:e.symbol}),o.jsxs("span",{className:"caption text-soft tabular-nums",children:[e.confidence,"%"]}),o.jsx("span",{className:"body-sm ml-auto font-bold tabular-nums",style:{color:t},children:ye(e.returnPct)})]}),o.jsx("p",{className:"body-sm text-soft leading-snug",children:e.claim}),n?o.jsxs("span",{className:"caption font-medium",style:{color:n.color},children:[n.glyph," ",n.label]}):o.jsxs("span",{className:"caption text-disabled uppercase tracking-wide",children:[e.verdict," · graded by return"]})]})}function Gc({children:e}){return o.jsx("div",{className:"body-sm text-soft flex h-full min-h-0 items-center justify-center text-center",children:e})}Ri.schema;function Ig({config:e}){const{open:t}=ss(),[n,r]=f.useState(()=>Date.now()),s=Pt(t.map(i=>i.symbol));if(f.useEffect(()=>{const i=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(i)},[]),f.useEffect(()=>{for(const i of t){const c=s[i.symbol];n>=i.resolveAt&&c!=null&&ro(i.id,c)}},[n,t,s]),t.length===0)return o.jsx(Gc,{children:"no open calls — log a read in Journal · Log"});const a=t.slice(0,e.max);return o.jsx("div",{className:`flex flex-col gap-2 ${xe}`,children:a.map(i=>{const c=s[i.symbol];return o.jsx($g,{call:i,now:n,mid:c,onClose:c!=null?()=>ro(i.id,c):void 0},i.id)})})}const Lg={...Ri,component:Ig};$i.schema;function Fg({config:e}){const{resolved:t}=ss();if(t.length===0)return o.jsx(Gc,{children:"nothing graded yet — your calls resolve here"});const n=t.slice(0,e.max);return o.jsx("div",{className:`flex flex-col gap-2 ${xe}`,children:n.map(r=>o.jsx(Dg,{call:r},r.id))})}const Og={...$i,component:Fg};Di.schema;function Ug(){const e=Object.keys(Tt).map(t=>({cls:t,rate:Tt[t].hits/Tt[t].n}));return e.sort((t,n)=>n.rate-t.rate),{edge:e[0],leak:e[e.length-1]}}function Bg(e){const{resolved:t}=ss(),{edge:n,leak:r}=Ug(),s=t.length,a=s?Math.round(t.reduce((l,u)=>l+u.confidence,0)/s):0,i=s?Math.round(t.filter(l=>l.verdict==="hit").length/s*100):0,c=a-i;return o.jsxs("div",{className:"flex h-full flex-col gap-2",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsx(Jn,{label:"your edge",value:`${Math.round(n.rate*100)}%`,sub:zt[n.cls],color:fe}),o.jsx(Jn,{label:"your leak",value:`${Math.round(r.rate*100)}%`,sub:`${zt[r.cls]} — size down`,color:_e}),o.jsx(Jn,{label:"calibration",value:s?`${a}→${i}`:"—",sub:s?c>4?`overconfident +${c}`:c<-4?`underconfident ${c}`:"well-calibrated":"no calls yet",color:Math.abs(c)>4?"#f4a259":fe})]}),o.jsx("div",{className:"rounded-md px-3 py-2",style:{background:"hsl(var(--zf-accent-hue, 242) 80% 60% / 0.1)",border:"1px solid var(--color-accent-line)"},children:o.jsxs("p",{className:"body-sm text-normal leading-snug",children:[o.jsx("span",{className:"font-semibold text-highlight",children:"zAI ·"})," Sharpest on"," ",zt[n.cls],". You leak on ",zt[r.cls]," —"," ",Tt[r.cls].hits,"/",Tt[r.cls].n,", and your kill rule tripped on most of them. Size those down."]})})]})}const Hg={...Di,component:Bg};function Mt(e,t=70,n=1){let r="242",s="90%";if(e){const a=getComputedStyle(e);r=a.getPropertyValue("--zf-accent-hue").trim()||"242",s=a.getPropertyValue("--zf-accent-sat").trim()||"90%"}return`hsla(${r}, ${s}, ${t}%, ${n})`}const Re={text:"rgba(255, 255, 255, 0.85)",textSoft:"rgba(255, 255, 255, 0.6)",gameOver:si};function $t(e,t,n,r,s){t.font='bold 12px "DM Sans", monospace',t.textAlign="left",t.fillStyle=Re.textSoft,t.fillText("HI",10,22),t.fillStyle=s,t.fillText(String(r).padStart(4,"0"),30,22),t.textAlign="right",t.fillStyle=Re.text,t.fillText(String(n).padStart(4,"0"),e.width-10,22)}const Vg=.6,Zg=-12,vn=40,Wg=40,Vt=44,io=24,Yg=40,co=3,Gg=5e-4,yt={ground:"rgba(255, 255, 255, 0.1)",groundTexture:"rgba(255, 255, 255, 0.06)",dino:"rgba(255, 255, 255, 1)",eye:"rgba(0, 0, 0, 0.8)",cactus:"#25A78D"};function Xc(e,t,n,r){e.fillStyle=yt.dino,e.fillRect(t+10,n+10,25,24),e.fillRect(t+20,n,20,16),e.fillStyle=yt.eye,e.fillRect(t+32,n+4,4,4),e.fillStyle=yt.dino,e.fillRect(t,n+16,14,8),e.fillRect(t-4,n+12,8,8),r===null?(e.fillRect(t+12,n+34,6,10),e.fillRect(t+24,n+34,6,10)):(e.fillRect(t+12,n+34,6,r===0?10:6),e.fillRect(t+24,n+34,6,r===1?10:6)),e.fillRect(t+30,n+18,4,10)}function Xg(e,t,n,r,s){const a=n-s;e.fillStyle=yt.cactus,e.fillRect(t+r/2-4,a,8,s),e.fillRect(t,a+10,8,6),e.fillRect(t,a+10,4,14),e.fillRect(t+r-8,a+18,8,6),e.fillRect(t+r-4,a+18,4,12)}function lo(e,t,n,r,s,a){const i=e.height-vn;t.clearRect(0,0,e.width,e.height),t.fillStyle=yt.ground,t.fillRect(0,i,e.width,2),Xc(t,50,i-Vt,null),t.textAlign="center",n==="idle"?(t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText("Press SPACE or tap to start",e.width/2,e.height/2-30)):(t.fillStyle=Re.gameOver,t.font='bold 20px "DM Sans", sans-serif',t.fillText("GAME OVER",e.width/2,e.height/2-40),t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText(`Score: ${r}`,e.width/2,e.height/2-10),t.fillStyle=Re.textSoft,t.fillText("Press SPACE or tap to restart",e.width/2,e.height/2+20)),t.textAlign="left",$t(e,t,r,s,a)}function qg(){const e=f.useRef(null),t=f.useRef(null),[n,r]=f.useState("idle"),[s,a]=f.useState(0),[i,c]=f.useState(()=>{if(typeof window<"u"){const g=localStorage.getItem("zframes-dino-high-score");return g?parseInt(g,10):0}return 0}),[l,u]=f.useState(!1),d=f.useRef(0),h=f.useRef(i),m=f.useRef(n),p=f.useRef(Mt(null));f.useEffect(()=>{h.current=i,i>0&&localStorage.setItem("zframes-dino-high-score",String(i))},[i]),f.useEffect(()=>{m.current=n},[n]);const x=f.useRef({dinoY:0,dinoVelocity:0,isJumping:!1,obstacles:[],speed:co,frameCount:0,groundOffset:0}),b=f.useCallback(()=>{const g=e.current;g&&(x.current={dinoY:g.height-vn-Vt,dinoVelocity:0,isJumping:!1,obstacles:[],speed:co,frameCount:0,groundOffset:0},d.current=0,a(0))},[]),y=f.useCallback(()=>{var v;if((v=t.current)==null||v.focus(),n!=="playing"){b(),r("playing");return}const g=x.current;g.isJumping||(g.dinoVelocity=Zg,g.isJumping=!0)},[n,b]);return f.useEffect(()=>{const g=S=>{const z=S.target;z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable||(S.code==="Space"||S.code==="ArrowUp")&&(S.preventDefault(),y())},v=t.current;if(v)return v.addEventListener("keydown",g),()=>v.removeEventListener("keydown",g)},[y]),f.useLayoutEffect(()=>{const g=e.current;if(!g)return;const v=()=>{const z=g.parentElement;if(z&&z.clientWidth>0&&z.clientHeight>0){g.width=z.clientWidth,g.height=z.clientHeight,p.current=Mt(g),x.current.dinoY=g.height-vn-Vt;const j=g.getContext("2d");j&&m.current!=="playing"&&lo(g,j,m.current,d.current,h.current,p.current),u(C=>!C)}};v();const S=new ResizeObserver(v);return S.observe(g.parentElement),()=>S.disconnect()},[]),f.useEffect(()=>{if(n!=="playing")return;const g=e.current,v=g==null?void 0:g.getContext("2d");if(!g||!v)return;let S;const z=g.height-vn,j=()=>{v.fillStyle=yt.ground,v.fillRect(0,z,g.width,2),v.fillStyle=yt.groundTexture;const w=x.current.groundOffset%30;for(let N=-w;N<g.width;N+=30)v.beginPath(),v.arc(N,z+12,1.5,0,Math.PI*2),v.fill(),v.beginPath(),v.arc(N+15,z+20,1,0,Math.PI*2),v.fill()},C=w=>{const E=x.current.dinoY;return 50+Wg-5>w.x&&55<w.x+w.width&&E+Vt>z-w.height&&E+5<z},k=()=>{const w=x.current;v.clearRect(0,0,g.width,g.height),w.dinoVelocity+=Vg,w.dinoY+=w.dinoVelocity;const N=z-Vt;w.dinoY>=N&&(w.dinoY=N,w.dinoVelocity=0,w.isJumping=!1),w.obstacles=w.obstacles.filter(L=>L.x>-io),w.obstacles.forEach(L=>{L.x-=w.speed});const E=w.obstacles[w.obstacles.length-1],W=300+Math.random()*200;(!E||E.x<g.width-W)&&Math.random()<.02&&w.obstacles.push({x:g.width,width:io,height:Yg});for(const L of w.obstacles)if(C(L)){d.current>h.current&&(h.current=d.current,c(d.current)),r("gameover");return}w.frameCount++,w.frameCount%6===0&&(d.current+=1,a(d.current)),w.speed+=Gg,w.groundOffset+=w.speed,j(),Xc(v,50,w.dinoY,w.isJumping?null:Math.floor(w.frameCount/5)%2),w.obstacles.forEach(L=>Xg(v,L.x,z,L.width,L.height)),$t(g,v,d.current,h.current,p.current),S=requestAnimationFrame(k)};return S=requestAnimationFrame(k),()=>cancelAnimationFrame(S)},[n]),f.useEffect(()=>{if(n==="playing")return;const g=e.current,v=g==null?void 0:g.getContext("2d");!g||!v||lo(g,v,n,s,i,p.current)},[n,s,i,l]),o.jsx("div",{ref:t,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onClick:y,onTouchStart:y,role:"application","aria-label":"Dino running game. Press space or tap to jump over obstacles.",children:o.jsx("canvas",{ref:e,className:"h-full w-full"})})}const Kg={...kp,component:qg};ui.schema;function Jg(e){return e<=25?"#F21553":e<=45?"#F97316":e<=55?"#F59E0B":e<=75?"#84CC16":"#25A78D"}function Qg({config:e}){const{points:t,isLoading:n}=$h(e.sparklineDays),r=t[0],s=f.useMemo(()=>[...t].reverse().map(i=>({date:new Date(i.time).toISOString(),value:i.value})),[t]);if(n)return o.jsx(M,{loading:!0,children:"loading index…"});if(!r)return o.jsx(M,{children:"no sentiment data yet"});const a=Jg(r.value);return o.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2.5",children:[o.jsx("div",{className:"metric-xl leading-none",style:{color:a,textShadow:`0 0 28px ${a}55`},children:r.value}),o.jsx("div",{className:"body-sm rounded-full px-2.5 py-0.5 font-semibold uppercase tracking-wide",style:{color:a,background:`${a}1f`,border:`1px solid ${a}33`},children:r.classification}),o.jsxs("div",{className:"relative w-full max-w-[180px] overflow-hidden rounded-xl",children:[o.jsx("div",{className:"h-[11px] w-full opacity-40",style:{background:"linear-gradient(90deg, #FF1F5F 4.89%, #464646 34.15%, #464646 69.98%, #81FE90 100%)"}}),o.jsx("div",{className:"absolute left-0 top-0 h-full w-full",style:{background:"repeating-linear-gradient(to right, var(--color-background-terminal), var(--color-background-terminal) 2px, transparent 2px, transparent 3px)"}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-[3px] -translate-x-1/2 -translate-y-1/2 rounded-xs",style:{left:`${r.value}%`,background:a}})]}),o.jsx(mt,{data:s,width:150,height:30,color:a}),o.jsxs("div",{className:"caption text-soft",children:["crypto fear & greed · ",e.sparklineDays,"d"]})]})}const eb={...ui,component:Qg};function qc({href:e,leading:t,title:n,subtitle:r,meta:s,titleAttr:a}){return o.jsxs("a",{href:e,target:"_blank",rel:"noreferrer noopener",title:a,className:"group relative flex min-w-0 items-start gap-3 border-b border-white/[0.06] py-2 pl-3 no-underline transition-colors last:border-b-0 before:absolute before:bottom-1.5 before:left-0 before:top-1.5 before:w-0.5 before:rounded-full before:bg-highlight before:opacity-0 before:transition-opacity hover:bg-white/[0.03] group-hover:before:opacity-100 hover:before:opacity-100",children:[t,o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"body-sm text-normal line-clamp-2 block font-medium leading-snug transition-colors group-hover:text-strong",children:n}),r&&o.jsx("span",{className:"caption text-soft mt-1 line-clamp-2 block leading-relaxed",children:r})]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 pt-px",children:[s!=null&&o.jsx("span",{className:"caption text-soft tabular-nums",children:s}),o.jsx("span",{className:"caption text-highlight/70 -mr-0.5 w-2 opacity-0 transition-opacity group-hover:opacity-100",children:"↗"})]})]})}Ni.schema;const ln={"10-K":"Annual report","10-Q":"Quarterly report","8-K":"Material event","20-F":"Annual report (foreign)","40-F":"Annual report (foreign)","6-K":"Foreign interim report","S-1":"Registration","S-3":"Registration","S-4":"Registration (M&A)","DEF 14A":"Proxy statement",DEFA14A:"Proxy materials","SC 13D":"Activist stake","SC 13G":"Passive stake",SD:"Specialized disclosure",3:"Initial insider ownership",4:"Insider transaction",5:"Annual insider ownership",144:"Proposed insider sale","11-K":"Employee benefit plan"},tb=/^(10-K|10-Q|8-K|20-F|40-F|6-K|S-|F-|424|DEF |DEFA|DEFM|11-K|SC 13|25)/i,nb=/^(3|4|5|144)(\/A)?$/;function os(e){return e.replace(/^SCHEDULE /i,"SC ").trim()}function rb(e,t){return t==="all"?!0:t==="insider"?nb.test(e):tb.test(e)}function sb(e){const t=os(e.form);if(ln[t])return ln[t];const n=t.replace(/\/A$/,"");return n!==t&&ln[n]?`${ln[n]} (amended)`:e.description&&e.description.toUpperCase()!==e.form.toUpperCase()?e.description:t}function ob({filing:e}){return o.jsx(qc,{href:e.url,titleAttr:e.form,leading:o.jsx("span",{className:"caption text-strong inline-flex w-16 shrink-0 justify-center truncate rounded bg-white/[0.06] px-1.5 py-1 font-bold",children:os(e.form)}),title:sb(e),subtitle:e.reportDate?`period ${e.reportDate}`:e.items?`items ${e.items}`:e.accessionNumber,meta:e.filingDate?qr(new Date(e.filingDate).getTime()):void 0})}function ab({config:e}){const{data:t,isLoading:n}=Bh(e.symbol),r=f.useMemo(()=>((t==null?void 0:t.filings)??[]).filter(c=>rb(os(c.form),e.forms)).slice(0,e.count),[t==null?void 0:t.filings,e.forms,e.count]);if(n)return o.jsx(M,{loading:!0,children:"loading SEC filings…"});if(!t)return o.jsxs(M,{children:["no SEC data for “",ae(e.symbol),"”"]});const s=t.tickers[0],a=e.symbol.includes(":")?e.symbol:s?`xyz:${s}`:null,i=[t.exchanges[0],t.category].filter(Boolean).join(" · ");return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a&&o.jsx(Fe,{symbol:a,size:22}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:t.name||s||ae(e.symbol)}),i&&o.jsx("div",{className:"caption text-soft truncate",children:i})]})]}),o.jsx("div",{className:"caption text-soft shrink-0 text-right",children:"filings"})]}),o.jsx("div",{className:xe,children:r.length>0?r.map(c=>o.jsx(ob,{filing:c},c.accessionNumber)):o.jsxs(M,{children:["no ",e.forms==="all"?"":`${e.forms} `,"filings yet"]})})]})}const ib={...Ni,component:ab};zi.schema;function cb(e){return e.unit==="USD/shares"?ze(e.value):e.unit==="shares"?Ze(e.value):le(e.value)}function lb({config:e}){const{data:t,isLoading:n}=Hh(e.symbol);return n?o.jsx(M,{loading:!0,children:"loading SEC financials…"}):!t||t.metrics.length===0?o.jsxs(M,{children:["no SEC financials for “",ae(e.symbol),"”"]}):o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:t.entityName||ae(e.symbol)}),o.jsx("div",{className:"caption text-soft truncate",children:"SEC EDGAR · XBRL company facts"})]}),o.jsx("div",{className:"caption text-soft shrink-0 text-right",children:"on filing"})]}),o.jsx("div",{className:`grid grid-cols-2 content-start gap-2 ${xe}`,children:t.metrics.map(r=>o.jsxs("div",{className:"rounded bg-white/[0.04] px-3 py-2",children:[o.jsx("div",{className:"caption text-soft truncate",children:r.label}),o.jsx("div",{className:"metric-sm text-strong",children:cb(r)}),o.jsx("div",{className:"caption text-soft truncate",children:r.fiscalPeriod})]},r.label))})]})}const ub={...zi,component:lb};wi.schema;function uo(e){return e>0?_e:fe}function db(e){return e>=2.5?"high stress":e>=1?"elevated":e>-1?"near average":"below average"}function mb({config:e}){const{stress:t,isLoading:n}=Uh(),r=f.useMemo(()=>((t==null?void 0:t.trend)??[]).slice(-e.trendDays).map(a=>({date:new Date(a.time).toISOString(),value:a.value})),[e.trendDays,t==null?void 0:t.trend]);if(n)return o.jsx(M,{loading:!0,children:"loading stress index…"});if(!t)return o.jsx(M,{children:"no stress-index data yet"});const s=uo(t.value);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"OFR FSI"}),o.jsx("div",{className:"body-sm text-normal",children:t.date})]}),o.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"metric-xl leading-none",style:{color:s,textShadow:`0 0 24px ${s}44`},children:[t.value>0?"+":"",t.value.toFixed(2)]}),o.jsx("div",{className:"caption text-soft mt-1",children:db(t.value)})]}),o.jsxs("div",{className:"caption text-soft max-w-[46%] text-right leading-snug",children:["0 = long-run average",o.jsx("br",{}),"higher = more stress"]})]}),o.jsx(mt,{data:r,width:210,height:42,color:s}),e.showCategories&&t.categories.length>0&&o.jsx("div",{className:"grid grid-cols-2 gap-1.5 border-t border-white/[0.08] pt-2",children:t.categories.map(a=>o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"caption text-soft truncate",children:a.label}),o.jsxs("span",{className:"body-sm font-bold tabular-nums",style:{color:uo(a.value)},children:[a.value>0?"+":"",a.value.toFixed(2)]})]},a.label))})]})}const fb={...wi,component:mb};Si.schema;const hb="LNS14000000",pb="CES0000000001";function gb({config:e}){const n=new Date().getUTCFullYear(),r=n-2,{series:s,isLoading:a}=kr(hb,r,n),{series:i,isLoading:c}=kr(pb,r,n),l=f.useMemo(()=>((s==null?void 0:s.points)??[]).slice(-e.months),[e.months,s==null?void 0:s.points]),u=f.useMemo(()=>l.map(x=>({date:new Date(x.time).toISOString(),value:x.value})),[l]);if(a&&c)return o.jsx(M,{loading:!0,children:"loading labor data…"});const d=l.at(-1);if(!s||!d)return o.jsx(M,{children:"no labor data yet"});const h=i==null?void 0:i.points.at(-1),m=i==null?void 0:i.points.at(-2),p=h&&m?h.value-m.value:null;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"unemployment rate"}),o.jsx("div",{className:"body-sm text-normal",children:d.date})]}),o.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"metric-xl text-strong leading-none",children:je(d.value,1)}),o.jsxs("div",{className:"caption text-soft mt-1",children:[s.source," · U-3"]})]}),p!==null&&h&&o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"caption text-soft",children:"nonfarm payrolls"}),o.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:Ce(p)},children:[p>=0?"+":"",Ze(p*1e3)]}),o.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[Ze(h.value*1e3)," jobs"]})]})]}),o.jsx(mt,{data:u,width:210,height:44,color:si}),o.jsxs("div",{className:"caption text-soft",children:[s.label," · ",l.length," monthly observations"]})]})}const bb={...Si,component:gb};ki.schema;function xb({config:e}){const{debt:t,isLoading:n}=Oh(e.trendDays),r=f.useMemo(()=>((t==null?void 0:t.trend)??[]).map(i=>({date:new Date(i.time).toISOString(),value:i.total})),[t==null?void 0:t.trend]);if(n)return o.jsx(M,{loading:!0,children:"loading national debt…"});if(!t)return o.jsx(M,{children:"no debt data yet"});const s=t.trend[0],a=s?t.total-s.total:null;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"total public debt"}),o.jsxs("div",{className:"body-sm text-normal",children:["as of ",t.date]})]}),o.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsx("div",{className:"metric-xl text-strong leading-none",children:le(t.total)}),a!==null&&s&&o.jsxs("div",{className:"text-right",children:[o.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[a>=0?"+":"",le(a)]}),o.jsxs("div",{className:"caption text-soft",children:["since ",s.date]})]})]}),o.jsx(mt,{data:r,width:210,height:42,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),e.showSplit&&o.jsxs("div",{className:"grid grid-cols-2 gap-1.5 border-t border-white/[0.08] pt-2",children:[o.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[o.jsx("div",{className:"caption text-soft truncate",children:"Held by public"}),o.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:le(t.heldByPublic)})]}),o.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[o.jsx("div",{className:"caption text-soft truncate",children:"Intragovernmental"}),o.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:le(t.intragovernmental)})]})]})]})}const yb={...ki,component:xb};function as({label:e,meta:t,value:n}){return o.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3 border-b border-white/[0.06] py-1.5 last:border-b-0",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("div",{className:"body-sm text-normal truncate font-semibold",children:e}),t!=null&&o.jsx("div",{className:"caption text-soft truncate",children:t})]}),o.jsx("div",{className:"metric-sm text-strong shrink-0",children:n})]})}ji.schema;function vb({auction:e}){const t=[e.securityTerm,e.securityType].filter(Boolean).join(" ");return o.jsx(as,{label:t||e.securityType,meta:e.auctionDate+(e.bidToCover!==null?` · ${e.bidToCover.toFixed(2)}× bid-to-cover`:""),value:e.rate!==null?je(e.rate):"—"})}function wb({config:e}){const{auctions:t,isLoading:n}=Fh(e.count);if(n)return o.jsx(M,{loading:!0,children:"loading auctions…"});if(!t.length)return o.jsx(M,{children:"no auction data yet"});const r=t.slice(0,e.count);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"treasury auctions"}),o.jsx("div",{className:"body-sm text-normal",children:"high yield · bid-to-cover"})]}),o.jsx("div",{className:"caption text-soft text-right",children:"results"})]}),o.jsx("div",{className:xe,children:r.map((s,a)=>o.jsx(vb,{auction:s},`${s.auctionDate}-${s.securityType}-${s.securityTerm}-${a}`))})]})}const kb={...ji,component:wb};Ti.schema;const mo=1440*60*1e3,Sb=10080*60*1e3;function jb({data:e,width:t}){return t<44?null:o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("span",{className:"caption text-normal tabular-nums",children:ri(e.rate*100)})})}function Nb({config:e}){const t=f.useMemo(()=>Date.now()-Sb,[]),{history:n,isLoading:r}=Ka(e.symbols,t),s=f.useMemo(()=>{const a=[];for(const i of e.symbols){const c=n[i]??[],l=new Map;for(const u of c){const d=Math.floor(u.time/mo)*mo,h=l.get(d)??{sum:0,n:0};h.sum+=u.fundingRate,h.n+=1,l.set(d,h)}for(const[u,{sum:d,n:h}]of l){const m=d/h,x=new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric"});a.push({id:`${i}-${u}`,row:ae(i),column:x,value:m*1e4,rate:m})}}return a},[n,e.symbols]);return r?o.jsx(M,{loading:!0,children:"loading funding…"}):s.length===0?o.jsx(M,{children:"no funding data"}):o.jsx(A0,{data:s,CellComponent:jb,gap:3,showLabels:!0,rowLabelWidth:48,columnLabelHeight:20})}const Cb={...Ti,component:Nb},zb={"24h":{ms:1440*60*1e3,timeframe:$e["24h"]},"7D":{ms:10080*60*1e3,timeframe:$e["7D"]},"1M":{ms:720*60*60*1e3,timeframe:$e["1M"]}};di.schema;function _b({config:e}){const{ms:t,timeframe:n}=zb[e.lookback],r=f.useMemo(()=>Date.now()-t,[t]),{history:s,isLoading:a}=Ka(e.symbols,r),i=f.useMemo(()=>e.symbols.map((c,l)=>({id:c,name:ae(c),color:Pe[l%Pe.length],data:(s[c]??[]).map(u=>({date:new Date(u.time).toISOString(),value:u.fundingRate*100}))})),[e.symbols,s]);return a?o.jsx(M,{loading:!0,children:"loading funding rates…"}):i.every(c=>c.data.length===0)?o.jsx(M,{children:"no funding data yet"}):o.jsx(Fn,{series:i,timeframe:n,height:250,formatValue:c=>ri(c)})}const Tb={...di,component:_b};Mi.schema;function Eb({config:e}){return o.jsxs("div",{className:"flex h-full w-full items-end gap-3 pb-2",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"h-[5px] w-[5px] shrink-0 rounded-full",style:{background:"var(--color-highlight)",boxShadow:"0 0 8px var(--color-highlight)"}}),o.jsx("h2",{className:"body-md text-strong font-extrabold uppercase leading-none tracking-[0.14em]",children:e.title})]}),e.subtitle&&o.jsx("p",{className:"caption text-soft pl-[13px] leading-none",children:e.subtitle})]}),o.jsx("span",{className:"mb-[5px] h-px flex-1",style:{background:"linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02) 65%, transparent)"}})]})}const Mb={...Mi,component:Eb};Ei.schema;function Ab({config:e}){const[t,n]=f.useState("loading");return f.useEffect(()=>n("loading"),[e.url]),t==="error"?o.jsx(M,{children:"image unavailable"}):o.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden rounded-md",children:[t==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(M,{loading:!0,children:"loading image…"})}),o.jsx("img",{src:e.url,alt:e.alt,className:`h-full w-full transition-opacity duration-300 ${t==="loaded"?"opacity-100":"opacity-0"}`,style:{objectFit:e.fit},onLoad:()=>n("loaded"),onError:()=>n("error")})]})}const Pb={...Ei,component:Ab};vi.schema;const Rb="CUUR0000SA0";function fo(e,t){return!t||t<=0?null:(e/t-1)*100}function $b({config:e}){const n=new Date().getUTCFullYear(),r=n-2,{series:s,isLoading:a}=kr(Rb,r,n),i=f.useMemo(()=>((s==null?void 0:s.points)??[]).slice(-e.months),[e.months,s==null?void 0:s.points]),c=i.at(-1),l=i.at(-2),u=c?i.find(b=>{const y=new Date(b.time),g=new Date(c.time);return y.getUTCFullYear()===g.getUTCFullYear()-1&&y.getUTCMonth()===g.getUTCMonth()}):void 0,d=f.useMemo(()=>i.map(b=>({date:new Date(b.time).toISOString(),value:b.value})),[i]);if(a)return o.jsx(M,{loading:!0,children:"loading CPI…"});if(!s||!c)return o.jsx(M,{children:"no CPI data yet"});const h=fo(c.value,l==null?void 0:l.value),m=fo(c.value,u==null?void 0:u.value),x=Ce(m??h??0);return o.jsxs("div",{className:"flex h-full flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"BLS CPI-U"}),o.jsx("div",{className:"body-sm text-normal",children:c.date})]}),o.jsx("div",{className:"caption text-soft text-right",children:"monthly"})]}),o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"metric-xl leading-none",style:{color:x,textShadow:`0 0 24px ${x}44`},children:m!==null?ye(m):"--"}),o.jsx("div",{className:"caption text-soft mt-1",children:"year over year"})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"caption text-soft",children:"index"}),o.jsx("div",{className:"body-md text-strong font-bold tabular-nums",children:c.value.toFixed(3)}),o.jsx("div",{className:"caption text-soft mt-2",children:"month over month"}),o.jsx("div",{className:"body-md font-bold tabular-nums",style:{color:Ce(h??0)},children:h!==null?ye(h):"--"})]})]}),o.jsx(mt,{data:d,width:210,height:46,color:x}),o.jsxs("div",{className:"caption text-soft",children:[s.label," · ",i.length," monthly observations"]})]})}const Db={...vi,component:$b},Se=[1,2,3,4,5],Ib=[0,1,2,3,4],Kc={US:["2026-01-01","2026-01-19","2026-02-16","2026-04-03","2026-05-25","2026-06-19","2026-07-03","2026-09-07","2026-11-26","2026-12-25"],TSX:["2026-01-01","2026-02-16","2026-04-03","2026-05-18","2026-07-01","2026-08-03","2026-09-07","2026-10-12","2026-12-25","2026-12-28"],B3:["2026-01-01","2026-02-16","2026-02-17","2026-04-03","2026-04-21","2026-05-01","2026-06-04","2026-09-07","2026-10-12","2026-11-02","2026-11-20","2026-12-25"],LSE:["2026-01-01","2026-04-03","2026-04-06","2026-05-04","2026-05-25","2026-08-31","2026-12-25","2026-12-28"],XETRA:["2026-01-01","2026-04-03","2026-04-06","2026-05-01","2026-12-24","2026-12-25","2026-12-31"],EURONEXT:["2026-01-01","2026-04-03","2026-04-06","2026-05-01","2026-12-25"],SIX:["2026-01-01","2026-01-02","2026-04-03","2026-04-06","2026-05-01","2026-05-14","2026-05-25","2026-12-24","2026-12-25","2026-12-31"],TSE:["2026-01-01","2026-01-02","2026-01-12","2026-02-11","2026-02-23","2026-03-20","2026-04-29","2026-05-04","2026-05-05","2026-05-06","2026-07-20","2026-08-11","2026-09-21","2026-09-22","2026-09-23","2026-10-12","2026-11-03","2026-11-23","2026-12-31"],HKEX:["2026-01-01","2026-02-17","2026-02-18","2026-02-19","2026-04-03","2026-04-06","2026-05-01","2026-05-25","2026-06-19","2026-07-01","2026-10-01","2026-10-19","2026-12-25"],CN:["2026-01-01","2026-02-16","2026-02-17","2026-02-18","2026-02-19","2026-02-20","2026-02-23","2026-02-24","2026-04-06","2026-05-01","2026-05-04","2026-05-05","2026-06-19","2026-10-01","2026-10-02","2026-10-05","2026-10-06","2026-10-07","2026-10-08"],NSE:["2026-01-26","2026-04-03","2026-05-01","2026-08-15","2026-10-02","2026-12-25"],KRX:["2026-01-01","2026-03-01","2026-05-05","2026-06-06","2026-08-15","2026-10-03","2026-10-09","2026-12-25"],SGX:["2026-01-01","2026-05-01","2026-08-10","2026-12-25"],SET:["2026-01-01","2026-01-02","2026-03-03","2026-04-06","2026-04-13","2026-04-14","2026-04-15","2026-05-01","2026-05-04","2026-06-01","2026-06-03","2026-07-28","2026-07-29","2026-08-12","2026-10-13","2026-10-23","2026-12-07","2026-12-10","2026-12-31"],ASX:["2026-01-01","2026-01-26","2026-04-03","2026-04-06","2026-04-07","2026-04-25","2026-06-08","2026-12-25","2026-12-28"],JSE:["2026-01-01","2026-03-21","2026-04-03","2026-04-06","2026-04-27","2026-05-01","2026-06-16","2026-08-10","2026-09-24","2026-12-16","2026-12-25"],TADAWUL:["2026-09-23"]},ct={NYSE:{code:"NYSE",name:"New York Stock Exchange",city:"New York",country:"US",website:"https://www.nyse.com",mark:"NY",tz:"America/New_York",open:"09:30",close:"16:00",days:Se,region:"Americas",holidayGroup:"US"},NASDAQ:{code:"NASDAQ",name:"Nasdaq",city:"New York",country:"US",website:"https://www.nasdaq.com",mark:"NQ",tz:"America/New_York",open:"09:30",close:"16:00",days:Se,region:"Americas",holidayGroup:"US"},TSX:{code:"TSX",name:"Toronto Stock Exchange",city:"Toronto",country:"CA",website:"https://www.tsx.com",mark:"TX",tz:"America/Toronto",open:"09:30",close:"16:00",days:Se,region:"Americas"},B3:{code:"B3",name:"B3",city:"São Paulo",country:"BR",website:"https://www.b3.com.br/en_us/",mark:"B3",tz:"America/Sao_Paulo",open:"10:00",close:"17:00",days:Se,region:"Americas"},LSE:{code:"LSE",name:"London Stock Exchange",city:"London",country:"GB",website:"https://www.londonstockexchange.com",mark:"LS",tz:"Europe/London",open:"08:00",close:"16:30",days:Se,region:"Europe"},XETRA:{code:"XETRA",name:"Deutsche Börse Xetra",city:"Frankfurt",country:"DE",website:"https://www.boerse-frankfurt.de/en",mark:"DX",tz:"Europe/Berlin",open:"09:00",close:"17:30",days:Se,region:"Europe"},EURONEXT:{code:"EURONEXT",name:"Euronext Paris",city:"Paris",country:"FR",website:"https://www.euronext.com",mark:"EN",tz:"Europe/Paris",open:"09:00",close:"17:30",days:Se,region:"Europe"},SIX:{code:"SIX",name:"SIX Swiss Exchange",city:"Zurich",country:"CH",website:"https://www.six-group.com/en/products-services/the-swiss-stock-exchange.html",mark:"SX",tz:"Europe/Zurich",open:"09:00",close:"17:30",days:Se,region:"Europe"},TSE:{code:"TSE",name:"Tokyo Stock Exchange",city:"Tokyo",country:"JP",website:"https://www.jpx.co.jp/english/",mark:"JP",tz:"Asia/Tokyo",open:"09:00",close:"15:30",days:Se,region:"Asia-Pacific"},HKEX:{code:"HKEX",name:"Hong Kong Exchange",city:"Hong Kong",country:"HK",website:"https://www.hkex.com.hk",mark:"HK",tz:"Asia/Hong_Kong",open:"09:30",close:"16:00",days:Se,region:"Asia-Pacific"},SSE:{code:"SSE",name:"Shanghai Stock Exchange",city:"Shanghai",country:"CN",website:"https://english.sse.com.cn",mark:"SH",tz:"Asia/Shanghai",open:"09:30",close:"15:00",days:Se,region:"Asia-Pacific",holidayGroup:"CN"},NSE:{code:"NSE",name:"National Stock Exchange",city:"Mumbai",country:"IN",website:"https://www.nseindia.com",mark:"NS",tz:"Asia/Kolkata",open:"09:15",close:"15:30",days:Se,region:"Asia-Pacific"},KRX:{code:"KRX",name:"Korea Exchange",city:"Seoul",country:"KR",website:"https://global.krx.co.kr",mark:"KR",tz:"Asia/Seoul",open:"09:00",close:"15:30",days:Se,region:"Asia-Pacific"},SGX:{code:"SGX",name:"Singapore Exchange",city:"Singapore",country:"SG",website:"https://www.sgx.com",mark:"SG",tz:"Asia/Singapore",open:"09:00",close:"17:00",days:Se,region:"Asia-Pacific"},SET:{code:"SET",name:"Stock Exchange of Thailand",city:"Bangkok",country:"TH",website:"https://www.set.or.th/en/home",mark:"SET",tz:"Asia/Bangkok",open:"10:00",close:"16:30",days:Se,region:"Asia-Pacific"},ASX:{code:"ASX",name:"Australian Securities Exchange",city:"Sydney",country:"AU",website:"https://www.asx.com.au",mark:"AS",tz:"Australia/Sydney",open:"10:00",close:"16:00",days:Se,region:"Asia-Pacific"},JSE:{code:"JSE",name:"Johannesburg Stock Exchange",city:"Johannesburg",country:"ZA",website:"https://www.jse.co.za",mark:"JS",tz:"Africa/Johannesburg",open:"09:00",close:"17:00",days:Se,region:"Middle East / Africa"},TADAWUL:{code:"TADAWUL",name:"Saudi Exchange",city:"Riyadh",country:"SA",website:"https://www.saudiexchange.sa",mark:"SA",tz:"Asia/Riyadh",open:"10:00",close:"15:00",days:Ib,region:"Middle East / Africa"}},Lb=["NYSE","NASDAQ","LSE","XETRA","EURONEXT","TSE","HKEX","SSE","NSE","SET","ASX"],Fb={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function An(e,t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short"}),r={};for(const s of n.formatToParts(e))s.type!=="literal"&&(r[s.type]=s.value);return{ymd:`${r.year}-${r.month}-${r.day}`,dow:Fb[r.weekday]??0,minutes:Number(r.hour)*60+Number(r.minute)+Number(r.second)/60}}function ho(e){const[t,n]=e.split(":").map(Number);return t*60+n}const Ob=864e5,Zt=1440;function Jc(e,t){const n=Kc[e.holidayGroup??e.code]??[],r=ho(e.open),s=ho(e.close),a=An(t,e.tz),i=(h,m)=>e.days.includes(h)&&!n.includes(m),c={code:e.code,name:e.name,city:e.city,country:e.country,website:e.website,mark:e.mark,tz:e.tz,open:e.open,close:e.close,region:e.region};if(i(a.dow,a.ymd)&&a.minutes>=r&&a.minutes<s)return{...c,status:"open",nextChangeMin:s-a.minutes};let u;if(i(a.dow,a.ymd)&&a.minutes<r)u=r-a.minutes;else{u=Zt-a.minutes+r;let h=!1;for(let m=1;m<=10;m++){const p=An(new Date(t.getTime()+m*Ob),e.tz);if(i(p.dow,p.ymd)){u=Zt-a.minutes+(m-1)*Zt+r,h=!0;break}}h||(u=-1)}const d=e.days.includes(a.dow)&&n.includes(a.ymd);return{...c,status:d?"holiday":"closed",nextChangeMin:u}}const po=["Americas","Europe","Asia-Pacific","Middle East / Africa"],go={open:0,holiday:1,closed:2};function Ub(e,t){const n=[...e];return t==="name"?n.sort((r,s)=>r.name.localeCompare(s.name)):t==="status"?n.sort((r,s)=>go[r.status]-go[s.status]||r.nextChangeMin-s.nextChangeMin):n.sort((r,s)=>po.indexOf(r.region)-po.indexOf(s.region)),n}function _r(e){if(e<0)return"—";if(e<1)return"<1m";const t=Math.floor(e),n=Math.floor(t/Zt),r=Math.floor(t%Zt/60),s=t%60;return n>0?`${n}d ${r}h`:r>0?`${r}h ${s}m`:`${s}m`}function Qc(e){const t=ct[e];return t?Kc[t.holidayGroup??t.code]??[]:[]}function Bb(e,t){return Qc(e).includes(t)}function Hb(e,t,n=new Date){const r=ct[e];if(!r)return[];const s=An(n,r.tz).ymd;return Qc(e).filter(a=>a>=s).sort().slice(0,Math.max(0,t))}function Tr(e,t=new Date){const n=ct[e];if(!n)return null;const{ymd:r,dow:s}=An(t,n.tz);return{ymd:r,dow:s}}li.schema;const el={open:{color:fe,chipBg:"rgba(63, 208, 143, 0.13)",label:"Open",verb:"closes",rail:fe,railOpacity:1,wash:"linear-gradient(90deg, rgba(63, 208, 143, 0.08), transparent 40%)"},closed:{color:"#8b92a1",chipBg:"rgba(255, 255, 255, 0.045)",label:"Closed",verb:"opens",rail:"rgba(255, 255, 255, 0.22)",railOpacity:.55,wash:"none"},holiday:{color:"#f2b066",chipBg:"rgba(242, 176, 102, 0.13)",label:"Holiday",verb:"opens",rail:"#f2b066",railOpacity:1,wash:"linear-gradient(90deg, rgba(242, 176, 102, 0.07), transparent 40%)"}};function Vb(){return o.jsxs("svg",{"aria-hidden":"true",className:"shrink-0",fill:"none",height:"15",viewBox:"0 0 20 20",width:"15",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7.25",stroke:"currentColor",strokeOpacity:"0.75",strokeWidth:"1.5"}),o.jsx("path",{d:"M2.75 10h14.5M10 2.75c2 2 3 4.42 3 7.25s-1 5.25-3 7.25M10 2.75c-2 2-3 4.42-3 7.25s1 5.25 3 7.25",stroke:"currentColor",strokeLinecap:"round",strokeOpacity:"0.55",strokeWidth:"1.2"}),o.jsx("path",{d:"m5.25 12.75 2.6-2.3 2.1 1.55 3.95-4.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.6"})]})}function Zb(e,t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"2-digit",minute:"2-digit",hour12:!1,timeZoneName:"short"}).format(e)}catch{return t}}function Wb(e){return/^[A-Z]{2}$/i.test(e)?[...e.toUpperCase()].map(t=>String.fromCodePoint(127462+t.charCodeAt(0)-65)).join(""):e}function Yb(){return o.jsxs("svg",{"aria-hidden":"true",className:"opacity-50 transition group-hover:translate-x-0.5 group-hover:-translate-y-0.5 group-hover:opacity-95",fill:"none",height:"12",viewBox:"0 0 16 16",width:"12",children:[o.jsx("path",{d:"M6 4.5H4.5a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2V10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),o.jsx("path",{d:"M9 2.5h4.5V7M8.25 7.75l5-5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]})}function Gb({state:e}){return o.jsx("span",{"aria-hidden":"true",className:"grid h-[30px] w-[30px] shrink-0 place-items-center overflow-hidden rounded-[9px] border border-white/10 shadow-[inset_0_1px_0_rgba(255,255,255,0.12),0_4px_10px_-7px_rgba(0,0,0,0.8)]",style:{background:"linear-gradient(150deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02) 48%, rgba(0,0,0,0.22))"},children:o.jsx("span",{className:"text-[1.15rem] leading-none drop-shadow-[0_1px_3px_rgba(0,0,0,0.5)]",children:Wb(e.country)})})}function Xb({state:e}){const t=el[e.status],n=e.status==="closed";return o.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border px-2 py-[3px] font-dmsans text-[0.5rem] font-bold uppercase leading-none tracking-[0.09em]",style:{borderColor:n?"rgba(255,255,255,0.1)":`${t.color}33`,background:t.chipBg,color:n?"rgba(255,255,255,0.62)":t.color},children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:n?"rgba(255,255,255,0.45)":t.color,boxShadow:e.status==="open"?`0 0 6px ${t.color}`:void 0}}),t.label]})}function qb({now:e,state:t}){const n=el[t.status],r=_r(t.nextChangeMin),s=Zb(e,t.tz);return o.jsxs("a",{"aria-label":`${t.name} website`,className:"group text-normal relative grid min-h-[42px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 overflow-hidden rounded-xl border border-white/[0.06] bg-white/[0.022] py-1.5 pr-2.5 pl-3 transition duration-200 hover:-translate-y-px hover:border-white/[0.14] hover:bg-white/[0.05] hover:text-strong focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white/50",href:t.website,rel:"noreferrer",style:{backgroundImage:n.wash},target:"_blank",title:`${t.name} · ${t.city} · ${t.open}-${t.close}`,children:[o.jsx("span",{"aria-hidden":"true",className:"absolute inset-y-[5px] left-0 w-[3px] rounded-r-full",style:{background:n.rail,opacity:n.railOpacity}}),o.jsx(Gb,{state:t}),o.jsxs("span",{className:"relative min-w-0 pl-0.5",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx("span",{className:"body-sm text-strong truncate font-bold",children:t.name}),o.jsx(Yb,{})]}),o.jsxs("span",{className:"caption text-soft flex min-w-0 items-center gap-1.5 tabular-nums",children:[o.jsx("span",{className:"truncate",children:t.city}),o.jsx("span",{className:"h-[3px] w-[3px] shrink-0 rounded-full bg-white/25"}),o.jsx("span",{className:"shrink-0",children:s})]})]}),o.jsxs("span",{className:"relative flex min-w-[84px] flex-col items-end gap-1",children:[o.jsx(Xb,{state:t}),o.jsxs("span",{className:"caption whitespace-nowrap text-right tabular-nums",style:{color:t.status==="closed"?"rgba(255,255,255,0.55)":n.color},children:[n.verb," ",r]})]})]})}function Kb({config:e}){const[t,n]=f.useState(()=>new Date);f.useEffect(()=>{const c=window.setInterval(()=>n(new Date),3e4);return()=>window.clearInterval(c)},[]);const r=e.exchanges.length?e.exchanges:Lb,s=r.join(","),a=f.useMemo(()=>{const c=r.map(l=>ct[l.toUpperCase()]).filter(l=>!!l).map(l=>Jc(l,t));return Ub(c,e.sort)},[s,t,e.sort]);if(a.length===0)return o.jsx(M,{children:"no known exchanges — check the codes"});const i=a.filter(c=>c.status==="open").length;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[o.jsxs("div",{className:"caption text-soft mb-2 flex items-center justify-between gap-3 uppercase tracking-wide",children:[o.jsx("span",{className:"truncate",children:"exchange sessions"}),o.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full border border-white/[0.08] bg-white/[0.045] px-2 py-0.5 tabular-nums",children:[i>0&&o.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:fe,boxShadow:`0 0 6px ${fe}`}}),o.jsx("span",{className:"text-strong font-bold",children:i}),o.jsxs("span",{className:"text-soft",children:["/ ",a.length," open"]})]})]}),o.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-auto pr-0.5",children:a.map(c=>o.jsx(qb,{now:t,state:c},c.code))})]})}const Jb={...li,component:Kb,titleIcon:Vb};Ui.schema;const Qb={coindesk:"CoinDesk",cointelegraph:"Cointelegraph",decrypt:"Decrypt",cnbc:"CNBC Markets",nasdaq:"Nasdaq",stocks:"Google News"};function ex({src:e}){const[t,n]=f.useState(!1);return t?null:o.jsx("img",{src:e,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:()=>n(!0),className:"size-12 shrink-0 rounded-md bg-white/[0.04] object-cover ring-1 ring-white/10"})}function tx({item:e}){return o.jsx(qc,{href:e.url,leading:e.imageUrl?o.jsx(ex,{src:e.imageUrl}):void 0,title:e.title,subtitle:e.summary||void 0,meta:e.publishedAt!==void 0?qr(e.publishedAt):void 0})}function nx({config:e}){var c;const t=e.source==="stocks",n=t&&e.symbols.length===0,r=n?"":e.source,{items:s,isLoading:a}=Zh(r,t?e.symbols:void 0,e.count);if(n)return o.jsx(M,{children:"add stock symbols to show company headlines"});if(a)return o.jsx(M,{loading:!0,children:"loading headlines…"});const i=((c=s[0])==null?void 0:c.source)??Qb[e.source]??"news";return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"caption text-soft truncate",children:i}),o.jsx("span",{className:"caption text-soft shrink-0",children:"headlines"})]}),o.jsx("div",{className:xe,children:s.length>0?s.map(l=>o.jsx(tx,{item:l},l.url)):o.jsxs(M,{children:["no headlines ",t?"for these symbols":"available"," — the runtime proxy may be offline"]})})]})}const rx={...Ui,component:nx};mi.schema;function sx({config:e}){const t=Ln(),[n,r]=f.useState(!1),[s,a]=f.useState(e.text),i=f.useRef(null);f.useEffect(()=>{a(e.text)},[e.text]),f.useEffect(()=>{var u;n&&((u=i.current)==null||u.focus())},[n]);const c=f.useCallback(()=>{s!==e.text&&(t==null||t({text:s})),r(!1)},[t,s,e.text]),l=e.align==="center"?"flex items-center justify-center text-center":"";return n?o.jsx("textarea",{ref:i,className:`body-sm text-normal h-full w-full resize-none bg-transparent outline-none placeholder:text-disabled ${l}`,value:s,onChange:u=>a(u.target.value),onBlur:c,onKeyDown:u=>{u.key==="Escape"&&(a(e.text),r(!1))},placeholder:"Write a note…"}):o.jsx("div",{className:`body-sm text-normal whitespace-pre-wrap ${xe} ${l} ${t?"cursor-text":""}`,onClick:()=>t&&r(!0),title:t?"Click to edit":void 0,children:e.text||o.jsx("span",{className:"text-soft italic",children:t?"Click to add a note…":"New note"})})}const ox={...mi,component:sx},Qn={"1m":6e4,"5m":5*6e4,"15m":15*6e4,"1h":60*6e4,"4h":240*6e4,"1d":1440*6e4},bo=60,ax={top:12,right:56,bottom:28,left:12};fi.schema;function ix({config:e}){const t=Qn[e.interval],n=f.useMemo(()=>Date.now()-t*bo,[t]),{candles:r,isLoading:s}=Sh(e.symbol,e.interval,n,Math.min(t,6e4)),i=Pt([e.symbol])[e.symbol],[c,l]=f.useState([]);f.useEffect(()=>{i!==void 0&&l(b=>{const y=[...b,{time:Date.now()/1e3,value:i}];return y.length>900?y.slice(-600):y})},[i]),f.useEffect(()=>l([]),[e.symbol]);const u=f.useMemo(()=>r.slice(0,-1).map(b=>({time:b.time/1e3,open:b.open,high:b.high,low:b.low,close:b.close})),[r]),d=r[r.length-1],h=f.useMemo(()=>{if(!d)return;const b=i??d.close;return{time:d.time/1e3,open:d.open,high:Math.max(d.high,b),low:Math.min(d.low,b),close:b}},[d,i]),m=i??(d==null?void 0:d.close)??0,p=f.useMemo(()=>t>=Qn["1d"]?b=>new Date(b*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric"}):t>=Qn["1h"]?b=>{const y=new Date(b*1e3);return`${y.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${String(y.getHours()).padStart(2,"0")}h`}:b=>new Date(b*1e3).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),[t]),x=f.useMemo(()=>{const b=r.map(g=>({time:g.time/1e3,value:g.close}));if(c.length===0)return b;const y=c[0].time;return[...b.filter(g=>g.time<y),...c]},[r,c]);return s&&r.length===0?o.jsx(M,{loading:!0,children:"loading chart…"}):o.jsx("div",{className:"h-full min-h-0",children:o.jsx(Lr,{mode:e.mode,data:x,value:m,candles:u,candleWidth:t/1e3,liveCandle:h,window:t/1e3*bo,color:e.color,theme:"dark",loading:s,formatValue:b=>ze(b),formatTime:p,padding:ax,showValue:!0,fill:!0,pulse:!0})})}const cx={...fi,component:ix,titleIcon:({config:e})=>o.jsx(Fe,{symbol:e.symbol,size:14})},lx={"24h":{ms:1440*60*1e3,interval:"15m",timeframe:$e["24h"]},"7D":{ms:10080*60*1e3,interval:"1h",timeframe:$e["7D"]},"1M":{ms:720*60*60*1e3,interval:"4h",timeframe:$e["1M"]}};Ii.schema;function ux({config:e}){const{ms:t,interval:n,timeframe:r}=lx[e.lookback],s=f.useMemo(()=>Date.now()-t,[t]),{candles:a,isLoading:i}=jh(e.symbols,n,s),c=f.useMemo(()=>e.symbols.map((l,u)=>{var m;const d=a[l]??[],h=(m=d[0])==null?void 0:m.close;return{id:l,name:ae(l),iconImageUrl:ni(l),color:Pe[u%Pe.length],data:d.map(p=>({date:new Date(p.time).toISOString(),value:e.normalize&&h?(p.close/h-1)*100:p.close}))}}),[e.symbols,e.normalize,a]);return i?o.jsx(M,{loading:!0,children:"loading prices…"}):c.every(l=>l.data.length===0)?o.jsx(M,{children:"no price data yet"}):o.jsx(Fn,{series:c,timeframe:r,height:250,formatValue:e.normalize?l=>ye(l):l=>ze(l)})}const dx={...Ii,component:ux},xo=720,mx=1e3,tl=3,fx={top:12,right:58,bottom:28,left:8};hi.schema;function nl(e){return e!==void 0&&Number.isFinite(e)}function hx(e,t,n,r){let s=!1;const a={...e};for(const i of t){const c=n[i];if(!nl(c))continue;const l=a[i]??[],u=l[l.length-1];if(u&&Math.abs(r-u.time)<.5&&u.value===c)continue;const d=l.length===0?[{time:r-tl,value:c},{time:r,value:c}]:[...l,{time:r,value:c}];a[i]=d.length>xo?d.slice(-xo):d,s=!0}return s?a:e}function yo(e,t){return t===0?0:(e/t-1)*100}function px({config:e}){const t=e.symbols,n=t.join("|"),r=Pt(t),s=Yt(t),[a,i]=f.useState({}),[c,l]=f.useState(()=>new Set),u=f.useMemo(()=>{var g;const y={};for(const v of t){const S=r[v]??((g=s[v])==null?void 0:g.markPx);nl(S)&&(y[v]=S)}return y},[r,s,t]),d=f.useRef(u);f.useEffect(()=>{d.current=u},[u]),f.useEffect(()=>{const y=new Set(t);i(g=>{let v=!1;const S={};for(const[z,j]of Object.entries(g)){if(!y.has(z)){v=!0;continue}S[z]=j}return v?S:g}),l(g=>{const v=new Set([...g].filter(S=>y.has(S)));return v.size===g.size?g:v})},[n,t]);const h=f.useCallback(y=>{l(g=>{const v=new Set(g);return v.has(y)?(v.delete(y),v):t.length-v.size<=1?g:(v.add(y),v)})},[t]),m=f.useCallback(()=>{const y=d.current;if(Object.keys(y).length===0)return;const g=Date.now()/1e3;i(v=>hx(v,t,y,g))},[n,t]);f.useEffect(()=>{m()},[m,u]),f.useEffect(()=>{const y=window.setInterval(m,mx);return()=>window.clearInterval(y)},[m]);const p=f.useMemo(()=>t.flatMap((y,g)=>{var j,C;if(c.has(y))return[];const v=a[y]??[],S=(j=v[0])==null?void 0:j.value;if(!S||v.length===0)return[];const z=e.normalize?v.map(k=>({time:k.time,value:yo(k.value,S)})):v;return[{id:y,label:ae(y),color:Pe[g%Pe.length],data:z,value:((C=z[z.length-1])==null?void 0:C.value)??0}]}),[a,c,t,e.normalize]),x=f.useMemo(()=>{var S,z;let y=1/0,g=-1/0;for(const j of t){const C=a[j]??[];C.length!==0&&(y=Math.min(y,((S=C[0])==null?void 0:S.time)??1/0),g=Math.max(g,((z=C[C.length-1])==null?void 0:z.time)??-1/0))}const v=Number.isFinite(y)&&Number.isFinite(g)?g-y:0;return Math.min(e.windowSec,Math.max(tl,Math.ceil(v)))},[a,t,e.windowSec]),b=p.some(y=>y.data.length>1);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o.jsx("div",{className:"grid flex-none grid-cols-1 gap-x-3 gap-y-1.5 border-b border-white/[0.06] pb-2 sm:grid-cols-2",children:t.map((y,g)=>{var k,w;const v=u[y],S=(w=(k=a[y])==null?void 0:k[0])==null?void 0:w.value,z=v!==void 0&&S?yo(v,S):void 0,j=Pe[g%Pe.length],C=c.has(y);return o.jsxs("button",{type:"button","aria-pressed":!C,title:`${C?"Show":"Hide"} ${ae(y)}`,className:`caption grid min-w-0 grid-cols-[auto_auto_minmax(0,1fr)_auto] items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left transition ${C?"opacity-40 hover:opacity-70":"bg-white/[0.035] opacity-100 hover:bg-white/[0.06]"}`,onClick:N=>{N.stopPropagation(),h(y)},onPointerDown:N=>N.stopPropagation(),children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{backgroundColor:j}}),o.jsx(Fe,{symbol:y,size:14}),o.jsx("span",{className:"truncate font-bold text-strong",children:ae(y)}),o.jsxs("span",{className:"text-normal tabular-nums",children:[v!==void 0?ze(v):"…",z!==void 0?o.jsx("span",{className:"ml-1 tabular-nums",style:{color:Ce(z)},children:ye(z)}):null]})]},y)})}),o.jsx("div",{className:"min-h-0 flex-1 [&>div[style*='align-items']]:!hidden",children:o.jsx(Lr,{data:[],value:0,series:p,theme:"dark",window:x,grid:!0,loading:!b,scrub:!1,badge:!1,formatValue:e.normalize?ye:ze,padding:fx,seriesToggleCompact:t.length>4,style:{width:"100%",height:"100%"}})})]})}const gx={...hi,component:px};function Xt({symbol:e,label:t,price:n,changePct:r,logoSize:s=16,gap:a="gap-2"}){return o.jsxs("div",{className:`grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center ${a}`,title:n!==void 0?`${t} · ${ze(n)}`:t,children:[o.jsx(Fe,{symbol:e,size:s}),o.jsx("span",{className:"body-sm truncate font-bold text-strong",children:t}),o.jsx("span",{className:"caption text-soft text-right tabular-nums",children:n!==void 0?ze(n):"—"}),o.jsx("span",{className:`caption text-right font-bold tabular-nums${r===void 0?" text-disabled":""}`,style:r!==void 0?{color:Ce(r)}:void 0,children:r!==void 0?ye(r):"…"})]})}pi.schema;function bx({config:e}){const{mids:t,isLoading:n}=qa(e.symbols),{stats:r,isLoading:s}=Xr(e.symbols),a=e.symbols.some(i=>{var c;return t[i]!==void 0||((c=r[i])==null?void 0:c.markPx)!==void 0});return(n||s)&&!a?o.jsx(M,{loading:!0,children:"loading prices…"}):o.jsx("div",{className:`flex flex-col gap-1.5 ${xe}`,children:e.symbols.map(i=>{var c,l;return o.jsx(Xt,{symbol:i,label:ae(i),price:t[i]??((c=r[i])==null?void 0:c.markPx),changePct:(l=r[i])==null?void 0:l.changePct,logoSize:18,gap:"gap-3"},i)})})}const xx={...pi,component:bx};yi.schema;function yx({config:e}){var u,d;const{rates:t,isLoading:n}=Dh(),{rates:r,isLoading:s}=Ih();if(n&&s)return o.jsx(M,{loading:!0,children:"loading official rates…"});if(!t.length&&!r.length)return o.jsx(M,{children:"no rates data yet"});const a=t.slice(0,e.maxReferenceRates),i=r.slice(0,e.maxTreasuryRates),c=(u=a[0])==null?void 0:u.date,l=(d=i[0])==null?void 0:d.date;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"official rates"}),o.jsx("div",{className:"body-sm text-normal",children:c?`as of ${c}`:"reference rates"})]}),o.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:a.map(h=>{const m=h.targetRateFrom!==void 0&&h.targetRateTo!==void 0?`target ${je(h.targetRateFrom)}-${je(h.targetRateTo)}`:h.volumeInBillions!==void 0?`${le(h.volumeInBillions*1e9)} volume`:h.source;return o.jsx(as,{label:h.label,value:je(h.rate),meta:m},h.code)})}),e.showTreasuryAverageRates&&i.length>0&&o.jsxs("div",{className:"border-t border-white/[0.08] pt-2",children:[o.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[o.jsx("span",{children:"Treasury average rates"}),o.jsx("span",{children:l})]}),o.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:i.map(h=>o.jsxs("div",{className:"rounded bg-white/[0.04] px-2 py-1.5",children:[o.jsx("div",{className:"caption text-soft truncate",children:h.security}),o.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:je(h.rate)})]},`${h.date}-${h.security}`))})]})]})}const vx={...yi,component:yx};_i.schema;const vo=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function wx({symbol:e,entry:t}){const n=e.includes(":")?e:`xyz:${t.symbol}`,r=Math.max(0,Math.min(100,t.shortPct));return o.jsxs("div",{className:"flex min-w-0 items-center gap-3 border-b border-white/[0.06] py-2 last:border-b-0",children:[o.jsx(Fe,{symbol:n,size:20}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[o.jsx("span",{className:"body-sm text-strong truncate font-semibold",children:t.symbol}),o.jsx("span",{className:"body-md text-strong font-bold tabular-nums",children:je(r,1)})]}),o.jsx("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-white/[0.07]",children:o.jsx("div",{className:"h-full rounded-full",style:{width:`${r}%`,background:vo(.85),boxShadow:`0 0 8px ${vo(.5)}`}})}),o.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:["short ",Ze(t.shortVolume)," /"," ",Ze(t.totalVolume)]})]})]})}function kx({config:e}){const{data:t,isLoading:n}=Vh(e.symbols),r=f.useMemo(()=>{const a=e.symbols.map(i=>({symbol:i,entry:t[i]})).filter(i=>!!i.entry);return a.sort((i,c)=>e.sort==="symbol"?i.entry.symbol.localeCompare(c.entry.symbol):e.sort==="volume"?c.entry.totalVolume-i.entry.totalVolume:c.entry.shortPct-i.entry.shortPct),a},[t,e.symbols,e.sort]);if(n)return o.jsx(M,{loading:!0,children:"loading short volume…"});if(r.length===0)return o.jsx(M,{children:"no FINRA short-volume data yet"});const s=r[0].entry.date;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"short volume"}),o.jsx("div",{className:"body-sm text-normal",children:s?`FINRA · ${s}`:"FINRA"})]}),o.jsxs("div",{className:"caption text-soft text-right",children:["reported volume",o.jsx("br",{}),"not short interest"]})]}),o.jsx("div",{className:xe,children:r.map(({symbol:a,entry:i})=>o.jsx(wx,{symbol:a,entry:i},a))})]})}const Sx={..._i,component:kx};gi.schema;const jx=["xyz:*","km:GOLD","km:SILVER","km:USOIL","km:USENERGY","km:US500","km:SMALL2000","km:USTECH","km:SEMI","km:GLDMINE"];function Nx({config:e}){const{stats:t,isLoading:n}=Xr(jx,6e4),{gainers:r,losers:s}=f.useMemo(()=>{const a=Object.entries(t).map(([i,c])=>({symbol:i,...c})).filter(i=>i.symbol.includes(":")&&i.markPx>0&&i.prevDayPx>0).sort((i,c)=>c.changePct-i.changePct);return{gainers:a.slice(0,e.count),losers:a.slice(-e.count).reverse()}},[t,e.count]);return n?o.jsx(M,{loading:!0,children:"loading movers…"}):r.length===0?o.jsx(M,{children:"no mover data yet"}):o.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"gainers"}),r.map(a=>o.jsx(Xt,{symbol:a.symbol,label:ae(a.symbol),price:a.markPx,changePct:a.changePct},a.symbol))]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"caption text-soft uppercase tracking-wide",children:"losers"}),s.map(a=>o.jsx(Xt,{symbol:a.symbol,label:ae(a.symbol),price:a.markPx,changePct:a.changePct},a.symbol))]})]})}const Cx={...gi,component:Nx};function Dt({width:e,height:t,label:n,secondary:r,title:s}){if(e<48||t<30)return null;const a=e<70||t<44;return o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center overflow-hidden p-1 text-center",title:s,children:[o.jsx("span",{className:"body-sm truncate font-bold text-strong",children:n}),!a&&r&&o.jsx("span",{className:"caption text-soft",children:r})]})}bi.schema;function zx({width:e,height:t,data:n}){const r=le(n.tvl);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r}`})}function _x({config:e}){const{entries:t,isLoading:n}=Nh(),r=f.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.name,value:s.tvl,tvl:s.tvl})),[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading TVL…"}):r.length===0?o.jsx(M,{children:"no TVL data"}):o.jsx(Rt,{data:r,LeafComponent:zx,getColorValue:s=>s.tvl})}const Tx={...bi,component:_x};Ci.schema;const wo=(e=1)=>`hsl(var(--zf-accent-hue, 242) 85% 72% / ${e})`;function Ex({rates:e}){const t=Math.min(...e),n=Math.max(...e),r=Math.max(.01,n-t),s=e.length,a=l=>100*l/(s-1),i=l=>4+32*(1-(l-t)/r),c=e.map((l,u)=>`${u?"L":"M"}${a(u).toFixed(2)},${i(l).toFixed(2)}`).join(" ");return o.jsxs("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"h-20 w-full","aria-hidden":!0,children:[o.jsx("path",{d:`${c} L100,40 L0,40 Z`,fill:wo(.14)}),o.jsx("path",{d:c,fill:"none",stroke:wo(.9),strokeWidth:1.5,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round"})]})}function Mx({config:e}){const{curve:t,isLoading:n}=Lh();if(n)return o.jsx(M,{loading:!0,children:"loading yield curve…"});if(!t||t.points.length<2)return o.jsx(M,{children:"no yield-curve data yet"});const r=u=>{var d;return(d=t.points.find(h=>h.label===u))==null?void 0:d.rate},s=r("2Y"),a=r("10Y"),i=s!=null&&a!=null?Math.round((a-s)*100):null,c=i!=null&&i<0,l=e.maturities;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"Treasury yield curve"}),o.jsxs("div",{className:"body-sm text-normal",children:["U.S. Treasury · ",t.date]})]}),o.jsx("div",{className:"caption text-soft text-right",children:"daily"})]}),i!=null&&o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsxs("span",{className:"metric-md leading-none",style:{color:Ce(i),textShadow:`0 0 24px ${Ce(i)}44`},children:[i>=0?"+":"",i," bps"]}),o.jsxs("span",{className:"caption text-soft",children:["2s10s · ",c?"inverted":"normal"]})]}),o.jsx(Ex,{rates:t.points.map(u=>u.rate)}),o.jsx("div",{className:"grid gap-1",style:{gridTemplateColumns:`repeat(${l.length}, minmax(0, 1fr))`},children:l.map(u=>{const d=r(u);return o.jsxs("div",{className:"rounded bg-white/[0.04] px-1.5 py-1 text-center",children:[o.jsx("div",{className:"caption text-soft",children:u}),o.jsx("div",{className:"body-sm text-strong font-bold tabular-nums",children:d!=null?je(d):"—"})]},u)})})]})}const Ax={...Ci,component:Mx};Bi.schema;function Px({width:e,height:t,data:n}){const r=le(n.volume24h);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r} 24h volume`})}function Rx({config:e}){const{entries:t,isLoading:n}=Ch(),r=f.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.name,value:s.volume24h,volume24h:s.volume24h,changePct:s.changePct??0})),[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading DEX volume…"}):r.length===0?o.jsx(M,{children:"no DEX volume data"}):o.jsx(Rt,{data:r,LeafComponent:Px,getColorValue:s=>s.changePct})}const $x={...Bi,component:Rx},Dx={"7D":{ms:10080*60*1e3,timeframe:$e["7D"]},"1M":{ms:720*60*60*1e3,timeframe:$e["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:$e["3M"]}};Hi.schema;function Ix({config:e}){const{ms:t,timeframe:n}=Dx[e.lookback],r=f.useMemo(()=>Date.now()-t,[t]),{history:s,isLoading:a}=zh(e.protocols),i=f.useMemo(()=>e.protocols.map((c,l)=>({id:c,name:oi(c),color:Pe[l%Pe.length],data:(s[c]??[]).filter(u=>u.time>=r).map(u=>({date:new Date(u.time).toISOString(),value:u.value}))})),[e.protocols,s,r]);return a?o.jsx(M,{loading:!0,children:"loading DEX volume…"}):i.every(c=>c.data.length===0)?o.jsx(M,{children:"no DEX volume data yet"}):o.jsx(Fn,{series:i,timeframe:n,height:250,formatValue:c=>le(c)})}const Lx={...Hi,component:Ix};Vi.schema;function Fx({width:e,height:t,data:n}){const r=le(n.tvl);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r} TVL`})}function Ox({config:e}){const{entries:t,isLoading:n}=_h(),r=f.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.name,value:s.tvl,tvl:s.tvl,changePct:s.changePct??0})),[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading protocol TVL…"}):r.length===0?o.jsx(M,{children:"no protocol TVL data"}):o.jsx(Rt,{data:r,LeafComponent:Fx,getColorValue:s=>s.changePct})}const Ux={...Vi,component:Ox},Bx={"7D":{ms:10080*60*1e3,timeframe:$e["7D"]},"1M":{ms:720*60*60*1e3,timeframe:$e["1M"]},"3M":{ms:2160*60*60*1e3,timeframe:$e["3M"]}};Zi.schema;function Hx({config:e}){const{ms:t,timeframe:n}=Bx[e.lookback],r=f.useMemo(()=>Date.now()-t,[t]),{history:s,isLoading:a}=Th(e.protocols),i=f.useMemo(()=>e.protocols.map((c,l)=>({id:c,name:oi(c),color:Pe[l%Pe.length],data:(s[c]??[]).filter(u=>u.time>=r).map(u=>({date:new Date(u.time).toISOString(),value:u.value}))})),[e.protocols,s,r]);return a?o.jsx(M,{loading:!0,children:"loading protocol TVL…"}):i.every(c=>c.data.length===0)?o.jsx(M,{children:"no protocol TVL data yet"}):o.jsx(Fn,{series:i,timeframe:n,height:250,formatValue:c=>le(c)})}const Vx={...Zi,component:Hx};Wi.schema;function Zx({width:e,height:t,data:n}){const r=le(n.fees24h);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r} 24h fees`})}function Wx({config:e}){const{entries:t,isLoading:n}=Eh(),r=f.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.name,value:s.fees24h,fees24h:s.fees24h,changePct:s.changePct??0})),[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading protocol fees…"}):r.length===0?o.jsx(M,{children:"no protocol fee data"}):o.jsx(Rt,{data:r,LeafComponent:Zx,getColorValue:s=>s.changePct})}const Yx={...Wi,component:Wx};Yi.schema;function Gx({width:e,height:t,data:n}){const r=le(n.marketCapUsd);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r} mcap · ${ye(n.changePct24h)}`})}function Xx({config:e}){const{entries:t,isLoading:n}=Mh(),r=f.useMemo(()=>t.slice(0,e.topN).map(s=>({id:s.symbol,value:s.marketCapUsd,marketCapUsd:s.marketCapUsd,changePct24h:s.changePct24h??0})),[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading market caps…"}):r.length===0?o.jsx(M,{children:"no market data"}):o.jsx(Rt,{data:r,LeafComponent:Gx,getColorValue:s=>s.changePct24h})}const qx={...Yi,component:Xx};Gi.schema;const Kx=25;function Jx({config:e}){const{entries:t,isLoading:n}=Ph(e.symbols),r=f.useMemo(()=>t.slice(0,Kx),[t]),s=f.useMemo(()=>r.reduce((a,i)=>Math.max(a,i.openInterestUsd),0),[r]);return n?o.jsx(M,{loading:!0,children:"loading open interest…"}):r.length===0?o.jsx(M,{children:"no open-interest data"}):o.jsx("div",{className:`flex flex-col gap-1.5 ${xe}`,children:r.map(a=>o.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2",title:`${a.symbol} · ${le(a.openInterestUsd)} open interest`,children:[o.jsx(Fe,{symbol:a.symbol,size:16}),o.jsxs("div",{className:"relative h-4 w-full overflow-hidden rounded-sm bg-white/[0.06]",children:[o.jsx("div",{className:"absolute inset-y-0 left-0 rounded-sm",style:{width:`${s>0?a.openInterestUsd/s*100:0}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72% / 0.5)"}}),o.jsx("span",{className:"absolute inset-y-0 left-1.5 flex items-center",children:o.jsx("span",{className:"body-sm truncate font-bold text-strong",children:ae(a.symbol)})})]}),o.jsx("span",{className:"caption text-soft text-right tabular-nums",children:le(a.openInterestUsd)})]},a.symbol))})}const Qx={...Gi,component:Jx},it=18,ey=14,ty=0,ko={snakeHead:"rgba(255, 255, 255, 0.95)",food:"hsla(347, 100%, 62%, 1)"};function So(e,t,n,r,s){e.fillStyle=r,e.fillRect(t.originX+n.x*it+s,t.originY+n.y*it+s,it-s*2,it-s*2)}function ny(e,t,n,r,s,a){t.clearRect(0,0,e.width,e.height),So(t,n,n.food,ko.food,3),n.snake.forEach((i,c)=>So(t,n,i,c===0?ko.snakeHead:a,2)),$t(e,t,r,s,a)}function jo(e,t,n,r,s,a){t.clearRect(0,0,e.width,e.height),t.textAlign="center",n==="idle"?(t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText("Arrow keys or swipe to start",e.width/2,e.height/2)):(t.fillStyle=Re.gameOver,t.font='bold 20px "DM Sans", sans-serif',t.fillText("GAME OVER",e.width/2,e.height/2-30),t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText(`Score: ${r}`,e.width/2,e.height/2),t.fillStyle=Re.textSoft,t.fillText("Press an arrow or tap to play again",e.width/2,e.height/2+28)),t.textAlign="left",$t(e,t,r,s,a)}function ry(){const e=f.useRef(null),t=f.useRef(null),[n,r]=f.useState("idle"),[s,a]=f.useState(0),[i,c]=f.useState(()=>{if(typeof window<"u"){const j=localStorage.getItem("zframes-snake-high-score");return j?parseInt(j,10):0}return 0}),[,l]=f.useState(!1),u=f.useRef(0),d=f.useRef(i),h=f.useRef(n),m=f.useRef(null),p=f.useRef(Mt(null));f.useEffect(()=>{d.current=i,i>0&&localStorage.setItem("zframes-snake-high-score",String(i))},[i]),f.useEffect(()=>{h.current=n},[n]);const x=f.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}),b=f.useCallback(()=>{const j=x.current;if(j.cols<=0||j.rows<=0)return;let C,k=0;do C={x:Math.floor(Math.random()*j.cols),y:Math.floor(Math.random()*j.rows)},k++;while(j.snake.some(w=>w.x===C.x&&w.y===C.y)&&k<400);j.food=C},[]),y=f.useCallback(()=>{const j=x.current,C=Math.floor(j.cols/2),k=Math.floor(j.rows/2);j.snake=[{x:C,y:k},{x:C-1,y:k},{x:C-2,y:k}],j.dir={x:1,y:0},j.pendingDir={x:1,y:0},j.stepCounter=0,b(),u.current=0,a(0)},[b]),g=f.useCallback(()=>{x.current.cols<=0||(y(),r("playing"))},[y]),v=f.useCallback((j,C)=>{const k=x.current;k.dir.x===-j&&k.dir.y===-C||(k.pendingDir={x:j,y:C})},[]);f.useEffect(()=>{const j=k=>{const w=k.target;if(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.isContentEditable)return;const N=h.current==="playing";let E=!0;switch(k.code){case"ArrowUp":case"KeyW":N?v(0,-1):g();break;case"ArrowDown":case"KeyS":N?v(0,1):g();break;case"ArrowLeft":case"KeyA":N?v(-1,0):g();break;case"ArrowRight":case"KeyD":N?v(1,0):g();break;case"Space":N||g();break;default:E=!1}E&&k.preventDefault()},C=t.current;if(C)return C.addEventListener("keydown",j),()=>C.removeEventListener("keydown",j)},[v,g]),f.useLayoutEffect(()=>{const j=e.current;if(!j)return;const C=()=>{const w=j.parentElement;if(w&&w.clientWidth>0&&w.clientHeight>0){j.width=w.clientWidth,j.height=w.clientHeight-ty,p.current=Mt(j);const N=x.current;N.cols=Math.max(5,Math.floor(j.width/it)),N.rows=Math.max(5,Math.floor(j.height/it)),N.originX=Math.floor((j.width-N.cols*it)/2),N.originY=Math.floor((j.height-N.rows*it)/2);const E=j.getContext("2d");E&&h.current!=="playing"&&jo(j,E,h.current,u.current,d.current,p.current),l(W=>!W)}};C();const k=new ResizeObserver(C);return k.observe(j.parentElement),()=>k.disconnect()},[]),f.useEffect(()=>{if(n!=="playing")return;const j=e.current,C=j==null?void 0:j.getContext("2d");if(!j||!C)return;let k;const w=()=>{u.current>d.current&&(d.current=u.current,c(u.current)),r("gameover")},N=()=>{const E=x.current;if(E.stepCounter++,E.stepCounter>=ey){E.stepCounter=0,E.dir=E.pendingDir;const W=E.snake[0],L=W.x+E.dir.x,A=W.y+E.dir.y;if(L<0||A<0||L>=E.cols||A>=E.rows){w();return}const U=L===E.food.x&&A===E.food.y;if((U?E.snake:E.snake.slice(0,-1)).some(I=>I.x===L&&I.y===A)){w();return}E.snake.unshift({x:L,y:A}),U?(u.current+=1,a(u.current),b()):E.snake.pop()}ny(j,C,E,u.current,d.current,p.current),k=requestAnimationFrame(N)};return k=requestAnimationFrame(N),()=>cancelAnimationFrame(k)},[n]),f.useEffect(()=>{if(n==="playing")return;const j=e.current,C=j==null?void 0:j.getContext("2d");!j||!C||jo(j,C,n,s,i,p.current)},[n,s,i]);const S=j=>{const C=j.touches[0];C&&(m.current={x:C.clientX,y:C.clientY})},z=j=>{var E;const C=m.current;m.current=null;const k=j.changedTouches[0];if((E=t.current)==null||E.focus(),h.current!=="playing"){g();return}if(!C||!k)return;const w=k.clientX-C.x,N=k.clientY-C.y;Math.abs(w)<12&&Math.abs(N)<12||(Math.abs(w)>Math.abs(N)?v(w>0?1:-1,0):v(0,N>0?1:-1))};return o.jsx("div",{ref:t,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onTouchStart:S,onTouchEnd:z,onClick:()=>{var j;return(j=t.current)==null?void 0:j.focus()},role:"application","aria-label":"Snake game. Use the arrow keys or swipe to steer.",children:o.jsx("canvas",{ref:e,className:"h-full w-full"})})}const sy={...Sp,component:ry},oy=.225,ay=-3.6,Ut=52,un=132,iy=210,cy=1.3,wn=64,ot=12,Er=28,No=28,qt={bird:"rgba(255, 255, 255, 0.95)",eye:"rgba(0, 0, 0, 0.8)",pipe:"hsla(160, 64%, 40%, 0.9)",ground:"rgba(255, 255, 255, 0.1)"};function rl(e,t,n,r){e.save(),e.translate(wn,t),e.rotate(Math.max(-.5,Math.min(.9,n*.06))),e.fillStyle=qt.bird,e.beginPath(),e.arc(0,0,ot,0,Math.PI*2),e.fill(),e.fillStyle=r,e.fillRect(-ot+2,0,10,5),e.fillStyle=qt.eye,e.beginPath(),e.arc(5,-4,2,0,Math.PI*2),e.fill(),e.restore()}function Co(e,t,n,r,s,a){t.clearRect(0,0,e.width,e.height);const i=e.height-Er;t.fillStyle=qt.ground,t.fillRect(0,i,e.width,2),rl(t,e.height/2,0,a),t.textAlign="center",n==="idle"?(t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText("Press SPACE or tap to fly",e.width/2,e.height/2-40)):(t.fillStyle=Re.gameOver,t.font='bold 20px "DM Sans", sans-serif',t.fillText("GAME OVER",e.width/2,e.height/2-50),t.fillStyle=Re.text,t.font='bold 14px "DM Sans", sans-serif',t.fillText(`Score: ${r}`,e.width/2,e.height/2-22),t.fillStyle=Re.textSoft,t.fillText("Press SPACE or tap to retry",e.width/2,e.height/2+6)),t.textAlign="left",$t(e,t,r,s,a)}function ly(){const e=f.useRef(null),t=f.useRef(null),[n,r]=f.useState("idle"),[s,a]=f.useState(0),[i,c]=f.useState(()=>{if(typeof window<"u"){const g=localStorage.getItem("zframes-flappy-bird-high-score");return g?parseInt(g,10):0}return 0}),[,l]=f.useState(!1),u=f.useRef(0),d=f.useRef(i),h=f.useRef(n),m=f.useRef(Mt(null));f.useEffect(()=>{d.current=i,i>0&&localStorage.setItem("zframes-flappy-bird-high-score",String(i))},[i]),f.useEffect(()=>{h.current=n},[n]);const p=f.useRef({birdY:0,birdVel:0,pipes:[],frameCount:0}),x=f.useCallback(g=>{const v=g.height-Er,S=No,z=v-No-un;return S+Math.random()*Math.max(0,z-S)},[]),b=f.useCallback(()=>{const g=e.current;g&&(p.current={birdY:g.height/2,birdVel:0,pipes:[{x:g.width+60,gapY:x(g),passed:!1}],frameCount:0},u.current=0,a(0))},[x]),y=f.useCallback(()=>{var g;if((g=t.current)==null||g.focus(),h.current!=="playing"){b(),r("playing");return}p.current.birdVel=ay},[b]);return f.useEffect(()=>{const g=S=>{const z=S.target;z.tagName==="INPUT"||z.tagName==="TEXTAREA"||z.isContentEditable||(S.code==="Space"||S.code==="ArrowUp")&&(S.preventDefault(),y())},v=t.current;if(v)return v.addEventListener("keydown",g),()=>v.removeEventListener("keydown",g)},[y]),f.useLayoutEffect(()=>{const g=e.current;if(!g)return;const v=()=>{const z=g.parentElement;if(z&&z.clientWidth>0&&z.clientHeight>0){g.width=z.clientWidth,g.height=z.clientHeight,m.current=Mt(g);const j=g.getContext("2d");h.current!=="playing"&&(p.current.birdY=g.height/2,j&&Co(g,j,h.current,u.current,d.current,m.current)),l(C=>!C)}};v();const S=new ResizeObserver(v);return S.observe(g.parentElement),()=>S.disconnect()},[]),f.useEffect(()=>{if(n!=="playing")return;const g=e.current,v=g==null?void 0:g.getContext("2d");if(!g||!v)return;let S;const z=g.height-Er,j=()=>{u.current>d.current&&(d.current=u.current,c(u.current)),r("gameover")},C=()=>{const k=p.current;v.clearRect(0,0,g.width,g.height),k.birdVel+=oy,k.birdY+=k.birdVel,k.pipes=k.pipes.filter(N=>N.x>-Ut),k.pipes.forEach(N=>N.x-=cy);const w=k.pipes[k.pipes.length-1];if((!w||w.x<g.width-iy)&&k.pipes.push({x:g.width,gapY:x(g),passed:!1}),k.birdY-ot<=0||k.birdY+ot>=z){j();return}for(const N of k.pipes){if(wn+ot>N.x&&wn-ot<N.x+Ut&&(k.birdY-ot<N.gapY||k.birdY+ot>N.gapY+un)){j();return}!N.passed&&N.x+Ut<wn&&(N.passed=!0,u.current+=1,a(u.current))}v.fillStyle=qt.pipe;for(const N of k.pipes)v.fillRect(N.x,0,Ut,N.gapY),v.fillRect(N.x,N.gapY+un,Ut,z-(N.gapY+un));v.fillStyle=qt.ground,v.fillRect(0,z,g.width,2),rl(v,k.birdY,k.birdVel,m.current),$t(g,v,u.current,d.current,m.current),k.frameCount++,S=requestAnimationFrame(C)};return S=requestAnimationFrame(C),()=>cancelAnimationFrame(S)},[n]),f.useEffect(()=>{if(n==="playing")return;const g=e.current,v=g==null?void 0:g.getContext("2d");!g||!v||Co(g,v,n,s,i,m.current)},[n,s,i]),o.jsx("div",{ref:t,tabIndex:0,className:"relative h-full w-full cursor-pointer select-none overflow-hidden outline-none",onClick:y,onTouchStart:y,role:"application","aria-label":"Flappy bird game. Press space or tap to flap.",children:o.jsx("canvas",{ref:e,className:"h-full w-full"})})}const uy={...jp,component:ly};Xi.schema;function dy(e){let t;try{t=new URL(e.trim())}catch{return null}const n=t.hostname.replace(/^www\./,"");if(n==="youtu.be"){const r=t.pathname.slice(1).split("/")[0];return r?`https://www.youtube.com/embed/${r}`:null}if(n==="youtube.com"||n==="m.youtube.com"){if(t.pathname==="/watch"){const s=t.searchParams.get("v");return s?`https://www.youtube.com/embed/${s}`:null}const r=t.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);return r?`https://www.youtube.com/embed/${r[1]}`:null}if(n==="vimeo.com"){const r=t.pathname.split("/").filter(Boolean)[0];return r&&/^\d+$/.test(r)?`https://player.vimeo.com/video/${r}`:null}return n==="player.vimeo.com"||t.protocol==="https:"?t.toString():null}function my({config:e}){const[t,n]=f.useState("loading"),r=f.useMemo(()=>dy(e.url),[e.url]);return f.useEffect(()=>n("loading"),[r]),r?t==="error"?o.jsx(M,{children:"video unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[t==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(M,{loading:!0,children:"loading video…"})}),o.jsx("iframe",{src:r,title:e.title,className:`h-full w-full border-0 transition-opacity duration-300 ${t==="loaded"?"opacity-100":"opacity-0"}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,onLoad:()=>n("loaded"),onError:()=>n("error")},r)]}):o.jsx(M,{children:"invalid video URL"})}const fy={...Xi,component:my};function hy(){const[e,t]=f.useState("loading");return e==="error"?o.jsx(M,{children:"canvas 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(M,{loading:!0,children:"loading canvas…"})}),o.jsx("iframe",{src:"https://drawdy.io",title:"Drawdy Canvas",className:`h-full w-full border-0 transition-opacity duration-300 ${e==="loaded"?"opacity-100":"opacity-0"}`,allow:"clipboard-read; clipboard-write",onLoad:()=>t("loaded"),onError:()=>t("error")})]})}const py={...Np,component:hy};qi.schema;const zo=864e5,_o=36e5,To=6e4;function Bt(e){let t=Math.max(0,e);const n=Math.floor(t/zo);t-=n*zo;const r=Math.floor(t/_o);t-=r*_o;const s=Math.floor(t/To);t-=s*To;const a=Math.floor(t/1e3);return{days:n,hours:r,minutes:s,seconds:a}}const er="var(--color-highlight)",tr="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",kt=e=>String(e).padStart(2,"0");function gy({config:e}){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(null),s=f.useRef(null),a=e.target.trim(),i=f.useMemo(()=>{if(!a)return null;const x=new Date(a).getTime();return Number.isFinite(x)?x:NaN},[a]),c=i!=null&&!Number.isNaN(i),[l,u]=f.useState(c&&i<=Date.now());f.useEffect(()=>{if(!c)return;const x=i-Date.now();if(x<=0){u(!0);return}u(!1);const b=window.setTimeout(()=>u(!0),x);return()=>window.clearTimeout(b)},[c,i]);const d=()=>c?i-Date.now():0;Je({ref:t,getRemainingMs:d,format:x=>String(Bt(x).days)}),Je({ref:n,getRemainingMs:d,format:x=>kt(Bt(x).hours)}),Je({ref:r,getRemainingMs:d,format:x=>kt(Bt(x).minutes)}),Je({ref:s,getRemainingMs:d,format:x=>kt(Bt(x).seconds)});const h=f.useMemo(()=>c?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(i)):"",[c,i]);if(!a)return o.jsx(M,{children:"set a target date & time"});if(!c)return o.jsxs(M,{children:["invalid target date: ",a]});const m=Bt(d()),p=[[t,String(m.days),"days"],[n,kt(m.hours),"hrs"],[r,kt(m.minutes),"min"],[s,kt(m.seconds),"sec"]];return o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center [container-type:size]",children:[e.label&&o.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[o.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:er,boxShadow:tr}}),e.label]}),o.jsx("div",{className:"flex items-start justify-center gap-[0.5em] leading-none tabular-nums",style:{fontSize:"clamp(0.9rem, 20cqmin, 2.8rem)"},children:p.map(([x,b,y],g)=>o.jsxs("div",{className:"flex flex-col items-center gap-[0.25em]",children:[o.jsx("span",{ref:x,suppressHydrationWarning:!0,className:"text-strong font-dmsans font-extrabold tracking-[-0.01em]",style:{fontSize:"1em",color:g===3&&!l?er:void 0,textShadow:g===3&&!l?tr:void 0},children:b}),o.jsx("span",{className:"text-soft uppercase tracking-[0.12em]",style:{fontSize:"0.26em"},children:y})]},y))}),l?o.jsx("div",{className:"caption font-semibold uppercase tracking-[0.2em]",style:{color:er,textShadow:tr},children:"reached"}):e.showTarget&&h&&o.jsx("div",{className:"caption text-soft tabular-nums",children:h})]})}const by={...qi,component:gy};Ki.schema;const xy=e=>/^https?:\/\//i.test(e);function yy(e){for(const t of[e,`https://${e}`])try{const n=new URL(t).hostname;if(n)return n}catch{}return null}function vy(e){const t=yy(e);return t?`https://www.google.com/s2/favicons?sz=64&domain=${encodeURIComponent(t)}`:null}function wy({link:e}){const[t,n]=f.useState(!1),r=e.icon.trim(),s=r&&xy(r)?r:null,a=r&&!s?r:null,i=s??(a?null:vy(e.url)),c=i!=null&&!t;return o.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.url,className:`group flex items-center gap-2 px-2.5 py-2 ${Ne}`,children:[o.jsx("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-md bg-white/[0.06] text-base leading-none","aria-hidden":!0,children:a?o.jsx("span",{children:a}):c?o.jsx("img",{src:i,alt:"",className:"h-full w-full object-contain",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>n(!0)}):o.jsx("span",{className:"text-soft font-dmsans font-bold uppercase",children:e.label.charAt(0)})}),o.jsx("span",{className:"body-sm text-normal min-w-0 flex-1 truncate font-medium group-hover:text-strong",children:e.label})]})}function ky({config:e}){return o.jsx("div",{className:xe,children:o.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:`repeat(${e.columns}, minmax(0, 1fr))`},children:e.links.map((t,n)=>o.jsx(wy,{link:t},`${t.url}-${n}`))})})}const Sy={...Ki,component:ky};Ji.schema;const jy="var(--color-highlight)";function dn(e){const t=Number(e);return Number.isFinite(t)?t:0}function mn({label:e,value:t,onChange:n,prefix:r,suffix:s}){return o.jsxs("label",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:e}),o.jsxs("span",{className:`flex items-center gap-1 px-2 py-1.5 ${Ne}`,children:[r&&o.jsx("span",{className:"body-sm text-soft",children:r}),o.jsx("input",{type:"number",inputMode:"decimal",value:t,onChange:a=>n(a.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"}),s&&o.jsx("span",{className:"body-sm text-soft",children:s})]})]})}function Ny({config:e}){const[t,n]=f.useState(String(e.account)),[r,s]=f.useState(String(e.riskPct)),[a,i]=f.useState(String(e.entry)),[c,l]=f.useState(String(e.stop));f.useEffect(()=>n(String(e.account)),[e.account]),f.useEffect(()=>s(String(e.riskPct)),[e.riskPct]),f.useEffect(()=>i(String(e.entry)),[e.entry]),f.useEffect(()=>l(String(e.stop)),[e.stop]);const u=f.useMemo(()=>{const p=dn(t),x=dn(r),b=dn(a),y=dn(c),g=p*x/100,v=Math.abs(b-y),S=v>0?g/v:0,z=S*b,j=b===y?"—":y<b?"long":"short";return{riskAmount:g,perUnit:v,size:S,value:z,side:j,hasStop:v>0}},[t,r,a,c]),d=e.currency,h=p=>`${d}${p.toLocaleString(void 0,{maximumFractionDigits:2})}`,m=p=>p.toLocaleString(void 0,{maximumFractionDigits:p>=1?2:4});return o.jsxs("div",{className:`${xe} flex flex-col gap-3`,children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsx(mn,{label:"Account",value:t,onChange:n,prefix:d}),o.jsx(mn,{label:"Risk",value:r,onChange:s,suffix:"%"}),o.jsx(mn,{label:"Entry",value:a,onChange:i,prefix:d}),o.jsx(mn,{label:"Stop",value:c,onChange:l,prefix:d})]}),o.jsxs("div",{className:"flex flex-col gap-1.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-2.5",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Position size"}),o.jsx("span",{className:"body-lg font-extrabold tabular-nums",style:{color:u.hasStop?jy:void 0},children:u.hasStop?m(u.size):"—"})]}),o.jsx(fn,{label:"Risk amount",value:h(u.riskAmount)}),o.jsx(fn,{label:"Per-unit risk",value:u.hasStop?h(u.perUnit):"set a stop"}),o.jsx(fn,{label:"Position value",value:u.hasStop?h(u.value):"—"}),o.jsx(fn,{label:"Direction",value:u.side})]})]})}function fn({label:e,value:t}){return o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:"body-sm text-soft",children:e}),o.jsx("span",{className:"body-sm text-normal tabular-nums",children:t})]})}const Cy={...Ji,component:Ny};Qi.schema;const Eo="var(--color-highlight)";function zy({config:e}){const t=e.quotes,[n,r]=f.useState(0);f.useEffect(()=>r(0),[e.quotes]),f.useEffect(()=>{if(e.intervalSec<=0||t.length<=1)return;const a=window.setInterval(()=>r(i=>(i+1)%t.length),e.intervalSec*1e3);return()=>window.clearInterval(a)},[e.intervalSec,t.length]);const s=t[Math.min(n,t.length-1)]??"";return o.jsx("div",{className:"flex h-full w-full items-center justify-center [container-type:size]",children:o.jsxs("figure",{className:"relative max-h-full overflow-auto px-3 text-center",children:[o.jsx("span",{"aria-hidden":!0,className:"block font-dmsans font-black leading-none",style:{fontSize:"clamp(1.5rem, 14cqmin, 3rem)",color:Eo},children:"“"}),o.jsx("blockquote",{className:"body-md text-normal -mt-[0.3em] whitespace-pre-wrap italic leading-snug",style:{fontSize:"clamp(0.85rem, 8cqmin, 1.25rem)"},children:s}),t.length>1&&o.jsx("figcaption",{className:"mt-2 flex justify-center gap-1.5","aria-hidden":!0,children:t.map((a,i)=>o.jsx("span",{className:"h-1 w-1 rounded-full transition-colors",style:{background:i===Math.min(n,t.length-1)?Eo:"var(--color-disabled)"}},i))})]})})}const _y={...Qi,component:zy};ec.schema;const Mo="rgba(255,255,255,0.16)";function Ty({config:e}){const t=e.orientation==="vertical",n=e.label.trim(),r=s=>o.jsx("span",{className:`shrink ${t?"w-0 flex-1":"h-0 flex-1"} `,style:t?{borderLeftWidth:1,borderLeftStyle:e.style,borderColor:Mo}:{borderTopWidth:1,borderTopStyle:e.style,borderColor:Mo}});return n?o.jsxs("div",{className:`flex h-full w-full items-center justify-center gap-3 ${t?"flex-col py-1":"px-1"}`,children:[r(),o.jsx("span",{className:"caption text-soft shrink-0 whitespace-nowrap uppercase tracking-[0.14em]",style:t?{writingMode:"vertical-rl"}:void 0,children:n}),r()]}):o.jsx("div",{className:`flex h-full w-full items-center justify-center ${t?"flex-col":""}`,children:r()})}const Ey={...ec,component:Ty};rc.schema;const My={slow:24,normal:14,fast:8},Ay=`
|
|
411
|
-
.zf-marquee {
|
|
412
|
-
display: flex;
|
|
413
|
-
align-items: center;
|
|
414
|
-
height: 100%;
|
|
415
|
-
width: 100%;
|
|
416
|
-
overflow: hidden;
|
|
417
|
-
}
|
|
418
|
-
.zf-marquee-track {
|
|
419
|
-
display: flex;
|
|
420
|
-
flex-shrink: 0;
|
|
421
|
-
align-items: center;
|
|
422
|
-
white-space: nowrap;
|
|
423
|
-
will-change: transform;
|
|
424
|
-
animation-name: zf-marquee-scroll;
|
|
425
|
-
animation-timing-function: linear;
|
|
426
|
-
animation-iteration-count: infinite;
|
|
427
|
-
}
|
|
428
|
-
.zf-marquee:hover .zf-marquee-track { animation-play-state: paused; }
|
|
429
|
-
.zf-marquee-item { padding-right: 3rem; }
|
|
430
|
-
@keyframes zf-marquee-scroll {
|
|
431
|
-
from { transform: translateX(0); }
|
|
432
|
-
to { transform: translateX(-50%); }
|
|
433
|
-
}
|
|
434
|
-
@media (prefers-reduced-motion: reduce) {
|
|
435
|
-
.zf-marquee-track { animation: none; }
|
|
436
|
-
}
|
|
437
|
-
`;function Py({config:e}){const t=e.accent?"text-highlight":"text-strong",n=My[e.speed];return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:Ay}),o.jsx("div",{className:"zf-marquee","aria-label":e.text,children:o.jsxs("div",{className:"zf-marquee-track",style:{animationDuration:`${n}s`},children:[o.jsx("span",{className:`zf-marquee-item metric-lg ${t}`,children:e.text}),o.jsx("span",{"aria-hidden":!0,className:`zf-marquee-item metric-lg ${t}`,children:e.text})]})})]})}const Ry={...rc,component:Py};tc.schema;const sl="var(--color-highlight)",Ao={coin:"Coin flip",dice:"Dice roll",list:"Random pick"},$y={1:[!1,!1,!1,!1,!0,!1,!1,!1,!1],2:[!0,!1,!1,!1,!1,!1,!1,!1,!0],3:[!0,!1,!1,!1,!0,!1,!1,!1,!0],4:[!0,!1,!0,!1,!1,!1,!0,!1,!0],5:[!0,!1,!0,!1,!0,!1,!0,!1,!0],6:[!0,!1,!0,!0,!1,!0,!0,!1,!0]};function nr(e,t){return e==="coin"?Math.random()<.5?"Heads":"Tails":e==="dice"?String(Math.floor(Math.random()*6)+1):t.length===0?"":t[Math.floor(Math.random()*t.length)]??""}function Dy({value:e}){const t=$y[e];return t?o.jsx("div",{className:"grid grid-cols-3 gap-1","aria-hidden":!0,children:t.map((n,r)=>o.jsx("span",{className:"h-1.5 w-1.5 rounded-full",style:{background:n?sl:"transparent"}},r))}):null}function Iy({config:e}){const{mode:t,options:n,label:r}=e,s=t==="list"&&n.length===0,[a,i]=f.useState(()=>nr(t,n)),[c,l]=f.useState(!1);f.useEffect(()=>{i(nr(t,n))},[t,n]),f.useEffect(()=>{if(!c)return;let h=0;const m=window.setInterval(()=>{i(nr(t,n)),h+=1,h>=6&&(window.clearInterval(m),l(!1))},60);return()=>window.clearInterval(m)},[c,t,n]);const u=f.useCallback(()=>{s||l(!0)},[s]);if(s)return o.jsx(M,{children:"add options to decide"});const d=t==="list"?"metric-lg":"metric-xl";return o.jsxs("button",{type:"button",onClick:u,"aria-label":`${Ao[t]} — roll again`,className:`flex h-full w-full cursor-pointer flex-col items-center justify-center gap-2 px-3 py-2 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:Ao[t]}),o.jsx("span",{"aria-live":"polite",className:`${d} max-w-full break-words text-center leading-none transition-transform`,style:{color:sl,transform:c?"scale(1.08)":void 0},children:a}),t==="dice"&&o.jsx(Dy,{value:Number(a)}),r.trim()&&o.jsx("span",{className:"caption text-soft max-w-full text-center",children:r.trim()}),o.jsx("span",{className:"caption text-disabled uppercase tracking-[0.12em]",children:"click to roll"})]})}const Ly={...tc,component:Iy};nc.schema;const ol="var(--color-highlight)";function rr(e){const t=Number(e);return Number.isFinite(t)?t:0}function sr({label:e,value:t,onChange:n}){return o.jsxs("label",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:e}),o.jsxs("span",{className:`flex items-center px-2 py-1.5 ${Ne}`,children:[o.jsx("span",{className:"body-sm text-soft",children:"$"}),o.jsx("input",{type:"number",inputMode:"decimal",value:t,onChange:r=>n(r.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 Fy({value:e,onChange:t}){return o.jsx("div",{className:`flex gap-1 p-1 ${Ne}`,children:["long","short"].map(n=>{const r=n===e;return o.jsx("button",{type:"button",onClick:()=>t(n),className:`caption flex-1 rounded px-2 py-1 text-center uppercase tracking-[0.12em] transition-colors ${r?"bg-white/[0.06] font-semibold":"text-soft"}`,style:r?{color:ol}:void 0,children:n},n)})})}function Oy({config:e}){const[t,n]=f.useState(String(e.entry)),[r,s]=f.useState(String(e.stop)),[a,i]=f.useState(String(e.target)),[c,l]=f.useState(e.direction);f.useEffect(()=>n(String(e.entry)),[e.entry]),f.useEffect(()=>s(String(e.stop)),[e.stop]),f.useEffect(()=>i(String(e.target)),[e.target]),f.useEffect(()=>l(e.direction),[e.direction]);const u=f.useMemo(()=>{const m=rr(t),p=rr(r),x=rr(a),b=Math.abs(m-p),y=Math.abs(x-m),g=b>0?y/b:0,v=m!==0?b/m*100:0,S=m!==0?y/m*100:0,z=b+y,j=z>0?b/z*100:50,C=c==="long"?p<m&&m<x:x<m&&m<p;return{riskPerUnit:b,rewardPerUnit:y,rr:g,riskPct:v,rewardPct:S,riskShare:j,hasRisk:b>0,hasData:z>0,valid:C}},[t,r,a,c]),d=u.hasData?u.hasRisk?`1 : ${u.rr.toFixed(u.rr>=10?0:1)}`:"∞":"—",h=e.label.trim();return o.jsxs("div",{className:`${xe} flex flex-col gap-3`,children:[h&&o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:h}),o.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[o.jsx(sr,{label:"Entry",value:t,onChange:n}),o.jsx(sr,{label:"Stop",value:r,onChange:s}),o.jsx(sr,{label:"Target",value:a,onChange:i})]}),o.jsx(Fy,{value:c,onChange:l}),o.jsxs("div",{className:"flex flex-col gap-2.5 rounded-lg border border-white/[0.07] bg-white/[0.03] p-3",children:[o.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[o.jsx("span",{className:"caption text-soft uppercase tracking-[0.12em]",children:"Risk : Reward"}),o.jsx("span",{className:"metric-md",style:{color:u.hasData?ol:void 0},children:d})]}),o.jsxs("div",{className:"flex h-2.5 w-full overflow-hidden rounded-full bg-white/[0.06]",children:[o.jsx("span",{className:"h-full",style:{width:`${u.riskShare}%`,background:_e}}),o.jsx("span",{className:"h-full",style:{width:`${100-u.riskShare}%`,background:fe}})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:_e},children:"Risk"}),o.jsx("span",{className:"body-sm tabular-nums",style:{color:_e},children:ye(-u.riskPct)}),o.jsxs("span",{className:"caption text-soft tabular-nums",children:[ze(u.riskPerUnit)," / unit"]})]}),o.jsxs("div",{className:"flex min-w-0 flex-col items-end text-right",children:[o.jsx("span",{className:"caption uppercase tracking-[0.12em]",style:{color:fe},children:"Reward"}),o.jsx("span",{className:"body-sm tabular-nums",style:{color:fe},children:ye(u.rewardPct)}),o.jsxs("span",{className:"caption text-soft tabular-nums",children:[ze(u.rewardPerUnit)," / unit"]})]})]}),u.hasData&&!u.valid&&o.jsxs("span",{className:"caption text-soft",children:["⚠ Prices don't bracket entry for a ",c," setup."]})]})]})}const Uy={...nc,component:Oy};sc.schema;const or="var(--color-highlight)",Po="0 0 18px hsl(var(--zf-accent-hue, 242) 92% 70% / 0.45)",hn=e=>String(e).padStart(2,"0");function By(e){const t=Math.floor(Math.max(0,e)/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60;return n>0?`${n}:${hn(r)}:${hn(s)}`:`${hn(r)}:${hn(s)}`}function Hy({config:e}){const t=Ln(),[n,r]=f.useState({startedAt:e.startedAt,accumulatedMs:e.accumulatedMs}),s=t?e.startedAt:n.startedAt,a=t?e.accumulatedMs:n.accumulatedMs,i=s!==0,c=f.useCallback(p=>{t?t(p):r(x=>({...x,...p}))},[t]),[,l]=f.useState(0);f.useEffect(()=>{if(!i)return;const p=window.setInterval(()=>l(x=>x+1),250);return()=>window.clearInterval(p)},[i]);const u=a+(i?Date.now()-s:0),d=()=>c({startedAt:Date.now()}),h=()=>c({startedAt:0,accumulatedMs:u}),m=()=>c({startedAt:0,accumulatedMs:0});return o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-center",children:[e.label&&o.jsxs("div",{className:"caption text-soft inline-flex items-center gap-1.5 uppercase tracking-[0.18em]",children:[o.jsx("span",{"aria-hidden":!0,className:"inline-block h-1 w-1 rounded-full",style:{background:or,boxShadow:i?Po:void 0}}),e.label]}),o.jsx("div",{className:"metric-lg text-strong leading-none",style:i?{color:or,textShadow:Po}:void 0,children:By(u)}),o.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o.jsx("button",{type:"button",onClick:i?h:d,className:`caption text-normal px-3 py-1 uppercase tracking-[0.12em] ${Ne}`,style:i?void 0:{color:or},children:i?"Pause":"Start"}),o.jsx("button",{type:"button",onClick:m,disabled:!i&&u===0,className:`caption text-soft px-3 py-1 uppercase tracking-[0.12em] transition-opacity disabled:opacity-40 ${Ne}`,children:"Reset"})]})]})}const Vy={...sc,component:Hy};oc.schema;function Ro(e){const[t,n]=e.split(":").map(Number);return t*60+n}function Zy(e){return Math.min(1,Math.max(0,e))}function Wy({config:e}){const[t,n]=f.useState(()=>new Date);f.useEffect(()=>{const m=setInterval(()=>n(new Date),3e4);return()=>clearInterval(m)},[]);const r=ct[e.exchange]??ct.NYSE;if(!r)return o.jsx(M,{children:"unknown exchange"});const s=Jc(r,t),a=s.status==="open",i=e.label.trim(),c=Ro(s.close)-Ro(s.open),l=a&&c>0?Zy((c-s.nextChangeMin)/c):0,u=Math.round(l*100),d=s.status==="holiday"?"Holiday":a?`${u}%`:"Closed",h=a?`closes in ${_r(s.nextChangeMin)}`:e.showCountdown?`opens in ${_r(s.nextChangeMin)}`:null;return o.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-2",children:[o.jsxs("div",{className:"caption text-soft flex items-center gap-1.5 uppercase tracking-[0.14em]",children:[o.jsx("span",{className:"text-normal font-semibold",children:r.mark}),o.jsx("span",{children:r.code}),i&&o.jsxs("span",{className:"text-disabled truncate tracking-normal normal-case",children:["· ",i]})]}),o.jsx("div",{className:`metric-md leading-none ${a?"text-strong":"text-soft"}`,children:d}),o.jsx("div",{className:"bg-surface h-2 w-full overflow-hidden rounded-full",children:o.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${l*100}%`,background:"var(--color-highlight)"}})}),h&&o.jsx("div",{className:"caption text-soft",children:h})]})}const Yy={...oc,component:Wy},Xe=[_e,"#ffa057","#ffd166","#9bd45f",fe];function Gy(e){return e>=100?Xe[0]:e>=50?Xe[1]:e>=20?Xe[2]:e>=5?Xe[3]:Xe[4]}function al({color:e,value:t,caption:n,className:r=""}){return o.jsxs("div",{className:`flex flex-col items-center justify-center rounded-lg px-2 py-2 ${r}`,style:{background:`${e}14`,border:`1px solid ${e}33`},children:[o.jsx("span",{className:"metric-md leading-none",style:{color:e},children:t}),o.jsx("span",{className:"caption text-soft mt-0.5",children:"sat/vB"}),o.jsx("span",{className:"caption text-soft mt-1 text-center",children:n})]})}pc.schema;const Xy={fastest:"Next block",halfHour:"~30 min",hour:"~1 hour",economy:"Economy",minimum:"Minimum"},qy={fastest:Xe[0],halfHour:Xe[1],hour:Xe[2],economy:Xe[3],minimum:Xe[4]};function Ky({config:e}){const{fees:t,isLoading:n}=Wh();return n?o.jsx(M,{loading:!0,children:"loading fees…"}):t?o.jsx("div",{className:"flex h-full flex-wrap content-center items-stretch justify-center gap-2",children:e.tiers.map(r=>o.jsx(al,{className:"min-w-[64px] flex-1",color:qy[r],value:t[r],caption:Xy[r]},r))}):o.jsx(M,{children:"no fee data yet"})}const Jy={...pc,component:Ky};gc.schema;function Qy({config:e}){const{state:t,isLoading:n}=Yh();if(n)return o.jsx(M,{loading:!0,children:"loading mempool…"});if(!t)return o.jsx(M,{children:"no mempool data yet"});const r=t.projected.slice(0,e.projectedBlocks),s=(t.vsize/1e6).toFixed(1);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"unconfirmed"}),o.jsx("div",{className:"metric-lg text-strong leading-none",children:t.count.toLocaleString("en-US")}),o.jsx("div",{className:"body-sm text-soft",children:"transactions"})]}),o.jsxs("div",{className:"text-right",children:[o.jsxs("div",{className:"body-md text-normal font-bold tabular-nums",children:[s," MvB"]}),o.jsx("div",{className:"caption text-soft",children:"pending vsize"})]})]}),o.jsx("div",{className:`flex gap-1.5 ${hp}`,children:r.map((a,i)=>o.jsx(al,{className:"min-w-[76px]",color:Gy(a.medianFee),value:`~${Math.round(a.medianFee)}`,caption:`${Ze(a.nTx)} tx`},i))})]})}const ev={...gc,component:Qy};bc.schema;function tv({config:e}){const{blocks:t,isLoading:n}=Gh(e.count);return n?o.jsx(M,{loading:!0,children:"loading blocks…"}):t.length===0?o.jsx(M,{children:"no block data yet"}):o.jsx("div",{className:"flex h-full min-h-0 flex-col",children:o.jsx("div",{className:xe,children:o.jsx("div",{className:"flex flex-col gap-1.5",children:t.map(r=>o.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 rounded-md bg-white/[0.03] px-2 py-1.5",title:`Block ${r.height} · ${r.poolName} · ${r.txCount.toLocaleString("en-US")} txs`,children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"body-sm text-strong font-bold tabular-nums",children:r.height.toLocaleString("en-US")}),o.jsx("span",{className:"caption text-soft",children:qr(r.time)})]}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"body-sm text-normal block truncate",children:r.poolName}),o.jsxs("span",{className:"caption text-soft",children:[r.txCount.toLocaleString("en-US")," txs"]})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("span",{className:"body-sm text-normal block font-bold tabular-nums",children:ai(r.totalFees)}),o.jsxs("span",{className:"caption text-soft",children:["~",Math.round(r.medianFee)," sat/vB"]})]})]},r.id))})})})}const nv={...bc,component:tv};xc.schema;function rv({config:e}){const{data:t,isLoading:n}=Xh(e.window),r=f.useMemo(()=>((t==null?void 0:t.hashrates)??[]).map(s=>({date:new Date(s.time).toISOString(),value:s.hashrate})),[t==null?void 0:t.hashrates]);return n?o.jsx(M,{loading:!0,children:"loading hashrate…"}):t?o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"network hashrate"}),o.jsx("div",{className:"metric-lg text-strong leading-none",children:fp(t.currentHashrate)})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:Ze(t.currentDifficulty)}),o.jsx("div",{className:"caption text-soft",children:"difficulty"})]})]}),o.jsx(mt,{data:r,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}),o.jsxs("div",{className:"caption text-soft",children:["past ",e.window]})]}):o.jsx(M,{children:"no hashrate data yet"})}const sv={...xc,component:rv};yc.schema;function ov(e){const t=Math.max(0,Math.round((e-Date.now())/1e3)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),s=Math.floor(t%3600/60);return n>0?`in ${n}d ${r}h`:r>0?`in ${r}h ${s}m`:`in ${s}m`}function av({config:e}){const{adjustment:t,isLoading:n}=qh();if(n)return o.jsx(M,{loading:!0,children:"loading difficulty…"});if(!t)return o.jsx(M,{children:"no difficulty data yet"});const{progressPercent:r,difficultyChange:s,remainingBlocks:a}=t,i=Ce(s);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"caption text-soft uppercase",children:"next adjustment"}),o.jsx("div",{className:"metric-lg leading-none",style:{color:i},children:ye(s)}),o.jsx("div",{className:"body-sm text-soft",children:s>=0?"harder":"easier"})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:ov(t.estimatedRetargetDate)}),o.jsxs("div",{className:"caption text-soft",children:[a.toLocaleString("en-US")," blocks left"]})]})]}),o.jsxs("div",{children:[o.jsx("div",{className:"relative h-2.5 w-full overflow-hidden rounded-full bg-white/[0.08]",children:o.jsx("div",{className:"absolute left-0 top-0 h-full rounded-full",style:{width:`${Math.min(100,Math.max(0,r))}%`,background:"hsl(var(--zf-accent-hue, 242) 85% 72%)"}})}),o.jsxs("div",{className:"caption text-soft mt-1 tabular-nums",children:[je(r,1)," through this epoch"]})]}),e.showPrevious&&o.jsxs("div",{className:"caption text-soft border-t border-white/[0.08] pt-2",children:["previous retarget"," ",o.jsx("span",{className:"font-bold tabular-nums",style:{color:Ce(t.previousRetarget)},children:ye(t.previousRetarget)})]})]})}const iv={...yc,component:av};vc.schema;function cv({width:e,height:t,data:n}){const r=je(n.sharePct,1);return o.jsx(Dt,{width:e,height:t,label:n.id,secondary:r,title:`${n.id} · ${r} of blocks`})}function lv({config:e}){const{pools:t,isLoading:n}=Kh(e.window),r=f.useMemo(()=>{const s=(t==null?void 0:t.pools)??[],i=s.slice(0,e.topN).map(l=>({id:l.name,value:l.blockCount,sharePct:l.sharePct})),c=s.slice(e.topN);if(c.length>0){const l=c.reduce((d,h)=>d+h.blockCount,0),u=c.reduce((d,h)=>d+h.sharePct,0);l>0&&i.push({id:"Other",value:l,sharePct:u})}return i},[t,e.topN]);return n?o.jsx(M,{loading:!0,children:"loading pools…"}):r.length===0?o.jsx(M,{children:"no mining data yet"}):o.jsx(Rt,{data:r,LeafComponent:cv,getColorValue:s=>s.sharePct})}const uv={...vc,component:lv};wc.schema;function ar(e,t){return t==null||t===0?null:(e-t)/t*100}function ir({label:e,value:t,delta:n}){return o.jsxs("div",{className:"flex flex-col items-center justify-center rounded-md bg-white/[0.04] px-2 py-2 text-center",children:[o.jsx("span",{className:"metric-sm text-strong leading-none",children:t}),o.jsx("span",{className:"caption text-soft mt-1",children:e}),n!==null&&o.jsx("span",{className:"caption mt-0.5 font-bold tabular-nums",style:{color:Ce(n)},children:ye(n)})]})}function dv({config:e}){const{stats:t,isLoading:n}=Jh();return n?o.jsx(M,{loading:!0,children:"loading lightning…"}):t?o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-2",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-1.5",children:[o.jsx(ir,{label:"nodes",value:t.nodeCount.toLocaleString("en-US"),delta:ar(t.nodeCount,t.prevNodeCount)}),o.jsx(ir,{label:"channels",value:t.channelCount.toLocaleString("en-US"),delta:ar(t.channelCount,t.prevChannelCount)}),o.jsx(ir,{label:"capacity",value:ai(t.totalCapacity),delta:ar(t.totalCapacity,t.prevTotalCapacity)})]}),e.showSplit&&o.jsxs("div",{className:"caption text-soft text-center",children:[t.clearnetNodes.toLocaleString("en-US")," clearnet ·"," ",t.torNodes.toLocaleString("en-US")," tor"]})]}):o.jsx(M,{children:"no lightning data yet"})}const mv={...wc,component:dv};kc.schema;const Mr=fe,Ar=_e;function fv(e){return e>1?Ar:Mr}function hv({config:e}){const{summary:t,isLoading:n}=Ja(e.currency);if(n)return o.jsx(M,{loading:!0,children:"loading options…"});if(!t)return o.jsx(M,{children:"no options data yet"});const r=e.basis==="oi"?t.putCallRatioOi:t.putCallRatioVolume,s=e.basis==="oi"?t.putCallRatioVolume:t.putCallRatioOi,a=t.callOi+t.putOi,i=a>0?t.callOi/a*100:50,c=100-i,l=fv(r);return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"caption text-soft uppercase",children:[e.currency," put/call · ",e.basis==="oi"?"OI":"vol"]}),o.jsx("div",{className:"metric-xl leading-none",style:{color:l},children:r.toFixed(2)})]}),o.jsxs("div",{className:"text-right",children:[o.jsx("div",{className:"body-md text-normal font-bold tabular-nums",children:s.toFixed(2)}),o.jsxs("div",{className:"caption text-soft",children:["by ",e.basis==="oi"?"volume":"OI"]})]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex h-3 w-full gap-1 overflow-hidden rounded-full",children:[o.jsx("div",{className:"h-full rounded-l-full",style:{width:`${i}%`,background:Mr}}),o.jsx("div",{className:"h-full rounded-r-full",style:{width:`${c}%`,background:Ar}})]}),o.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[o.jsxs("span",{children:[o.jsx("span",{style:{color:Mr},children:"calls"})," ",je(i,0)]}),o.jsxs("span",{children:[je(c,0)," ",o.jsx("span",{style:{color:Ar},children:"puts"})]})]})]}),o.jsxs("div",{className:"caption text-soft",children:["avg implied vol ",je(t.avgIv,1)]})]})}const pv={...kc,component:hv};Sc.schema;const gv={"7D":{ms:7*864e5,res:3600},"1M":{ms:30*864e5,res:43200},"3M":{ms:90*864e5,res:86400}};function bv({config:e}){const{ms:t,res:n}=gv[e.lookback],r=f.useMemo(()=>Date.now()-t,[t]),{points:s,isLoading:a}=ep(e.currency,r,n),i=f.useMemo(()=>s.map(u=>({date:new Date(u.time).toISOString(),value:u.value})),[s]);if(a)return o.jsx(M,{loading:!0,children:"loading volatility…"});if(s.length===0)return o.jsx(M,{children:"no volatility data yet"});const c=s[s.length-1].value,l=c-s[0].value;return o.jsxs("div",{className:"flex h-full min-h-0 flex-col justify-center gap-3",children:[o.jsxs("div",{className:"flex items-end justify-between gap-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"caption text-soft uppercase",children:[e.currency," DVOL · implied vol"]}),o.jsx("div",{className:"metric-lg text-strong leading-none",children:c.toFixed(1)})]}),o.jsxs("div",{className:"text-right",children:[o.jsxs("div",{className:"body-md font-bold tabular-nums",style:{color:Ce(l)},children:[l>=0?"+":"",l.toFixed(1)]}),o.jsxs("div",{className:"caption text-soft",children:["past ",e.lookback]})]})]}),o.jsx(mt,{data:i,width:320,height:54,color:"hsl(var(--zf-accent-hue, 242) 85% 72%)"})]})}const xv={...Sc,component:bv};jc.schema;const $o=fe,Do=_e;function yv({config:e}){const{summary:t,isLoading:n}=Ja(e.currency),r=f.useMemo(()=>{if(!t)return null;const S=t.underlyingPrice,z=t.nearestExpiry.strikes;if(z.length===0)return null;const j=[...z].sort((k,w)=>Math.abs(k.strike-S)-Math.abs(w.strike-S)).slice(0,e.strikes).sort((k,w)=>k.strike-w.strike),C=Math.max(1,...j.map(k=>Math.max(k.callOi,k.putOi)));return{near:j,maxOi:C,spot:S,expiry:t.nearestExpiry.expiry}},[t,e.strikes]);if(n)return o.jsx(M,{loading:!0,children:"loading strikes…"});if(!r)return o.jsx(M,{children:"no options data yet"});const{near:s,maxOi:a,spot:i,expiry:c}=r,l=600,u=200,d=6,m=u-d-4,p=s.length,x=l/p,b=Math.max(2,x*.34),y=S=>S*x+x/2,g=S=>S/a*m;let v=null;if(i<=s[0].strike)v=y(0);else if(i>=s[p-1].strike)v=y(p-1);else for(let S=0;S<p-1;S++)if(i>=s[S].strike&&i<=s[S+1].strike){const z=s[S+1].strike-s[S].strike||1,j=(i-s[S].strike)/z;v=y(S)+j*(y(S+1)-y(S));break}return o.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o.jsxs("div",{className:"caption text-soft mb-1 flex justify-between",children:[o.jsxs("span",{children:["OI by strike · ",c]}),o.jsxs("span",{children:[o.jsx("span",{style:{color:$o},children:"calls"})," ·"," ",o.jsx("span",{style:{color:Do},children:"puts"})]})]}),o.jsxs("svg",{viewBox:`0 0 ${l} ${u}`,preserveAspectRatio:"none",className:"min-h-0 w-full flex-1",children:[o.jsx("line",{x1:0,y1:d+m,x2:l,y2:d+m,style:{stroke:"var(--color-disabled)"},strokeWidth:1}),s.map((S,z)=>{const j=y(z),C=g(S.callOi),k=g(S.putOi);return o.jsxs("g",{children:[o.jsx("rect",{x:j-b-1,y:d+m-C,width:b,height:C,fill:$o}),o.jsx("rect",{x:j+1,y:d+m-k,width:b,height:k,fill:Do})]},S.strike)}),v!==null&&o.jsx("line",{x1:v,y1:d,x2:v,y2:d+m,style:{stroke:"var(--color-soft)"},strokeWidth:1,strokeDasharray:"4 3"})]}),o.jsxs("div",{className:"caption text-soft mt-1 flex justify-between tabular-nums",children:[o.jsx("span",{children:Ze(s[0].strike)}),o.jsxs("span",{className:"text-normal",children:["spot ",ze(i)]}),o.jsx("span",{children:Ze(s[p-1].strike)})]})]})}const vv={...jc,component:yv};Nc.schema;function wv({config:e}){const{entries:t,isLoading:n}=Ah(),{gainers:r,losers:s}=f.useMemo(()=>{const a=t.filter(i=>i.rank<=e.minRank&&i.volume24hUsd>0).map(i=>({symbol:i.symbol,price:i.priceUsd,chg:i.changePct[e.window]??0})).sort((i,c)=>c.chg-i.chg);return{gainers:a.slice(0,e.count),losers:a.slice(-e.count).reverse()}},[t,e.window,e.count,e.minRank]);return n?o.jsx(M,{loading:!0,children:"loading movers…"}):r.length===0?o.jsx(M,{children:"no mover data yet"}):o.jsxs("div",{className:"grid h-full grid-cols-2 gap-x-4 overflow-hidden",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["gainers · ",e.window]}),r.map(a=>o.jsx(Xt,{symbol:a.symbol,label:a.symbol,price:a.price,changePct:a.chg},a.symbol))]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("div",{className:"caption text-soft uppercase tracking-wide",children:["losers · ",e.window]}),s.map(a=>o.jsx(Xt,{symbol:a.symbol,label:a.symbol,price:a.price,changePct:a.chg},a.symbol))]})]})}const kv={...Nc,component:wv};ac.schema;function Sv(e,t){const[n,r,s]=e.split("-").map(Number),[a,i,c]=t.split("-").map(Number);return Math.round((Date.UTC(a,i-1,c)-Date.UTC(n,r-1,s))/864e5)}function jv(e){const[t,n,r]=e.split("-").map(Number);return new Date(Date.UTC(t,n-1,r)).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"})}function Nv(e){return e<=0?"today":e===1?"tomorrow":`in ${e}d`}function Cv({config:e}){var a;if(!ct[e.exchange])return o.jsx(M,{children:"unknown exchange"});const n=(a=Tr(e.exchange))==null?void 0:a.ymd,r=Hb(e.exchange,e.count),s=e.label.trim();return!n||r.length===0?o.jsx(M,{children:"no upcoming holidays on file"}):o.jsxs("div",{className:"flex h-full w-full flex-col",children:[s&&o.jsx("div",{className:"caption text-soft mb-1 shrink-0 uppercase tracking-[0.12em]",children:s}),o.jsx("div",{className:`min-h-0 flex-1 ${xe}`,children:r.map(i=>o.jsx(as,{label:jv(i),value:Nv(Sv(n,i))},i))})]})}const zv={...ac,component:Cv};ic.schema;const _v=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Tv="#f2b066",Ev=864e5;function Mv({config:e}){const t=ct[e.exchange],n=t?Tr(e.exchange):null;if(!t||!n)return o.jsx(M,{children:"unknown exchange"});const r=new Date,s=(n.dow+6)%7,a=[];for(let l=0;l<7;l++){const u=Tr(e.exchange,new Date(r.getTime()+(l-s)*Ev));if(!u)continue;const d=t.days.includes(u.dow),h=d&&Bb(e.exchange,u.ymd);a.push({ymd:u.ymd,dow:u.dow,day:Number(u.ymd.split("-")[2]),isToday:u.ymd===n.ymd,isHoliday:h,isTrading:d&&!h})}const i=e.weekdaysOnly?a.filter(l=>t.days.includes(l.dow)):a,c=e.label.trim();return o.jsxs("div",{className:"flex h-full w-full flex-col justify-center gap-1.5",children:[c&&o.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:c}),o.jsx("div",{className:"flex min-h-0 flex-1 items-stretch gap-1",children:i.map(l=>{const u=!l.isTrading&&!l.isHoliday;return o.jsxs("div",{title:l.isHoliday?"Market holiday":l.isTrading?"Trading day":"Closed",className:`flex flex-1 flex-col items-center justify-center rounded-md border px-1 py-1 ${l.isToday?"text-strong":u?"text-disabled":"text-normal"}`,style:{borderColor:l.isToday?"var(--color-highlight)":"rgba(255,255,255,0.06)",color:l.isHoliday&&!l.isToday?Tv:void 0},children:[o.jsx("span",{className:"caption opacity-80",children:_v[l.dow]}),o.jsx("span",{className:"metric-sm",children:l.day})]},l.ymd)})})]})}const Av={...ic,component:Mv};cc.schema;function pn({label:e,value:t,onChange:n}){return o.jsxs("label",{className:`flex flex-col gap-0.5 px-2 py-1 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft truncate",children:e}),o.jsx("input",{type:"number",value:Number.isFinite(t)?t:0,onChange:r=>n(Number(r.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]})}function Pv({config:e}){const[t,n]=f.useState(e.principal),[r,s]=f.useState(e.ratePct),[a,i]=f.useState(e.periods),[c,l]=f.useState(e.contribution),{series:u,ending:d,contributed:h,gain:m}=f.useMemo(()=>{const b=r/100,y=Math.max(0,Math.min(600,Math.floor(a))),g=[{date:"0",value:t}];let v=t,S=t;for(let z=1;z<=y;z++)v=v*(1+b)+c,S+=c,g.push({date:String(z),value:v});return{series:g,ending:v,contributed:S,gain:v-S}},[t,r,a,c]),p=h>0?m/h*100:0,x=e.label.trim();return o.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[x&&o.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:x}),o.jsxs("div",{className:"shrink-0",children:[o.jsx("div",{className:"caption text-soft",children:"projected value"}),o.jsx("div",{className:"metric-lg text-strong",children:le(d)}),o.jsxs("div",{className:"body-sm",style:{color:Ce(p)},children:[ye(p)," · ",le(m)," gain"]})]}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(mt,{data:u,width:260,height:48,variant:"green",className:"w-full"})}),o.jsxs("div",{className:"grid shrink-0 grid-cols-2 gap-1.5",children:[o.jsx(pn,{label:"principal",value:t,onChange:n}),o.jsx(pn,{label:"rate %/period",value:r,onChange:s}),o.jsx(pn,{label:"periods",value:a,onChange:i}),o.jsx(pn,{label:"contribution",value:c,onChange:l})]})]})}const Rv={...cc,component:Pv};lc.schema;function $v({config:e}){const[t,n]=f.useState(e.fills.length?e.fills:[{price:0,size:0}]),[r,s]=f.useState(e.currentPrice),{avg:a,totalSize:i}=f.useMemo(()=>{let d=0,h=0;for(const m of t)d+=m.price*m.size,h+=m.size;return{avg:h>0?d/h:0,totalSize:h}},[t]),c=a>0&&r>0?(r-a)/a*100:null,l=e.label.trim(),u=(d,h,m)=>n(p=>p.map((x,b)=>b===d?{...x,[h]:m}:x));return o.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[l&&o.jsx("div",{className:"caption text-soft shrink-0 uppercase tracking-[0.12em]",children:l}),o.jsxs("div",{className:"shrink-0",children:[o.jsx("div",{className:"caption text-soft",children:"break-even (avg cost)"}),o.jsx("div",{className:"metric-lg text-strong",children:i>0?ze(a):"—"}),o.jsxs("div",{className:"caption text-soft",children:[i>0?`${i} units`:"add fills below",c!==null&&o.jsxs(o.Fragment,{children:[" · ",o.jsxs("span",{style:{color:Ce(c)},children:[ye(c)," unrealized"]})]})]})]}),o.jsxs("div",{className:`min-h-0 flex-1 ${xe}`,children:[t.map((d,h)=>o.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[o.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft",children:"px"}),o.jsx("input",{type:"number",value:Number.isFinite(d.price)?d.price:0,onChange:m=>u(h,"price",Number(m.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),o.jsxs("label",{className:`flex flex-1 items-center gap-1 px-2 py-1 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft",children:"sz"}),o.jsx("input",{type:"number",value:Number.isFinite(d.size)?d.size:0,onChange:m=>u(h,"size",Number(m.target.value)),className:"body-sm text-strong w-full bg-transparent outline-none"})]}),o.jsx("button",{type:"button",onClick:()=>n(m=>m.length>1?m.filter((p,x)=>x!==h):m),className:"caption text-soft hover:text-strong shrink-0 px-1","aria-label":"remove fill",children:"×"})]},h)),o.jsx("button",{type:"button",onClick:()=>n(d=>[...d,{price:0,size:0}]),className:`caption text-soft hover:text-strong w-full px-2 py-1 ${Ne}`,children:"+ add fill"})]}),o.jsxs("label",{className:`flex shrink-0 items-center gap-1 px-2 py-1 ${Ne}`,children:[o.jsx("span",{className:"caption text-soft shrink-0",children:"current price"}),o.jsx("input",{type:"number",value:Number.isFinite(r)?r:0,onChange:d=>s(Number(d.target.value)),className:"body-sm text-strong w-full bg-transparent text-right outline-none"})]})]})}const Dv={...lc,component:$v};uc.schema;function Iv({config:e}){const t=Ln(),[n,r]=f.useState(e.checked),s=t?e.checked:n,a=l=>{const u=e.items.map((d,h)=>h===l?!s[h]:!!s[h]);t?t({checked:u}):r(u)},i=e.items.filter((l,u)=>s[u]).length,c=e.title.trim();return o.jsxs("div",{className:"flex h-full w-full flex-col",children:[o.jsxs("div",{className:"mb-1 flex shrink-0 items-baseline justify-between gap-2",children:[c&&o.jsx("div",{className:"body-sm text-strong truncate font-semibold",children:c}),o.jsxs("div",{className:"caption text-soft shrink-0 tabular-nums",children:[i,"/",e.items.length]})]}),o.jsx("div",{className:`min-h-0 flex-1 ${xe}`,children:e.items.map((l,u)=>o.jsxs("button",{type:"button",onClick:()=>a(u),className:"flex w-full items-center gap-2 py-1 text-left",children:[o.jsx("span",{className:"caption flex h-4 w-4 shrink-0 items-center justify-center rounded border leading-none",style:{borderColor:s[u]?"var(--color-highlight)":"rgba(255,255,255,0.2)",background:s[u]?"var(--color-highlight)":"transparent",color:s[u]?"#0b0e14":"transparent"},children:"✓"}),o.jsx("span",{className:`body-sm ${s[u]?"text-disabled line-through":"text-normal"}`,children:l})]},u))})]})}const Lv={...uc,component:Iv};dc.schema;function Fv(e){const t=Math.floor(e/60),n=e%60;return`${t}:${String(n).padStart(2,"0")}`}function Ov({config:e}){const t=Math.max(1,Math.round(e.workMin*60)),n=Math.max(1,Math.round(e.breakMin*60)),[r,s]=f.useState("work"),[a,i]=f.useState(t),[c,l]=f.useState(!1),[u,d]=f.useState(1);f.useEffect(()=>{s("work"),i(t),l(!1),d(1)},[t,n]);const h=f.useRef(r);h.current=r;const m=f.useRef(u);m.current=u,f.useEffect(()=>{if(!c)return;const y=setInterval(()=>{i(g=>g>1?g-1:h.current==="work"?(s("break"),n):(s("work"),d(v=>m.current>=e.cycles?1:v+1),t))},1e3);return()=>clearInterval(y)},[c,t,n,e.cycles]);const p=()=>{l(!1),s("work"),i(t),d(1)},x=e.label.trim(),b=r==="work"?"var(--color-highlight)":void 0;return o.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1",children:[x&&o.jsx("div",{className:"caption text-soft uppercase tracking-[0.12em]",children:x}),o.jsxs("div",{className:"caption text-soft uppercase tracking-[0.18em]",children:[r," · ",u,"/",e.cycles]}),o.jsx("div",{className:"metric-xl text-strong",style:{color:b},children:Fv(a)}),o.jsxs("div",{className:"mt-1 flex gap-1",children:[o.jsx("button",{type:"button",onClick:()=>l(y=>!y),className:`caption text-normal px-3 py-1 ${Ne}`,children:c?"Pause":"Start"}),o.jsx("button",{type:"button",onClick:p,className:`caption text-soft px-3 py-1 ${Ne}`,children:"Reset"})]})]})}const Uv={...dc,component:Ov};mc.schema;function Bv({config:e}){const t=e.rules.filter(r=>r.trim()),n=e.title.trim();return t.length===0?o.jsx(M,{children:"no rules yet"}):o.jsxs("div",{className:"flex h-full w-full flex-col",children:[n&&o.jsx("div",{className:"body-sm text-strong mb-1 shrink-0 font-semibold",children:n}),o.jsx("ol",{className:`min-h-0 flex-1 ${xe}`,children:t.map((r,s)=>o.jsxs("li",{className:"flex gap-2 py-1",children:[o.jsx("span",{className:"caption text-highlight shrink-0 tabular-nums",children:s+1}),o.jsx("span",{className:"body-sm text-normal",children:r})]},s))})]})}const Hv={...mc,component:Bv};fc.schema;function Vv(e){return[{name:"Breathe in",dur:e.inhale,scale:1},{name:"Hold",dur:e.hold,scale:1},{name:"Breathe out",dur:e.exhale,scale:.45},{name:"Hold",dur:e.holdAfter,scale:.45}]}function Zv({config:e}){const t=Vv(e),[n,r]=f.useState(0);f.useEffect(()=>{r(0)},[e.inhale,e.hold,e.exhale,e.holdAfter]),f.useEffect(()=>{const i=Math.max(0,t[n].dur),c=setTimeout(()=>r(l=>(l+1)%t.length),Math.max(300,i*1e3));return()=>clearTimeout(c)},[n,e.inhale,e.hold,e.exhale,e.holdAfter]);const s=t[n].scale,a=Math.max(.3,t[n].dur);return o.jsxs("div",{className:"relative flex h-full w-full items-center justify-center overflow-hidden",children:[o.jsx("div",{className:"aspect-square w-[55%] rounded-full",style:{background:"var(--color-highlight)",opacity:.25,transform:`scale(${s})`,transition:`transform ${a}s ease-in-out`}}),o.jsx("div",{className:"caption text-soft absolute uppercase tracking-[0.2em]",children:t[n].name})]})}const Wv={...fc,component:Zv};hc.schema;const Yv=["track","album","playlist","artist","episode","show"];function Gv(e){let t;try{t=new URL(e.trim())}catch{return null}if(t.hostname.replace(/^www\./,"")!=="open.spotify.com")return null;const n=t.pathname.split("/").filter(Boolean),r=n.findIndex(s=>Yv.includes(s));return r===-1||!n[r+1]?null:`https://open.spotify.com/embed/${n[r]}/${n[r+1]}`}function Xv({config:e}){const[t,n]=f.useState("loading"),r=f.useMemo(()=>Gv(e.url),[e.url]);return r?t==="error"?o.jsx(M,{children:"player unavailable"}):o.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:[t==="loading"&&o.jsx("div",{className:"absolute inset-0 z-10",children:o.jsx(M,{loading:!0,children:"loading player…"})}),o.jsx("iframe",{src:r,title:"Spotify player",className:"w-full",height:e.compact?152:"100%",style:{border:0,height:e.compact?152:"100%"},loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture",onLoad:()=>n("loaded"),onError:()=>n("error")},r+String(e.compact))]}):o.jsx(M,{children:"paste a Spotify track / album / playlist URL"})}const qv={...hc,component:Xv},Kv=[Mp,ug,hg,gg,xg,kg,Rg,Lg,Og,Hg,Kg,eb,ib,ub,fb,bb,yb,kb,Cb,Tb,Mb,Pb,Db,Jb,rx,ox,cx,dx,gx,xx,vx,Sx,Cx,Tx,Ax,$x,Lx,Ux,Vx,Yx,qx,Qx,sy,uy,fy,py,by,Sy,Cy,_y,Ey,Ry,Ly,Uy,Vy,Yy,Jy,ev,nv,sv,iv,uv,mv,pv,xv,vv,kv,zv,Av,Rv,Dv,Lv,Uv,Hv,Wv,qv];class ee{constructor(t){Y(this,"entries",new Map);Y(this,"inflight",new Map);Y(this,"namespace");Y(this,"ttlMs");Y(this,"persist");Y(this,"staleOnError");Y(this,"revive");this.namespace=t.namespace,this.ttlMs=t.ttlMs,this.persist=t.persist??!1,this.staleOnError=t.staleOnError??!0,this.revive=t.revive}get(t,n){const r=this.read(t);if(r&&Date.now()-r.at<this.ttlMs)return Promise.resolve(r.value);const s=this.inflight.get(t);if(s)return s;const a=n().then(i=>(this.write(t,i),i)).catch(i=>{if(this.staleOnError&&r)return r.value;throw i}).finally(()=>{this.inflight.delete(t)});return this.inflight.set(t,a),a}read(t){const n=this.entries.get(t);if(n)return n;if(!this.persist||typeof localStorage>"u")return null;try{const r=localStorage.getItem(this.storageKey(t));if(!r)return null;const s=JSON.parse(r);if(typeof(s==null?void 0:s.at)!="number")return null;let a;if(this.revive){const c=this.revive(s.value);if(c===null)return null;a=c}else a=s.value;const i={at:s.at,value:a};return this.entries.set(t,i),i}catch{return null}}write(t,n){const r={at:Date.now(),value:n};if(this.entries.set(t,r),!(!this.persist||typeof localStorage>"u"))try{localStorage.setItem(this.storageKey(t),JSON.stringify(r))}catch{}}storageKey(t){return`${this.namespace}:${t}`}}const Jv=1e4,Qv="zframes (+https://github.com/zentryhq/zframes)";async function il(e,{timeoutMs:t=Jv,init:n,proxied:r}){const s=new Headers(n==null?void 0:n.headers);typeof document>"u"&&!s.has("User-Agent")&&s.set("User-Agent",Qv);const a=r&&typeof document<"u"?`${cp}?url=${encodeURIComponent(e)}`:e,i=await fetch(a,{...n,headers:s,signal:(n==null?void 0:n.signal)??AbortSignal.timeout(t)});if(!i.ok)throw new Error(`${e} failed: ${i.status}`);return i}async function ne(e,t,n={}){const s=await(await il(e,n)).json();return t?t.parse(s):s}async function Pr(e,t={}){return(await il(e,t)).text()}const e1="https://api.alternative.me/fng/",t1=new ee({namespace:"zframes:alternativeme:fng",ttlMs:45*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});class n1{constructor(){Y(this,"name","alternative.me");Y(this,"capabilities",["sentiment"])}async getFearGreed(t=30){return t1.get(String(t),async()=>{const n=await ne(`${e1}?limit=${t}`);if(!Array.isArray(n==null?void 0:n.data))throw new Error("alternative.me fng: unexpected response shape");return n.data.map(r=>({value:Number(r.value),classification:r.value_classification??"",time:Number(r.timestamp)*1e3})).filter(r=>Number.isFinite(r.value)&&Number.isFinite(r.time))})}}const r1=new ee({namespace:"zframes:binance:portfolio",ttlMs:45e3,persist:!1});class s1{constructor(){Y(this,"name","Binance");Y(this,"capabilities",["portfolio"]);Y(this,"portfolioKinds",["binance"])}async getPortfolio(t){if(t.kind!=="binance")throw new Error(`BinanceProvider can't serve source: ${t.kind}`);return r1.get("binance",async()=>{const n=await fetch(`${lp}?source=binance`,{headers:{accept:"application/json"}});if(n.status===401)throw new Error("binance: not connected");if(!n.ok)throw new Error(`binance portfolio relay ${n.status}`);return await n.json()})}}const o1="https://api.bls.gov/publicAPI/v2/timeseries/data/",a1={CUUR0000SA0:"CPI-U all items",LNS14000000:"Unemployment rate",CES0000000001:"Nonfarm payrolls",CES0500000003:"Avg hourly earnings",LNS11300000:"Labor force participation"};function i1(e){const t=Number(e);return Number.isFinite(t)?t:null}function c1(e,t){const n=/^M(0[1-9]|1[0-2])$/.exec(t??""),r=Number(e);if(!n||!Number.isFinite(r))return null;const s=Number(n[1]);return Date.UTC(r,s-1,1)}function l1(e){return new Intl.DateTimeFormat("en-US",{month:"short",year:"numeric",timeZone:"UTC"}).format(e)}const u1=new ee({namespace:"zframes:macro",ttlMs:360*6e4,persist:!0,revive:e=>e&&Array.isArray(e.points)?e:null});class d1{constructor(){Y(this,"name","bls");Y(this,"capabilities",["macro-series"])}async getMacroSeries(t,n,r){return u1.get(`${t}:${n}:${r}`,()=>this.fetchMacroSeries(t,n,r))}async fetchMacroSeries(t,n,r){var l,u,d;const s=`${o1}${encodeURIComponent(t)}?startyear=${n}&endyear=${r}`,a=await ne(s);if(a.status!=="REQUEST_SUCCEEDED")throw new Error(`bls series ${t}: ${((l=a.message)==null?void 0:l.join(", "))||"request failed"}`);const i=(d=(u=a.Results)==null?void 0:u.series)==null?void 0:d[0];if(!(i!=null&&i.data))throw new Error("bls series: unexpected response shape");const c=i.data.map(h=>{const m=i1(h.value),p=c1(h.year,h.period);return m===null||p===null?null:{time:p,date:l1(p),value:m,period:`${h.year}-${h.period}`}}).filter(h=>h!==null).sort((h,m)=>h.time-m.time);return{seriesId:i.seriesID??t,label:a1[t]??t,source:"BLS",points:c}}}const m1="https://api.coingecko.com/api/v3/global",f1="https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=50&page=1&sparkline=false&price_change_percentage=24h",h1=new ee({namespace:"zframes:coingecko:global",ttlMs:12*6e4,persist:!0}),p1=new ee({namespace:"zframes:coingecko:markets",ttlMs:10*6e4,persist:!0});class g1{constructor(){Y(this,"name","coingecko");Y(this,"capabilities",["global-market","coin-markets"])}async getGlobalMarket(){return h1.get("global",async()=>{var r;const t=await ne(m1);if(!((r=t==null?void 0:t.data)!=null&&r.total_market_cap)||!t.data.market_cap_percentage)throw new Error("coingecko global: unexpected response shape");const n=Number(t.data.market_cap_change_percentage_24h_usd);return{totalMarketCapUsd:t.data.total_market_cap.usd??0,marketCapChangePct24h:Number.isFinite(n)?n:0,dominance:t.data.market_cap_percentage}})}async getCoinMarkets(){return p1.get("markets",async()=>{const t=await ne(f1);if(!Array.isArray(t))throw new Error("coingecko markets: unexpected response shape");return t.filter(n=>Number.isFinite(n.market_cap)&&n.market_cap>0).map(n=>({symbol:(n.symbol??"").toUpperCase(),name:n.name,marketCapUsd:n.market_cap,changePct24h:Number.isFinite(n.price_change_percentage_24h)?n.price_change_percentage_24h:void 0}))})}}const b1=300,x1=e=>`https://api.coinpaprika.com/v1/tickers?quotes=USD&limit=${e}`,y1=new ee({namespace:"zframes:coinpaprika:movers",ttlMs:12*6e4,persist:!0}),gn=e=>Number.isFinite(e)?e:0;class v1{constructor(){Y(this,"name","coinpaprika");Y(this,"capabilities",["coin-movers"])}async getCoinMovers(t=b1){return y1.get(`movers:${t}`,async()=>{const n=await ne(x1(t));if(!Array.isArray(n))throw new Error("coinpaprika tickers: unexpected response shape");return n.filter(r=>{var s;return((s=r==null?void 0:r.quotes)==null?void 0:s.USD)&&Number.isFinite(r.quotes.USD.price)}).map(r=>{const s=r.quotes.USD;return{symbol:(r.symbol??"").toUpperCase(),name:r.name,rank:r.rank,priceUsd:s.price,marketCapUsd:s.market_cap,volume24hUsd:s.volume_24h,changePct:{"1h":gn(s.percent_change_1h),"24h":gn(s.percent_change_24h),"7d":gn(s.percent_change_7d),"30d":gn(s.percent_change_30d)}}})})}}const w1="https://api.llama.fi/v2/chains",k1="https://api.llama.fi/overview/dexs",S1="https://api.llama.fi/overview/fees",j1="https://api.llama.fi/protocols",On=8*6e4,cl=30*6e4,N1=new ee({namespace:"zframes:defillama:tvl",ttlMs:On}),C1=new ee({namespace:"zframes:defillama:dex-volume",ttlMs:On}),z1=new ee({namespace:"zframes:defillama:protocol-tvl",ttlMs:On}),_1=new ee({namespace:"zframes:defillama:protocol-fees",ttlMs:On}),T1=new ee({namespace:"zframes:defillama:dex-history",ttlMs:cl}),E1=new ee({namespace:"zframes:defillama:protocol-history",ttlMs:cl}),Io=e=>[...e].sort().join(",");function M1(e){return Array.isArray(e)?e.map(([t,n])=>({time:t*1e3,value:Number(n)})).filter(t=>Number.isFinite(t.time)&&Number.isFinite(t.value)):[]}const cr=e=>Number.isFinite(e)?e:void 0;class A1{constructor(){Y(this,"name","defillama");Y(this,"capabilities",["tvl","dex-volume","protocol-tvl","protocol-fees"])}async getTvlByChain(){return N1.get("chains",async()=>{const t=await ne(w1);if(!Array.isArray(t))throw new Error("defillama chains: unexpected response shape");return t.filter(n=>Number.isFinite(n.tvl)&&n.tvl>0).sort((n,r)=>r.tvl-n.tvl).map(n=>({name:n.name,tvl:n.tvl}))})}async getDexVolume(){return C1.get("overview",async()=>{const t=await ne(k1),n=t==null?void 0:t.protocols;if(!Array.isArray(n))throw new Error("defillama dexs: unexpected response shape");return n.filter(r=>Number.isFinite(r.total24h)&&(r.total24h??0)>0).map(r=>({name:r.name,volume24h:r.total24h,changePct:cr(r.change_1d)})).sort((r,s)=>s.volume24h-r.volume24h)})}async getDexVolumeHistory(t){return T1.get(Io(t),async()=>{const n=await Promise.all(t.map(r=>ne(`https://api.llama.fi/summary/dexs/${encodeURIComponent(r)}?excludeTotalDataChartBreakdown=true`).then(s=>[r,M1(s.totalDataChart)]).catch(()=>[r,[]])));return Object.fromEntries(n)})}async getProtocolTvl(){return z1.get("overview",async()=>{const t=await ne(j1);if(!Array.isArray(t))throw new Error("defillama protocols: unexpected response shape");return t.filter(n=>Number.isFinite(n.tvl)&&(n.tvl??0)>0).map(n=>({name:n.name,tvl:n.tvl,category:n.category,changePct:cr(n.change_1d)})).sort((n,r)=>r.tvl-n.tvl)})}async getProtocolTvlHistory(t){return E1.get(Io(t),async()=>{const n=await Promise.all(t.map(r=>ne(`https://api.llama.fi/protocol/${encodeURIComponent(r)}`).then(s=>[r,(s.tvl??[]).map(a=>({time:a.date*1e3,value:Number(a.totalLiquidityUSD)})).filter(a=>Number.isFinite(a.time)&&Number.isFinite(a.value))]).catch(()=>[r,[]])));return Object.fromEntries(n)})}async getProtocolFees(){return _1.get("overview",async()=>{const t=await ne(S1),n=t==null?void 0:t.protocols;if(!Array.isArray(n))throw new Error("defillama fees: unexpected response shape");return n.filter(r=>Number.isFinite(r.total24h)&&(r.total24h??0)>0).map(r=>({name:r.name,fees24h:r.total24h,changePct:cr(r.change_1d)})).sort((r,s)=>s.fees24h-r.fees24h)})}}const Lo="https://www.deribit.com/api/v2/public",P1=new ee({namespace:"zframes:deribit:summary",ttlMs:4*6e4,persist:!0}),R1=new ee({namespace:"zframes:deribit:dvol",ttlMs:9*6e4,persist:!0}),$1={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11},D1=/^[A-Z]+-(\d{1,2}[A-Z]{3}\d{2})-(\d+(?:\.\d+)?)-([CP])$/;function I1(e){const t=/^(\d{1,2})([A-Z]{3})(\d{2})$/.exec(e);if(!t)return Number.POSITIVE_INFINITY;const n=Number(t[1]),r=$1[t[2]],s=2e3+Number(t[3]);return r===void 0?Number.POSITIVE_INFINITY:Date.UTC(s,r,n,8,0,0)}class L1{constructor(){Y(this,"name","deribit");Y(this,"capabilities",["options-summary","volatility-index"])}async getOptionsSummary(t){const n=t.toUpperCase();return P1.get(n,async()=>{const r=await ne(`${Lo}/get_book_summary_by_currency?currency=${n}&kind=option`),s=r==null?void 0:r.result;if(!Array.isArray(s)||s.length===0)throw new Error("deribit options: unexpected response shape");let a=0,i=0,c=0,l=0,u=0,d=0,h=0;const m=new Map;for(const g of s){const v=D1.exec(g.instrument_name);if(!v)continue;const[,S,z,j]=v,C=Number(z),k=g.open_interest??0,w=g.volume??0,N=j==="C";N?(a+=k,c+=w):(i+=k,l+=w),Number.isFinite(g.mark_iv)&&k>0&&(u+=g.mark_iv*k,d+=k),!h&&Number.isFinite(g.underlying_price)&&(h=g.underlying_price);let E=m.get(S);E||(E=new Map,m.set(S,E));let W=E.get(C);W||(W={callOi:0,putOi:0},E.set(C,W)),N?W.callOi+=k:W.putOi+=k}const p=Date.now(),x=[...m.keys()].map(g=>({expiry:g,expiryMs:I1(g)}));x.sort((g,v)=>g.expiryMs-v.expiryMs);const b=x.find(g=>g.expiryMs>p)??x[0]??null;let y={expiry:(b==null?void 0:b.expiry)??"",expiryMs:(b==null?void 0:b.expiryMs)??0,strikes:[]};if(b){const g=m.get(b.expiry);y={expiry:b.expiry,expiryMs:b.expiryMs,strikes:[...g.entries()].map(([v,S])=>({strike:v,callOi:S.callOi,putOi:S.putOi})).sort((v,S)=>v.strike-S.strike)}}return{currency:n,underlyingPrice:h,putCallRatioOi:a>0?i/a:0,putCallRatioVolume:c>0?l/c:0,callOi:a,putOi:i,callVolume:c,putVolume:l,avgIv:d>0?u/d:0,nearestExpiry:y,asOf:Date.now()}})}async getVolatilityIndex(t,n,r){const s=t.toUpperCase();return R1.get(`${s}:${r}`,async()=>{var c;const a=await ne(`${Lo}/get_volatility_index_data?currency=${s}&start_timestamp=${n}&end_timestamp=${Date.now()}&resolution=${r}`),i=(c=a==null?void 0:a.result)==null?void 0:c.data;if(!Array.isArray(i))throw new Error("deribit dvol: unexpected response shape");return i.map(l=>({time:l[0],value:l[4]})).sort((l,u)=>l.time-u.time)})}}const F1=e=>`https://cdn.finra.org/equity/regsho/daily/CNMSshvol${e}.txt`,O1="zframes (+https://github.com/zentryhq/zframes)",U1=7,B1=60*6e4,H1=new ee({namespace:"zframes:finra:shortvol",ttlMs:B1});function V1(e){const t=e.indexOf(":");return t===-1?e:e.slice(t+1)}function Z1(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}${String(e.getUTCDate()).padStart(2,"0")}`}async function W1(e,t=15e3){const n=new Headers;typeof document>"u"&&n.set("User-Agent",O1);const r=await fetch(e,{headers:n,signal:AbortSignal.timeout(t)});if(!r.ok)throw new Error(`${e} failed: ${r.status}`);return r.text()}function Y1(e){const t=e.split(/\r?\n/),n=new Map;let r="";for(let s=1;s<t.length;s++){const a=t[s].split("|");if(a.length<5)continue;const[i,c,l,u,d]=a;if(!c)continue;const h=Number(l),m=Number(d);!Number.isFinite(h)||!Number.isFinite(m)||(!r&&/^\d{8}$/.test(i)&&(r=`${i.slice(0,4)}-${i.slice(4,6)}-${i.slice(6,8)}`),n.set(c.toUpperCase(),{date:r||i,symbol:c,shortVolume:h,shortExemptVolume:Number(u)||0,totalVolume:m,shortPct:m>0?h/m*100:0}))}if(n.size===0)throw new Error("finra: empty or unparseable short-volume file");return{date:r,bySymbol:n}}class G1{constructor(){Y(this,"name","finra");Y(this,"capabilities",["short-volume"])}async getShortVolume(t){const n=await this.loadReport(),r={};for(const s of t){const a=n.bySymbol.get(V1(s).toUpperCase());a&&(r[s]=a)}return r}loadReport(){return H1.get("latest",()=>this.fetchLatest())}async fetchLatest(){const t=Date.now();for(let n=0;n<=U1;n++){const r=new Date(t-n*864e5);try{return Y1(await W1(F1(Z1(r))))}catch{}}throw new Error("finra: no recent short-volume file found")}}const X1="wss://api.hyperliquid.xyz/ws",q1="https://api.hyperliquid.xyz/info",lr=e=>e.includes(":")?e.split(":")[0]:"";async function bn(e){return ne(q1,void 0,{init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}})}class K1{constructor(){Y(this,"name","hyperliquid");Y(this,"capabilities",["quote-stream","day-stats","funding-history","ohlcv","open-interest"]);Y(this,"ws",null);Y(this,"listeners",new Set);Y(this,"reconnectTimer",null);Y(this,"closedByUser",!1);Y(this,"wantedDexes",new Set([""]));Y(this,"subscribedDexes",new Set);Y(this,"mergedMids",{})}subscribeMids(t,n){this.listeners.add(t);for(const r of n??[])this.wantedDexes.add(lr(r));return this.ensureSocket(),this.subscribeMissingDexes(),()=>{this.listeners.delete(t),this.listeners.size===0&&this.teardown()}}async getDayStats(t){const n=new Set,r=new Set;if(!t)n.add("");else for(const i of t)i.endsWith(":*")?n.add(i.slice(0,-2)):r.add(i);const s=new Set(n);for(const i of r)s.add(lr(i));const a={};return await Promise.all([...s].map(async i=>{const c={type:"metaAndAssetCtxs"};i&&(c.dex=i);const[l,u]=await bn(c),d=n.has(i);l.universe.forEach((h,m)=>{if(!d&&!r.has(h.name))return;const p=u[m];if(!p)return;const x=Number(p.markPx),b=Number(p.prevDayPx);!Number.isFinite(x)||!Number.isFinite(b)||(a[h.name]={markPx:x,prevDayPx:b,changePct:b?(x-b)/b*100:0})})})),a}async getOpenInterest(t){const n=new Set,r=new Set;if(!t)n.add("");else for(const i of t)i.endsWith(":*")?n.add(i.slice(0,-2)):r.add(i);const s=new Set(n);for(const i of r)s.add(lr(i));const a=[];return await Promise.all([...s].map(async i=>{const c={type:"metaAndAssetCtxs"};i&&(c.dex=i);const[l,u]=await bn(c),d=n.has(i);l.universe.forEach((h,m)=>{if(!d&&!r.has(h.name))return;const p=u[m];if(!p)return;const x=Number(p.markPx),b=Number(p.openInterest);!Number.isFinite(x)||!Number.isFinite(b)||a.push({symbol:h.name,openInterestUsd:b*x})})})),a.sort((i,c)=>c.openInterestUsd-i.openInterestUsd)}async getFundingHistory(t,n){const r=await Promise.all(t.map(async s=>{const i=(await bn({type:"fundingHistory",coin:s,startTime:n})).map(c=>({time:c.time,fundingRate:Number(c.fundingRate)})).filter(c=>Number.isFinite(c.fundingRate)&&Number.isFinite(c.time));return[s,i]}));return Object.fromEntries(r)}async getCandles(t,n,r){return(await bn({type:"candleSnapshot",req:{coin:t,interval:n,startTime:r}})).map(a=>({time:a.t,open:Number(a.o),high:Number(a.h),low:Number(a.l),close:Number(a.c),volume:Number(a.v)}))}ensureSocket(){if(this.ws)return;this.closedByUser=!1,this.subscribedDexes=new Set;const t=new WebSocket(X1);this.ws=t,t.onopen=()=>{this.subscribeMissingDexes()},t.onmessage=n=>{var s;let r;try{r=JSON.parse(String(n.data))}catch{return}if(!(r.channel!=="allMids"||!((s=r.data)!=null&&s.mids))){for(const[a,i]of Object.entries(r.data.mids))this.mergedMids[a]=Number(i);for(const a of this.listeners)a(this.mergedMids)}},t.onclose=()=>{this.ws=null,!this.closedByUser&&this.listeners.size>0&&(this.reconnectTimer=setTimeout(()=>this.ensureSocket(),2e3))}}subscribeMissingDexes(){const t=this.ws;if(!(!t||t.readyState!==WebSocket.OPEN))for(const n of this.wantedDexes){if(this.subscribedDexes.has(n))continue;const r={type:"allMids"};n&&(r.dex=n),t.send(JSON.stringify({method:"subscribe",subscription:r})),this.subscribedDexes.add(n)}}teardown(){var t;this.closedByUser=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.ws)==null||t.close(),this.ws=null,this.subscribedDexes=new Set,this.mergedMids={}}}const st="https://mempool.space/api",J1=new ee({namespace:"zframes:mempool:fees",ttlMs:25e3,persist:!0}),Q1=new ee({namespace:"zframes:mempool:state",ttlMs:12e3,persist:!0}),ew=new ee({namespace:"zframes:mempool:blocks",ttlMs:25e3,persist:!0}),tw=new ee({namespace:"zframes:mempool:hashrate",ttlMs:25*6e4,persist:!0}),nw=new ee({namespace:"zframes:mempool:difficulty",ttlMs:5e4,persist:!0}),rw=new ee({namespace:"zframes:mempool:pools",ttlMs:4*6e4,persist:!0}),sw=new ee({namespace:"zframes:mempool:lightning",ttlMs:25*6e4,persist:!0});class ow{constructor(){Y(this,"name","mempool");Y(this,"capabilities",["btc-fees","btc-mempool","btc-blocks","btc-hashrate","btc-difficulty","mining-pools","lightning-stats"])}async getBtcFees(){return J1.get("latest",async()=>{const t=await ne(`${st}/v1/fees/recommended`);if(!t||typeof t.fastestFee!="number")throw new Error("mempool fees: unexpected response shape");return{fastest:t.fastestFee,halfHour:t.halfHourFee,hour:t.hourFee,economy:t.economyFee,minimum:t.minimumFee}})}async getMempoolState(){return Q1.get("latest",async()=>{const[t,n]=await Promise.all([ne(`${st}/mempool`),ne(`${st}/v1/fees/mempool-blocks`)]);if(!t||typeof t.count!="number")throw new Error("mempool state: unexpected response shape");const r=(Array.isArray(n)?n:[]).map(s=>({medianFee:s.medianFee,feeRange:Array.isArray(s.feeRange)?s.feeRange:[],totalFees:s.totalFees,nTx:s.nTx,blockVSize:s.blockVSize}));return{count:t.count,vsize:t.vsize,totalFee:t.total_fee,projected:r}})}async getBtcBlocks(t=8){return ew.get(String(t),async()=>{const n=await ne(`${st}/v1/blocks`);if(!Array.isArray(n))throw new Error("mempool blocks: unexpected response shape");return n.slice(0,t).map(r=>{var s,a,i,c,l,u;return{id:r.id,height:r.height,time:r.timestamp*1e3,txCount:r.tx_count,size:r.size,totalFees:((s=r.extras)==null?void 0:s.totalFees)??0,medianFee:((a=r.extras)==null?void 0:a.medianFee)??0,poolName:((c=(i=r.extras)==null?void 0:i.pool)==null?void 0:c.name)??"Unknown",poolSlug:((u=(l=r.extras)==null?void 0:l.pool)==null?void 0:u.slug)??"unknown"}})})}async getNetworkHashrate(t){return tw.get(t,async()=>{const n=await ne(`${st}/v1/mining/hashrate/${encodeURIComponent(t)}`);if(!n||!Array.isArray(n.hashrates))throw new Error("mempool hashrate: unexpected response shape");return{currentHashrate:n.currentHashrate,currentDifficulty:n.currentDifficulty,hashrates:n.hashrates.map(r=>({time:r.timestamp*1e3,hashrate:r.avgHashrate})),difficulty:(n.difficulty??[]).map(r=>({time:r.time*1e3,difficulty:r.difficulty}))}})}async getDifficultyAdjustment(){return nw.get("latest",async()=>{const t=await ne(`${st}/v1/difficulty-adjustment`);if(!t||typeof t.progressPercent!="number")throw new Error("mempool difficulty: unexpected response shape");return{progressPercent:t.progressPercent,difficultyChange:t.difficultyChange,previousRetarget:t.previousRetarget,remainingBlocks:t.remainingBlocks,remainingTimeMs:t.remainingTime,estimatedRetargetDate:t.estimatedRetargetDate,nextRetargetHeight:t.nextRetargetHeight,avgBlockTimeMs:t.timeAvg}})}async getMiningPools(t){return rw.get(t,async()=>{const n=await ne(`${st}/v1/mining/pools/${encodeURIComponent(t)}`);if(!n||!Array.isArray(n.pools))throw new Error("mempool pools: unexpected response shape");const r=n.blockCount||0;return{window:t,totalBlocks:r,pools:n.pools.map(s=>({name:s.name,slug:s.slug,blockCount:s.blockCount,sharePct:r>0?s.blockCount/r*100:0,rank:s.rank}))}})}async getLightningStats(){return sw.get("latest",async()=>{var r,s,a;const t=await ne(`${st}/v1/lightning/statistics/latest`),n=t==null?void 0:t.latest;if(!n||typeof n.node_count!="number")throw new Error("mempool lightning: unexpected response shape");return{nodeCount:n.node_count,channelCount:n.channel_count,totalCapacity:n.total_capacity,torNodes:n.tor_nodes,clearnetNodes:n.clearnet_nodes,medCapacity:n.med_capacity,prevNodeCount:(r=t.previous)==null?void 0:r.node_count,prevChannelCount:(s=t.previous)==null?void 0:s.channel_count,prevTotalCapacity:(a=t.previous)==null?void 0:a.total_capacity}})}}const aw={coindesk:{url:"https://www.coindesk.com/arc/outboundfeeds/rss/",source:"CoinDesk"},cointelegraph:{url:"https://cointelegraph.com/rss",source:"Cointelegraph"},decrypt:{url:"https://decrypt.co/feed",source:"Decrypt"},cnbc:{url:"https://www.cnbc.com/id/20910258/device/rss/rss.html",source:"CNBC Markets"},nasdaq:{url:"https://www.nasdaq.com/feed/rssoutbound?category=Markets",source:"Nasdaq"}},iw=e=>{const t=`(${e.join(" OR ")}) stock`;return`https://news.google.com/rss/search?q=${encodeURIComponent(t)}&hl=en-US&gl=US&ceid=US:en`},Fo={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};function Kt(e){return e.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi,(t,n)=>{const r=n.toLowerCase();if(Fo[r])return Fo[r];if(n[0]==="#"){const s=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):t}return t})}const Un=e=>e.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g,"$1");function Oo(e){return Kt(Un(e).replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function Le(e,t){const n=e.match(new RegExp(`<${t}(?:\\s[^>]*)?>([\\s\\S]*?)</${t}>`,"i"));return n?n[1]:void 0}function cw(e){const t=[...e.matchAll(/<link\b[^>]*\bhref="([^"]+)"[^>]*>/gi)];if(t.length>0){const r=t.find(s=>/rel="alternate"/i.test(s[0]))??t.find(s=>!/\brel=/i.test(s[0]))??t[0];return Kt(r[1]).trim()}const n=Le(e,"link");return n?Kt(Un(n)).trim():void 0}function St(e,t){const n=e.match(new RegExp(`\\b${t}\\s*=\\s*"([^"]*)"`,"i"));return n?Kt(n[1]).trim():void 0}const xn=e=>!!e&&/^https:\/\//i.test(e);function lw(e){var s,a;const t=(s=e.match(/<media:thumbnail\b[^>]*>/i))==null?void 0:s[0];if(t){const i=St(t,"url");if(xn(i))return i}for(const i of e.matchAll(/<media:content\b[^>]*>/gi)){const c=St(i[0],"medium"),l=St(i[0],"type"),u=c==="image"||!c&&!(l!=null&&l.match(/^(audio|video)\//i)),d=St(i[0],"url");if(u&&xn(d))return d}for(const i of e.matchAll(/<enclosure\b[^>]*>/gi)){if(!((a=St(i[0],"type"))!=null&&a.startsWith("image/")))continue;const c=St(i[0],"url");if(xn(c))return c}const n=Le(e,"content:encoded")??Le(e,"description")??Le(e,"content")??Le(e,"summary"),r=n?Un(n).match(/<img\b[^>]*\bsrc="([^"]+)"/i):null;if(r){const i=Kt(r[1]).trim();if(xn(i))return i}}function uw(e){const t=Le(e,"pubDate")??Le(e,"published")??Le(e,"updated")??Le(e,"dc:date");if(!t)return;const n=Date.parse(Un(t).trim());return Number.isFinite(n)?n:void 0}function Uo(e,t,n){const r=[...e.matchAll(/<(item|entry)\b[\s\S]*?<\/\1>/gi)].map(a=>a[0]),s=[];for(const a of r){const i=Le(a,"title"),c=cw(a);if(!i||!c)continue;const l=Oo(i);if(!l)continue;const u=Le(a,"description")??Le(a,"summary")??Le(a,"content"),d=u?Oo(u).slice(0,280):void 0,h=uw(a),m=lw(a);s.push({title:l,url:c,source:t,...d?{summary:d}:{},...h?{publishedAt:h}:{},...m?{imageUrl:m}:{}})}return s.some(a=>a.publishedAt!==void 0)&&s.sort((a,i)=>(i.publishedAt??0)-(a.publishedAt??0)),s.slice(0,n)}class dw{constructor(){Y(this,"name","news");Y(this,"capabilities",["news"])}async getNews({feed:t,symbols:n,limit:r=12}){if(t==="stocks"){const i=(n??[]).map(l=>(l.split(":").pop()??"").toUpperCase()).filter(Boolean);if(i.length===0)return[];const c=await Pr(iw(i),{proxied:!0,timeoutMs:12e3});return Uo(c,"Google News",r)}const s=aw[t];if(!s)throw new Error(`news: unknown feed "${t}"`);const a=await Pr(s.url,{proxied:!0,timeoutMs:12e3});return Uo(a,s.source,r)}}const mw="https://markets.newyorkfed.org/api/rates/all/latest.json",fw={SOFR:"SOFR",SOFRAI:"SOFR averages",EFFR:"Effective fed funds",OBFR:"Overnight bank funding",TGCR:"Tri-party repo",BGCR:"Broad general collateral"},Bo=["EFFR","SOFR","TGCR","BGCR","OBFR","SOFRAI"],hw=new ee({namespace:"zframes:nyfed:rates",ttlMs:12*6e4,persist:!0,revive:e=>Array.isArray(e)?e:null});function pt(e){const t=Number(e);return Number.isFinite(t)?t:null}function pw(e,t){const n=Bo.indexOf(e.code),r=Bo.indexOf(t.code);return(n===-1?99:n)-(r===-1?99:r)}class gw{constructor(){Y(this,"name","nyfed");Y(this,"capabilities",["reference-rates"])}async getReferenceRates(){return hw.get("latest",async()=>{const t=await ne(mw);if(!Array.isArray(t==null?void 0:t.refRates))throw new Error("ny fed rates: unexpected response shape");return t.refRates.map(n=>{const r=String(n.type??""),s=pt(n.percentRate??n.average30day);if(!r||!n.effectiveDate||s===null)return null;const a={code:r,label:fw[r]??r,date:n.effectiveDate,rate:s,source:"New York Fed"},i=pt(n.volumeInBillions),c=pt(n.targetRateFrom),l=pt(n.targetRateTo),u=pt(n.average30day),d=pt(n.average90day),h=pt(n.average180day);return i!==null&&(a.volumeInBillions=i),c!==null&&(a.targetRateFrom=c),l!==null&&(a.targetRateTo=l),u!==null&&(a.average30Day=u),d!==null&&(a.average90Day=d),h!==null&&(a.average180Day=h),a}).filter(n=>n!==null).sort(pw)})}}const bw="https://www.financialresearch.gov/financial-stress-index/data/fsi.csv",xw=60*6e4,yw=new ee({namespace:"zframes:ofr:fsi",ttlMs:xw}),vw=[[2,"Credit"],[3,"Equity valuation"],[4,"Safe assets"],[5,"Funding"],[6,"Volatility"]];function Ho(e){const t=Number(e);return Number.isFinite(t)?t:null}function ww(e){const t=e.split(/\r?\n/),n=[];let r=null;for(let i=1;i<t.length;i++){const c=t[i].split(",");if(c.length<7)continue;const l=c[0],u=Ho(c[1]),d=Date.parse(`${l}T00:00:00Z`);!l||u===null||!Number.isFinite(d)||(n.push({time:d,date:l,value:u}),r=c)}if(!r||n.length===0)throw new Error("ofr fsi: empty or unparseable CSV");const s=n[n.length-1],a=vw.map(([i,c])=>({label:c,value:Ho(r[i])??0}));return{value:s.value,date:s.date,categories:a,trend:n.slice(-90),source:"OFR"}}class kw{constructor(){Y(this,"name","ofr");Y(this,"capabilities",["financial-stress"])}async getFinancialStress(){return yw.get("latest",()=>Pr(bw,{proxied:!0}).then(ww))}}const Sw={A:1090872,AAPL:320193,ABBV:1551152,ABEV:1565025,ABNB:1559720,ABT:1800,ACGL:947484,ACN:1467373,ADBE:796343,ADI:6281,ADM:7084,ADP:8670,ADSK:769397,AEE:1002910,AEM:2809,AEP:4904,AFL:4977,AIG:5272,AJG:354190,ALAB:1736297,ALC:1167379,ALL:899051,ALNY:1178670,AMAT:6951,AMD:2488,AME:1037868,AMGN:318154,AMP:820027,AMRZ:2035989,AMT:1053507,AMX:1129137,AMZN:1018724,ANET:1596532,AON:315293,APD:2969,APH:820313,APO:1858681,APP:1751008,ARES:1176948,ARGX:1697862,ARM:1973239,ASML:937966,ASTS:1780312,ASX:1122411,ATEYY:1158838,ATO:731802,AU:1973832,AVGO:1730168,AXON:1069183,AXP:4962,AZN:901832,AZO:866787,B:756894,BA:12927,BABA:1577552,BAC:70858,BAESY:895564,BAM:1937926,BBD:1160330,BBVA:842180,BCS:312069,BDX:10795,BE:1664703,BHP:811809,BIDU:1329099,BIIB:875045,BKNG:1075531,BKR:1701605,BLK:2012383,BMO:927971,BMWKY:1446250,BMY:14272,BN:1001085,BNS:9631,BNY:1390777,BP:313807,"BRK-A":1067983,"BRK-B":1067983,BSBR:1471055,BSX:885725,BTI:1303523,BUD:1668717,BX:1393818,C:831001,CAH:721371,CARR:1783180,CAT:18230,CB:896159,CBOE:1374310,CBRE:1138118,CBRS:2021728,CCEP:1650107,CCI:1051470,CCJ:1009001,CCL:815097,CDNS:813672,CEG:1868275,CHT:1132924,CI:1739940,CIEN:936395,CKHGF:1469059,CL:21665,CLS:1030894,CM:1045520,CMCSA:1166691,CME:1156375,CMG:1058090,CMI:26172,CNC:1071739,CNI:16868,CNQ:1017413,COF:927628,COHR:820318,COIN:1679788,COP:1163165,COR:1140859,COST:909832,CP:16875,CPRT:900075,CQP:1383650,CRDO:1807794,CRH:849395,CRM:1108524,CRWD:1535527,CRWV:1769628,CSCO:858877,CSLLY:1274152,CSX:277948,CTAS:723254,CTVA:1755672,CVE:1475260,CVNA:1690820,CVS:64803,CVX:93410,CYATY:2070829,D:715957,DAL:27904,DASH:1792789,DB:1159508,DDOG:1561550,DE:315189,DELL:1571996,DEO:835403,DHI:882184,DHR:313616,DIA:1041130,DIS:1744489,DLMAY:2073893,DLR:1297996,DOV:29905,DTE:936340,DTEGY:946770,DUK:1326160,DVN:1090012,E:1002242,EA:712515,EBAY:1065088,EC:1444406,ECL:31462,ED:1047862,EIX:827052,EL:1001250,ELV:1156039,EME:105634,EMR:32604,ENB:895728,EOG:821189,EONGY:1136808,EPD:1061219,EQIX:1101239,EQNR:1140625,EQT:33213,ERIC:717826,ESLT:1027664,ET:1276187,ETN:1551182,ETR:65984,EW:1099800,EXC:1109357,EXR:1289490,F:37996,FANG:1539838,FAST:815556,FCX:831259,FDX:1048911,FER:1468522,FERG:2011641,FISV:798354,FITB:35527,FIX:1035983,FLEX:866374,FMX:1061736,FNV:1456346,FOX:1754301,FOXA:1754301,FRFHF:915191,FSLR:1274494,FTNT:1262039,FTS:1666175,GALDY:2021390,GD:40533,GE:40545,GEHC:1932393,GEV:1996810,GFI:1172724,GFS:1709048,GILD:882095,GLD:1222333,GLW:24741,GM:1467858,GOOG:1652044,GOOGL:1652044,GRMN:1121788,GS:886982,GSK:1131399,GWLIF:850918,GWW:277135,HAL:45012,HBAN:49196,HCA:860730,HD:354950,HDB:1144967,HEI:46619,HIG:874766,HLN:1900304,HLT:1585689,HMC:715153,HON:773840,HOOD:1783879,HPE:1645590,HSBC:1089113,HSY:47111,HTHIY:47710,HUM:49071,HWM:4281,IBKR:1381197,IBM:51143,IBN:1103838,ICE:1571949,IDXX:874716,IFNNY:1107457,IMO:49938,INFY:1067491,ING:1039765,INTC:50863,INTU:896878,IQV:1478242,IR:1699150,IRM:1020569,ISRG:1035267,ITUB:1132597,ITW:49826,IX:1070304,JBL:898293,JCI:833444,JD:1549802,JHPCY:2071868,JNJ:200406,JPM:19617,KB:1445930,KBGGY:1535759,KDP:1418135,KEYS:1601046,KGC:701818,KKR:1404912,KLAC:319201,KMB:55785,KMI:1506307,KO:21344,KR:56873,KVUE:1944048,KXIAY:2053383,LHX:202058,LIN:1707925,LITE:1633978,LLY:59478,LMT:936468,LNG:3570,LOW:60667,LRCX:707549,LSEGY:1842726,LVS:1300514,LYG:1160106,LYV:1335258,MA:1141391,MAR:1048286,MCD:63908,MCHP:827054,MCK:927653,MCO:1059556,MDLN:2046386,MDLZ:1103982,MDT:1613103,MELI:1099590,MET:1099219,META:1326801,MFC:1086888,MFG:1335730,MGCLY:2039784,MLM:916076,MMM:66740,MNST:865752,MO:764180,MPC:1510295,MPLX:1552e3,MPWR:1280452,MRK:310158,MRSH:62709,MRVL:1835632,MS:895421,MSCI:1408198,MSFT:789019,MSI:68505,MSTR:1050446,MT:1243429,MTB:36270,MTZ:15615,MU:723125,MUFG:67088,NBIS:1513845,NDAQ:1120193,NEE:753308,NEM:1164727,NET:1477333,NFLX:1065280,NGG:1004315,NKE:320187,NOC:1133421,NOK:924613,NOW:1373715,NSC:702165,NTAP:1002047,NTES:1110646,NTR:1725964,NTRA:1604821,NTRS:73124,NU:1691493,NUE:73309,NVDA:1045810,NVO:353278,NVS:1114448,NWG:844150,NWS:1564708,NWSA:1564708,NXPI:1413447,O:726728,ODFL:878927,OKE:1039684,ON:1097864,ORCL:1341439,ORLY:898173,OXY:797468,PANW:1327567,PAYX:723531,PBA:1546066,PBR:1119639,PCAR:75362,PCG:1004980,PDD:1737806,PEG:788784,PEP:77476,PFE:78003,PG:80424,PGR:80661,PH:76334,PLD:1045609,PLTR:1321655,PM:1413329,PNC:713676,PRU:1137774,PSA:1393311,PSX:1534701,PUK:1116578,PWR:1050915,PYPL:1633917,Q:2058873,QCOM:804328,QQQ:1067839,QSR:1618756,RACE:1648416,RBLX:1315098,RCL:884887,RDDT:1713445,REGN:872589,RELX:929869,RIO:863064,RJF:720005,RKLB:1819994,RKT:1805284,RMD:943819,ROK:1024478,ROP:882835,ROST:745732,RPRX:1802768,RSG:1060391,RSHGY:1447391,RTNTF:887028,RTX:101829,RVMD:1628171,RY:1000275,RYAAY:1038683,SAN:891478,SAP:1000184,SATS:1415404,SBUX:829224,SCCO:1001838,SCHW:316709,SCMWY:1069336,SE:1703399,SHEL:1306965,SHG:1263043,SHOP:1594805,SHW:89800,SLB:87347,SLF:1097362,SLV:1330568,SMERY:1830056,SMFG:1022837,SNDK:2023554,SNHIY:2098326,SNOW:1640147,SNPS:883241,SNY:1121404,SO:92122,SONY:313838,SPG:1063761,SPGI:64040,SPOT:1639920,SPY:884394,SRE:1032208,STLD:1022671,STM:932787,STT:93751,STX:1137789,SU:311337,SUNB:2083785,SYK:310764,SYY:96021,T:732717,TAK:1395064,TCOM:1269238,TD:947263,TDG:1260221,TECK:886986,TEL:1385157,TER:97210,TEVA:818686,TFC:92230,TGT:27419,TJX:109198,TKO:1973266,TM:1094517,TMO:97745,TMUS:1283699,TPR:1116132,TRGP:1389170,TRI:1075124,TRMOY:2071881,TRP:1232384,TRV:86312,TS:1190723,TSLA:1318605,TT:1466258,TTE:879764,TTWO:946581,TWLO:1447669,TXN:97476,TYHOY:2018139,UA:1336917,UAA:1336917,UAL:100517,UBER:1543151,UBS:1610520,UI:1511737,UL:217410,UMC:1033767,UNH:731766,UNP:100885,UPS:1090727,URI:1067701,USB:36104,V:1403161,VALE:917851,VG:2007855,VICI:1705696,VIK:1745201,VLO:1035002,VMC:1396009,VOD:839923,VRT:1674101,VRTX:875320,VST:1692819,VTR:740260,VZ:732712,WAB:943452,WAT:1000697,WBD:1437107,WCN:1318220,WDAY:1327811,WDC:106040,WEC:783325,WELL:766704,WFC:72971,WM:823768,WMB:107263,WMT:104169,WPM:1323404,XEL:72903,XOM:34088,XYZ:1512673,YUM:1041061,ZM:1585521,ZTS:1555280};function Rr(e){return String(e).replace(/\D/g,"").padStart(10,"0")}function Vo(e){const t=e.trim(),n=/^cik[-\s]?(\d{1,10})$/i.exec(t)??/^(\d{1,10})$/.exec(t);if(n)return n[1].padStart(10,"0");const r=(t.includes(":")?t.slice(t.lastIndexOf(":")+1):t).toUpperCase().replace(/[^A-Z0-9.-]/g,""),s=Sw[r];return s===void 0?null:Rr(s)}const jw=e=>`https://data.sec.gov/submissions/CIK${e}.json`,Nw=e=>`https://data.sec.gov/api/xbrl/companyfacts/CIK${e}.json`,ll=15*6e4,Cw=new ee({namespace:"zframes:sec:filings",ttlMs:ll}),zw=new ee({namespace:"zframes:sec:facts",ttlMs:ll});function _w(e,t,n){const r=String(Number(e)),s=t.replace(/-/g,""),a=`https://www.sec.gov/Archives/edgar/data/${r}/${s}`;return n?`${a}/${n}`:`${a}/`}const Tw=[{label:"Revenue",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["RevenueFromContractWithCustomerExcludingAssessedTax","Revenues","SalesRevenueNet"]},{label:"Net income",unit:"USD",taxonomy:"us-gaap",kind:"flow",concepts:["NetIncomeLoss"]},{label:"Total assets",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["Assets"]},{label:"Shareholders' equity",unit:"USD",taxonomy:"us-gaap",kind:"instant",concepts:["StockholdersEquity"]},{label:"Diluted EPS",unit:"USD/shares",taxonomy:"us-gaap",kind:"flow",concepts:["EarningsPerShareDiluted","EarningsPerShareBasic"]},{label:"Shares outstanding",unit:"shares",taxonomy:"dei",kind:"instant",concepts:["EntityCommonStockSharesOutstanding"]}];function Ew(e){return e.fy?e.fp==="FY"?`FY${e.fy}`:`${e.fp??""} ${e.fy}`.trim():e.end??""}function Mw(e,t){const n=e.filter(s=>s.end&&s.form&&Number.isFinite(s.val));return(t==="flow"&&n.some(s=>s.fp==="FY")?n.filter(s=>s.fp==="FY"):n).reduce((s,a)=>!s||a.end>s.end?a:s,null)}function Aw(e){var n,r;if(!e)return[];const t=[];for(const s of Tw){const a=e[s.taxonomy];if(!a)continue;let i=null;for(const c of s.concepts){const l=(r=(n=a[c])==null?void 0:n.units)==null?void 0:r[s.unit];if(!(l!=null&&l.length))continue;const u=Mw(l,s.kind);u&&(!i||u.end>i.end)&&(i=u)}i&&t.push({label:s.label,value:i.val,unit:s.unit,end:i.end,fiscalPeriod:Ew(i),form:i.form})}return t}class Pw{constructor(t){Y(this,"name","sec");Y(this,"capabilities",["filings","fundamentals"]);this.contact=t}nodeInit(){return this.contact&&typeof document>"u"?{init:{headers:{"User-Agent":`zframes (${this.contact})`}}}:void 0}async getCompanyFacts(t){const n=Vo(t);if(!n)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return zw.get(n,()=>this.fetchCompanyFacts(n))}async fetchCompanyFacts(t){const n=await ne(Nw(t),void 0,{proxied:!0,...this.nodeInit()}),r=Aw(n.facts);if(r.length===0)throw new Error("sec companyfacts: no headline metrics found");return{cik:Rr(n.cik??t),entityName:n.entityName??"",metrics:r}}async getCompanyFilings(t){const n=Vo(t);if(!n)throw new Error(`sec: unknown ticker "${t}" — not in the bundled map; pass a CIK (e.g. "320193") instead`);return Cw.get(n,()=>this.fetchFilings(n))}async fetchFilings(t){var i,c,l,u,d,h,m;const n=await ne(jw(t),void 0,this.nodeInit()),r=(i=n.filings)==null?void 0:i.recent;if(!r||!Array.isArray(r.accessionNumber))throw new Error("sec submissions: unexpected response shape");const s=r.accessionNumber.length,a=[];for(let p=0;p<s;p++){const x=r.accessionNumber[p],b=(c=r.form)==null?void 0:c[p],y=(l=r.filingDate)==null?void 0:l[p];if(!x||!b||!y)continue;const g=(u=r.reportDate)==null?void 0:u[p],v=(d=r.primaryDocDescription)==null?void 0:d[p],S=(h=r.items)==null?void 0:h[p];a.push({form:b,filingDate:y,accessionNumber:x,url:_w(t,x,(m=r.primaryDocument)==null?void 0:m[p]),...g?{reportDate:g}:{},...v?{description:v}:{},...S?{items:S}:{}})}return{cik:Rr(n.cik??t),name:n.name??"",tickers:n.tickers??[],exchanges:n.exchanges??[],filings:a,...n.sic?{sic:n.sic}:{},...n.sicDescription?{sicDescription:n.sicDescription}:{},...n.category?{category:n.category}:{},...n.fiscalYearEnd?{fiscalYearEnd:n.fiscalYearEnd}:{}}}}const Rw="https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?sort=-record_date&page%5Bsize%5D=20&format=json",$w=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?sort=-record_date&page%5Bsize%5D=${e}&format=json`,Dw=e=>`https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?sort=-auction_date&filter=bid_to_cover_ratio:gt:0&fields=auction_date,security_type,security_term,high_yield,high_discnt_rate,high_investment_rate,bid_to_cover_ratio,offering_amt,total_accepted&page%5Bsize%5D=${e}&format=json`,Iw=e=>`https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value_month=${e}`,Lw="zframes (+https://github.com/zentryhq/zframes)",Bn=180*6e4,Fw=new ee({namespace:"zframes:treasury:yield-curve",ttlMs:Bn,persist:!0}),Ow=new ee({namespace:"zframes:treasury:avg-rates",ttlMs:Bn,persist:!0}),Uw=new ee({namespace:"zframes:treasury:national-debt",ttlMs:Bn,persist:!0}),Bw=new ee({namespace:"zframes:treasury:auctions",ttlMs:Bn,persist:!0}),Hw=[["BC_1MONTH","1M",1],["BC_2MONTH","2M",2],["BC_3MONTH","3M",3],["BC_4MONTH","4M",4],["BC_6MONTH","6M",6],["BC_1YEAR","1Y",12],["BC_2YEAR","2Y",24],["BC_3YEAR","3Y",36],["BC_5YEAR","5Y",60],["BC_7YEAR","7Y",84],["BC_10YEAR","10Y",120],["BC_20YEAR","20Y",240],["BC_30YEAR","30Y",360]];function Ge(e){const t=Number(e);return Number.isFinite(t)?t:null}async function Vw(e,t=15e3){const n=new Headers;typeof document>"u"&&n.set("User-Agent",Lw);const r=await fetch(e,{headers:n,signal:AbortSignal.timeout(t)});if(!r.ok)throw new Error(`${e} failed: ${r.status}`);return r.text()}function Zw(e){return`${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,"0")}`}function Ww(e){const t=e.match(/<m:properties>[\s\S]*?<\/m:properties>/g);if(!(t!=null&&t.length))return null;let n=null;for(const s of t){const a=/<d:NEW_DATE[^>]*>([^<]+)<\/d:NEW_DATE>/.exec(s);if(!a)continue;const i=a[1].slice(0,10);(!n||i>n.date)&&(n={date:i,raw:s})}if(!n)return null;const r=[];for(const[s,a,i]of Hw){const c=new RegExp(`<d:${s}[^>]*>([^<]*)</d:${s}>`).exec(n.raw),l=c?Number(c[1]):NaN;Number.isFinite(l)&&r.push({label:a,months:i,rate:l})}return r.length?{date:n.date,points:r}:null}class Yw{constructor(){Y(this,"name","treasury");Y(this,"capabilities",["treasury-rates","yield-curve","treasury-auctions","national-debt"])}async getYieldCurve(){return Fw.get("latest",()=>this.fetchYieldCurve())}async fetchYieldCurve(){const t=new Date;for(let n=0;n<=1;n++){const r=new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()-n,1)),s=await Vw(Iw(Zw(r))).catch(()=>""),a=Ww(s);if(a)return a}throw new Error("treasury yield curve: no recent data")}async getTreasuryAverageRates(){return Ow.get("latest",()=>this.fetchTreasuryAverageRates())}async fetchTreasuryAverageRates(){var r;const t=await ne(Rw);if(!Array.isArray(t==null?void 0:t.data))throw new Error("treasury average rates: unexpected response shape");const n=(r=t.data.find(s=>s.record_date))==null?void 0:r.record_date;return n?t.data.filter(s=>s.record_date===n).map(s=>{const a=Ge(s.avg_interest_rate_amt);return a===null||!s.security_type_desc||!s.security_desc?null:{date:n,securityType:s.security_type_desc,security:s.security_desc,rate:a}}).filter(s=>s!==null):[]}async getNationalDebt(t=180){return Uw.get(String(t),()=>this.fetchNationalDebt(t))}async fetchNationalDebt(t){const n=Math.max(2,Math.min(t,400)),r=await ne($w(n),void 0,{proxied:!0});if(!Array.isArray(r==null?void 0:r.data)||r.data.length===0)throw new Error("treasury debt to the penny: unexpected response shape");const s=[];for(let i=r.data.length-1;i>=0;i--){const c=r.data[i],l=Ge(c.tot_pub_debt_out_amt),u=Date.parse(`${c.record_date}T00:00:00Z`);!c.record_date||l===null||!Number.isFinite(u)||s.push({time:u,date:c.record_date,total:l})}if(s.length===0)throw new Error("treasury debt to the penny: no usable rows");const a=r.data[0];return{date:a.record_date??s[s.length-1].date,total:Ge(a.tot_pub_debt_out_amt)??s[s.length-1].total,heldByPublic:Ge(a.debt_held_public_amt)??0,intragovernmental:Ge(a.intragov_hold_amt)??0,trend:s}}async getTreasuryAuctions(t=8){return Bw.get(String(t),()=>this.fetchTreasuryAuctions(t))}async fetchTreasuryAuctions(t){const n=Math.max(1,Math.min(t,30)),r=await ne(Dw(n),void 0,{proxied:!0});if(!Array.isArray(r==null?void 0:r.data))throw new Error("treasury auctions: unexpected response shape");return r.data.map(s=>{if(!s.auction_date||!s.security_type)return null;const a=Ge(s.high_yield)??Ge(s.high_investment_rate);return{auctionDate:s.auction_date,securityType:s.security_type,securityTerm:s.security_term??"",rate:a,bidToCover:Ge(s.bid_to_cover_ratio),offeringAmount:Ge(s.offering_amt),totalAccepted:Ge(s.total_accepted)}}).filter(s=>s!==null)}}const Gw=["https://ethereum-rpc.publicnode.com","https://rpc.ankr.com/eth"],Xw="https://api.coingecko.com/api/v3/simple/price",qw="0x70a08231",Kw=1,Jw={symbol:"ETH",address:null,decimals:18,cgId:"ethereum"},$r=[Jw,{symbol:"USDC",address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,cgId:"usd-coin"},{symbol:"USDT",address:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,cgId:"tether"},{symbol:"DAI",address:"0x6B175474E89094C44Da98b954EedeAC495271d0F",decimals:18,cgId:"dai"},{symbol:"WETH",address:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",decimals:18,cgId:"weth"},{symbol:"WBTC",address:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",decimals:8,cgId:"wrapped-bitcoin"},{symbol:"LINK",address:"0x514910771AF9Ca656af840dff83E8264EcF986CA",decimals:18,cgId:"chainlink"},{symbol:"UNI",address:"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",decimals:18,cgId:"uniswap"},{symbol:"AAVE",address:"0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9",decimals:18,cgId:"aave"},{symbol:"LDO",address:"0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32",decimals:18,cgId:"lido-dao"},{symbol:"MKR",address:"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2",decimals:18,cgId:"maker"},{symbol:"CRV",address:"0xD533a949740bb3306d119CC777fa900bA034cd52",decimals:18,cgId:"curve-dao-token"},{symbol:"SHIB",address:"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",decimals:18,cgId:"shiba-inu"},{symbol:"PEPE",address:"0x6982508145454Ce325dDbE47a25d4ec3d2311933",decimals:18,cgId:"pepe"}],Zo=/^0x[0-9a-fA-F]{40}$/;async function Qw(e){const t=e.trim();if(Zo.test(t))return t;try{const n=await ne(`https://api.ensideas.com/ens/resolve/${encodeURIComponent(t)}`);if(n.address&&Zo.test(n.address))return n.address}catch{}throw new Error(`couldn't resolve address: ${t}`)}function e2(e){return`${qw}000000000000000000000000${e.slice(2).toLowerCase()}`}function t2(e,t){if(!e||e==="0x")return 0;try{return Number(BigInt(e))/10**t}catch{return 0}}async function n2(e){const t=$r.map((c,l)=>c.address===null?{jsonrpc:"2.0",id:l,method:"eth_getBalance",params:[e,"latest"]}:{jsonrpc:"2.0",id:l,method:"eth_call",params:[{to:c.address,data:e2(e)},"latest"]}),n=JSON.stringify(t);let r=null,s;for(const c of Gw)try{const l=await fetch(c,{method:"POST",headers:{"content-type":"application/json"},body:n,signal:AbortSignal.timeout(12e3)});if(!l.ok)throw new Error(`rpc ${l.status}`);r=await l.json();break}catch(l){s=l}if(!r)throw new Error(`all RPC endpoints failed: ${String(s)}`);const a=new Map;for(const c of r)c.result&&a.set(c.id,c.result);const i=new Map;return $r.forEach((c,l)=>{const u=t2(a.get(l),c.decimals);u>0&&i.set(c.symbol,u)}),i}async function r2(e){if(e.length===0)return{};const t=`${Xw}?ids=${e.join(",")}&vs_currencies=usd&include_24hr_change=true`;return ne(t)}function s2(e){return`${e.slice(0,6)}…${e.slice(-4)}`}const o2=new ee({namespace:"zframes:wallet:portfolio",ttlMs:45e3,persist:!1});class a2{constructor(){Y(this,"name","On-chain wallet");Y(this,"capabilities",["portfolio"]);Y(this,"portfolioKinds",["wallet"])}async getPortfolio(t){if(t.kind!=="wallet"||!t.address)throw new Error("wallet provider needs a wallet source with an address");return o2.get(t.address,async()=>{const n=await Qw(t.address),r=await n2(n),s=$r.filter(l=>r.has(l.symbol)),a=await r2(s.map(l=>l.cgId)),i=s.map(l=>{var m,p;const u=r.get(l.symbol)??0,d=(m=a[l.cgId])==null?void 0:m.usd,h=d!==void 0?u*d:void 0;return{symbol:l.symbol,amount:u,valueUsd:h,changePct24h:(p=a[l.cgId])==null?void 0:p.usd_24h_change}}).filter(l=>l.valueUsd!==void 0&&l.valueUsd>=Kw).sort((l,u)=>(u.valueUsd??0)-(l.valueUsd??0)),c=i.reduce((l,u)=>l+(u.valueUsd??0),0);return{source:"wallet",label:s2(n),holdings:i,totalUsd:c,asOf:Date.now()}})}}const i2=f.lazy(()=>Qo(()=>import("./index-DPlG_EDx.js"),__vite__mapDeps([0,1]))),c2="/unicornStudio.umd.mjs",Wo="invert(1) hue-rotate(180deg) saturate(1.25)",l2="opacity 0.5s var(--zf-ease-out), filter 0.5s var(--zf-ease-out)",u2=e=>Math.min(.42,e*2.4),ul=242,d2=e=>{const t=((e-ul)%360+360)%360;return t>180?t-360:t},dl=90,m2=e=>Math.round(e/dl*1e3)/1e3;function f2({background:e,active:t=!1,thinking:n=!1,accentHue:r=ul,accentSat:s=dl}){if(e.type!=="unicorn"||!e.projectId)return null;const a=d2(r),i=m2(s),c=[a===0?"":`hue-rotate(${a}deg)`,i===1?"":`saturate(${i})`].filter(Boolean).join(" "),l=c||"none",u=c?`${c} ${Wo}`:Wo;return o.jsx("div",{"aria-hidden":!0,style:{position:"fixed",inset:0,zIndex:0,overflow:"hidden",pointerEvents:"none"},children:o.jsx("div",{style:{position:"absolute",inset:0,opacity:t?u2(e.opacity):e.opacity,filter:t?u:l,transition:l2,willChange:"opacity, filter"},children:o.jsx("div",{className:n?"zf-bg-hue":void 0,style:{position:"absolute",inset:0},children:o.jsx("div",{className:n?"zf-bg-breathe":void 0,style:{position:"absolute",inset:0},children:o.jsx(f.Suspense,{fallback:null,children:o.jsx(i2,{projectId:e.projectId,width:"100vw",height:"100vh",scale:e.scale,dpi:e.dpi,sdkUrl:c2})})})})})})}const h2=["xyz:*"],p2=200,g2="var(--zf-up, #3fd08f)",b2="var(--zf-down, #ff6b81)";function x2(e){return e>=1e3?`$${e.toLocaleString("en-US",{maximumFractionDigits:0})}`:e>=1?`$${e.toLocaleString("en-US",{maximumFractionDigits:2})}`:`$${e.toPrecision(4)}`}const y2=`
|
|
438
|
-
.zf-tape {
|
|
439
|
-
position: fixed;
|
|
440
|
-
left: 0;
|
|
441
|
-
right: 0;
|
|
442
|
-
bottom: 0;
|
|
443
|
-
z-index: 30;
|
|
444
|
-
height: 36px;
|
|
445
|
-
display: flex;
|
|
446
|
-
align-items: center;
|
|
447
|
-
overflow: hidden;
|
|
448
|
-
background: rgba(10, 11, 17, 0.86);
|
|
449
|
-
backdrop-filter: blur(10px);
|
|
450
|
-
-webkit-backdrop-filter: blur(10px);
|
|
451
|
-
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
452
|
-
font-family: var(--font-dmsans, system-ui, sans-serif);
|
|
453
|
-
-webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
|
|
454
|
-
mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
|
|
455
|
-
}
|
|
456
|
-
.zf-tape-track {
|
|
457
|
-
display: flex;
|
|
458
|
-
flex-shrink: 0;
|
|
459
|
-
align-items: center;
|
|
460
|
-
white-space: nowrap;
|
|
461
|
-
will-change: transform;
|
|
462
|
-
animation-name: zf-tape-scroll;
|
|
463
|
-
animation-timing-function: linear;
|
|
464
|
-
animation-iteration-count: infinite;
|
|
465
|
-
}
|
|
466
|
-
.zf-tape:hover .zf-tape-track { animation-play-state: paused; }
|
|
467
|
-
.zf-tape-item {
|
|
468
|
-
display: inline-flex;
|
|
469
|
-
align-items: center;
|
|
470
|
-
gap: 7px;
|
|
471
|
-
padding: 0 15px;
|
|
472
|
-
border-right: 1px solid rgba(255, 255, 255, 0.06);
|
|
473
|
-
font-size: 12px;
|
|
474
|
-
line-height: 1;
|
|
475
|
-
}
|
|
476
|
-
.zf-tape-sym { font-weight: 700; color: rgba(255, 255, 255, 0.92); letter-spacing: 0.02em; }
|
|
477
|
-
.zf-tape-px { color: rgba(255, 255, 255, 0.58); font-variant-numeric: tabular-nums; }
|
|
478
|
-
.zf-tape-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
479
|
-
@keyframes zf-tape-scroll {
|
|
480
|
-
from { transform: translateX(0); }
|
|
481
|
-
to { transform: translateX(-50%); }
|
|
482
|
-
}
|
|
483
|
-
@media (prefers-reduced-motion: reduce) {
|
|
484
|
-
.zf-tape { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
|
|
485
|
-
.zf-tape-track { animation: none; }
|
|
486
|
-
}
|
|
487
|
-
`;function v2(){const e=Yt(h2,6e4),t=Yt(void 0,6e4),{symbols:n,stats:r}=f.useMemo(()=>{const c=u=>Object.entries(u).filter(([,d])=>d.markPx>0&&d.prevDayPx>0).map(([d])=>d).sort();return{symbols:[...c(e),...c(t)].slice(0,p2),stats:{...t,...e}}},[e,t]),s=Pt(n);if(n.length===0)return null;const a=Math.max(40,n.length*2.2),i=c=>n.map(l=>{const u=r[l];if(!u)return null;const d=s[l]??u.markPx,h=u.changePct>=0?g2:b2,m=u.changePct>=0?"+":"";return o.jsxs("span",{className:"zf-tape-item",children:[o.jsx(Fe,{symbol:l,size:15}),o.jsx("span",{className:"zf-tape-sym",children:ae(l)}),o.jsx("span",{className:"zf-tape-px",children:x2(d)}),o.jsxs("span",{className:"zf-tape-chg",style:{color:h},children:[m,u.changePct.toFixed(2),"%"]})]},`${c}-${l}`)});return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:y2}),o.jsx("div",{className:"zf-tape","aria-label":"live ticker tape",children:o.jsxs("div",{className:"zf-tape-track",style:{animationDuration:`${a}s`},children:[i("a"),o.jsx("span",{"aria-hidden":!0,style:{display:"contents"},children:i("b")})]})})]})}const Yo="(max-width: 640px)";function w2(){const[e,t]=f.useState(()=>window.matchMedia(Yo).matches);return f.useEffect(()=>{const n=window.matchMedia(Yo),r=()=>t(n.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const k2="/unicornStudio.legacy.umd.mjs";let jt=null;function S2(){return typeof window>"u"||typeof document>"u"?Promise.reject(new Error("UnicornStudio needs a browser")):jt||(jt=(async()=>{const t=`const module={exports:{}};const exports=module.exports;
|
|
488
|
-
`+await fetch(k2).then(r=>{if(!r.ok)throw new Error(`failed to load UnicornStudio (${r.status})`);return r.text()})+`
|
|
489
|
-
export default module.exports;`,n=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));try{const s=(await import(n)).default;if(!(s!=null&&s.addScene))throw new Error("UnicornStudio engine missing addScene");return s}finally{URL.revokeObjectURL(n)}})(),jt.catch(()=>{jt=null}),jt)}class j2{constructor(t){Y(this,"_url");this._raw=t;const n=URL.createObjectURL(new Blob([JSON.stringify(this._raw)],{type:"application/json"}));this._url=n}get url(){return this._url}}const Go=new j2({history:[{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"gradient",usesPingPong:!1,speed:.25,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
490
|
-
precision highp float;in vec2 vTextureCoord;uniform vec2 uMousePos;vec3 getColor(int index) { switch(index) { case 0: return vec3(1, 1, 1); case 1: return vec3(0, 0, 0); case 2: return vec3(0, 0, 0); case 3: return vec3(0, 0, 0); case 4: return vec3(0, 0, 0); case 5: return vec3(0, 0, 0); case 6: return vec3(0, 0, 0); case 7: return vec3(0, 0, 0); case 8: return vec3(0, 0, 0); case 9: return vec3(0, 0, 0); case 10: return vec3(0, 0, 0); case 11: return vec3(0, 0, 0); case 12: return vec3(0, 0, 0); case 13: return vec3(0, 0, 0); case 14: return vec3(0, 0, 0); case 15: return vec3(0, 0, 0); default: return vec3(0.0); } }const float PI = 3.14159265;vec2 rotate(vec2 coord, float angle) { float s = sin(angle); float c = cos(angle); return vec2( coord.x * c - coord.y * s, coord.x * s + coord.y * c ); }out vec4 fragColor;vec3 getColor(vec2 uv) {return vec3(1, 1, 1); }void main() {vec2 uv = vTextureCoord; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); uv -= pos; uv /= (0.5000*2.); uv = rotate(uv, (0.0000 - 0.5) * 2. * PI); vec4 color = vec4(getColor(uv), 1.); fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
491
|
-
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = aTextureCoord; }`],data:{downSample:.5,depth:!1,uniforms:{},isBackground:!0},id:"effect"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0793650793650795,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"NORMAL",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.49660178547135064,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.35409161821999585,leftMode:"relative",top:.6850280273460352,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.49660178547135064,0],[.49660178547135064,.4600869483043395],[0,.4600869483043395]],fill:["#7001D7"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
492
|
-
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform sampler2D uBgTexture; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform int uSampleBg;out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000);uv = uv - pos;vec4 color = texture(uTexture, uv); vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); }color = mix(background, color / max(color.a, 0.0001), color.a * 1.0000);fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
493
|
-
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:1.0158730158730158,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.46738991573774175,widthMode:"relative",height:.46008694830433955,heightMode:"auto",left:.7457263018329404,leftMode:"relative",top:.5757566919333954,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.46738991573774175,0],[.46738991573774175,.46008694830433955],[0,.46008694830433955]],fill:["#4E21AC"],fitToCanvas:!1,gradientType:"linear",type:"circle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
494
|
-
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
495
|
-
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape1"},{breakpoints:[],visible:!0,locked:!1,aspectRatio:.996031746031746,layerName:"",userDownsample:1,isElement:!0,opacity:1,effects:[],displace:0,trackMouse:0,anchorPoint:"center",mouseMomentum:0,blendMode:"MULTIPLY",bgDisplace:0,mask:0,maskBackground:{type:"Vec3",_x:0,_y:0,_z:0},maskAlpha:0,maskDepth:0,dispersion:0,axisTilt:0,states:{appear:[],scroll:[],hover:[]},layerType:"shape",width:.45826120644598894,widthMode:"relative",height:.4600869483043395,heightMode:"auto",left:.49185679854495884,leftMode:"relative",top:.35992750274551055,topMode:"relative",rotation:0,pos:{type:"Vec2",_x:.5,_y:.5},borderRadius:0,gradientAngle:0,strokeWidth:0,coords:[[0,0],[.45826120644598894,0],[.45826120644598894,.4600869483043395],[0,.4600869483043395]],fill:["#FFC7E6"],fitToCanvas:!1,gradientType:"linear",type:"rectangle",stroke:["#000000"],numSides:3,compiledFragmentShaders:[`#version 300 es
|
|
496
|
-
precision highp float; in vec2 vTextureCoord; in vec3 vVertexPosition;uniform vec2 uResolution; uniform vec2 uMousePos; uniform sampler2D uBgTexture; uniform sampler2D uPreviousLayerTexture; uniform sampler2D uTexture; uniform int uSampleBg;vec3 blend (int blendMode, vec3 src, vec3 dst) { return src * dst; }const float STEPS = 24.0; const float PI = 3.1415926;vec2 perspectiveUV(vec2 uv) { float aspectRatio = uResolution.x/uResolution.y; vec2 centeredUV = uv - 0.5; centeredUV.x *= aspectRatio; float strength = 1.0 + (vVertexPosition.z * 0.0000); vec2 perspectiveUV = centeredUV / strength; perspectiveUV.x /= aspectRatio; perspectiveUV += 0.5; return perspectiveUV; }out vec4 fragColor;void main() { vec2 uv = vTextureCoord; vec2 pos = mix(vec2(0), (uMousePos - 0.5), 0.0000); uv = perspectiveUV(uv) - pos; vec4 background = vec4(0);if(uSampleBg == 1) { background = texture(uBgTexture, vTextureCoord); } vec4 color = texture(uTexture, uv);if (0.0000 == 1.00) { if(0 == 2) { background *= (1. - color.a); color = background; } else { background *= color.a; color.rgb = background.rgb; color.rgb = 0.0000 > 0. ? mix(vec3(0, 0, 0), color.rgb, color.a) : color.rgb; color.a = min(1., color.a + 0.0000); if(0 == 1) { vec4 previousLayer = texture(uPreviousLayerTexture, vTextureCoord); color = mix(previousLayer, color/max(color.a, 0.0001), color.a * 1.0000); } } fragColor = color; return; }if (3 > 0) { vec3 unpremultColor = color.rgb / max(color.a, 0.0001); vec3 blendedColor = blend(3, unpremultColor, background.rgb); color = vec4(blendedColor, 1.0) * (color.a * 1.0000); color = color + background * (1.0 - color.a); } else { color = mix(background, color + background * (1.0 - color.a), 1.0000); }fragColor = color; }`],compiledVertexShaders:[`#version 300 es
|
|
497
|
-
precision highp float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix; uniform vec2 uMousePos;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { float angleX = uMousePos.y * 0.5 - 0.25; float angleY = (1.-uMousePos.x) * 0.5 - 0.25;mat4 rotateX = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angleX), -sin(angleX), 0.0, 0.0, sin(angleX), cos(angleX), 0.0, 0.0, 0.0, 0.0, 1.0); mat4 rotateY = mat4(cos(angleY), 0.0, sin(angleY), 0.0, 0.0, 1.0, 0.0, 0.0, -sin(angleY), 0.0, cos(angleY), 0.0, 0.0, 0.0, 0.0, 1.0);mat4 rotationMatrix = rotateX * rotateY; gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vVertexPosition = (rotationMatrix * vec4(aVertexPosition, 1.0)).xyz; vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{uniforms:{}},id:"shape2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"blur",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
498
|
-
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 0 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 0 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
499
|
-
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 1 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 1 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
500
|
-
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 2 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 2 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction); fragColor = color;}`,`#version 300 es
|
|
501
|
-
precision highp float; precision highp int;in vec3 vVertexPosition; in vec2 vTextureCoord;uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution; float ease (int easingFunc, float t) { return t; } uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }out vec4 fragColor;const int kernelSize = 36; float getGaussianWeight(int index) { switch(index) { case 0: return 0.00094768; case 1: return 0.00151965; case 2: return 0.00237008; case 3: return 0.00359517; case 4: return 0.0053041; case 5: return 0.00761097; case 6: return 0.01062197; case 7: return 0.01441804; case 8: return 0.01903459; case 9: return 0.0244409; case 10: return 0.03052299; case 11: return 0.03707432; case 12: return 0.04379813; case 13: return 0.05032389; case 14: return 0.05623791; case 15: return 0.06112521; case 16: return 0.06461716; case 17: return 0.06643724; case 18: return 0.06643724; case 19: return 0.06461716; case 20: return 0.06112521; case 21: return 0.05623791; case 22: return 0.05032389; case 23: return 0.04379813; case 24: return 0.03707432; case 25: return 0.03052299; case 26: return 0.0244409; case 27: return 0.01903459; case 28: return 0.01441804; case 29: return 0.01062197; case 30: return 0.00761097; case 31: return 0.0053041; case 32: return 0.00359517; case 33: return 0.00237008; case 34: return 0.00151965; case 35: return 0.00094768; default: return 0.0; } }vec4 GaussianBlur(sampler2D tex, vec2 uv, vec2 direction) { vec4 color = vec4(0.0); vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); float inner = distance(uv, pos); float outer = max(0., 1.-distance(uv, pos));float amt = 3 <= 1 ? 6. : 11.; float amount = (1.0000 * amt) * ease(0, mix(inner, outer, 0.1000)); color += texture(tex, uv) * getGaussianWeight(0); for (int i = 0; i < kernelSize; i++) { float x = float(i - kernelSize / 2) * amount; color += texture(tex, uv + vec2(x * 0.001) * direction * vec2(1.0000, 1. - 1.0000)) * getGaussianWeight(i); } return color; }vec4 blur(vec2 uv, vec2 direction) { return GaussianBlur(uTexture, uv, direction); }void main() { vec2 uv = vTextureCoord; vec4 color = vec4(0); int dir = 3 % 2; vec2 direction = dir == 1 ? vec2(0, uResolution.x/uResolution.y) : vec2(1, 0);color = blur(uv, direction);float dither = (randFibo(gl_FragCoord.xy) - 0.5) / 255.0; color.rgb += dither; fragColor = color;}`],compiledVertexShaders:[`#version 300 es
|
|
502
|
-
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{downSample:.25,depth:!1,uniforms:{},isBackground:!1,passes:[{prop:"vertical",value:1,downSample:.25},{prop:"vertical",value:2,downSample:.5},{prop:"vertical",value:3,downSample:.5}]},id:"effect1"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sdf_shape",usesPingPong:!1,texture:!1,speed:1,trackMouseMove:0,mouseMomentum:1,trackMouse:.15,animating:!0,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
503
|
-
precision highp float; precision highp int;in vec2 vTextureCoord; uniform sampler2D uTexture;uniform float uTime;uniform vec2 uMousePos; uniform vec2 uResolution;uvec2 pcg2d(uvec2 v) { v = v * 1664525u + 1013904223u; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; v ^= v >> 16; v.x += v.y * v.y * 1664525u + 1013904223u; v.y += v.x * v.x * 1664525u + 1013904223u; return v; }float randFibo(vec2 p) { uvec2 v = floatBitsToUint(p); v = pcg2d(v); uint r = v.x ^ v.y; return float(r) / float(0xffffffffu); }const float PI = 3.141592653; const float PI2 = 6.283185306; const int DISP_STEPS = 12; const vec3 viewDir = vec3(0,0, -4.25);ivec2 customTexSize; float customTexAspect;const mat3 ROT_Y_90 = mat3( 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0 );const mat3 ROT_Z_90 = mat3( 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );const mat3 ROT_X_90 = mat3( 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 );mat3 rotY(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c); }mat3 rotX(float ang) { float c = cos(ang), s = sin(ang); return mat3(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c); }mat3 rotZ(float ang) { float c = cos(ang), s = sin(ang); return mat3(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0); }mat2 rot(float a) { float s = sin(a); float c = cos(a); return mat2(c, -s, s, c); }vec3 twistY(vec3 p, float amount) { float c = cos(amount * p.y); float s = sin(amount * p.y); mat2 m = mat2(c, -s, s, c); return vec3(m * p.xz, p.y); }vec3 twistX(vec3 p, float amount) { float c = cos(amount * p.x); float s = sin(amount * p.x); mat2 m = mat2(c, -s, s, c); return vec3(p.x, m * p.yz); }float smin(float a, float b, float k) { float h = max(k - abs(a - b), 0.0); return min(a, b) - h * h * 0.25 / k; }float sphere(vec3 p, float r) { return length(p) - r; }float sdfCylinder(vec3 p, float radius, float height) { vec2 d = abs(vec2(length(p.xz) - radius, p.y)) - vec2(radius, height * 0.5); return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)); }float sdStar5(vec2 p, float r, float rf) { const vec2 k1 = vec2(0.809016994375, -0.587785252292); const vec2 k2 = vec2(-k1.x,k1.y); p.x = abs(p.x); p -= 2.0*max(dot(k1,p),0.0)*k1; p -= 2.0*max(dot(k2,p),0.0)*k2; p.x = abs(p.x); p.y -= r; vec2 ba = rf*vec2(-k1.y,k1.x) - vec2(0,1); float h = clamp( dot(p,ba)/dot(ba,ba), 0.0, r ); return length(p-ba*h) * sign(p.y*ba.x-p.x*ba.y); }float mergedDiscs(vec3 p) { float result = sdfCylinder(p, 0.7, 0.01 + 0.0000 * 0.5);for(float i = 1.; i < 4.; i++) { float angle = (i * 45.)/360. * 2.0 * PI; mat2 rotZMat = rot(angle); vec3 rotatedP = vec3(rotZMat * p.xy, p.z);result = smin( result, sdfCylinder(rotatedP, 0.7, 0.01 + 0.0000 * 0.5), 0.2 ); }return max(result, sphere(p, 1.4)); }vec3 getRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getThreeDRepeat(vec3 p) { float spacing = (0.5000 + 0.4800 * 0.38) * 8.; return p; }vec3 getAdjustedP(vec3 p) { float scale = max(0.2600, 0.000000001); float scaleFactor = 1.0/scale; vec3 adjustedP = p * scaleFactor;vec2 twist = vec2(0.7, 0.82);adjustedP.xy *= vec2(uResolution.x / uResolution.y, 1);adjustedP *= (1. + (0.4800 + 0.01));vec2 mousePos = mix(vec2(0), uMousePos - 0.5, 0.1500); vec2 axis = vec2(-1. * vec3(0.48503740648379057, 0.5187032418952618, 0.6966).y - 1. + mousePos.y/PI, vec3(0.48503740648379057, 0.5187032418952618, 0.6966).x + mousePos.x/PI) * 2.;adjustedP = getRepeat(adjustedP);float baseTime = uTime * 0.02; float timeX = vec3(0, 1.2, 0).x * baseTime; float timeY = vec3(0, 1.2, 0).y * baseTime; float timeZ = vec3(0, 1.2, 0).z * baseTime;mat3 rotYMat = rotY(axis.y * PI); mat3 rotXMat = rotX(axis.x * PI); mat3 rotZMat = rotZ(vec3(0.48503740648379057, 0.5187032418952618, 0.6966).z * 2.0 * PI);mat3 combinedRotation = rotZMat * rotYMat * rotXMat; mat3 combinedAnimation = rotZ(timeZ) * rotX(timeX) * rotY(timeY);adjustedP = combinedRotation * adjustedP; adjustedP = combinedAnimation * adjustedP; adjustedP = getThreeDRepeat(adjustedP); adjustedP = mix(adjustedP, twistY(adjustedP, -1.0 * twist.y), step(0.0, abs(twist.y))); adjustedP = mix(adjustedP, twistX(adjustedP, -1.0 * twist.x), step(0.0, abs(twist.x)));return adjustedP; }float getMergedSDF(vec3 p) { p = getAdjustedP(p); return mergedDiscs(p); }float fresnel(vec3 eyeVector, vec3 worldNormal, float power) { float NdotV = abs(dot(eyeVector, worldNormal)); float width = fwidth(dot(eyeVector, worldNormal)); float threshold = 0.2; float edgeDampFactor = smoothstep(threshold, -threshold, width); float fresnelFactor = 1.0 - NdotV; return pow(fresnelFactor, power) * mix(1., edgeDampFactor * 2., 0.5); }vec3 noFrostOrDispersion(vec3 rd, vec3 normal) { float ior = 1.0 / (1.0 + 0.7000 * 0.25); vec3 refractedRay = refract(rd, normal, ior); return texture(uTexture, vTextureCoord - refractedRay.xy).rgb; }vec3 frostOrDispersion(vec3 rd, vec3 normal) { vec3 refractionColor = vec3(0); float iorBase = 1. + 0.7000 * 0.25;vec3 dispCoefficients = vec3(0.03, 0.06, 0.1) * 0.2500 * 1.2;for (int i = 0; i < DISP_STEPS; ++i) { float step = float(i) / float(DISP_STEPS); vec3 disp = step * dispCoefficients; vec3 ior = 1.0 / (iorBase + disp);vec3 refractedRayR = refract(rd, normal, ior.r); vec3 refractedRayG = refract(rd, normal, ior.g); vec3 refractedRayB = refract(rd, normal, ior.b);refractionColor.r += texture(uTexture, vTextureCoord - refractedRayR.xy).r; refractionColor.g += texture(uTexture, vTextureCoord - refractedRayG.xy).g; refractionColor.b += texture(uTexture, vTextureCoord - refractedRayB.xy).b; }return clamp(refractionColor / float(DISP_STEPS), 0.0, 1.0); }vec3 calculateNormal(vec3 p, float eps) { vec2 e = vec2(1.0, -1.0) * eps * 0.5; return normalize( e.xyy * getMergedSDF(p + e.xyy) + e.yyx * getMergedSDF(p + e.yyx) + e.yxy * getMergedSDF(p + e.yxy) + e.xxx * getMergedSDF(p + e.xxx) ); }vec3 sampleTexture(vec3 rd, vec3 normal) {return frostOrDispersion(rd, normal); return noFrostOrDispersion(rd, normal); }float scene(vec3 p) { return max(0.0000000001, getMergedSDF(p) - (0.4800 + 0.005)) * max(0.2600, 0.000000001); }const int STEPS = 128; const float MAX_DISTANCE = 100.0;vec4 rayMarch(vec3 ro, vec3 rd) { float pixelSize = 0.0025; float traveled = 0.; vec3 entryPoint = vec3(0.0); vec3 entryNormal = vec3(0.0); float partialAlpha = 0.0; float lastDistance = 0.0; float smoothing = mix(1., 4., 1.0000);for (int i = 0; i < STEPS; ++i) { vec3 currentPos = ro + rd * traveled; float distance = scene(currentPos); float progress = float(i)/float(STEPS); float step = distance * mix(1., 1.5, progress);if (distance > MAX_DISTANCE) break;if (distance < pixelSize) { partialAlpha = 1.; entryPoint = currentPos; entryNormal = calculateNormal(entryPoint, pixelSize * smoothing); break; }lastDistance = distance;traveled += max(step, pixelSize); if (traveled > MAX_DISTANCE) break; }if (partialAlpha == 0.0) { return texture(uTexture, vTextureCoord); }vec3 samplePosition = mix(rd, entryPoint, 0.0000);vec3 refractionColor = vec3(0.0);refractionColor = sampleTexture(samplePosition, entryNormal); vec3 lightDir = vec3(((vec2(vec3(0.25, 0.25, -3).x, 1.-vec3(0.25, 0.25, -3).y) - 0.333) * 3.) - vec2(0.5, 0.5), vec3(0.25, 0.25, -3).z); vec3 normLightDir = normalize(lightDir);float lightAndShadow = dot(entryNormal, normLightDir); vec3 lightColor = mix(vec3(1), vec3(1, 1, 1), 1. - 0.0000); vec3 fresnelEffect = vec3(0.0);fresnelEffect = fresnel(rd, entryNormal, 8.0) * 0.3000 * vec3(1, 1, 1);vec3 specularEffect = vec3(0.0);vec3 halfwayDir = normalize(lightDir + rd); float specFactor = pow(max(dot(entryNormal, halfwayDir), 0.0), 64.0 * 0.3000 + 0.01); specularEffect = specFactor * 0.3000 * lightColor;vec3 combinedEffects = fresnelEffect + specularEffect; vec3 finalColor = mix(refractionColor, vec3(1, 1, 1) * lightAndShadow, 0.0000); finalColor += combinedEffects;vec4 outputColor = vec4(finalColor, 1.);return outputColor; }out vec4 fragColor;void main() { vec4 col = vec4(0); vec4 bg = texture(uTexture, vTextureCoord);if(0.2600 <= 0.0001 || 0.5000 <= 0.0001) { col = vec4(0); if(1 == 1) { col = bg; } fragColor = col; return; }vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); vec2 uv = vTextureCoord - pos; float fovFactor = tan(radians(20.) * 0.5); vec3 rd = vec3(uv * fovFactor, 0.5); col = rayMarch(viewDir, rd); float dither = (randFibo(vTextureCoord.xy) - 0.5) / 255.0; col += dither;col = mix(bg, col, 0.5000); fragColor = col;}`],compiledVertexShaders:[`#version 300 es
|
|
504
|
-
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect2"},{breakpoints:[],visible:!0,aspectRatio:1,userDownsample:1,layerType:"effect",type:"sphere",usesPingPong:!1,trackMouse:0,mouseMomentum:0,texture:!1,animating:!1,isMask:0,compiledFragmentShaders:[`#version 300 es
|
|
505
|
-
precision mediump float; in vec3 vVertexPosition; in vec2 vTextureCoord; uniform sampler2D uTexture; uniform vec2 uMousePos; uniform vec2 uResolution;const float STEPS = 16.0; const float PI = 3.1415926;vec3 chromaticAbberation(vec2 st, float angle, float amount, float blend) { float aspectRatio = uResolution.x/uResolution.y; float rotation = angle * 360.0 * PI / 180.0; vec2 aberrated = amount * vec2(0.1 * sin(rotation) * aspectRatio, 0.1 * cos(rotation)); aberrated *= distance(st, vec2(0.5)) * 2.0; vec4 red = vec4(0); vec4 blue = vec4(0); vec4 green = vec4(0); float invSteps = 1.0 / STEPS; float invStepsHalf = invSteps * 0.5; for(float i = 1.0; i <= STEPS; i++) { vec2 offset = aberrated * (i * invSteps); red += texture(uTexture, st - offset) * invSteps; blue += texture(uTexture, st + offset) * invSteps; }for (float i = 0.0; i <= STEPS; i++) { vec2 offset = aberrated * ((i * invSteps) - 0.5); green += texture(uTexture, st + offset) * invSteps; } return vec3(red.r, green.g, blue.b); }vec2 sphericalTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float tau) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter);float z = sqrt(lensRadius * lensRadius - s * s);float uAlpha = (1.0 - (1.0 / tau)) * asin(u / lensRadius); float vAlpha = (1.0 - (1.0 / tau)) * asin(v / lensRadius);u = uCenter + z * sin(uAlpha); v = vCenter + z * sin(vAlpha);return vec2(u/aspectRatio, v); }float circularIn(float t) { return 1.0 - sqrt(1.0 - t * t); }vec2 fisheyeTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale ) { float aspectRatio = uResolution.x / uResolution.y;vec2 dir = vec2(u - uCenter, v - vCenter);dir.x /= lensRadius; dir.y /= lensRadius;float dist = length(dir) * 0.15;if (dist < 1.0) { float theta = atan(dir.y, dir.x);float r = dist * 2.0 * PI; float z = sqrt(1.0 - r * r) + 0.25; float rDist = atan(r, z) / PI; float newDist = mix(dist, rDist, 5.);dir.x = newDist * cos(theta); dir.y = newDist * sin(theta); }dir.x *= lensRadius; dir.y *= lensRadius;return mix(vec2(u/aspectRatio, v), vec2(uCenter/aspectRatio, vCenter) + dir, 1.0000); }vec2 discTransformation( float u, float v, float uCenter, float vCenter, float lensRadius, float distortionScale) { float aspectRatio = uResolution.x/uResolution.y; u -= uCenter; v -= vCenter;float s = sqrt(u * u + v * v); if (s > lensRadius) return vec2(u + uCenter, v + vCenter); float r = sqrt(u * u + v * v) / lensRadius; if(r == 0.0) return vec2(uCenter, vCenter);r = pow(r, distortionScale); float theta = atan(r); float rad = theta / r;u = rad * u + uCenter; v = rad * v + vCenter;return vec2(u/aspectRatio, v); }out vec4 fragColor; void main() { vec2 uv = vTextureCoord; vec4 color = texture(uTexture, uv); float aspectRatio = uResolution.x/uResolution.y; uv.x = uv.x * aspectRatio; vec2 sphereCoords = uv; vec2 pos = vec2(0.5, 0.5) + mix(vec2(0), (uMousePos-0.5), 0.0000); pos.x *= aspectRatio;float radius = 0.5000 * uResolution.x/max(uResolution.x, uResolution.y);if(1 == 0) { sphereCoords = sphericalTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 1) { sphereCoords = discTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); } else if(1 == 2) { sphereCoords = fisheyeTransformation( mix(sphereCoords.x, 1.-sphereCoords.x, 0.0000), mix(sphereCoords.y, 1.-sphereCoords.y, 0.0000), mix(pos.x, 1.-pos.x, 0.0000), mix(pos.y, 1.-pos.y, 0.0000), radius/2., 1. + 1.0000 * 9. ); }vec2 scaledCoords = (sphereCoords - 0.5) + 0.5; vec4 sphere = texture(uTexture, clamp(scaledCoords, 0.0, 1.0)); float distFromPos = distance(uv, pos); float edgeSmooth = 0.001; float insideSphere = 1.0 - smoothstep(radius/2.0 - edgeSmooth, radius/2.0, distFromPos); float insideSphereAlpha = 1.0 - smoothstep(radius/2.0 + 0.002 - edgeSmooth, radius/2.0 + 0.002, distFromPos); sphere.rgb = chromaticAbberation(scaledCoords, atan(scaledCoords.y, scaledCoords.x), distFromPos * 1.0000, 1.0); color = mix(color, sphere, insideSphere); color.rgb += vec3((0.5000-0.5)*2.) * mix(0., circularIn(smoothstep(0., radius, distFromPos)), insideSphere); if(1 == 1) { color.a = insideSphereAlpha; color.rgb = mix(vec3(0), color.rgb, insideSphereAlpha); } fragColor = color;}`],compiledVertexShaders:[`#version 300 es
|
|
506
|
-
precision mediump float;in vec3 aVertexPosition; in vec2 aTextureCoord;uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform mat4 uTextureMatrix;out vec2 vTextureCoord; out vec3 vVertexPosition;void main() { gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0); vTextureCoord = (uTextureMatrix * vec4(aTextureCoord, 0.0, 1.0)).xy; }`],data:{depth:!1,uniforms:{},isBackground:!1},id:"effect3"}],options:{name:"zAI Orb final",fps:60,dpi:1.5,scale:1,includeLogo:!1,isProduction:!1},version:"1.4.29",id:"l9tOlEGo3rE5cxAzUCHg"});function N2({className:e,dpi:t=2,scale:n=1,fps:r=60,onScene:s,onError:a}){const i=f.useRef(null),c=f.useId();return f.useEffect(()=>{if(!i.current)return;let l=!1,u=null;return(async()=>{try{const d=await S2();if(l||!i.current)return;i.current.setAttribute("data-us-project-src",Go.url),u=d.addScene({filePath:Go.url,elementId:c,dpi:t,scale:n,fps:r});const h=await u;if(l){h.destroy();return}s(h)}catch{l||a()}})(),()=>{l=!0,s(null),u==null||u.then(d=>d.destroy()).catch(()=>{})}},[c,t,n,r]),o.jsx("div",{ref:i,id:c,className:e,role:"img","aria-hidden":!0})}const ur=80,Dr=40,gt=6,C2=1e4,z2=5e3;function dr(e,t){return e.find(n=>n.capabilities.includes(t))??null}function _2(e,t){return Promise.race([e.then(n=>n).catch(()=>null),new Promise(n=>setTimeout(()=>n(null),t))])}function Ke(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e);return t>=1e12?`$${(e/1e12).toFixed(2)}T`:t>=1e9?`$${(e/1e9).toFixed(2)}B`:t>=1e6?`$${(e/1e6).toFixed(2)}M`:t>=1e3?`$${Math.round(e).toLocaleString("en-US")}`:`$${e.toFixed(2)}`}function bt(e,t=1){return Number.isFinite(e)?`${e>=0?"+":""}${e.toFixed(t)}%`:"—"}function T2(e){if(!Number.isFinite(e))return"—";const t=Math.abs(e),n=t>=1e3?0:t>=1?2:t>=.01?4:6;return`$${e.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n})}`}function E2(e){const t=[];if(typeof e.symbol=="string"&&t.push(e.symbol),Array.isArray(e.symbols))for(const n of e.symbols)typeof n=="string"&&t.push(n);return t}function mr(e){return e.filter(t=>t&&t!=="*"&&!t.endsWith(":*"))}function M2(e,t){for(const n of t){const r=e[n];if(typeof r=="string"&&r.trim())return r.trim()}return null}function is(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function A2(e,t){return e.frames.map(n=>{const r=t.get(n.frame);let s=n.config??{};if(r){const a=r.schema.safeParse(s);a.success&&(s=a.data)}return{type:n.frame,title:n.title,capabilities:(r==null?void 0:r.capabilities)??[],config:s,symbols:E2(s)}})}function P2(e){const t=[];for(const n of e.slice(0,ur)){let r=`- ${n.type}`;if(n.title&&(r+=` "${n.title}"`),n.symbols.length&&(r+=` [${n.symbols.slice(0,Dr).join(", ")}]`),n.symbols.length===0){const s=M2(n.config,["text","content","body","label","timezone","feed"]);s&&(r+=`: ${is(s,80)}`)}t.push(r)}return e.length>ur&&t.push(`- …and ${e.length-ur} more frames`),t}function fr(e,t){const n=new Set;for(const r of e)if(r.capabilities.some(s=>t.includes(s)))for(const s of r.symbols)n.add(s);return[...n]}async function R2(e,t){const n=new Set;for(const m of t)for(const p of m.capabilities)n.add(p);const r=m=>n.has(m)&&dr(e,m),s=[],a=(m,p,x)=>{const b=r(p);b&&s.push(_2(x(b),z2).then(y=>y?[m,y]:null))},i=mr(fr(t,["day-stats","quote-stream","ohlcv"])).slice(0,Dr);i.length&&a(1,"day-stats",async m=>{const p=await m.getDayStats(i),x=i.map(b=>{const y=p[b];return y?`${b} ${T2(y.markPx)} (${bt(y.changePct)})`:null}).filter(Boolean);return x.length?`Prices: ${x.join(" · ")}`:null});const c=t.find(m=>m.capabilities.includes("sentiment")),l=typeof(c==null?void 0:c.config.sparklineDays)=="number"?c.config.sparklineDays:30;a(2,"sentiment",async m=>{const x=(await m.getFearGreed(l))[0];return x?`Fear & Greed: ${x.value} (${x.classification})`:null}),a(3,"global-market",async m=>{const p=await m.getGlobalMarket(),x=Object.entries(p.dominance).sort((b,y)=>y[1]-b[1]).slice(0,3).map(([b,y])=>`${b.toUpperCase()} ${y.toFixed(1)}%`).join(", ");return`Global crypto: total mcap ${Ke(p.totalMarketCapUsd)} (${bt(p.marketCapChangePct24h)} 24h); dominance ${x}`});const u=mr(fr(t,["funding-history"])).slice(0,Dr);u.length&&a(4,"funding-history",async m=>{const p=await m.getFundingHistory(u,Date.now()-864e5),x=u.map(b=>{const y=p[b],g=y&&y[y.length-1];return g?`${b} ${bt(g.fundingRate*100,4)}`:null}).filter(Boolean);return x.length?`Funding (latest): ${x.join(" · ")}`:null});const d=mr(fr(t,["open-interest"]));if(a(5,"open-interest",async m=>{const x=(await m.getOpenInterest(d.length?d:void 0)).slice(0,gt).map(b=>`${b.symbol} ${Ke(b.openInterestUsd)}`);return x.length?`Open interest: ${x.join(" · ")}`:null}),a(6,"tvl",async m=>{const x=(await m.getTvlByChain()).slice(0,gt).map(b=>`${b.name} ${Ke(b.tvl)}`);return x.length?`TVL by chain: ${x.join(" · ")}`:null}),a(7,"protocol-tvl",async m=>{const x=(await m.getProtocolTvl()).slice(0,gt).map(b=>`${b.name} ${Ke(b.tvl)}`);return x.length?`Protocol TVL: ${x.join(" · ")}`:null}),a(8,"dex-volume",async m=>{const x=(await m.getDexVolume()).slice(0,gt).map(b=>`${b.name} ${Ke(b.volume24h)}`);return x.length?`DEX volume (24h): ${x.join(" · ")}`:null}),a(9,"protocol-fees",async m=>{const x=(await m.getProtocolFees()).slice(0,gt).map(b=>`${b.name} ${Ke(b.fees24h)}`);return x.length?`Protocol fees (24h): ${x.join(" · ")}`:null}),a(10,"coin-markets",async m=>{const x=(await m.getCoinMarkets()).slice(0,gt).map(b=>`${b.symbol} ${Ke(b.marketCapUsd)}${b.changePct24h!=null?` (${bt(b.changePct24h)})`:""}`);return x.length?`Top coins by mcap: ${x.join(" · ")}`:null}),a(11,"coin-movers",async m=>{const x=[...await m.getCoinMovers(300)].sort((g,v)=>(v.changePct["24h"]??0)-(g.changePct["24h"]??0)),b=x.slice(0,3).map(g=>`${g.symbol} ${bt(g.changePct["24h"]??0)}`),y=x.slice(-3).reverse().map(g=>`${g.symbol} ${bt(g.changePct["24h"]??0)}`);return x.length?`Movers (24h): up ${b.join(", ")} · down ${y.join(", ")}`:null}),r("news")){const m=dr(e,"news"),p=new Set;for(const x of t){if(!x.capabilities.includes("news"))continue;const b=typeof x.config.feed=="string"?x.config.feed:null;if(!b||p.has(b))continue;p.add(b);const y=x.symbols.length?[...x.symbols]:void 0;a(12,"news",async()=>{const v=(await m.getNews({feed:b,symbols:y,limit:4})).slice(0,4).map(S=>`“${is(S.title,90)}”`);return v.length?`News (${b}): ${v.join("; ")}`:null})}}if(a(13,"btc-fees",async m=>{const p=await m.getBtcFees();return`BTC fees: fastest ${p.fastest}, 1h ${p.hour}, economy ${p.economy} sat/vB`}),a(14,"btc-mempool",async m=>{const p=await m.getMempoolState();return`Mempool: ${p.count.toLocaleString("en-US")} txs, ${p.projected.length} blocks pending`}),a(15,"btc-blocks",async m=>{const x=(await m.getBtcBlocks(1))[0];return x?`Latest block: #${x.height} (${x.poolName}, ${x.txCount} txs)`:null}),a(16,"btc-difficulty",async m=>{const p=await m.getDifficultyAdjustment();return`Difficulty: ${bt(p.difficultyChange)} expected in ${p.remainingBlocks} blocks`}),a(17,"mining-pools",async m=>{const x=(await m.getMiningPools("1w")).pools[0];return x?`Mining pools (1w): ${x.name} ${x.sharePct.toFixed(1)}%`:null}),a(18,"lightning-stats",async m=>{const p=await m.getLightningStats();return`Lightning: ${p.nodeCount.toLocaleString("en-US")} nodes, ${p.channelCount.toLocaleString("en-US")} channels`}),a(19,"yield-curve",async m=>{const p=await m.getYieldCurve(),x=y=>p.points.find(g=>g.label===y),b=["3M","2Y","10Y","30Y"].map(y=>{const g=x(y);return g?`${y} ${g.rate.toFixed(2)}%`:null}).filter(Boolean);return b.length?`Yield curve (${p.date}): ${b.join(", ")}`:null}),a(20,"reference-rates",async m=>{const x=(await m.getReferenceRates()).slice(0,3).map(b=>`${b.code} ${b.rate.toFixed(2)}%`);return x.length?`Reference rates: ${x.join(", ")}`:null}),a(21,"financial-stress",async m=>{const p=await m.getFinancialStress();return`Financial stress (OFR): ${p.value.toFixed(2)} (${p.date})`}),a(22,"national-debt",async m=>{const p=await m.getNationalDebt();return`US national debt: ${Ke(p.total)} (${p.date})`}),r("options-summary")){const m=new Set;for(const x of t)x.capabilities.includes("options-summary")&&m.add(typeof x.config.currency=="string"?x.config.currency:"BTC");const p=dr(e,"options-summary");for(const x of m)a(23,"options-summary",async()=>{const b=await p.getOptionsSummary(x);return`Options ${b.currency}: put/call ${b.putCallRatioOi.toFixed(2)} (OI), avg IV ${b.avgIv.toFixed(1)}%`})}if(r("portfolio"))for(const m of t){if(!m.capabilities.includes("portfolio"))continue;const p=m.config.source;if(!p||typeof p.kind!="string")continue;const x=e.find(b=>b.getPortfolio&&(b.portfolioKinds??[]).includes(p.kind));x&&a(24,"portfolio",async()=>{const b=await x.getPortfolio(p),y=b.totalUsd??b.holdings.reduce((v,S)=>v+(S.valueUsd??0),0),g=[...b.holdings].sort((v,S)=>(S.valueUsd??0)-(v.valueUsd??0)).slice(0,gt).map(v=>v.symbol).join(", ");return`Portfolio (${b.label??b.source}): ${Ke(y)}${g?`, top: ${g}`:""}`})}return(await Promise.all(s)).filter(m=>m!==null).sort((m,p)=>m[0]-p[0]).map(m=>m[1])}function $2(e,t){const n=In();return f.useCallback(async()=>{try{const r=A2(e,t);if(r.length===0)return null;const s=P2(r),a=await R2(n,r),i=[];s.length&&i.push(`Frames on the dashboard:
|
|
507
|
-
${s.join(`
|
|
508
|
-
`)}`),a.length&&i.push(`Live readings right now:
|
|
509
|
-
${a.join(`
|
|
510
|
-
`)}`);const c=i.join(`
|
|
511
|
-
|
|
512
|
-
`);return c?is(c,C2):null}catch{return null}},[n,e,t])}const D2=1,I2=5,L2="effect2",Xo=["what's going on?","what's moving today?","how's BTC funding looking?","what should I be watching?","summarize the market for me","explain my dashboard","is it fear or greed right now?","anything unusual today?"],F2=3600,Ir=320;function O2(e){return e===503?"No assistant is set up to answer yet — install Claude, Codex, or Kimi.":e===413?"That question was too long — try a shorter one.":e>=500?"zAI ran into a problem answering — give it another try.":e===200?"zAI sent back an unexpected response. If you just updated zframes, restart the server.":`zAI couldn't answer right now (error ${e}).`}const U2=`
|
|
513
|
-
/* Focus scrim: opening the orb blurs + dims the dashboard behind so attention
|
|
514
|
-
lands on the conversation. Sits below the orb dock (z 40) and above the
|
|
515
|
-
ticker tape (z 30), so the orb + chat stay sharp while everything else
|
|
516
|
-
recedes. Clicking it dismisses the orb (click-away-to-close). */
|
|
517
|
-
.zai-scrim {
|
|
518
|
-
position: fixed;
|
|
519
|
-
inset: 0;
|
|
520
|
-
z-index: 35;
|
|
521
|
-
opacity: 0;
|
|
522
|
-
pointer-events: none;
|
|
523
|
-
background: radial-gradient(
|
|
524
|
-
135% 135% at 100% 100%,
|
|
525
|
-
rgba(7, 8, 16, 0.08),
|
|
526
|
-
rgba(7, 8, 16, 0.5) 72%
|
|
527
|
-
);
|
|
528
|
-
backdrop-filter: blur(0px) saturate(1);
|
|
529
|
-
-webkit-backdrop-filter: blur(0px) saturate(1);
|
|
530
|
-
transition:
|
|
531
|
-
opacity 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
532
|
-
backdrop-filter 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
533
|
-
-webkit-backdrop-filter 0.42s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
534
|
-
}
|
|
535
|
-
.zai-scrim[data-open="true"] {
|
|
536
|
-
opacity: 1;
|
|
537
|
-
pointer-events: auto;
|
|
538
|
-
backdrop-filter: blur(1.75px) saturate(1.06);
|
|
539
|
-
-webkit-backdrop-filter: blur(1.75px) saturate(1.06);
|
|
540
|
-
}
|
|
541
|
-
.zai-dock {
|
|
542
|
-
position: fixed;
|
|
543
|
-
right: 18px;
|
|
544
|
-
bottom: 50px;
|
|
545
|
-
z-index: 40;
|
|
546
|
-
display: flex;
|
|
547
|
-
align-items: center;
|
|
548
|
-
gap: 10px;
|
|
549
|
-
font-family: var(--font-dmsans, system-ui, sans-serif);
|
|
550
|
-
}
|
|
551
|
-
.zai-panel {
|
|
552
|
-
display: flex;
|
|
553
|
-
align-items: center;
|
|
554
|
-
width: 0;
|
|
555
|
-
opacity: 0;
|
|
556
|
-
overflow: hidden;
|
|
557
|
-
transition:
|
|
558
|
-
width 0.34s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
559
|
-
opacity 0.22s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
560
|
-
}
|
|
561
|
-
.zai-dock[data-open="true"] .zai-panel {
|
|
562
|
-
width: 330px;
|
|
563
|
-
opacity: 1;
|
|
564
|
-
}
|
|
565
|
-
.zai-input-wrap {
|
|
566
|
-
display: flex;
|
|
567
|
-
align-items: center;
|
|
568
|
-
gap: 8px;
|
|
569
|
-
width: 330px;
|
|
570
|
-
padding: 9px 10px 9px 14px;
|
|
571
|
-
border-radius: 9999px;
|
|
572
|
-
background: rgba(12, 13, 20, 0.72);
|
|
573
|
-
backdrop-filter: blur(12px);
|
|
574
|
-
-webkit-backdrop-filter: blur(12px);
|
|
575
|
-
border: 1px solid hsla(263, 80%, 72%, 0.24);
|
|
576
|
-
/* Negative spread keeps the drop shadow hugging the pill instead of bleeding
|
|
577
|
-
a wide dark halo into the blurred scrim behind it. */
|
|
578
|
-
box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
|
|
579
|
-
}
|
|
580
|
-
/* The input and its animated placeholder share one box: the placeholder is an
|
|
581
|
-
absolutely-positioned layer behind the (transparent) input, so the real
|
|
582
|
-
caret/text sit on top while the hint cross-fades underneath. */
|
|
583
|
-
.zai-input-field {
|
|
584
|
-
position: relative;
|
|
585
|
-
flex: 1;
|
|
586
|
-
min-width: 0;
|
|
587
|
-
display: flex;
|
|
588
|
-
align-items: center;
|
|
589
|
-
}
|
|
590
|
-
.zai-input {
|
|
591
|
-
position: relative;
|
|
592
|
-
z-index: 1;
|
|
593
|
-
flex: 1;
|
|
594
|
-
min-width: 0;
|
|
595
|
-
background: transparent;
|
|
596
|
-
border: 0;
|
|
597
|
-
outline: 0;
|
|
598
|
-
color: #e7e9f3;
|
|
599
|
-
font-size: 13px;
|
|
600
|
-
}
|
|
601
|
-
.zai-ph {
|
|
602
|
-
position: absolute;
|
|
603
|
-
left: 0;
|
|
604
|
-
right: 0;
|
|
605
|
-
top: 50%;
|
|
606
|
-
pointer-events: none;
|
|
607
|
-
color: rgba(255, 255, 255, 0.4);
|
|
608
|
-
font-size: 13px;
|
|
609
|
-
white-space: nowrap;
|
|
610
|
-
overflow: hidden;
|
|
611
|
-
text-overflow: ellipsis;
|
|
612
|
-
opacity: 0;
|
|
613
|
-
transform: translateY(-50%) translateY(5px);
|
|
614
|
-
transition:
|
|
615
|
-
opacity ${Ir}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)),
|
|
616
|
-
transform ${Ir}ms var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
617
|
-
}
|
|
618
|
-
.zai-ph[data-show="true"] {
|
|
619
|
-
opacity: 1;
|
|
620
|
-
transform: translateY(-50%) translateY(0);
|
|
621
|
-
}
|
|
622
|
-
/* While thinking, the hint shimmers instead of cycling (overrides opacity). */
|
|
623
|
-
.zai-ph-busy {
|
|
624
|
-
animation: zai-ph-pulse 1.5s ease-in-out infinite;
|
|
625
|
-
}
|
|
626
|
-
@keyframes zai-ph-pulse {
|
|
627
|
-
0%, 100% { opacity: 0.34; }
|
|
628
|
-
50% { opacity: 0.7; }
|
|
629
|
-
}
|
|
630
|
-
.zai-agent {
|
|
631
|
-
flex: none;
|
|
632
|
-
font-size: 10px;
|
|
633
|
-
font-weight: 700;
|
|
634
|
-
letter-spacing: 0.05em;
|
|
635
|
-
text-transform: uppercase;
|
|
636
|
-
color: hsla(263, 85%, 82%, 0.95);
|
|
637
|
-
background: hsla(263, 80%, 60%, 0.16);
|
|
638
|
-
border-radius: 7px;
|
|
639
|
-
padding: 4px 7px;
|
|
640
|
-
cursor: pointer;
|
|
641
|
-
user-select: none;
|
|
642
|
-
white-space: nowrap;
|
|
643
|
-
transition: background 0.15s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
644
|
-
}
|
|
645
|
-
.zai-agent:hover { background: hsla(263, 80%, 60%, 0.28); }
|
|
646
|
-
|
|
647
|
-
/* The WebGL orb scene IS the orb — clipped to a circle and faded in once ready.
|
|
648
|
-
The button is just a transparent container; nothing is drawn behind the orb. */
|
|
649
|
-
.zai-orb-canvas {
|
|
650
|
-
position: absolute;
|
|
651
|
-
inset: 0;
|
|
652
|
-
border-radius: 9999px;
|
|
653
|
-
overflow: hidden;
|
|
654
|
-
opacity: 0;
|
|
655
|
-
transition: opacity 0.45s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
656
|
-
pointer-events: none;
|
|
657
|
-
}
|
|
658
|
-
.zai-orb[data-webgl="true"] .zai-orb-canvas { opacity: 1; }
|
|
659
|
-
.zai-orb-canvas canvas {
|
|
660
|
-
width: 100% !important;
|
|
661
|
-
height: 100% !important;
|
|
662
|
-
display: block;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
.zai-orb {
|
|
666
|
-
position: relative;
|
|
667
|
-
width: 60px;
|
|
668
|
-
height: 60px;
|
|
669
|
-
flex: none;
|
|
670
|
-
padding: 0;
|
|
671
|
-
border: 0;
|
|
672
|
-
border-radius: 9999px;
|
|
673
|
-
cursor: pointer;
|
|
674
|
-
background: transparent;
|
|
675
|
-
transition: transform 0.2s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
|
|
676
|
-
}
|
|
677
|
-
.zai-orb:hover { transform: scale(1.06); }
|
|
678
|
-
.zai-orb:active { transform: scale(0.97); }
|
|
679
|
-
/* Minimal fallback gradient, shown only if the WebGL scene fails to load, so
|
|
680
|
-
the orb stays visible + clickable instead of being an invisible button. */
|
|
681
|
-
.zai-orb[data-fallback="true"] {
|
|
682
|
-
background:
|
|
683
|
-
radial-gradient(circle at 34% 28%, hsla(263, 95%, 86%, 0.95), transparent 45%),
|
|
684
|
-
radial-gradient(circle at 62% 70%, #7a17e0 0%, #4a0a92 55%, #2c0560 100%);
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
.zai-history {
|
|
688
|
-
position: absolute;
|
|
689
|
-
right: 70px;
|
|
690
|
-
bottom: 72px;
|
|
691
|
-
width: 344px;
|
|
692
|
-
display: flex;
|
|
693
|
-
flex-direction: column;
|
|
694
|
-
gap: 8px;
|
|
695
|
-
max-height: 52vh;
|
|
696
|
-
overflow-y: auto;
|
|
697
|
-
overscroll-behavior: contain;
|
|
698
|
-
pointer-events: auto;
|
|
699
|
-
scrollbar-width: none;
|
|
700
|
-
}
|
|
701
|
-
.zai-history::-webkit-scrollbar {
|
|
702
|
-
display: none;
|
|
703
|
-
}
|
|
704
|
-
/* The top fade is a "more above" affordance — only painted once the thread has
|
|
705
|
-
scrolled up off the top. Applying it unconditionally clipped the top edge of
|
|
706
|
-
even a single short chip, so it's gated on scroll position (see onScroll). */
|
|
707
|
-
.zai-history[data-masked="true"] {
|
|
708
|
-
-webkit-mask-image: linear-gradient(180deg, transparent, #000 16%);
|
|
709
|
-
mask-image: linear-gradient(180deg, transparent, #000 16%);
|
|
710
|
-
}
|
|
711
|
-
/* Bottom-pin short threads (the conversation floats just above the input):
|
|
712
|
-
margin-top:auto on the first chip pushes the group down while there's slack,
|
|
713
|
-
then yields to scrolling once the thread outgrows max-height — so a long
|
|
714
|
-
answer scrolls up instead of hard-clipping the oldest message off the top. */
|
|
715
|
-
.zai-history > :first-child {
|
|
716
|
-
margin-top: auto;
|
|
717
|
-
}
|
|
718
|
-
.zai-msg {
|
|
719
|
-
width: fit-content;
|
|
720
|
-
max-width: 100%;
|
|
721
|
-
padding: 8px 12px;
|
|
722
|
-
border-radius: 14px;
|
|
723
|
-
font-size: 13px;
|
|
724
|
-
line-height: 1.45;
|
|
725
|
-
white-space: pre-wrap;
|
|
726
|
-
word-break: break-word;
|
|
727
|
-
backdrop-filter: blur(10px);
|
|
728
|
-
-webkit-backdrop-filter: blur(10px);
|
|
729
|
-
animation: zai-rise 0.28s var(--zf-ease-out, cubic-bezier(0.23, 1, 0.32, 1)) both;
|
|
730
|
-
}
|
|
731
|
-
.zai-msg-user {
|
|
732
|
-
align-self: flex-end;
|
|
733
|
-
background: hsla(263, 70%, 55%, 0.28);
|
|
734
|
-
border: 1px solid hsla(263, 80%, 75%, 0.3);
|
|
735
|
-
color: #f0ecff;
|
|
736
|
-
}
|
|
737
|
-
.zai-msg-zai {
|
|
738
|
-
align-self: flex-start;
|
|
739
|
-
background: rgba(12, 13, 20, 0.66);
|
|
740
|
-
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
741
|
-
color: #dfe3ef;
|
|
742
|
-
}
|
|
743
|
-
.zai-msg-error {
|
|
744
|
-
color: #ffb4bd;
|
|
745
|
-
border-color: rgba(255, 107, 129, 0.4);
|
|
746
|
-
}
|
|
747
|
-
@keyframes zai-rise {
|
|
748
|
-
from { opacity: 0; transform: translateY(6px); }
|
|
749
|
-
to { opacity: 1; transform: translateY(0); }
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
@media (prefers-reduced-motion: reduce) {
|
|
753
|
-
.zai-msg { animation: none; }
|
|
754
|
-
.zai-panel { transition: none; }
|
|
755
|
-
.zai-ph { transition: opacity 0.15s linear; transform: translateY(-50%); }
|
|
756
|
-
.zai-ph[data-show="true"] { transform: translateY(-50%); }
|
|
757
|
-
.zai-ph-busy { animation: none; opacity: 0.5; }
|
|
758
|
-
.zai-scrim { transition: opacity 0.2s linear; }
|
|
759
|
-
}
|
|
760
|
-
`;function B2({onOpenChange:e,onThinkingChange:t,spec:n,registry:r}){var ke;const[s,a]=f.useState(null),[i,c]=f.useState(null),[l,u]=f.useState(!1),[d,h]=f.useState(""),[m,p]=f.useState(!1),[x,b]=f.useState([]),[y,g]=f.useState(!1),[v,S]=f.useState(!1),[z,j]=f.useState(0),[C,k]=f.useState(!0),[w,N]=f.useState(!1),E=f.useRef(null),W=f.useRef(null),L=f.useRef(null),A=$2(n,r),U=f.useCallback((V,de)=>{var ce;const J=(ce=V.layers)==null?void 0:ce.find(Be=>Be.id===L2&&Be.layerType==="effect");J&&J.layerType==="effect"&&(J.speed=de?I2:D2)},[]),_=f.useCallback(V=>{L.current=V,V?(U(V,!1),S(!1),g(!0)):g(!1)},[U]),I=f.useCallback(()=>{g(!1),S(!0)},[]);f.useEffect(()=>{L.current&&U(L.current,m)},[m,U]),f.useEffect(()=>{let V=!1;return fetch(up,{cache:"no-store"}).then(de=>de.ok?de.json():{agents:[]}).then(de=>{var ce;if(V)return;const J=de.agents??[];a(J),c(((ce=J[0])==null?void 0:ce.id)??null)}).catch(()=>{V||a([])}),()=>{V=!0}},[]),f.useEffect(()=>{var V;l&&((V=E.current)==null||V.focus())},[l]),f.useEffect(()=>{const V=W.current;V&&(V.scrollTop=V.scrollHeight,N(V.scrollTop>1))},[x,l]),f.useEffect(()=>{if(!l||m){k(!0);return}let V;const de=setInterval(()=>{k(!1),V=setTimeout(()=>{j(J=>(J+1)%Xo.length),k(!0)},Ir)},F2);return()=>{clearInterval(de),clearTimeout(V)}},[l,m]),f.useEffect(()=>{e==null||e(l)},[l,e]),f.useEffect(()=>{t==null||t(m)},[m,t]);const H=V=>b(de=>[...de,V].slice(-8));async function te(){var be;const V=d.trim();if(!V||m)return;const de=x.filter(Me=>!Me.error).map(Me=>({role:Me.role,text:Me.text}));H({role:"user",text:V}),h(""),p(!0);let J=!1,ce="";const Be=()=>{J||(J=!0,H({role:"zai",text:""}))},ft=(Me,Ie=!1)=>b(tt=>{const He=[...tt];for(let Oe=He.length-1;Oe>=0;Oe--)if(He[Oe].role==="zai"){He[Oe]={...He[Oe],text:Me,error:Ie};break}return He});try{const Me=await A(),Ie=await fetch(dp,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({question:V,agent:i,context:Me??void 0,history:de.length?de:void 0})}),tt=Ie.headers.get("content-type")??"";if(!Ie.body||!tt.includes("application/x-ndjson")){const We=await Ie.json().catch(()=>null);if(Ie.ok&&typeof(We==null?void 0:We.answer)=="string"&&We.answer.trim()){H({role:"zai",text:We.answer.trim()});return}H({role:"zai",text:(We==null?void 0:We.error)??O2(Ie.status),error:!0});return}const He=Ie.body.getReader(),Oe=new TextDecoder;let It="";for(;;){const{value:We,done:fl}=await He.read();if(fl)break;It+=Oe.decode(We,{stream:!0});let Hn;for(;(Hn=It.indexOf(`
|
|
761
|
-
`))!==-1;){const ls=It.slice(0,Hn).trim();if(It=It.slice(Hn+1),!ls)continue;let nt;try{nt=JSON.parse(ls)}catch{continue}nt.type==="delta"&&typeof nt.text=="string"?(Be(),ce+=nt.text,ft(ce)):nt.type==="done"?(Be(),ft(nt.answer||ce)):nt.type==="error"&&(Be(),ft(nt.error||"zAI couldn't finish that answer — try again.",!0))}}J||H({role:"zai",text:"zAI didn't return anything — try again.",error:!0})}catch{const Me="zAI couldn't be reached — check that the zframes server is running.";J?ft(Me,!0):H({role:"zai",text:Me,error:!0})}finally{p(!1),(be=E.current)==null||be.focus()}}function se(V){V.key==="Enter"&&!V.shiftKey?(V.preventDefault(),te()):V.key==="Escape"&&u(!1)}function R(){if(!s||s.length<2||!i)return;const V=s.findIndex(de=>de.id===i);c(s[(V+1)%s.length].id)}if(!s||s.length===0)return null;const ie=((ke=s.find(V=>V.id===i))==null?void 0:ke.label)??s[0].label;return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:U2}),o.jsx("div",{className:"zai-scrim","data-open":l,onClick:()=>u(!1),"aria-hidden":"true"}),o.jsxs("div",{className:"zai-dock","data-open":l,"data-busy":m,children:[l&&x.length>0&&o.jsx("div",{className:"zai-history",ref:W,"data-masked":w,onScroll:V=>N(V.currentTarget.scrollTop>1),"aria-live":"polite",children:x.map((V,de)=>o.jsx("div",{className:V.role==="user"?"zai-msg zai-msg-user":`zai-msg zai-msg-zai${V.error?" zai-msg-error":""}`,children:V.text},de))}),o.jsx("div",{className:"zai-panel",children:o.jsxs("div",{className:"zai-input-wrap",children:[o.jsxs("div",{className:"zai-input-field",children:[o.jsx("input",{ref:E,className:"zai-input",value:d,onChange:V=>h(V.target.value),onKeyDown:se,placeholder:"",disabled:m,"aria-label":"Ask zAI"}),o.jsx("span",{className:`zai-ph${m?" zai-ph-busy":""}`,"data-show":!d&&(m||C),"aria-hidden":"true",children:m?"thinking…":Xo[z]})]}),o.jsx("span",{className:"zai-agent",onClick:R,title:s.length>1?"Click to switch agent":`Answered by ${ie}`,children:ie})]})}),o.jsx("button",{type:"button",className:"zai-orb","data-webgl":y,"data-fallback":v,onClick:()=>u(V=>!V),"aria-label":l?"Close zAI":"Ask zAI","aria-expanded":l,children:o.jsx(N2,{className:"zai-orb-canvas",onScene:_,onError:I})})]})]})}const H2=f.lazy(()=>Qo(()=>import("./editor-DVTcqJo4.js"),__vite__mapDeps([2,1,3,4,5,6,7])).then(e=>({default:e.DashboardEditor}))),yn=Pl(Kv),V2=[new K1,new A1,new n1,new g1,new v1,new gw,new Yw,new d1,new Pw,new G1,new kw,new dw,new ow,new L1,new s1,new a2];function cs({children:e}){return o.jsx("main",{className:"mx-auto max-w-2xl px-6 py-16",children:e})}function Z2(){return o.jsx(cs,{children:o.jsx("p",{className:"body-sm text-soft",children:"loading dashboard…"})})}function W2({message:e}){return o.jsxs(cs,{children:[o.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"couldn’t load your dashboard"}),o.jsxs("p",{className:"body-sm text-soft mb-4",children:["The zframes runtime couldn’t read ",o.jsx("code",{children:"dashboard.json"}),". Make sure you’re running ",o.jsx("code",{children:"zframes serve"})," next to it."]}),o.jsx("p",{className:"caption text-soft",children:o.jsx("code",{children:e})})]})}function Y2({issues:e}){return o.jsxs(cs,{children:[o.jsx("h1",{className:"font-dmsans text-strong mb-2 text-lg font-extrabold",children:"dashboard.json is not a valid spec"}),o.jsxs("p",{className:"body-sm text-soft mb-4",children:["Fix the issues below (or run ",o.jsx("code",{children:"zframes lint dashboard.json"}),"), then reload."]}),o.jsx("ul",{className:"body-sm text-normal list-disc space-y-1 pl-5",children:e.map((t,n)=>o.jsxs("li",{children:[o.jsx("code",{children:t.path.join(".")||"(root)"}),": ",t.message]},n))})]})}async function G2(e){try{const t=await fetch(ip,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`HTTP ${t.status}`);window.location.reload()}catch(t){console.error("zframes: failed to save dashboard.json",t),window.alert("Couldn't save dashboard.json — is `zframes serve` still running? Your edits are still on screen; try Save again.")}}function X2(){const[e,t]=f.useState({status:"loading"}),[n,r]=f.useState(null),[s,a]=f.useState(null),[i,c]=f.useState(null),[l,u]=f.useState(null),[d,h]=f.useState(null),[m,p]=f.useState(null),[x,b]=f.useState(null),y=w2(),[g,v]=f.useState(!1),[S,z]=f.useState(!1),j=s??(e.status==="ready"?e.spec.theme.accentHue:null),C=i??(e.status==="ready"?e.spec.theme.accentSat:null),k=l??(e.status==="ready"?e.spec.typography.scale:null),w=d??(e.status==="ready"?e.spec.theme.upColor:null),N=m??(e.status==="ready"?e.spec.theme.downColor:null);if(f.useEffect(()=>{j!=null&&document.documentElement.style.setProperty("--zf-accent-hue",String(j))},[j]),f.useEffect(()=>{C!=null&&document.documentElement.style.setProperty("--zf-accent-sat",`${C}%`)},[C]),f.useEffect(()=>{k!=null&&(document.documentElement.style.fontSize=`${k*100}%`)},[k]),f.useEffect(()=>{w!=null&&document.documentElement.style.setProperty("--zf-up",w)},[w]),f.useEffect(()=>{N!=null&&document.documentElement.style.setProperty("--zf-down",N)},[N]),f.useEffect(()=>{let L=!1;return fetch(ap,{cache:"no-store"}).then(A=>{if(!A.ok)throw new Error(`HTTP ${A.status}`);return A.json()}).then(A=>{if(L)return;const U=wh.safeParse(A);t(U.success?{status:"ready",spec:U.data}:{status:"invalid",issues:U.error.issues})}).catch(A=>{L||t({status:"error",message:String(A)})}),()=>{L=!0}},[]),e.status==="loading")return o.jsx(Z2,{});if(e.status==="error")return o.jsx(W2,{message:e.message});if(e.status==="invalid")return o.jsx(Y2,{issues:e.issues});const E=e.spec,W=(x??E.grid.mode)==="flow-horizontal";return o.jsxs(kh,{providers:V2,children:[o.jsx(f2,{background:E.background,active:g,thinking:S,accentHue:j??E.theme.accentHue,accentSat:C??E.theme.accentSat}),o.jsxs("main",{className:`relative z-10 mx-auto pt-5 ${W?"h-[100dvh] max-w-none overflow-hidden px-0":"max-w-[1320px] px-4 pb-24 sm:px-6"}`,style:{"--zf-accent-hue":j??E.theme.accentHue,"--zf-accent-sat":`${C??E.theme.accentSat}%`},children:[o.jsxs("header",{className:`mb-5 flex flex-col gap-2 border-b border-white/[0.06] pb-4 sm:flex-row sm:items-center sm:justify-between ${W?"px-4 sm:px-6":""}`,children:[o.jsxs("div",{className:"flex items-baseline gap-3",children:[o.jsxs("h1",{className:"font-dmsans text-strong text-lg font-extrabold tracking-tight",children:["/",o.jsx("span",{style:{color:"hsl(var(--zf-accent-hue, 242) var(--zf-accent-sat, 90%) 76%)"},children:"zframes"})]}),o.jsx("span",{className:"body-sm text-soft",children:E.title}),o.jsxs("span",{className:"caption text-soft rounded-full border border-white/[0.08] px-1.5 py-0.5 font-mono leading-none",title:"zframes runtime version",children:["v","0.3.0"]})]}),o.jsx("div",{ref:r,className:"flex min-h-9 items-center justify-end"})]}),y?o.jsx(Bs,{spec:E,registry:yn}):o.jsx(f.Suspense,{fallback:o.jsx(Bs,{spec:E,registry:yn}),children:o.jsx(H2,{spec:E,registry:yn,onSave:G2,customiseButtonTarget:n,onAccentHueChange:a,onAccentSatChange:c,onFontScaleChange:u,onUpColorChange:h,onDownColorChange:p,onModeChange:b})})]}),o.jsx(v2,{}),o.jsx(B2,{onOpenChange:v,onThinkingChange:z,spec:E,registry:yn})]})}const ml=document.getElementById("root");if(!ml)throw new Error("missing #root element");bl.createRoot(ml).render(o.jsx(f.StrictMode,{children:o.jsx(X2,{})}));export{ek as F,yh as N,kh as a,tp as b,sp as c,np as d,xh as e,tk as t,In as u};
|