asciify-engine 4.25.0 → 4.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/field.cjs +1 -1
- package/dist/field.d.cts +132 -275
- package/dist/field.d.ts +132 -275
- package/dist/field.js +1 -1
- package/dist/glyph-field-C2fQIlnq.d.cts +292 -0
- package/dist/glyph-field-DRC-7uVf.d.ts +292 -0
- package/dist/kit/{chunk-KS3TL3S2.js → chunk-2FH6GGV6.js} +1 -1
- package/dist/kit/chunk-2GAV4OAK.js +1 -0
- package/dist/kit/{chunk-3F6FTBMN.js → chunk-2LBQ7QJT.js} +1 -1
- package/dist/kit/chunk-3LJ5C3U3.js +1 -0
- package/dist/kit/{chunk-SQGJ263V.js → chunk-3MHEDZLZ.js} +1 -1
- package/dist/kit/{chunk-KTYCGGRO.js → chunk-3OD5BMF5.js} +1 -1
- package/dist/kit/{chunk-OVCIHOOS.js → chunk-3VEMKDBW.js} +1 -1
- package/dist/kit/{chunk-H4DBJULW.js → chunk-42KMN727.js} +1 -1
- package/dist/kit/{chunk-PND73YEV.js → chunk-6G5MPND3.js} +1 -1
- package/dist/kit/{chunk-CA5J25SV.js → chunk-6WU247CB.js} +1 -1
- package/dist/kit/{chunk-6L2GAV5C.js → chunk-776H2BJ7.js} +1 -1
- package/dist/kit/{chunk-4SHQA3CO.js → chunk-7DXSG526.js} +1 -1
- package/dist/kit/{chunk-L3P7ZDSK.js → chunk-7M2FFUZ3.js} +1 -1
- package/dist/kit/{chunk-XYLLL2PQ.js → chunk-7NVKRDKE.js} +1 -1
- package/dist/kit/chunk-AIGAJMNN.js +1 -0
- package/dist/kit/{chunk-XXPDXJMQ.js → chunk-B3TY6UXJ.js} +1 -1
- package/dist/kit/chunk-BFBG3VHI.js +1 -0
- package/dist/kit/{chunk-6XNIZ52V.js → chunk-CG6SGQMY.js} +1 -1
- package/dist/kit/{chunk-KBXVIAWS.js → chunk-CGSWUO67.js} +1 -1
- package/dist/kit/{chunk-PFNFW4ZI.js → chunk-DCLJHSWM.js} +1 -1
- package/dist/kit/{chunk-QTVMD62E.js → chunk-DMRPBFLW.js} +1 -1
- package/dist/kit/{chunk-CR7QS3B3.js → chunk-E3FPFANJ.js} +1 -1
- package/dist/kit/{chunk-LUOIH2EM.js → chunk-EKYEA7Z4.js} +1 -1
- package/dist/kit/{chunk-QKZYCROD.js → chunk-F6F2C3RH.js} +1 -1
- package/dist/kit/chunk-FEAFQY7O.js +1 -0
- package/dist/kit/{chunk-A6EDU3UT.js → chunk-FHN3PPSI.js} +1 -1
- package/dist/kit/{chunk-FIWIUXNV.js → chunk-FPCCX4FM.js} +1 -1
- package/dist/kit/{chunk-EHYFSX5K.js → chunk-FWODCYYJ.js} +1 -1
- package/dist/kit/{chunk-PZAQLUAS.js → chunk-GBNV3GXG.js} +1 -1
- package/dist/kit/chunk-GF72XM4C.js +1 -0
- package/dist/kit/{chunk-MRDEO5HZ.js → chunk-GKR3ROYR.js} +1 -1
- package/dist/kit/{chunk-D4KCZSIP.js → chunk-H5KHXZWR.js} +1 -1
- package/dist/kit/{chunk-EJ3W4FN6.js → chunk-I5R2347P.js} +1 -1
- package/dist/kit/{chunk-ZYYLWSPY.js → chunk-IBNDCKEX.js} +1 -1
- package/dist/kit/{chunk-A73S2BCE.js → chunk-ILXVBO7M.js} +1 -1
- package/dist/kit/{chunk-QZHZWO7N.js → chunk-JELJEEJO.js} +1 -1
- package/dist/kit/{chunk-XDNCXCR7.js → chunk-K6JX64AS.js} +1 -1
- package/dist/kit/{chunk-2D2SG6FW.js → chunk-KCEYRIU4.js} +1 -1
- package/dist/kit/{chunk-SE6MQQLB.js → chunk-KDROJANO.js} +1 -1
- package/dist/kit/{chunk-ODMQERGZ.js → chunk-KEE55QSD.js} +1 -1
- package/dist/kit/{chunk-YBBYCUFP.js → chunk-KFXMLIVF.js} +1 -1
- package/dist/kit/{chunk-P6S6HSN3.js → chunk-KLRF3S7O.js} +1 -1
- package/dist/kit/{chunk-ANLBW5RI.js → chunk-KXI3T72F.js} +1 -1
- package/dist/kit/{chunk-PDNKLLBI.js → chunk-KY5KCIZE.js} +1 -1
- package/dist/kit/{chunk-PCGRRX5P.js → chunk-LE53AVKR.js} +1 -1
- package/dist/kit/{chunk-MIA6TUQC.js → chunk-LVCGC3SO.js} +1 -1
- package/dist/kit/chunk-M5VVLYI2.js +1 -0
- package/dist/kit/{chunk-KJJJORN6.js → chunk-MJJSZS23.js} +1 -1
- package/dist/kit/{chunk-EPVZIGEZ.js → chunk-MZFK765W.js} +1 -1
- package/dist/kit/{chunk-G4BQYQJ6.js → chunk-NF4WVWAC.js} +1 -1
- package/dist/kit/{chunk-JRSCTMFM.js → chunk-NW4U2YRE.js} +1 -1
- package/dist/kit/chunk-ORSI57T2.js +1 -0
- package/dist/kit/{chunk-GCIZKMJL.js → chunk-QSTDYL35.js} +1 -1
- package/dist/kit/{chunk-B6GZ645M.js → chunk-QVICL57J.js} +1 -1
- package/dist/kit/{chunk-JAM46FF6.js → chunk-RXOPJJC4.js} +1 -1
- package/dist/kit/{chunk-YL2AXWRA.js → chunk-SDSW7422.js} +1 -1
- package/dist/kit/{chunk-WT3XOWAI.js → chunk-TRDA73HN.js} +1 -1
- package/dist/kit/{chunk-VFV7HZ3G.js → chunk-UOYBFLGJ.js} +1 -1
- package/dist/kit/{chunk-EWPT56TR.js → chunk-UVLKCAKH.js} +1 -1
- package/dist/kit/{chunk-EHXSXMBE.js → chunk-VBWG7HQA.js} +1 -1
- package/dist/kit/{chunk-2TQW2PIG.js → chunk-VIUEAEBX.js} +1 -1
- package/dist/kit/{chunk-BBOSHBZK.js → chunk-VV2KP7ZW.js} +1 -1
- package/dist/kit/{chunk-4XT5IKM3.js → chunk-VX2AD3M7.js} +1 -1
- package/dist/kit/{chunk-2KFBIOVS.js → chunk-W4U5CK6L.js} +1 -1
- package/dist/kit/chunk-WDS7VM2E.js +1 -0
- package/dist/kit/{chunk-6YVZZ3DO.js → chunk-WI2AF2KE.js} +1 -1
- package/dist/kit/{chunk-HMW5NRUV.js → chunk-XUCYFWC3.js} +1 -1
- package/dist/kit/{chunk-V6GEQ5Y5.js → chunk-Z2FRNFMB.js} +1 -1
- package/dist/kit/{chunk-NPJ77LDC.js → chunk-Z3KD6CLE.js} +1 -1
- package/dist/kit/{chunk-ONVONNUH.js → chunk-ZCXNGJGB.js} +1 -1
- package/dist/kit/{chunk-IUX46UDR.js → chunk-ZWZZMU5P.js} +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.cts +1 -1
- package/dist/kit.d.ts +1 -1
- package/dist/kit.js +1 -1
- package/dist/studio-worker.js +1 -0
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +1 -1
- package/package.json +2 -1
- package/skills/asciify-engine/SKILL.md +2 -2
- package/skills/asciify-engine/references/performance.md +1 -1
- package/dist/kit/chunk-2JQ4MRIP.js +0 -1
- package/dist/kit/chunk-BJRPY7UB.js +0 -1
- package/dist/kit/chunk-EK4GIXIO.js +0 -1
- package/dist/kit/chunk-PFQBEWCF.js +0 -1
- package/dist/kit/chunk-SAQJAH2I.js +0 -1
- package/dist/kit/chunk-SVXRMHUJ.js +0 -1
- package/dist/kit/chunk-UO4U32P7.js +0 -1
- package/dist/kit/chunk-XVB3B3FV.js +0 -1
- package/dist/kit/chunk-YDP6566E.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-
|
|
1
|
+
import{mountSurface as t,house as e,styleKeeper as n,handle as r,clamp as o}from"./chunk-GF72XM4C.js";var l={values:[],duration:560},a=.46,i=(t,e)=>e?Math.min(e-1,Math.max(0,Math.floor(t*e))):-1;function c(t,e){if(!e)return{bar:0,gap:0,left:0};const n=e<=7?.5:.6;let r=Math.max(1,Math.floor(t/e));for(;r>1&&e*r+(e-1)*Math.max(1,Math.round(r*n))>t;)r--;const o=e>1?Math.max(0,Math.min(Math.ceil(r*n*1.6),Math.floor((t-e*r)/(e-1)))):0;return{bar:r,gap:o,left:Math.max(0,Math.floor((t-e*r-(e-1)*o)/2))}}function s(s,h={}){const u={current:{...l,...h}};let d=u.current.values,m=null,f=[],p=0,M=!1,x=null,g=!1===u.current.intro?-1e9:performance.now(),v=[],b=[],w=[],k={cols:0,rows:0};const y=()=>u.current.values??[],E=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:7,cellAspect:1,glyphScale:1.1,shade:.5,blend:"off",...u.current.look}),A=(t,e)=>{const{cellSize:n=7,maxPixelRatio:r=2}=E(),o=Math.min("number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1,r),l=Math.max(2,Math.round(n*o)),a=l/o,i=t=>{const e=Math.max(1,Math.floor(t*o/l));for(let t=e;t>1&&t>e-8;t--)if(Math.abs(t*a-Math.round(t*a))<.01)return t;return e},c=i(t),s=Math.max(2,i(e));return{cols:c,rows:s,cell:a,gw:Math.round(c*a),gh:Math.round(s*a)}};let L={left:0,cell:0};const C=(t,e)=>null===m?t===e-1?.8:a:t===m?.8:.3,$=(t,n)=>e((n-g-(b[t]??0))/u.current.duration),S=(t,e,n,r)=>{const l=((t,e,n,r)=>{const{bar:l,gap:a,left:i}=c(n,e.length),s=u.current.max??1.04*Math.max(...e,0),h=s>0?o(Math.max(0,e[t])/s)*(r-1):0,d=i+t*(l+a);return{x0:d,x1:d+l,h:h>0?Math.max(1,Math.round(h)):0}})(t,e,k.cols,k.rows);if(r)return l;const a=v[t]??{...l,h:0},i=$(t,n);return{x0:a.x0+(l.x0-a.x0)*i,x1:a.x1+(l.x1-a.x1)*i,h:a.h+(l.h-a.h)*i}};x=t({host:s,look:E,ink:()=>u.current.ink??"--ascii-ink-strong",kit:u,reducedMotion:()=>u.current.reducedMotion,resolution:(t,e)=>{const{cell:n}=A(t,e);return[Math.max(2,2*Math.round(t/n)),Math.max(4,2*Math.round(e/n))]},onFail:()=>{x=null},paint:({pen:t,width:n,height:r,now:l,still:i})=>{const c=(()=>{const t=x?.canvas;if(!t||!s.offsetWidth)return!1;const{gw:e,gh:n,cell:r}=A(s.offsetWidth,s.offsetHeight),o=Math.round((s.offsetWidth-e)/2),l=[`${o}px`,s.offsetHeight-n+"px",`${e}px`,`${n}px`];L={left:o,cell:r};let a=!1;return["left","top","width","height"].forEach((e,n)=>{t.style[e]!==l[n]&&(t.style[e]=l[n],a=!0)}),a&&x?.field.resize(),a})(),h=n/2,d=r/2;k={cols:h,rows:d};const m=y(),M=m.length,v=p?Math.min(64,l-p):16;p=l;const b=new Float32Array(h*d),E=(t,e,n)=>{const r=(d-1-e)*h+t;n>b[r]&&(b[r]=n)};for(let t=0;t<h;t++)E(t,0,.16);const R=({x0:t,x1:e,h:n},r)=>{if(n<=.01)return;const l=Math.ceil(n)-1;for(let a=Math.max(0,Math.floor(t));a<Math.min(h,Math.ceil(e));a++){const i=o(Math.min(a+1,e)-Math.max(a,t));for(let t=0;t<=l&&t<d-1;t++)E(a,t+1,(t===l?Math.min(1,r+.2):r)*i*o(n-t))}};let F=!1;const H=i?1:e((l-g)/u.current.duration);H<1&&(F=!0);for(const t of w)R({...t,h:t.h*(1-H)},a);H>=1&&(w=[]);for(let t=0;t<M;t++){!i&&$(t,l)<1&&(F=!0);const e=C(t,M),n=f[t]??e;f[t]=i?e:n+(e-n)*(1-Math.exp(-v/70)),Math.abs(f[t]-e)>.004&&(F=!0),R(S(t,m,l,i),f[t])}for(let e=0;e<b.length;e++){if(b[e]<=0)continue;const n=Math.round(255*b[e]);t.fillStyle=`rgb(${n} ${n} ${n})`,t.fillRect(e%h*2,2*Math.floor(e/h),2,2)}return c&&i&&x?.kick(),F||c}});const R=n(),F=x?null:document.createElement("div"),H=()=>{if(!F)return;const t=y(),e=t.length,n=u.current.max??1.04*Math.max(...t,0);F.replaceChildren(...t.map((t,r)=>{const l=document.createElement("div");return l.setAttribute("style",`flex:1 1 0;height:${n>0?(100*o(t/n)).toFixed(2):0}%;margin:0 ${e<=7?22:18}%;background:currentColor;opacity:${.9*(.16+.84*C(r,e))}`),l}))};F&&("static"===getComputedStyle(s).position&&R.set(s,"position","relative"),F.setAttribute("aria-hidden","true"),F.setAttribute("style","position:absolute;inset:0;display:flex;align-items:flex-end;pointer-events:none"),s.appendChild(F));const I=document.createElement("table");I.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0");const P=()=>{const t=u.current.format??(t=>t.toLocaleString()),e=u.current.labels??[],n=document.createElement("tbody");y().forEach((r,o)=>{const l=document.createElement("tr"),a=document.createElement("th"),i=document.createElement("td");a.setAttribute("scope","row"),a.setAttribute("style","font-weight:inherit"),a.textContent=e[o]??String(o+1),i.textContent=t(r),l.appendChild(a),l.appendChild(i),n.appendChild(l)}),I.replaceChildren(n)};P(),s.appendChild(I);const W=!s.hasAttribute("tabindex"),z=!s.hasAttribute("role");W&&(s.tabIndex=0),z&&s.setAttribute("role","group");const X=t=>{const e=y().length,n=null!==t&&e?Math.min(e-1,Math.max(0,Math.round(t))):null;n!==m&&(m=n,x?.kick(),H(),u.current.onHover?.(m,null===m?null:y()[m],null===m?null:u.current.labels?.[m]??null))},G=t=>u.current.stagger??(t<=7?45:12),O=(t,n)=>{const r=y(),o=u.current.labels,l=performance.now(),i=!!x?.still(),c=k.cols&&!i?t.map((e,n)=>S(n,t,l,!1)):[],s=i?[]:w.map(t=>({...t,h:t.h*(1-e((l-g)/u.current.duration))})),h=new Map,m=(t,e,r)=>o&&n?r?.[t]??`#${t}`:"#"+(e-1-t);t.forEach((e,r)=>h.set(m(r,t.length,n),r));const p=new Set,M=f;let E=0;const A=r.length;v=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n&&c[n]?(p.add(n),c[n]):null}),f=r.map((t,e)=>{const n=h.get(m(e,A,o));return void 0!==n?M[n]??a:a}),b=v.map(t=>t?0:E++*G(A)*.6),w=[...s,...c.filter((t,e)=>!p.has(e))].filter(t=>t.h>.01),d=r,g=l,x?.kick(),H()};H();const j=t=>{const e=s.getBoundingClientRect(),n=y().length;if(!e.width)return;const r=(t.clientX-e.left)/e.width,o=t.clientY-e.top;if(r<0||r>1||o<0||o>e.height)return void X(null);if(!k.cols)return void X(i(r,n));const{bar:l,gap:a,left:h}=c(k.cols,n);X(Math.round(((t.clientX-e.left-L.left)/L.cell-h-l/2)/Math.max(1,l+a)))},B=()=>X(null),D=t=>{const e=y().length,n="ArrowRight"===t.key?null===m?0:Math.min(e-1,m+1):"ArrowLeft"===t.key?null===m?e-1:Math.max(0,m-1):"Home"===t.key?0:"End"===t.key?e-1:"Escape"===t.key?null:void 0;void 0!==n&&e&&(t.preventDefault(),X(n))};s.addEventListener("pointermove",j),s.addEventListener("pointerdown",j),s.addEventListener("pointerleave",B),s.addEventListener("pointercancel",B),s.addEventListener("keydown",D),s.addEventListener("blur",B);const Y="function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t?.isIntersecting&&!M&&(M=!0,!1!==u.current.intro&&(()=>{const t=y().length;d=y(),g=performance.now(),v=[],w=[],b=Array.from({length:t},(e,n)=>n*G(t)),f=y().map((t,e,n)=>C(e,n.length)),x?.kick(),H()})())},{threshold:.4}):null;Y?.observe(s);let q=u.current.labels;return r(()=>x,u,t=>{P(),t.values!==d&&(O(d,q),q=t.labels),x?.refresh()},{set(t,e){const n=d,r=q;u.current={...u.current,values:[...t],...e?{labels:[...e]}:{}},q=u.current.labels,null!==m&&m>=t.length&&X(null),P(),O(n,r)},highlight:X,get active(){return m},get values(){return y()}},()=>{Y?.disconnect(),I.remove(),F?.remove(),R.restore(),s.removeEventListener("pointermove",j),s.removeEventListener("pointerdown",j),s.removeEventListener("pointerleave",B),s.removeEventListener("pointercancel",B),s.removeEventListener("keydown",D),s.removeEventListener("blur",B),W&&s.removeAttribute("tabindex"),z&&s.removeAttribute("role")})}var h=l;export{h as BLOCK_CHART_DEFAULTS,i as barAt,c as barLayout,s as blockChart};//# sourceMappingURL=chunk-VBWG7HQA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectStyle as e}from"./chunk-
|
|
1
|
+
import{injectStyle as e}from"./chunk-LE53AVKR.js";import{mountSurface as t,hash as n,handle as r,prefersReduced as i,clamp as o,house as a,smoothstep as s}from"./chunk-GF72XM4C.js";var l={caret:!0,settle:60,stagger:18,reasoningLines:2,transition:"flicker",roll:300,glyphs:"#%*+=-:"},c="cubic-bezier(.16, 1, .3, 1)",d=`\n:where(.ascii-reasoning){display:grid;grid-template-rows:1fr;transition:grid-template-rows 260ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning[data-collapsed]){grid-template-rows:0fr;opacity:0}\n:where(.ascii-reasoning-in){min-height:0;overflow:hidden}\n:where(.ascii-reasoning ol){height:calc(var(--ascii-reasoning-lines, 2) * 1.5em);margin:0 0 .5em;padding:0;list-style:none;overflow:hidden;-webkit-mask-image:linear-gradient(to bottom,transparent,#000 45%);mask-image:linear-gradient(to bottom,transparent,#000 45%)}\n:where(.ascii-reasoning li){height:1.5em;line-height:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.62;translate:0 calc(var(--ascii-reasoning-shift, 0) * -1.5em);transition:translate 240ms ${c},opacity 200ms ${c}}\n:where(.ascii-reasoning li[data-new]){opacity:0}\n@media (prefers-reduced-motion: reduce){:where(.ascii-reasoning, .ascii-reasoning li){transition:none}}\n`,p=.7,h=e=>[...e.children].filter(e=>"IMG"===e.tagName&&void 0!==e.dataset?.asciiPoster);function u(c,u={}){const m={current:{...l,...u}},g=[...c.childNodes];let f="idle",y="",x=[],w=null,v=0,b=null,k=null,M=null;const S=()=>{const e=getComputedStyle(c),t=parseFloat(e.fontSize)||15,n=parseFloat(e.lineHeight),r=Number.isFinite(n)&&n>0?n:1.5*t;return{size:t,line:r,ch:r/2,cw:Math.max(2,Math.round(.44*t))}},C="roll"===m.current.transition;let A=null,$=null;const E=e=>{f!==e&&(f=e,"done"!==e&&"stopped"!==e||(A?.setAttribute("data-collapsed",""),A?.setAttribute("aria-hidden","true")),"streaming"===e?c.setAttribute("aria-busy","true"):c.removeAttribute("aria-busy"),m.current.onState?.(e))},P=e=>{e.span.style.removeProperty("color"),e.span.style.removeProperty("opacity")},F=()=>{x.forEach(P),x=[],"streaming"===f&&b&&E("done"),b?.(),b=null};if(M=t({host:c,look:()=>{if(C){return{mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:S().size<24?2:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...m.current.look}}const{ch:e,cw:t}=S();return{mark:"glyph",charset:" :-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:e,cellAspect:t/e,glyphScale:1,shade:.6,...m.current.look}},ink:()=>m.current.ink??getComputedStyle(c).color,kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null,F()},resolution:C?2:1,paint:({pen:e,now:t,still:r,box:i,scale:l})=>{if(C)return((e,t,r,i,l)=>{const d=getComputedStyle(c),p=parseFloat(d.fontSize)||15,{line:h}=S(),u=`${d.fontStyle} ${d.fontWeight} ${d.fontSize} ${d.fontFamily}`;e.setTransform(l,0,0,l,0,0),e.textAlign="left",e.textBaseline="alphabetic",e.font=u;const g=e.measureText("x"),y=g.fontBoundingBoxAscent||.8*p,v=g.fontBoundingBoxDescent||.2*p;r&&(x.forEach(P),x=[]);const k=m.current;if(x=x.filter(r=>{if(t>=r.at)return P(r),!1;const l=o((t-r.from)/Math.max(1,r.at-r.from)),c=a(l),d=i(r.span);if(r.span.style.setProperty("opacity",s(.72,1,l).toFixed(3)),l<=0)return!0;const m=d.y+(d.h-h)/2,g=m+(h-y-v)/2+y,f=3+r.seed%3,x=[...Array.from({length:f},(e,t)=>k.glyphs[Math.floor(n(t,r.seed)*k.glyphs.length)]??""),r.span.textContent??""],w=(1-c)*(x.length-1)*h;return e.save(),e.beginPath(),e.rect(d.x-2,m,d.w+4,h),e.clip(),e.globalAlpha=1-s(.72,1,l),x.forEach((t,n)=>{const r=g+(n-(x.length-1))*h+w;if(r<m-h||r>m+2*h)return;const i=n===x.length-1;e.font=i?u:`600 ${.84*p}px "Geist Mono", ui-monospace, monospace`,e.fillStyle=i?"#fff":"#d0d0d0",e.fillText(t,d.x+(i?0:(d.w-e.measureText(t).width)/2),r)}),e.restore(),!0}),e.globalAlpha=1,!x.length&&b&&F(),k.caret&&"idle"!==f&&(w||"streaming"===f)){const n=x.find(e=>e.from>t),r=n?n.span.previousElementSibling:w,o=r?i(r):{x:0,y:0,w:0,h:h},a=o.y+(o.h-h)/2;e.fillStyle="streaming"===f?"#fff":"rgb(178.5 178.5 178.5)",e.fillRect(o.x+o.w+.18*p,a+.2*h,Math.max(2,.5*p),.6*h)}return x.length>0})(e,t,r,i,l);const{line:d,ch:h,cw:u,size:g}=S(),y=Math.floor(t/48),v=d/4,k=(t,n)=>{const r=Math.floor((t.y-v+t.h/2)/d)*d+v+(d-h)/2,i=Math.round(t.x/u),o=Math.round(255*n);e.fillStyle=`rgb(${o} ${o} ${o})`,e.fillRect(i*u,r,Math.max(1,Math.round((t.x+t.w)/u)-i)*u,h)};if(r&&(x.forEach(P),x=[]),x=x.filter(e=>t>=e.at?(P(e),!1):(k(i(e.span),.55+.45*n(y,e.seed)),!0)),!x.length&&b&&F(),m.current.caret&&"idle"!==f&&(w||"streaming"===f)){const e=w?i(w):{x:0,y:v,w:0,h:d},t=Math.round((e.x+e.w+.3*g)/u)*u;k({x:t,y:e.y,w:u,h:e.h},"streaming"===f?1:p)}return x.length>0}}),M){const e=getComputedStyle(c),t=M.canvas.style,n=e=>parseFloat(e??"")||0,{line:r}=S(),i=n(e.paddingTop)-r/4,o=n(e.paddingRight)-r/2,a=n(e.paddingBottom)-r/4,s=n(e.paddingLeft);t.top=`${i}px`,t.left=`${s}px`,t.width=`calc(100% - ${s+o}px)`,t.height=`calc(100% - ${i+a}px)`}return r(()=>M,m,()=>M?.refresh(),{write:e=>{if(!e)return;"streaming"!==f&&("idle"===f&&(c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas)),k=null,E("streaming")),y+=e;const t=e=>c.appendChild(e);if(!M)return void t(document.createTextNode(e));const n=performance.now(),r=m.current,i=M.still();let o=0;for(const a of e.match(/\s+|\S/g)??[]){if(/^\s/.test(a)){t(document.createTextNode(a));continue}const e=document.createElement("span");if(e.textContent=a,!i)if(C){const t=x.length?x[x.length-1].from+r.stagger:n,i=Math.max(n,t);e.style.setProperty("opacity","0"),x.push({span:e,from:i,at:i+r.roll,seed:31*v+o})}else e.style.setProperty("color","transparent"),x.push({span:e,from:n,at:n+r.settle+o*r.stagger,seed:31*v+o});t(e),w=e,o++}v++,M.kick()},done:()=>k||("streaming"!==f?Promise.resolve():(k=new Promise(e=>{b=e}),M&&x.length?M.kick():F(),k)),stop(){if("idle"===f&&A)return k=null,E("stopped"),void M?.kick();"streaming"===f&&(x.forEach(P),x=[],E("stopped"),b?.(),b=null,M?.kick())},reasoning:t=>{if(!t||"undefined"==typeof document)return;if(!A||!$){e("ascii-kit-reasoning",d),A=document.createElement("div"),A.className="ascii-reasoning";const t=document.createElement("div");t.className="ascii-reasoning-in",$=document.createElement("ol"),t.appendChild($),A.appendChild(t),c.parentElement?.insertBefore(A,c)}A.removeAttribute("data-collapsed"),A.removeAttribute("aria-hidden");const n=Math.max(1,Math.round(m.current.reasoningLines));A.style.setProperty("--ascii-reasoning-lines",String(n));const r=document.createElement("li");r.textContent=t;const o=m.current.reducedMotion??i();o||r.setAttribute("data-new",""),$.appendChild(r);const a=A,s=String(Math.max(0,$.children.length-n));o?a.style.setProperty("--ascii-reasoning-shift",s):(getComputedStyle(r).translate,requestAnimationFrame(()=>{r.removeAttribute("data-new"),a.style.setProperty("--ascii-reasoning-shift",s)}))},reset(){x=[],y="",w=null,v=0,A?.remove(),A=$=null,b?.(),b=null,k=null,c.replaceChildren(...h(c)),M&&c.appendChild(M.canvas),E("idle"),M?.kick()},get state(){return f},get text(){return y}},()=>{b?.(),b=null,A?.remove(),A=$=null,c.removeAttribute("aria-busy"),y?c.textContent=y:c.replaceChildren(...g)})}var m=l;export{m as STREAM_TEXT_DEFAULTS,u as streamText};//# sourceMappingURL=chunk-VIUEAEBX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,mountSurface as e,handle as n,hash as r,house as o}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,handle as n,hash as r,house as o}from"./chunk-GF72XM4C.js";var a={duration:800,trigger:"visible",replayOnHover:!0,settle:"glyphs"};function i(t,e,n=.82){const o=t.getContext("2d");if(!o)return;const a=t.width,i=t.height,l=o.createImageData(a,i),c=t=>t*t*(3-2*t),s=(t,e)=>{const n=Math.floor(t),o=Math.floor(e),a=c(t-n),i=c(e-o),l=r(n,o),s=r(n+1,o),f=r(n,o+1);return l+(s-l)*a+(f-l)*i+(l-s-f+r(n+1,o+1))*a*i};for(let t=0;t<i;t++)for(let r=0;r<a;r++){const o=.6*s(r/6+2.4*e,t/3.5-.8*e)+.4*s(r/2.5-3*e,t/2),c=Math.min(1,2.4*(1-Math.hypot(2*(r/a-.5),2*(t/i-.5))*n)),f=.72*Math.max(0,o-.42)*Math.max(0,c)*255,g=4*(t*a+r);l.data[g]=l.data[g+1]=l.data[g+2]=f,l.data[g+3]=255}o.putImageData(l,0,0)}function l(l,c={}){const s={current:{...a,...c}},f=t(),g=document.createElement("canvas"),d=document.createElement("canvas");let h=-1,p="",u=!1,m=!1,x=null;const v=(t,e)=>{const n=`${t}x${e}:${s.current.text??""}:${l.textContent}`;if(n===p)return;p=n,g.width=t,g.height=e;const r=g.getContext("2d");r.fillStyle="#000",r.fillRect(0,0,t,e),void 0!==s.current.text?function(t,e,n,r,o){const a=getComputedStyle(e),i=n.split("\n");t.fillStyle="#fff",t.textAlign="center",t.textBaseline="middle";const l=(parseFloat(a.letterSpacing)||0)/(parseFloat(a.fontSize)||16),c=e=>{"letterSpacing"in t&&(t.letterSpacing=l*e+"px")};t.font=`${a.fontWeight} 100px ${a.fontFamily}`,c(0);const s=Math.max(1,...i.map(e=>t.measureText(e).width)),f=Math.min(.94*r/s*100,.9*o/i.length);t.font=`${a.fontWeight} ${f}px ${a.fontFamily}`,c(f),i.forEach((e,n)=>t.fillText(e,r/2,o/2+(n-(i.length-1)/2)*f*1.04))}(r,l,s.current.text,t,e):function(t,e,n,r){const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=document.createRange();t.fillStyle="#fff",t.textAlign="left",t.textBaseline="alphabetic";for(let e=o.nextNode();e;e=o.nextNode()){const o=e.parentElement;if(!o)continue;const i=getComputedStyle(o);t.font=`${i.fontStyle} ${i.fontWeight} ${parseFloat(i.fontSize)*r}px ${i.fontFamily}`,"letterSpacing"in t&&(t.letterSpacing=(parseFloat(i.letterSpacing)||0)*r+"px");const l=t.measureText("Hg"),c=l.fontBoundingBoxAscent||parseFloat(i.fontSize)*r*.8,s=l.fontBoundingBoxDescent||parseFloat(i.fontSize)*r*.2,f="uppercase"===i.textTransform?t=>t.toUpperCase():"lowercase"===i.textTransform?t=>t.toLowerCase():t=>t;for(const o of e.data.matchAll(/\S+/g)){a.setStart(e,o.index),a.setEnd(e,o.index+o[0].length);const i=a.getClientRects()[0];if(!i)continue;const l=(i.top-n.top)*r,g=i.height*r;t.fillText(f(o[0]),(i.left-n.left)*r,l+(g-c-s)/2+c)}}a.detach?.()}(r,l,l.getBoundingClientRect(),t/(l.getBoundingClientRect().width||1))};x=e({host:l,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4.5,cellAspect:.62,glyphScale:.92,contrast:1.35,hover:"trail",trail:{strength:.6,radius:.2},...s.current.look}),ink:()=>s.current.ink??getComputedStyle(l).color,kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.restore()},paint:({pen:t,width:e,height:n,now:a,still:l})=>{v(e,n);const c=s.current,f="text"===c.settle;if(h<0||l)return!(!m&&"visible"===c.trigger&&!l)&&(f&&h>=0||t.drawImage(g,0,0),h>=0&&S(),!1);const p=a-h,x=.3*c.duration,w=.7*c.duration,y=Math.max(2,Math.ceil(e/20)),M=Math.max(2,Math.ceil(n/20));if(d.width===y&&d.height===M||(d.width=y,d.height=M),i(d,p/1e3),t.imageSmoothingEnabled=!0,p<x)return t.drawImage(d,0,0,e,n),u&&(t.globalAlpha=1-o(p/x),t.drawImage(g,0,0),t.globalAlpha=1),!0;const b=Math.min(1,(p-x)/w),E=(1.18*b-.02)*e,k=.14*e,I=5.58,$=Math.floor(a/16);if(b>=1)return f||t.drawImage(g,0,0),S(),!1;t.drawImage(d,0,0,e,n),E>0&&t.drawImage(g,0,0,E,n,0,0,E,n);for(let e=Math.max(0,Math.floor(E/I)*I);e<E+k;e+=I){const o=(e-E)/k;for(let a=0;a<n;a+=9)r(e+13*$,a)<o||(t.globalAlpha=.35+.65*r(a+7*$,e),t.fillStyle="#000",t.fillRect(e,a,I,9),t.drawImage(g,e,a,I,9,e,a,I,9))}return t.globalAlpha=1,!0}});const S=()=>{h=-1,u="text"!==s.current.settle,u||f.restore()},w=()=>{x&&(f.set(l,"-webkit-text-fill-color","transparent"),m=!0,h=performance.now(),x.kick())};let y=!1;const M=x&&"visible"===s.current.trigger&&"function"==typeof IntersectionObserver?new IntersectionObserver(([t])=>{t.isIntersecting&&!y&&w(),y=t.isIntersecting},{threshold:.5}):null;x&&("text"!==s.current.settle&&f.set(l,"-webkit-text-fill-color","transparent"),u="text"!==s.current.settle&&"manual"===s.current.trigger,M?M.observe(l):"visible"===s.current.trigger&&w());let b=!1;const E=()=>{b||(b=!0,s.current.replayOnHover&&h<0&&w())},k=()=>{b=!1},I=t=>{!b||t.target instanceof Node&&l.contains(t.target)||(b=!1)};return x&&(l.addEventListener("pointerenter",E),l.addEventListener("pointermove",E),l.addEventListener("pointerleave",k),document.addEventListener("pointermove",I,!0)),x&&document.fonts?.ready.then(()=>{p="",x?.kick()}),n(()=>x,s,()=>{p="",x?.refresh()},{replay:w},()=>{M?.disconnect(),l.removeEventListener("pointerenter",E),l.removeEventListener("pointermove",E),l.removeEventListener("pointerleave",k),document.removeEventListener("pointermove",I,!0),f.restore()})}var c=a;export{c as DECODE_DEFAULTS,l as decode,i as driftNoise};//# sourceMappingURL=chunk-VV2KP7ZW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{injectStyle as e}from"./chunk-
|
|
1
|
+
import{injectStyle as e}from"./chunk-LE53AVKR.js";import{drawBlocks as t,snapshot as n,blocksOf as r,BLOCK_W as o,BLOCK_H as s}from"./chunk-Z2FRNFMB.js";import{styleKeeper as i,mountSurface as a,house as c,clamp as l,handle as u,hash as d,boxIn as f,prefersReduced as p}from"./chunk-GF72XM4C.js";var h={input:"input",rows:'[role="option"]',hotkey:"k",manage:!0,closeOnRun:!0,highlight:!0,ai:"[data-ai]"},m=200,g=3600,y=40,v="cubic-bezier(.16, 1, .3, 1)",x=`\n:where([data-ascii-cmd-highlight]){position:absolute;left:0;top:0;z-index:-1;pointer-events:none;opacity:0;background:var(--ascii-cmd-highlight,color-mix(in oklab,currentColor 7%,transparent));transition:translate 240ms ${v},width 240ms ${v},height 240ms ${v},opacity 160ms ${v}}\n:where([data-ascii-cmd-highlight][data-on]){opacity:1}\n@media (prefers-reduced-motion:reduce){:where([data-ascii-cmd-highlight]){transition:none}}\n`;function k(k,w={}){const b={current:{...h,...w}},E=i(),$=()=>[...k.querySelectorAll(b.current.rows)],M=()=>k.querySelector(b.current.input),A=i();let L=b.current.open??!k.hasAttribute("hidden"),C=0,S=null,T=!1,O=0,R=null,W=[],H=null,F=0,z=0;const D=new WeakMap,P=()=>!!(b.current.reducedMotion??p());e("ascii-kit-command",x),"static"===getComputedStyle(k).position&&A.set(k,"position","relative"),A.set(k,"isolation","isolate");const K=document.createElement("div");K.setAttribute("aria-hidden","true"),K.dataset.asciiCmdHighlight="",b.current.highlight&&k.insertBefore(K,k.firstElementChild);const j=e=>{if(void 0===e.offsetParent)return f(k,e);let t=0,n=0;for(let r=e;r&&r!==k;r=r.offsetParent)t+=r.offsetLeft,n+=r.offsetTop;for(let r=e.parentElement;r&&r!==k;r=r.parentElement)t-=r.scrollLeft,n-=r.scrollTop;return{x:t,y:n,w:e.offsetWidth,h:e.offsetHeight}},N=e=>{const t=$()[C];if(!K.parentElement)return;if(!t||!L)return void delete K.dataset.on;const n=j(t),r=!e||void 0===K.dataset.on||P();r&&(K.style.transition="none"),K.style.translate=`${n.x}px ${n.y}px`,K.style.width=`${n.w}px`,K.style.height=`${n.h}px`,K.style.borderRadius=getComputedStyle(t).borderTopLeftRadius,K.dataset.on="",r&&(K.offsetWidth,K.style.removeProperty("transition"))};let q=null;const B=i();R=a({host:k,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...b.current.look}),ink:()=>b.current.ink??"--ascii-ink-strong",kit:b,reducedMotion:()=>b.current.reducedMotion,resolution:2,onFail:()=>{R=null},paint:({pen:e,now:i,still:a,box:u})=>{if(e.setTransform(2,0,0,2,0,0),S){const n=S,r=(i-n.start)/(n.closing?m:260);if(!(r>=1||a)){const o=n.closing?1-1.02*c(r):1.04*c(r);return t(e,n.snap,n.blocks,n.order,o,(e,t)=>[(n.ox-e.x)*t*.9,(n.oy-e.y)*t*.9],n.closing?1:1-l((r-.72)/.28),.4),!0}S=null}if(!L||T)return!1;let f=!1;W=W.filter(n=>{const r=(i-n.start)/280;return(r>=.7||a)&&n.styles.restore(),r>=1||a||!k.contains(n.row)?(n.styles.restore(),!1):(f=!0,r>0&&t(e,n.snap,n.blocks,n.order,1.04*c(r),(e,t)=>[14*t,0],1-l((r-.7)/.3),.42),!0)});const p=$()[C];if(p&&!a&&p.matches(b.current.ai)){p!==H&&(H=p,F=i+160);const t=i-F,a=t>=0?t%g/1100:-1;if(a>=0&&a<1&&!W.some(e=>e.row===p))((e,t,i,a,c)=>{const l=R,u=`${t.textContent}|${i.x}|${i.y}|${i.w}`;if(q?.row!==t||q.key!==u){const e=n(t,l.box,l.canvas.clientWidth||k.offsetWidth,l.canvas.clientHeight||k.offsetHeight,2);q={row:t,key:u,snap:e,blocks:r(e,2)}}const f=i.x-y+(i.w+80)*(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(a),p=Math.floor(c/70);for(const t of q.blocks){const n=(t.x+2-f)/y;if(n<=-1||n>=1)continue;const r=1-n*n;d(t.x+p,t.y)>.35+.65*r||(e.globalAlpha=Math.min(1,1.6*r),e.drawImage(q.snap,2*t.x,2*t.y,2*o,2*s,t.x,t.y,o,s))}e.globalAlpha=1;const h=f-i.x;B.set(t,"mask-image",`linear-gradient(90deg, #000 ${h-y}px, transparent ${h-14}px, transparent ${h+14}px, #000 ${h+y}px)`)})(e,p,u(p),a,i),f=!0;else{if(B.restore(),f)return!0;z&&clearTimeout(z);const e=t>=0?g-t%g:-t;z=setTimeout(()=>{z=0,R?.kick()},Math.max(16,e))}}else H=null,B.restore();return f}}),R&&(k.dataset.gpu="");const G=(e=!0)=>{const t=$();if(C=t.length?Math.min(Math.max(0,C),t.length-1):0,N(e),!b.current.manage)return;t.forEach((e,t)=>e.setAttribute("aria-selected",String(t===C)));const n=M(),r=t[C]?.id;n&&r&&n.setAttribute("aria-activedescendant",r)},V=()=>`inset(0 round ${getComputedStyle(k).borderTopLeftRadius||"0px"})`,I=()=>{const e=b.current.trigger,t=k.offsetWidth,n=k.offsetHeight;if(!e)return`inset(0 ${Math.max(0,t/2-40)}px ${Math.max(0,n-36)}px round 18px)`;const r=f(k,e);return`inset(${r.y}px ${t-r.x-r.w}px ${n-r.y-r.h}px ${r.x}px round ${r.h/2}px)`},U=e=>{const t=R;if(!t)return;const o=k.offsetWidth,s=k.offsetHeight,i=n(k,t.box,o,s,2),a=r(i,2),c=b.current.trigger,l=c?t.box(c):{x:o/2,y:0,w:0,h:0},u=l.x+l.w/2,d=l.y+l.h/2,f=Math.hypot(o,s)||1;S={snap:i,blocks:a,order:Float32Array.from(a,e=>Math.hypot(e.x-u,e.y-d)/f*.7+.3*e.seed),ox:u,oy:d,start:performance.now(),closing:e},t.kick()},X=e=>{if(e)for(const e of[...k.children])"CANVAS"===e.tagName&&void 0!==e.dataset.asciiKit||E.set(e,"opacity","0");else E.restore()},Z=(e,t,n="none")=>"function"!=typeof k.animate?null:k.animate(e.map(e=>({clipPath:e})),{duration:t,easing:v,fill:n}),J=()=>{O&&clearTimeout(O),O=0},Q=(e=!0)=>{!L||T?(J(),L=!0,T=!1,C=0,k.removeAttribute("hidden"),k.dataset.open="",b.current.trigger?.setAttribute("aria-expanded","true"),G(!1),(()=>{for(const e of $())D.set(e,j(e).y)})(),e&&M()?.focus({preventScroll:!0}),b.current.onOpenChange?.(!0),P()?R?.kick():(k.dataset.state="opening",Z([I(),V()],260),R&&(T=!0,X(!0),U(!1)),O=setTimeout(()=>{O=0,delete k.dataset.state,T=!1,X(!1),R?.kick()},143))):e&&M()?.focus({preventScroll:!0})},Y=()=>{if(!L)return;J();const e=k.contains(document.activeElement),t=()=>{O=0,T=!1,L=!1,S=null,delete k.dataset.state,delete k.dataset.open,X(!1),N(!1);for(const e of W)e.styles.restore();W=[],B.restore(),q=null,k.setAttribute("hidden",""),b.current.trigger?.setAttribute("aria-expanded","false"),e&&b.current.trigger?.focus({preventScroll:!0}),R?.kick(),b.current.onOpenChange?.(!1)};if(P())return void t();T=!0,k.dataset.state="closing",R&&(U(!0),X(!0));const n=Z([V(),I()],m,"forwards"),r="function"==typeof k.animate?k.animate([{opacity:1},{opacity:1,offset:.4},{opacity:0}],{duration:m,fill:"forwards"}):null;O=setTimeout(()=>{t(),n?.cancel(),r?.cancel()},m)},_=e=>{const t=$().length;t&&(C=(Math.round(e)%t+t)%t,G(),R?.kick())},ee=(e=C)=>{const t=$()[e];if(!t||T)return;_(e),R?.field.pulse({element:t,strength:.6}),t.matches(b.current.ai)&&(H=t,F=performance.now()),t.dataset.run="",b.current.onRun?.(e,t);const n=()=>{delete t.dataset.run,b.current.closeOnRun&&Y()};P()?n():setTimeout(n,240)},te=e=>{if(!b.current.manage)return;const t=$().length;if("Escape"===e.key&&L)return e.preventDefault(),e.stopPropagation(),void Y();if(e.target!==M()&&!$().includes(e.target))return;const n="ArrowDown"===e.key?C+1:"ArrowUp"===e.key?C-1:"Home"===e.key?0:"End"===e.key?t-1:null;if(null!==n)return e.preventDefault(),void _(n);"Enter"===e.key&&(e.preventDefault(),ee())},ne=e=>{const t=e.target?.closest?.(b.current.rows);return t?$().indexOf(t):-1},re=e=>{if(!b.current.manage)return;const t=ne(e);t<0||t!==C&&_(t)},oe=e=>{if(!b.current.manage)return;const t=ne(e);t>=0&&ee(t)},se=()=>{b.current.manage&&(C=0,G(!1))},ie="function"==typeof MutationObserver?new MutationObserver(()=>{L&&(G(!1),(()=>{const e=R,t=$(),o=t.filter(e=>{const t=j(e).y,n=D.get(e);return D.set(e,t),void 0===n||Math.abs(n-t)>1});for(const e of W)t.includes(e.row)&&!o.includes(e.row)||e.styles.restore();if(W=W.filter(e=>t.includes(e.row)&&!o.includes(e.row)),!e||!e.live||e.still()||T||!L)return;const s=e.canvas.clientWidth||k.offsetWidth,a=e.canvas.clientHeight||k.offsetHeight,c=performance.now();o.forEach((t,o)=>{const l=n(t,e.box,s,a,2),u=r(l,2);if(!u.length)return;const d=Math.min(...u.map(e=>e.x)),f=Math.max(1,Math.max(...u.map(e=>e.x))-d),p=i();for(const e of[...t.children])p.set(e,"opacity","0");W.push({row:t,snap:l,blocks:u,order:Float32Array.from(u,e=>(e.x-d)/f*.72+.28*e.seed),start:c+28*o,styles:p})}),e.kick()})())}):null;ie?.observe(k,{childList:!0,subtree:!0});const ae="function"==typeof ResizeObserver?new ResizeObserver(()=>N(!1)):null;ae?.observe(k);const ce=()=>{L?Y():Q(!0)},le=e=>{const t=b.current.hotkey;t&&e.key?.toLowerCase()===t.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L?document.activeElement===M()?Y():M()?.focus():Q(!0))},ue=e=>{if(!b.current.manage||!L||T)return;const t=e.target;k.contains(t)||b.current.trigger?.contains(t)||Y()};k.addEventListener("keydown",te),k.addEventListener("pointermove",re),k.addEventListener("click",oe),k.addEventListener("input",se);const de=b.current.trigger;return de?.addEventListener("click",ce),de?.setAttribute("aria-expanded",String(L)),de?.setAttribute("aria-haspopup","dialog"),document.addEventListener("keydown",le),document.addEventListener("pointerdown",ue),L?k.dataset.open="":k.setAttribute("hidden",""),G(),u(()=>R,b,()=>{G(),R?.refresh()},{open:Q,close:Y,select:_,run:ee,toggle(){L?Y():Q(!0)},get isOpen(){return L},get selected(){return C}},()=>{J(),z&&clearTimeout(z),X(!1);for(const e of W)e.styles.restore();B.restore(),ie?.disconnect(),ae?.disconnect(),K.remove(),A.restore(),k.removeEventListener("keydown",te),k.removeEventListener("pointermove",re),k.removeEventListener("click",oe),k.removeEventListener("input",se),de?.removeEventListener("click",ce),document.removeEventListener("keydown",le),document.removeEventListener("pointerdown",ue),delete k.dataset.gpu,delete k.dataset.state})}var w=h;export{w as COMMAND_PALETTE_DEFAULTS,k as commandPalette};//# sourceMappingURL=chunk-VX2AD3M7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";var n=(t,e,n,i)=>{const r=.2*Math.sin(3*t+2*e+.2*i);return(.65*Math.pow(.5+.5*Math.sin(45*(t+r)),8)+.35*Math.pow(.5+.5*Math.sin(50*(e-.3*r)),10))*(.4+.6*Math.sin(2*e+.4))},i={id:"weave",name:"Weave",description:"Interlaced threads with a subtle change in tension.",cellSize:12,speed:1,cursor:!1,mount:i=>e(i,(e,i,r,h,o,a)=>t(n,e,i,r,h,{ditherStrength:a.ditherStrength,fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink}))};export{i as weave};//# sourceMappingURL=chunk-W4U5CK6L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{styleKeeper as t,mountSurface as e,easeOut as n,srOnly as o,handle as r,isDark as a}from"./chunk-GF72XM4C.js";var i={tone:"neutral",live:!1,indicator:!0,sheen:!0},l={light:{green:[22,150,82],amber:[214,138,8],red:[214,52,52],neutral:[120,120,114],new:[255,255,255]},dark:{green:[120,240,170],amber:[255,206,110],red:[255,156,156],neutral:[200,200,192],new:[255,255,255]}},s={light:[[.03," "],[.08,"·"],[.13,"•"],[.18,"○"],[.5,"●"],[.56,"◐"],[.62,"◓"],[.68,"◑"],[.74,"◒"],[.8,"●"],[.88,"✧"],[2,"✦"]],dark:[[.02," "],[.06,"✦"],[.1,"✧"],[.2,"·"],[.3,"•"],[.38,"○"],[.64,"●"],[.68,"◐"],[.72,"◓"],[.76,"◑"],[.8,"◒"],[2,"●"]]},c=t=>Array.from({length:96},(e,n)=>t.find(([t])=>n/95<t)[1]).join(""),d={light:c(s.light),dark:c(s.dark)},h=["◐","◓","◑","◒"],u=["✧","·","✧","✦","✧","✦"],f=12;var p=(t,e)=>{return"green"===(n=t.dataset.tone)||"amber"===n||"red"===n||"neutral"===n||"new"===n?t.dataset.tone:e;var n};function m(t,e,n){return{x:t.x+2,y:Math.round((t.y+t.h/2)/n-.5)*n,w:Math.max(0,t.w-4)}}function x(t,e){const n=t=>t.toFixed(2),o=e/2,r=t.filter(t=>t.w>2*o).map(({x:t,y:r,w:a})=>`M${n(t+o)} ${n(r)}H${n(t+a-o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+a-o)} ${n(r+e)}H${n(t+o)}A${n(o)} ${n(o)} 0 0 1 ${n(t+o)} ${n(r)}Z`).join("");return r?`path("${r}")`:"inset(50%)"}function M(c,M={}){const g={current:{...i,...M}},y=c instanceof HTMLElement?[c]:[...c],w=1===y.length,v=w?y[0]:y.length?function(t){let e=t[0].parentElement;for(;e&&!t.every(t=>e.contains(t));)e=e.parentElement;return e??document.body}(y):null,b=t(),k=new Map,$=new Map,E=new Map,C=new Map,S=[],A=t=>void 0!==t.dataset.count?"count":"new"===p(t,g.current.tone)?"new":"status",F=t=>void 0!==t.dataset.live?"false"!==t.dataset.live:g.current.live,z=(t=-1e6)=>{for(const e of y){const n=p(e,g.current.tone),o=k.get(e);o?o.to!==n&&k.set(e,{from:o.to,to:n,at:t}):k.set(e,{from:n,to:n,at:-1e6})}};z();const L=()=>P?.dark()??(!v||a(v))?"dark":"light",j=()=>({mark:"glyph",charset:d[L()],font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:f,cellAspect:1,glyphScale:1,color:"source",saturation:1,shade:0,...g.current.look}),H=()=>{const{cellSize:t=f,cellAspect:e=1}=j(),n=Math.min(2,globalThis.devicePixelRatio||1),o=Math.max(2,Math.round(t*n));return{ch:o/n,cw:Math.max(2,Math.round(o*e))/n}};let T=[0,0];const I=new Map;let P=null,q="";function B(){for(;S.length;)S.pop()();b.restore()}P=v?e({host:v,layer:w?"under":"over",look:j,ink:()=>g.current.ink,kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const{cw:n,ch:o}=H();return[Math.max(2,Math.round(2*t/n)),Math.max(2,Math.round(2*e/o))]},onFail:()=>{P=null,B()},onTheme:()=>P?.field.update({charset:d[L()]}),paint:({pen:t,now:e,still:o,dark:r,box:a,width:i,w:c})=>{const d=g.current,f=r?"dark":"light",p={...l[f],...d.tones?.[f]},M=(t,e)=>((t,e,n=.5)=>{const o=s[t],r=o.findIndex(([,t])=>t===e),a=r>0?o[r-1][0]:0;return a+(Math.min(o[r][0],1)-a)*n})(f,t,e),{cw:w,ch:S}=H(),z=i/c,L=(e,n,o,r)=>{r<=0||(t.fillStyle=function(t,e){const n=Math.max(1,...t),o=t.map(t=>t/n*255),r=(.2126*o[0]+.7152*o[1]+.0722*o[2])/255,a=Math.min(1,e/Math.max(r,.01));return`rgb(${o.map(t=>Math.round(Math.max(0,Math.min(255,t*a)))).join(" ")})`}(o,r),t.fillRect(Math.round((e+.5)*w*z)-1,Math.round((n+.5)*S*z)-1,2,2))};let j=!1;const B=y.map(t=>"count"!==A(t)&&d.indicator?t.querySelector("[data-dot]"):null),G=y.map((t,e)=>{const n=a(t),o=B[e]?a(B[e]):null,[r,i]=I.get(t)??[0,0],l=t=>({...t,x:t.x+T[0]-r,y:t.y+T[1]-i});return{b:l(n),dot:o&&l(o)}}),N=G.find((t,e)=>t.dot&&"status"===A(y[e]))??G.find(t=>t.dot)??G[0];if(N){const t=(t,e)=>{const n=((t-e/2)%e+e)%e;return n>.001?n-e:0},e=[N.dot?t(N.dot.x+N.dot.w/2,w):0,t(N.b.y+N.b.h/2,S)];(Math.abs(e[0]-T[0])>.01||Math.abs(e[1]-T[1])>.01)&&(T=e,P.canvas.style.translate=`${T[0].toFixed(2)}px ${T[1].toFixed(2)}px`)}const R=P.canvas.style,W=(t,e,n)=>Math.max(1,Math.floor((t-e)/n))*n+"px",O=W(v.clientWidth,T[0],w),X=W(v.clientHeight,T[1],S);R.width===O&&R.height===X||(R.width=O,R.height=X,P.field.resize(),j=!0);const Z=G.map((t,e)=>{const n=t=>({...t,x:t.x-T[0],y:t.y-T[1]});return((t,e,n,o,r)=>{const[a,i]=I.get(t)??[0,0],l=(t,e)=>Math.round((t-e/2)/e)*e+e/2-t,s=n?l(n.x+n.w/2,o):0,c=l(e.y+e.h/2,r);return(Math.abs(s-a)>.01||Math.abs(c-i)>.01)&&(I.set(t,[s,c]),b.set(t,"translate",`${s.toFixed(2)}px ${c.toFixed(2)}px`)),{b:{...e,x:e.x+s,y:e.y+c},dot:n&&{...n,x:n.x+s,y:n.y+c}}})(y[e],n(t.b),t.dot&&n(t.dot),w,S)}),D=Z.map(t=>t.b).map(t=>m(t,0,S)),J=x(D,S);return J!==q&&(q=J,P.canvas.style.clipPath=J),y.forEach((t,r)=>{const i=D[r],l=A(t),s=Math.round(i.y/S),c=Math.ceil(i.x/w),d=Math.floor((i.x+i.w)/w)-1;var m,x,g;if(!(d<c))if("status"===l){const a=Z[r].dot;if(!a)return;const i=k.get(t),l=e-i.at,u=o?1:n(l/240);u<1&&(j=!0);const y=(m=p[i.from],x=p[i.to],g=u,m.map((t,e)=>t+(x[e]-t)*g)),v=!o&&F(t),b=Math.floor((a.x+a.w/2)/w),$="light"===f?.55:.7,E="light"===f?.35:.25;let C="neutral"===i.to?M("○"):"amber"===i.to&&F(t)?M("◐"):M("●",$);"red"===i.to&&!o&&l<640?(j=!0,Math.floor(l/160)%2==0&&(C=M("○"))):v&&"amber"===i.to?(j=!0,C=M(h[Math.floor((e+90*r)/130)%4])):v&&(j=!0,C=M("●",$-E*Math.cos((e+500*r)/2200*Math.PI*2))),b>=c&&b<=d&&L(b,s,y,C)}else if("new"===l){const n=Z[r].dot;if(!n)return;const a=Math.max(0,(e-($.get(t)??-1e6))/720),i=Math.floor((n.x+n.w/2)/w);a<1&&!o&&(j=!0),i>=c&&i<=d&&L(i,s,p.new,M(a<1&&!o?u[Math.floor(a*u.length)]:"✦"))}else{const r=E.get(t),i=C.get(t)?.digits.children;if(!i)return;if((r?(e-r.at)/600:1)>=1||o){for(const t of i)t.style.opacity="",t.style.translate="";return}j=!0,[...i].forEach((t,o)=>{if(!r.changed[o])return;const i=t,l=a(i),h=(e-r.at-70*o)/460,u=n((h-.72)/.28);if(i.style.opacity=String(u),i.style.translate=`0 ${3*(u-1)}px`,h<=0||h>=.78)return;const f=Math.min(d,Math.max(c,Math.floor((l.x+l.w/2)/w)));L(f,s,p.neutral,M(["·","•","○","●"][Math.floor(9*h)%4]))})}}),j}}):null;const G=t=>[...t].map(t=>Object.assign(document.createElement("span"),{textContent:" "===t?"":t}));if(P){w||(P.canvas.style.zIndex="1");for(const t of y){if("count"===A(t)){const e=(t.textContent??"").trim(),n=[...t.childNodes],r=o(e),a=document.createElement("span");a.setAttribute("aria-hidden","true"),b.set(a,"display","inline-flex"),a.replaceChildren(...G(e)),t.replaceChildren(r,a),C.set(t,{text:e,live:r,digits:a}),S.push(()=>{const o=C.get(t)?.text??e;o===e?t.replaceChildren(...n):t.textContent=o})}else if(g.current.indicator&&!t.querySelector("[data-dot]")){const e=document.createElement("span");e.dataset.dot="",e.setAttribute("aria-hidden","true"),e.setAttribute("style",`display:inline-block;flex:none;width:${f}px;height:${f}px;margin-inline-end:4px;vertical-align:middle`),t.prepend(e),S.push(()=>e.remove())}if(!w)for(const e of[...t.childNodes])if(3===e.nodeType&&e.textContent?.trim()){const t=document.createElement("span");e.parentElement.insertBefore(t,e),t.appendChild(e),S.push(()=>{t.parentElement?.insertBefore(e,t),t.remove()}),N(t)}else e instanceof HTMLElement&&void 0===e.dataset.dot&&N(e)}C.size&&document.fonts?.ready.then(()=>P?.kick()),v.addEventListener("pointermove",O),v.addEventListener("pointerleave",X)}function N(t){"static"===getComputedStyle(t).position&&b.set(t,"position","relative"),b.set(t,"z-index","2")}function R(t){const e=performance.now();for(const n of t?[t]:y.filter(t=>"new"===A(t)))$.set(n,e);P?.kick()}let W=null;function O(t){const e=t.target,n=y.find(t=>e&&t.contains(e))??null;n!==W&&(W=n,n&&"new"===A(n)&&g.current.sheen&&R(n))}function X(){W=null}return r(()=>P,g,()=>{z(performance.now()),P?.refresh()},{sheen:R,count:(t,e)=>{const n=e??y.find(t=>"count"===A(t));if(!n)return;const o=String(t),r=C.get(n);if(!r)return void(n.textContent=o);if(o===r.text)return;const a=Math.max(o.length,r.text.length),i=r.text.padStart(a," "),l=o.padStart(a," "),s=P?.still()??!0;r.text=o,r.live.textContent=o,r.digits.replaceChildren(...G(l)),E.set(n,{at:s?-1e6:performance.now(),changed:[...l].map((t,e)=>t!==i[e])}),P?.kick()},refresh:()=>{z(performance.now()),P?.kick()}},()=>{v?.removeEventListener("pointermove",O),v?.removeEventListener("pointerleave",X),B()})}var g=i;export{g as PILL_DEFAULTS,l as PILL_TONES,x as laneClip,M as pill,m as pillLane,p as pillTone};//# sourceMappingURL=chunk-WDS7VM2E.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-
|
|
1
|
+
import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as c}from"./chunk-3OD5BMF5.js";function e(c,e,n,r,a={x:.5,y:.5},i={}){const{fontSize:l=12,chars:s="·-=+|/",accentColor:h,color:f,bands:d=3,speed:g=1,bandWidth:M=.12,glitch:m=!0,lightMode:p=!1}=i,$=h??(p?"#6b8700":"#d4ff00"),b=.62*l,x=1.4*l,u=Math.ceil(e/b),S=Math.ceil(n/x);c.clearRect(0,0,e,n),c.font=`${l}px monospace`,c.textBaseline="top";let z=255,C=255,k=255;if(p&&(z=55,C=55,k=55),f){const o=t(f);o&&(z=o.r,C=o.g,k=o.b)}let y=212,j=255,B=0;const G=t($);G&&(y=G.r,j=G.g,B=G.b);const V=r*g;for(let t=0;t<S;t++)for(let e=0;e<u;e++){const n=t/S,r=((n*d-.5*V)%1+1)%1,i=Math.max(0,1-r/M),l=.35*(.5*o(3*e,7*t)+.5);let h=0;if(m){const c=e/u-a.x,r=n-a.y,i=Math.sqrt(c*c+r*r);if(i<.18){const c=o(11*e+Math.floor(12*V),5*t);h=Math.max(0,1-i/.18)*(c>.5?c-.3:0)}}const f=Math.min(1,l+.8*i+.6*h);if(f<.04)continue;const g=s[Math.floor(f*(s.length-1))],$=i>.55,G=p?.82*f:.12*f;c.fillStyle=$?`rgba(${y},${j},${B},${p?.92:.28})`:`rgba(${z},${C},${k},${G})`,c.fillText(g,e*b,t*x)}}var n={id:"grid",name:"Grid",description:"Scan bands roll down a character grid and glitch near the cursor.",cellSize:12,speed:1,cursor:!0,mount:t=>c(t,(t,o,c,n,r,a)=>e(t,o,c,n,r,{fontSize:a.fontSize,chars:a.chars,lightMode:a.lightMode,color:a.ink,accentColor:a.accent}))};export{n as grid,e as renderGridBackground};//# sourceMappingURL=chunk-WI2AF2KE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-
|
|
1
|
+
import{mountPageField as e,pageHandle as t,sleep as r,pulseAt as o}from"./chunk-7DXSG526.js";import{styleKeeper as a}from"./chunk-GF72XM4C.js";function n(n,l={}){const i={current:{...l}},c=a(),s=n.querySelector("img"),u=i.current.image??s??null;let d=null;d=u?e({host:n,look:()=>{const e=i.current;return{mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"cover",focus:e.focus??{x:.5,y:.4},hover:"trail",trail:{strength:.95,radius:.42},clear:!!e.clear&&{element:e.clear,padding:8,feather:.12,shape:"rect"},...e.look}},ink:()=>i.current.ink??"--ascii-ink-strong",source:u,label:i.current.label??(u instanceof HTMLImageElement&&u.alt||void 0),kit:i,reducedMotion:()=>i.current.reducedMotion,onFail:()=>{d=null,c.restore()}}):null,d&&s&&u===s&&c.set(s,"opacity","0");let h=0,m=!1;return t(()=>d,i,()=>{},{pulse:(e,t=1)=>{d&&!d.still()&&o(d.field,e,t)},shimmer:e=>{const t=d?.field;if(!t||e===m||e&&d.still())return;const o=++h;m=e,e?(async()=>{let e;try{e=await(async()=>{if(u instanceof HTMLImageElement)return u.complete||await u.decode(),u;const e=new Image;return e.crossOrigin="anonymous",e.src=u,await e.decode(),e})()}catch{return}const a=Math.min(1,1400/Math.max(e.naturalWidth,e.naturalHeight,1)),n=Object.assign(document.createElement("canvas"),{width:Math.max(1,Math.round(e.naturalWidth*a)),height:Math.max(1,Math.round(e.naturalHeight*a))}),l=n.getContext("2d"),i=n.width,c=n.height,s=performance.now();for(;o===h&&d?.field===t;){const o=performance.now(),a=-.4*i+1.8*((o-s)/1100%1)*i;l.globalCompositeOperation="source-over",l.drawImage(e,0,0,i,c);const u=l.createLinearGradient(a-.22*i,.3*a,a+.22*i,.3*a+.3*c);u.addColorStop(0,"rgb(0 0 0 / 0)"),u.addColorStop(.5,"rgb(255 255 255 / .42)"),u.addColorStop(1,"rgb(0 0 0 / 0)"),l.globalCompositeOperation="lighter",l.fillStyle=u,l.fillRect(0,0,i,c),await t.setSource(n),await r(Math.max(0,48-(performance.now()-o)))}})():t.setSource(u)}},()=>{h++,c.restore()})}export{n as artPanel};//# sourceMappingURL=chunk-XUCYFWC3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hash as t,settledSource as e}from"./chunk-
|
|
1
|
+
import{hash as t,settledSource as e}from"./chunk-GF72XM4C.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-Z2FRNFMB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{scenePreset as e}from"./chunk-
|
|
1
|
+
import{scenePreset as e}from"./chunk-3VEMKDBW.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-Z3KD6CLE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-
|
|
1
|
+
import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-3OD5BMF5.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-ZCXNGJGB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-
|
|
1
|
+
import{styleKeeper as t,srOnly as e,mountSurface as n,clamp as o,smoothstep as r,hash as a,house as l,handle as i,prefersReduced as s}from"./chunk-GF72XM4C.js";var c={start:!0,stagger:38,roll:520,wave:55,glyphs:"#%*+=-:"},h=t=>`Thought for ${t}s`;function u(u,p={}){const f={current:{...c,...p}},m=t(),g=[...u.childNodes],d=f.current.label??null,y=d?[...d.childNodes]:[];let x="done",k=0,C=0,b=-1e9,w=0,M="",S=null;const A=d?e("",!0):null,v=document.createElement("span");let $="",F="";const E=()=>f.current.reducedMotion??s(),T=(t,e)=>{F=$,$=t,d&&(A&&(A.textContent=t),S?(v.replaceChildren(...[...t].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),b=e?performance.now():-1e9,S.kick()):d.textContent=t)};d&&(S=n({host:d,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:2,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...f.current.look}),ink:()=>f.current.ink??getComputedStyle(d).color,kit:f,reducedMotion:()=>f.current.reducedMotion,resolution:2,onFail:()=>{S=null,d.textContent=$,m.restore()},paint:({pen:t,now:e,still:n,box:i,scale:s})=>{const c=getComputedStyle(v),h=parseFloat(c.fontSize)||14,u=`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;t.setTransform(s,0,0,s,0,0),t.textAlign="center",t.textBaseline="alphabetic",t.font=u;const p=t.measureText("x"),m=p.fontBoundingBoxAscent||.8*h,g=p.fontBoundingBoxDescent||.2*h,d=f.current,y=[...v.children],k=e-b<d.roll+y.length*d.wave,w=y.length*d.wave+d.roll+420;let M=!1;return y.forEach((s,c)=>{let p=1;if(!n&&k)p=o((e-b-c*d.wave)/d.roll);else if(!n&&"thinking"===x){const t=(e-C)%w-c*d.wave;p=t<0||t>d.roll?1:t/d.roll}const f=p<1?r(.7,1,p).toFixed(3):"";if(s.style.opacity!==f&&(s.style.opacity=f),p>=1||!s.textContent?.trim())return;M=!0;const y=i(s),S=y.y+(y.h-m-g)/2+m,A=y.x+y.w/2,v=k?F[c]??" ":s.textContent,$=s.textContent,E=[v,...Array.from({length:3},(t,e)=>d.glyphs[Math.floor(a(e+7*c,Math.floor(C))*d.glyphs.length)]??""),$],T=l(p)*(E.length-1)*y.h;t.save(),t.beginPath(),t.rect(y.x-2,y.y,y.w+4,y.h),t.clip(),t.globalAlpha=1-r(.7,1,p),E.forEach((e,n)=>{const o=S+n*y.h-T;if(o<y.y-y.h||o>y.y+2*y.h)return;const r=0===n||n===E.length-1;t.font=r?u:`600 ${.86*h}px "Geist Mono", ui-monospace, monospace`,t.fillStyle=r?"#fff":"#d0d0d0",t.fillText(e,A,o)}),t.restore()}),t.globalAlpha=1,M||!n&&("thinking"===x||k)}}),S&&A&&(m.set(v,"display","inline-flex"),m.set(v,"white-space","pre"),v.setAttribute("aria-hidden","true"),d.replaceChildren(A,v,S.canvas)));const B=document.createElement("span"),z=()=>{w++,x="thinking",C=performance.now(),M="",B.replaceChildren(),u.replaceChildren(B),u.setAttribute("aria-busy","true"),T(f.current.labels?.thinking??"Thinking…",!1),f.current.onState?.("thinking",0),S?.kick()};let G=0,P=0;return f.current.start&&z(),i(()=>S,f,()=>S?.refresh(),{think:z,stream:async t=>{"thinking"!==x&&z();const e=w;G=0;let n="";const o=()=>{"thinking"===x&&(x="streaming",P=performance.now(),k=Math.max(1,Math.round((P-C)/1e3)),T((f.current.labels?.done??h)(k),!0),f.current.onState?.("streaming",k))},r=(t,e)=>{n+=t;const r=e?n.length:n.search(/\s\S*$/)+1;r<=0||(o(),M+=n.slice(0,r),(t=>{const e=!E()&&!S?.still();for(const n of t.match(/\s+|\S+/g)??[]){if(/^\s/.test(n)){B.append(n);continue}const t=document.createElement("span");if(t.textContent=n,e){m.set(t,"opacity","0");const e=Math.max(0,G*f.current.stagger-(performance.now()-P));m.set(t,"transition",`opacity 260ms cubic-bezier(.16, 1, .3, 1) ${Math.round(e)}ms`),requestAnimationFrame(()=>requestAnimationFrame(()=>t.style.setProperty("opacity","1")))}G++,B.appendChild(t)}})(n.slice(0,r)),n=n.slice(r))};if("string"==typeof t)r(t,!0);else{for await(const n of t){if(e!==w)return;r(n,!1)}if(e!==w)return;r("",!0)}o();const a=E()?0:Math.max(0,G*f.current.stagger-(performance.now()-P))+260;await new Promise(t=>setTimeout(t,a)),e===w&&(x="done",u.setAttribute("aria-busy","false"),f.current.onState?.("done",k),S?.kick())},get state(){return x}},()=>{w++,m.restore(),u.removeAttribute("aria-busy"),M?u.textContent=M:u.replaceChildren(...g),d&&($?d.textContent=$:d.replaceChildren(...y))})}var p=c;export{p as THINKING_DEFAULTS,u as thinking};//# sourceMappingURL=chunk-ZWZZMU5P.js.map
|