asciify-engine 4.24.0 → 4.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +325 -0
  2. package/README.md +71 -718
  3. package/dist/core.cjs +1 -1
  4. package/dist/core.js +1 -1
  5. package/dist/field.cjs +1 -1
  6. package/dist/field.d.cts +132 -272
  7. package/dist/field.d.ts +132 -272
  8. package/dist/field.js +1 -1
  9. package/dist/glyph-field-C2fQIlnq.d.cts +292 -0
  10. package/dist/glyph-field-DRC-7uVf.d.ts +292 -0
  11. package/dist/hover.cjs +1 -1
  12. package/dist/hover.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/kit/chunk-2FH6GGV6.js +1 -0
  16. package/dist/kit/chunk-2GAV4OAK.js +1 -0
  17. package/dist/kit/{chunk-C4KZYCPF.js → chunk-2LBQ7QJT.js} +1 -1
  18. package/dist/kit/{chunk-BN7HL52Z.js → chunk-3LJ5C3U3.js} +1 -1
  19. package/dist/kit/{chunk-NURPDP3Y.js → chunk-3MHEDZLZ.js} +1 -1
  20. package/dist/kit/{chunk-BR6ZNJZW.js → chunk-3OD5BMF5.js} +1 -1
  21. package/dist/kit/{chunk-C3C7AYKL.js → chunk-3VEMKDBW.js} +1 -1
  22. package/dist/kit/{chunk-PFKYKAIP.js → chunk-42KMN727.js} +1 -1
  23. package/dist/kit/{chunk-2CF4PX6U.js → chunk-6G5MPND3.js} +1 -1
  24. package/dist/kit/{chunk-QALCXKU6.js → chunk-6WU247CB.js} +1 -1
  25. package/dist/kit/{chunk-YBRP6BFW.js → chunk-776H2BJ7.js} +1 -1
  26. package/dist/kit/chunk-7DXSG526.js +1 -0
  27. package/dist/kit/{chunk-H2UZBVKE.js → chunk-7M2FFUZ3.js} +1 -1
  28. package/dist/kit/{chunk-5BEBNKYM.js → chunk-7NVKRDKE.js} +1 -1
  29. package/dist/kit/{chunk-XB4DKPGL.js → chunk-AIGAJMNN.js} +1 -1
  30. package/dist/kit/{chunk-O7SGY4YJ.js → chunk-B3TY6UXJ.js} +1 -1
  31. package/dist/kit/{chunk-XDKKCIIL.js → chunk-BFBG3VHI.js} +1 -1
  32. package/dist/kit/{chunk-3A5LID2G.js → chunk-CG6SGQMY.js} +1 -1
  33. package/dist/kit/{chunk-T3GWGPST.js → chunk-CGSWUO67.js} +1 -1
  34. package/dist/kit/{chunk-DFOWXOZR.js → chunk-DAJSBX6H.js} +1 -1
  35. package/dist/kit/{chunk-IUKSHYED.js → chunk-DCLJHSWM.js} +1 -1
  36. package/dist/kit/{chunk-W2STAN6V.js → chunk-DMRPBFLW.js} +1 -1
  37. package/dist/kit/{chunk-XANKANGR.js → chunk-E3FPFANJ.js} +1 -1
  38. package/dist/kit/{chunk-VC2ZQG63.js → chunk-EKYEA7Z4.js} +1 -1
  39. package/dist/kit/{chunk-IQTGJRDX.js → chunk-F6F2C3RH.js} +1 -1
  40. package/dist/kit/chunk-FEAFQY7O.js +1 -0
  41. package/dist/kit/{chunk-FUI5AVIF.js → chunk-FHN3PPSI.js} +1 -1
  42. package/dist/kit/{chunk-QRCXXS5Z.js → chunk-FPCCX4FM.js} +1 -1
  43. package/dist/kit/{chunk-TTGMK4EA.js → chunk-FWODCYYJ.js} +1 -1
  44. package/dist/kit/{chunk-AIM3J2US.js → chunk-GBNV3GXG.js} +1 -1
  45. package/dist/kit/chunk-GF72XM4C.js +1 -0
  46. package/dist/kit/{chunk-SARCZMLN.js → chunk-GKR3ROYR.js} +1 -1
  47. package/dist/kit/{chunk-ROR6MG3K.js → chunk-H5KHXZWR.js} +1 -1
  48. package/dist/kit/{chunk-PCIAA2LL.js → chunk-I5R2347P.js} +1 -1
  49. package/dist/kit/{chunk-4QHFEMFS.js → chunk-IBNDCKEX.js} +1 -1
  50. package/dist/kit/{chunk-J2YZBT3N.js → chunk-ILXVBO7M.js} +1 -1
  51. package/dist/kit/{chunk-S62H7ZIU.js → chunk-JELJEEJO.js} +1 -1
  52. package/dist/kit/{chunk-2NVKPXPL.js → chunk-K6JX64AS.js} +1 -1
  53. package/dist/kit/{chunk-3473NPIN.js → chunk-KCEYRIU4.js} +1 -1
  54. package/dist/kit/{chunk-HTUGMGVA.js → chunk-KDROJANO.js} +1 -1
  55. package/dist/kit/{chunk-5QE6UMXN.js → chunk-KEE55QSD.js} +1 -1
  56. package/dist/kit/{chunk-MIZ2DUHU.js → chunk-KFXMLIVF.js} +1 -1
  57. package/dist/kit/{chunk-G57QACJG.js → chunk-KLRF3S7O.js} +1 -1
  58. package/dist/kit/{chunk-ENTDGT2V.js → chunk-KXI3T72F.js} +1 -1
  59. package/dist/kit/{chunk-4ZQFDFEH.js → chunk-KY5KCIZE.js} +1 -1
  60. package/dist/kit/{chunk-4OT66HSZ.js → chunk-LE53AVKR.js} +1 -1
  61. package/dist/kit/{chunk-WJLZM3DR.js → chunk-LVCGC3SO.js} +1 -1
  62. package/dist/kit/chunk-M5VVLYI2.js +1 -0
  63. package/dist/kit/{chunk-7ABNWOW4.js → chunk-MJJSZS23.js} +1 -1
  64. package/dist/kit/{chunk-VVW7LZT2.js → chunk-MZFK765W.js} +1 -1
  65. package/dist/kit/{chunk-5I4IZTL5.js → chunk-NF4WVWAC.js} +1 -1
  66. package/dist/kit/{chunk-PIU2BMFU.js → chunk-NW4U2YRE.js} +1 -1
  67. package/dist/kit/{chunk-5Z2EJAUV.js → chunk-ORSI57T2.js} +1 -1
  68. package/dist/kit/{chunk-UML6XQAR.js → chunk-QSTDYL35.js} +1 -1
  69. package/dist/kit/{chunk-K563CCOL.js → chunk-QVICL57J.js} +1 -1
  70. package/dist/kit/{chunk-MQJQIDO5.js → chunk-RXOPJJC4.js} +1 -1
  71. package/dist/kit/{chunk-SNCXU7KF.js → chunk-SDSW7422.js} +1 -1
  72. package/dist/kit/{chunk-DZ5XGHTJ.js → chunk-TRDA73HN.js} +1 -1
  73. package/dist/kit/{chunk-KWTF6Q5W.js → chunk-UOYBFLGJ.js} +1 -1
  74. package/dist/kit/chunk-UVLKCAKH.js +1 -0
  75. package/dist/kit/{chunk-YCWMOTYH.js → chunk-VBWG7HQA.js} +1 -1
  76. package/dist/kit/{chunk-FR3ZJNOY.js → chunk-VIUEAEBX.js} +1 -1
  77. package/dist/kit/{chunk-ZRJVOUWH.js → chunk-VV2KP7ZW.js} +1 -1
  78. package/dist/kit/chunk-VX2AD3M7.js +1 -0
  79. package/dist/kit/{chunk-RFLIFKZ4.js → chunk-W4U5CK6L.js} +1 -1
  80. package/dist/kit/{chunk-I4QVLLRQ.js → chunk-WI2AF2KE.js} +1 -1
  81. package/dist/kit/{chunk-MGVPLQ3Z.js → chunk-XUCYFWC3.js} +1 -1
  82. package/dist/kit/{chunk-BNVRKD3V.js → chunk-Z2FRNFMB.js} +1 -1
  83. package/dist/kit/{chunk-BQZCLGCY.js → chunk-Z3KD6CLE.js} +1 -1
  84. package/dist/kit/{chunk-E3TUOX2A.js → chunk-ZCXNGJGB.js} +1 -1
  85. package/dist/kit/{chunk-IPVN22ZM.js → chunk-ZWZZMU5P.js} +1 -1
  86. package/dist/kit.cjs +1 -1
  87. package/dist/kit.d.cts +4 -2
  88. package/dist/kit.d.ts +4 -2
  89. package/dist/kit.js +1 -1
  90. package/dist/studio-worker.js +1 -0
  91. package/dist/studio.cjs +1 -1
  92. package/dist/studio.js +1 -1
  93. package/package.json +3 -1
  94. package/skills/asciify-engine/SKILL.md +2 -2
  95. package/skills/asciify-engine/references/applying-asciify.md +1 -1
  96. package/skills/asciify-engine/references/kit.md +2 -2
  97. package/skills/asciify-engine/references/performance.md +6 -3
  98. package/dist/kit/chunk-3PCKMO6I.js +0 -1
  99. package/dist/kit/chunk-4HWMQCAM.js +0 -1
  100. package/dist/kit/chunk-73M2OESE.js +0 -1
  101. package/dist/kit/chunk-BTD6EFAW.js +0 -1
  102. package/dist/kit/chunk-OWEZV7TQ.js +0 -1
  103. package/dist/kit/chunk-S7RZP2MT.js +0 -1
  104. package/dist/kit/chunk-UO7RB7RC.js +0 -1
  105. package/dist/kit/chunk-XM56OTYT.js +0 -1
@@ -1 +1 @@
1
- import{imageFor as e,drawCover as t,injectStyle as a,imageReady as n,toneOf as r}from"./chunk-4OT66HSZ.js";import{styleKeeper as i,clamp as o,mountSurface as c,smoothstep as s,handle as l,prefersReduced as p}from"./chunk-S7RZP2MT.js";var d=e=>"string"==typeof e?{src:e}:e;function u(u,h){const m={current:{open:0,duration:420,label:"Images",...h}},f=i(),v=m.current.images.map(d);let x=o(Math.round(m.current.open),0,Math.max(0,v.length-1)),b=0,g=0;const w=v.map((e,t)=>({x:t===x?1:0,v:0})),y=v.map(()=>null),k=v.map(()=>null);let E=null;const A=v.map(t=>{const a=document.createElement("button");a.type="button",a.className="ascii-acc-panel",a.setAttribute("aria-label",[t.title??t.alt,t.meta].filter(Boolean).join(", ")||t.src);const n=e(t.src);if(n.className="ascii-acc-photo",n.alt="",n.draggable=!1,t.focus&&n.style.setProperty("object-position",`${100*t.focus.x}% ${100*t.focus.y}%`),a.appendChild(n),t.title||t.meta){const e=document.createElement("span");e.className="ascii-acc-caption",e.setAttribute("aria-hidden","true");for(const[a,n]of[["ascii-acc-title",t.title],["ascii-acc-meta",t.meta]]){if(!n)continue;const t=document.createElement("span");t.className=a,t.textContent=n,e.appendChild(t)}a.appendChild(e)}return a});function M(e,t){const a=b?Math.min(.064,(e-b)/1e3):1/60;b=e;const n=5/(Math.max(1,m.current.duration)/1e3),r=Math.max(1,Math.ceil(240*a)),i=a/r;let o=!1;return w.forEach((e,a)=>{const c=a===x?1:0;t&&(e.x=c,e.v=0);for(let t=0;t<r&&(e.x!==c||e.v);t++)e.v+=(-n*n*(e.x-c)-2*n*e.v)*i,e.x+=e.v*i;Math.abs(e.x-c)<.001&&Math.abs(e.v)<.01?(e.x=c,e.v=0):o=!0,L(A[a],e.x)}),o||(b=0),o}function L(e,t){const a=e.style;a.setProperty("--ascii-acc-open",t.toFixed(4)),a.setProperty("--ascii-acc-photo",(E?s(.15,.75,t):.45+.55*t).toFixed(3)),a.setProperty("--ascii-acc-caption",s(.6,1,t).toFixed(3))}E=c({host:u,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.94,hover:"trail",trail:{strength:.5,radius:.25},...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{E=null,delete u.dataset.asciiField},onTheme:()=>{y.forEach((e,t)=>{k[t]=e&&E?r(e,!E.dark()):null}),E?.kick()},paint:({pen:e,still:a,now:n,box:r})=>{const i=M(n,a);return A.forEach((a,n)=>{const i=k[n],o=w[n].x,c=1-s(.45,.95,o);if(!i||c<=0)return;const l=r(a),p=parseFloat(getComputedStyle(a).borderTopLeftRadius)||0,d=1.04-.04*o;e.save(),e.beginPath(),e.roundRect(l.x,l.y,l.w,l.h,p),e.clip(),e.globalAlpha=c,t(e,i,l.x-l.w*(d-1)/2,l.y-l.h*(d-1)/2,l.w*d,l.h*d,v[n].focus?.x,v[n].focus?.y),e.restore()}),i}});const F=()=>{A.forEach((e,t)=>{e.setAttribute("aria-expanded",String(t===x)),e.tabIndex=t===x?0:-1})},S=(e,t=!1)=>{e=o(Math.round(e),0,A.length-1),t&&A[e]?.focus(),e!==x&&(x=e,F(),m.current.onChange?.(e),(()=>{if(E)return void E.kick();if(g||"function"!=typeof requestAnimationFrame)return void(g||M(performance.now(),!0));const e=t=>{g=M(t,!!(m.current.reducedMotion??p()))?requestAnimationFrame(e):0};g=requestAnimationFrame(e)})())};let C=0,T=0,P=0,j=0,q=0;const N=()=>{C&&clearTimeout(C),C=0},R=A.map((e,t)=>{const a=e=>{if("mouse"!==e.pointerType)return;const a=e.timeStamp||performance.now(),n=Math.max(1,a-P);if(j=P&&n<100?.5*j+Math.abs(e.clientX-T)/n*.5:0,T=e.clientX,P=a,q!==t&&N(),q=t,t!==x)return j<.3?(N(),void S(t)):void(C||(C=setTimeout(()=>{C=0,S(q)},90)));N()},n=()=>{N(),S(t)},r=()=>{e.matches(":focus-visible")&&S(t)},i=e=>{const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key],n="Home"===e.key?0:"End"===e.key?A.length-1:void 0!==a?(t+a+A.length)%A.length:null;null!==n&&(e.preventDefault(),S(n,!0))};return e.addEventListener("pointermove",a),e.addEventListener("pointerdown",n),e.addEventListener("click",n),e.addEventListener("focus",r),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointermove",a),e.removeEventListener("pointerdown",n),e.removeEventListener("click",n),e.removeEventListener("focus",r),e.removeEventListener("keydown",i)}}),z=()=>{N(),P=0};u.addEventListener("pointerleave",z),a("ascii-kit-accordion",'\n:where([data-ascii-accordion]){display:flex;gap:6px}\n:where(.ascii-acc-panel){position:relative;flex:calc(1 + 3.2 * var(--ascii-acc-open, 0)) 1 0;min-width:0;margin:0;padding:0;border:0;border-radius:12px;overflow:hidden;background:transparent;color:#fff;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}\n:where(.ascii-acc-panel[aria-expanded="true"]){cursor:default}\n:where(.ascii-acc-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:var(--ascii-acc-photo, 0);scale:calc(1.04 - .04 * var(--ascii-acc-open, 0))}\n:where(.ascii-acc-caption){position:absolute;inset:auto 0 0;display:flex;color:#fff;flex-direction:column;gap:2px;padding:28px 12px 11px;background:linear-gradient(to top, rgb(0 0 0 / .62), transparent);white-space:nowrap;opacity:var(--ascii-acc-caption, 0);translate:0 calc(6px - 6px * var(--ascii-acc-caption, 0))}\n:where(.ascii-acc-title){font-size:15px;font-weight:500}\n:where(.ascii-acc-meta){font-size:14px;opacity:.8}\n'),u.dataset.asciiAccordion="",E&&(u.dataset.asciiField="");const D=u.getAttribute("role"),H=u.getAttribute("aria-label");return D||u.setAttribute("role","group"),H||u.setAttribute("aria-label",m.current.label),A.forEach((e,t)=>{L(e,w[t].x),u.appendChild(e)}),F(),A.forEach((e,t)=>{const a=e.querySelector("img");a&&n(a).then(e=>{y[t]=e,k[t]=E?r(e,!E.dark()):null,E?.kick()},()=>{})}),l(()=>E,m,e=>{H||u.setAttribute("aria-label",e.label),E?.refresh()},{select:S,get open(){return x}},()=>{R.forEach(e=>e()),N(),g&&cancelAnimationFrame(g),u.removeEventListener("pointerleave",z),A.forEach(e=>e.remove()),delete u.dataset.asciiAccordion,delete u.dataset.asciiField,D||u.removeAttribute("role"),H||u.removeAttribute("aria-label"),f.restore()})}export{u as accordion};//# sourceMappingURL=chunk-5BEBNKYM.js.map
1
+ import{imageFor as e,drawCover as t,injectStyle as a,imageReady as n,toneOf as r}from"./chunk-LE53AVKR.js";import{styleKeeper as i,clamp as o,mountSurface as c,smoothstep as s,handle as l,prefersReduced as p}from"./chunk-GF72XM4C.js";var d=e=>"string"==typeof e?{src:e}:e;function u(u,h){const m={current:{open:0,duration:420,label:"Images",...h}},f=i(),v=m.current.images.map(d);let x=o(Math.round(m.current.open),0,Math.max(0,v.length-1)),b=0,g=0;const w=v.map((e,t)=>({x:t===x?1:0,v:0})),y=v.map(()=>null),k=v.map(()=>null);let E=null;const A=v.map(t=>{const a=document.createElement("button");a.type="button",a.className="ascii-acc-panel",a.setAttribute("aria-label",[t.title??t.alt,t.meta].filter(Boolean).join(", ")||t.src);const n=e(t.src);if(n.className="ascii-acc-photo",n.alt="",n.draggable=!1,t.focus&&n.style.setProperty("object-position",`${100*t.focus.x}% ${100*t.focus.y}%`),a.appendChild(n),t.title||t.meta){const e=document.createElement("span");e.className="ascii-acc-caption",e.setAttribute("aria-hidden","true");for(const[a,n]of[["ascii-acc-title",t.title],["ascii-acc-meta",t.meta]]){if(!n)continue;const t=document.createElement("span");t.className=a,t.textContent=n,e.appendChild(t)}a.appendChild(e)}return a});function M(e,t){const a=b?Math.min(.064,(e-b)/1e3):1/60;b=e;const n=5/(Math.max(1,m.current.duration)/1e3),r=Math.max(1,Math.ceil(240*a)),i=a/r;let o=!1;return w.forEach((e,a)=>{const c=a===x?1:0;t&&(e.x=c,e.v=0);for(let t=0;t<r&&(e.x!==c||e.v);t++)e.v+=(-n*n*(e.x-c)-2*n*e.v)*i,e.x+=e.v*i;Math.abs(e.x-c)<.001&&Math.abs(e.v)<.01?(e.x=c,e.v=0):o=!0,L(A[a],e.x)}),o||(b=0),o}function L(e,t){const a=e.style;a.setProperty("--ascii-acc-open",t.toFixed(4)),a.setProperty("--ascii-acc-photo",(E?s(.15,.75,t):.45+.55*t).toFixed(3)),a.setProperty("--ascii-acc-caption",s(.6,1,t).toFixed(3))}E=c({host:u,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.94,hover:"trail",trail:{strength:.5,radius:.25},...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{E=null,delete u.dataset.asciiField},onTheme:()=>{y.forEach((e,t)=>{k[t]=e&&E?r(e,!E.dark()):null}),E?.kick()},paint:({pen:e,still:a,now:n,box:r})=>{const i=M(n,a);return A.forEach((a,n)=>{const i=k[n],o=w[n].x,c=1-s(.45,.95,o);if(!i||c<=0)return;const l=r(a),p=parseFloat(getComputedStyle(a).borderTopLeftRadius)||0,d=1.04-.04*o;e.save(),e.beginPath(),e.roundRect(l.x,l.y,l.w,l.h,p),e.clip(),e.globalAlpha=c,t(e,i,l.x-l.w*(d-1)/2,l.y-l.h*(d-1)/2,l.w*d,l.h*d,v[n].focus?.x,v[n].focus?.y),e.restore()}),i}});const F=()=>{A.forEach((e,t)=>{e.setAttribute("aria-expanded",String(t===x)),e.tabIndex=t===x?0:-1})},C=(e,t=!1)=>{e=o(Math.round(e),0,A.length-1),t&&A[e]?.focus(),e!==x&&(x=e,F(),m.current.onChange?.(e),(()=>{if(E)return void E.kick();if(g||"function"!=typeof requestAnimationFrame)return void(g||M(performance.now(),!0));const e=t=>{g=M(t,!!(m.current.reducedMotion??p()))?requestAnimationFrame(e):0};g=requestAnimationFrame(e)})())};let S=0,j=0,P=0,T=0,q=0;const N=()=>{S&&clearTimeout(S),S=0},R=A.map((e,t)=>{const a=e=>{if("mouse"!==e.pointerType)return;const a=e.timeStamp||performance.now(),n=Math.max(1,a-P);if(T=P&&n<100?.5*T+Math.abs(e.clientX-j)/n*.5:0,j=e.clientX,P=a,q!==t&&N(),q=t,t!==x)return T<.3?(N(),void C(t)):void(S||(S=setTimeout(()=>{S=0,C(q)},90)));N()},n=()=>{N(),C(t)},r=()=>{e.matches(":focus-visible")&&C(t)},i=e=>{const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key],n="Home"===e.key?0:"End"===e.key?A.length-1:void 0!==a?(t+a+A.length)%A.length:null;null!==n&&(e.preventDefault(),C(n,!0))};return e.addEventListener("pointermove",a),e.addEventListener("pointerdown",n),e.addEventListener("click",n),e.addEventListener("focus",r),e.addEventListener("keydown",i),()=>{e.removeEventListener("pointermove",a),e.removeEventListener("pointerdown",n),e.removeEventListener("click",n),e.removeEventListener("focus",r),e.removeEventListener("keydown",i)}}),z=()=>{N(),P=0};u.addEventListener("pointerleave",z),a("ascii-kit-accordion",'\n:where([data-ascii-accordion]){display:flex;gap:6px}\n:where(.ascii-acc-panel){position:relative;flex:calc(1 + 3.2 * var(--ascii-acc-open, 0)) 1 0;min-width:0;margin:0;padding:0;border:0;border-radius:12px;overflow:hidden;background:transparent;color:#fff;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}\n:where(.ascii-acc-panel[aria-expanded="true"]){cursor:default}\n:where(.ascii-acc-photo){position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:var(--ascii-acc-photo, 0);scale:calc(1.04 - .04 * var(--ascii-acc-open, 0))}\n:where(.ascii-acc-caption){position:absolute;inset:auto 0 0;display:flex;color:#fff;flex-direction:column;gap:2px;padding:28px 12px 11px;background:linear-gradient(to top, rgb(0 0 0 / .62), transparent);white-space:nowrap;opacity:var(--ascii-acc-caption, 0);translate:0 calc(6px - 6px * var(--ascii-acc-caption, 0))}\n:where(.ascii-acc-title){font-size:15px;font-weight:500}\n:where(.ascii-acc-meta){font-size:14px;opacity:.8}\n'),u.dataset.asciiAccordion="",E&&(u.dataset.asciiField="");const X=u.getAttribute("role"),D=u.getAttribute("aria-label");return X||u.setAttribute("role","group"),D||u.setAttribute("aria-label",m.current.label),A.forEach((e,t)=>{L(e,w[t].x),u.appendChild(e)}),F(),A.forEach((e,t)=>{const a=e.querySelector("img");a&&n(a).then(e=>{y[t]=e,k[t]=E?r(e,!E.dark()):null,E?.kick()},()=>{})}),l(()=>E,m,e=>{D||u.setAttribute("aria-label",e.label),E?.refresh()},{select:C,get open(){return x}},()=>{R.forEach(e=>e()),N(),g&&cancelAnimationFrame(g),u.removeEventListener("pointerleave",z),A.forEach(e=>e.remove()),delete u.dataset.asciiAccordion,delete u.dataset.asciiField,X||u.removeAttribute("role"),D||u.removeAttribute("aria-label"),f.restore()})}export{u as accordion};//# sourceMappingURL=chunk-7NVKRDKE.js.map
@@ -1 +1 @@
1
- import{parseColor as o,hash2 as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as l}from"./chunk-BR6ZNJZW.js";import{mixHex as e}from"./chunk-S7RZP2MT.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:M="#88ffcc",speed:b=1,helixCount:g,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),$=Math.ceil(r/m),x=g??Math.max(1,Math.floor(e/80)),C=u/x,S=o(c)??{r:0,g:229,b:255},k=o(s)??{r:255,g:64,b:129},A=o(M)??{r:136,g:255,b:204};l.clearRect(0,0,e,r),l.font=`${n}px "JetBrains Mono", monospace`,l.textBaseline="top";const T=a*b,z=.35*C;for(let o=0;o<x;o++){const e=C*(o+.5);for(let r=0;r<$;r++){const a=r/$*Math.PI*6-1.8*T,i=e+Math.sin(a)*z,n=e+Math.sin(a+Math.PI)*z,c=Math.round(i),s=Math.round(n);if(c<0||c>=u)continue;const M=t(31*o+7*r,3),b=f[Math.floor(M*f.length)],g=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*g,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(b,c*d,r*m),s>=0&&s<u){const e=t(53*o+11*r,7),a=f[Math.floor(e*f.length)];l.globalAlpha=.35+.65*p,l.fillStyle=`rgb(${k.r},${k.g},${k.b})`,l.fillText(a,s*d,r*m)}if(r%3===0){const e=Math.min(c,s),a=Math.max(c,s);if(a-e>1){const i=t(17*r+43*o,5),n=h[Math.floor(i*h.length)],f=.25*(g+p)+.2;l.globalAlpha=f,l.fillStyle=`rgb(${A.r},${A.g},${A.b})`;for(let o=e+1;o<a;o++)l.fillText(n,o*d,r*m)}}}}l.globalAlpha=1}var a={id:"dna",name:"DNA",description:"Double helices scroll past with base-pair letters.",cellSize:13,speed:1,cursor:!1,mount:o=>l(o,(o,t,l,a,i,n)=>r(o,t,l,a,{fontSize:n.fontSize,color:n.ink,color2:n.accent??e(n.ink,"#ffffff",.55),bridgeColor:e(n.ink,"#0c0d0b",.35)}))};export{a as dna,r as renderDnaBackground};//# sourceMappingURL=chunk-XB4DKPGL.js.map
1
+ import{parseColor as o,hash2 as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as l}from"./chunk-3OD5BMF5.js";import{mixHex as e}from"./chunk-GF72XM4C.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:M="#88ffcc",speed:b=1,helixCount:g,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),$=Math.ceil(r/m),x=g??Math.max(1,Math.floor(e/80)),C=u/x,S=o(c)??{r:0,g:229,b:255},k=o(s)??{r:255,g:64,b:129},A=o(M)??{r:136,g:255,b:204};l.clearRect(0,0,e,r),l.font=`${n}px "JetBrains Mono", monospace`,l.textBaseline="top";const z=a*b,T=.35*C;for(let o=0;o<x;o++){const e=C*(o+.5);for(let r=0;r<$;r++){const a=r/$*Math.PI*6-1.8*z,i=e+Math.sin(a)*T,n=e+Math.sin(a+Math.PI)*T,c=Math.round(i),s=Math.round(n);if(c<0||c>=u)continue;const M=t(31*o+7*r,3),b=f[Math.floor(M*f.length)],g=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*g,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(b,c*d,r*m),s>=0&&s<u){const e=t(53*o+11*r,7),a=f[Math.floor(e*f.length)];l.globalAlpha=.35+.65*p,l.fillStyle=`rgb(${k.r},${k.g},${k.b})`,l.fillText(a,s*d,r*m)}if(r%3===0){const e=Math.min(c,s),a=Math.max(c,s);if(a-e>1){const i=t(17*r+43*o,5),n=h[Math.floor(i*h.length)],f=.25*(g+p)+.2;l.globalAlpha=f,l.fillStyle=`rgb(${A.r},${A.g},${A.b})`;for(let o=e+1;o<a;o++)l.fillText(n,o*d,r*m)}}}}l.globalAlpha=1}var a={id:"dna",name:"DNA",description:"Double helices scroll past with base-pair letters.",cellSize:13,speed:1,cursor:!1,mount:o=>l(o,(o,t,l,a,i,n)=>r(o,t,l,a,{fontSize:n.fontSize,color:n.ink,color2:n.accent??e(n.ink,"#ffffff",.55),bridgeColor:e(n.ink,"#0c0d0b",.35)}))};export{a as dna,r as renderDnaBackground};//# sourceMappingURL=chunk-AIGAJMNN.js.map
@@ -1 +1 @@
1
- import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-BR6ZNJZW.js";var o=(i,t,o,r)=>{const e=.12+.06*Math.sin(.1*r),n=Math.sin(68*i),h=Math.sin(68*(i*Math.cos(e)+t*Math.sin(e)));return.8*Math.pow((n+h+2)/4,3)},r={id:"moire",name:"Moiré",description:"Two fine line fields overlap into broad, shifting bands.",cellSize:12,speed:1,cursor:!1,mount:r=>t(r,(t,r,e,n,h,s)=>i(o,t,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as moire};//# sourceMappingURL=chunk-O7SGY4YJ.js.map
1
+ import{renderMaterial as i}from"./chunk-XPXMCXYI.js";import{mountCanvas as t}from"./chunk-3OD5BMF5.js";var o=(i,t,o,r)=>{const e=.12+.06*Math.sin(.1*r),n=Math.sin(68*i),h=Math.sin(68*(i*Math.cos(e)+t*Math.sin(e)));return.8*Math.pow((n+h+2)/4,3)},r={id:"moire",name:"Moiré",description:"Two fine line fields overlap into broad, shifting bands.",cellSize:12,speed:1,cursor:!1,mount:r=>t(r,(t,r,e,n,h,s)=>i(o,t,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as moire};//# sourceMappingURL=chunk-B3TY6UXJ.js.map
@@ -1 +1 @@
1
- import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";function n(e,n,c,l,i={}){const{fontSize:r=13,chars:a="0123456789ABCDEF@#$&*+=/<>",accentColor:s,color:f,speed:h=1,density:g=.55,tailLength:d=14,lightMode:$=!1}=i,p=s??($?"#6b8700":"#d4ff00"),m=.62*r,u=1.4*r,M=Math.ceil(n/m),b=Math.ceil(c/u);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let C=255,S=255,x=255;if($&&(C=55,S=55,x=55),f){const o=t(f);o&&(C=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const B=t(p);B&&(z=B.r,k=B.g,y=B.b);const R=b+d;for(let t=0;t<M;t++){if(o(17*t,3)>g)continue;const n=(.5+1.5*o(31*t,7))*h,c=o(13*t,11)*R,i=Math.floor((l*n*7+c)%R),r=t*m;for(let n=0;n<=d;n++){const c=i-(d-n);if(c<0||c>=b)continue;const s=c*u,f=o(53*t+Math.floor(5*l+n),7*c),h=a[Math.floor(f*a.length)],g=n/d;if(n===d)e.fillStyle=`rgba(${z},${k},${y},${$?.7:.85})`;else{const t=$?.85*g:.15*g;e.fillStyle=`rgba(${C},${S},${x},${t})`}e.fillText(h,r,s)}}}var c={id:"rain",name:"Rain",description:"Columns of falling characters with bright heads.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,c,l,i)=>n(t,o,e,c,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,accentColor:i.accent}))};export{c as rain,n as renderRainBackground};//# sourceMappingURL=chunk-XDKKCIIL.js.map
1
+ import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";function n(e,n,c,l,i={}){const{fontSize:r=13,chars:a="0123456789ABCDEF@#$&*+=/<>",accentColor:s,color:f,speed:h=1,density:g=.55,tailLength:d=14,lightMode:$=!1}=i,p=s??($?"#6b8700":"#d4ff00"),M=.62*r,m=1.4*r,u=Math.ceil(n/M),b=Math.ceil(c/m);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let C=255,S=255,x=255;if($&&(C=55,S=55,x=55),f){const o=t(f);o&&(C=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const B=t(p);B&&(z=B.r,k=B.g,y=B.b);const j=b+d;for(let t=0;t<u;t++){if(o(17*t,3)>g)continue;const n=(.5+1.5*o(31*t,7))*h,c=o(13*t,11)*j,i=Math.floor((l*n*7+c)%j),r=t*M;for(let n=0;n<=d;n++){const c=i-(d-n);if(c<0||c>=b)continue;const s=c*m,f=o(53*t+Math.floor(5*l+n),7*c),h=a[Math.floor(f*a.length)],g=n/d;if(n===d)e.fillStyle=`rgba(${z},${k},${y},${$?.7:.85})`;else{const t=$?.85*g:.15*g;e.fillStyle=`rgba(${C},${S},${x},${t})`}e.fillText(h,r,s)}}}var c={id:"rain",name:"Rain",description:"Columns of falling characters with bright heads.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,c,l,i)=>n(t,o,e,c,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,accentColor:i.accent}))};export{c as rain,n as renderRainBackground};//# sourceMappingURL=chunk-BFBG3VHI.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as r}from"./chunk-BR6ZNJZW.js";var e=(t,r,e,o)=>{const i=48*t+4*Math.sin(2.6*r+.08*o)+1.5*Math.sin(7*r-2*t);return Math.pow(.5+.5*Math.sin(i),10)*(.35+.55*Math.pow(Math.sin(2*r+.4),2))},o={id:"etch",name:"Etch",description:"Cut-grain lines follow a slow, sculpted current.",cellSize:12,speed:1,cursor:!1,mount:o=>r(o,(r,o,i,n,h,s)=>t(e,r,o,i,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{o as etch};//# sourceMappingURL=chunk-3A5LID2G.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as r}from"./chunk-3OD5BMF5.js";var e=(t,r,e,o)=>{const i=48*t+4*Math.sin(2.6*r+.08*o)+1.5*Math.sin(7*r-2*t);return Math.pow(.5+.5*Math.sin(i),10)*(.35+.55*Math.pow(Math.sin(2*r+.4),2))},o={id:"etch",name:"Etch",description:"Cut-grain lines follow a slow, sculpted current.",cellSize:12,speed:1,cursor:!1,mount:o=>r(o,(r,o,i,n,h,s)=>t(e,r,o,i,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{o as etch};//# sourceMappingURL=chunk-CG6SGQMY.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-BR6ZNJZW.js";var o=(t,i,o,r)=>{const e=5.5*(t-.5*o)+.65*Math.sin(3.2*i+.2*r)+.12*r;return Math.pow(.5+.5*Math.cos(e),7)*(.45+.55*Math.sin(2.4*i+.2))},r={id:"veil",name:"Veil",description:"Tall folds of light drifting across a quiet ground.",cellSize:12,speed:1,cursor:!1,mount:r=>i(r,(i,r,e,n,h,s)=>t(o,i,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as veil};//# sourceMappingURL=chunk-T3GWGPST.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-3OD5BMF5.js";var o=(t,i,o,r)=>{const e=5.5*(t-.5*o)+.65*Math.sin(3.2*i+.2*r)+.12*r;return Math.pow(.5+.5*Math.cos(e),7)*(.45+.55*Math.sin(2.4*i+.2))},r={id:"veil",name:"Veil",description:"Tall folds of light drifting across a quiet ground.",cellSize:12,speed:1,cursor:!1,mount:r=>i(r,(i,r,e,n,h,s)=>t(o,i,r,e,n,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{r as veil};//# sourceMappingURL=chunk-CGSWUO67.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,mountSurface as e,easeOut as n,srOnly as o,handle as r,isDark as a}from"./chunk-S7RZP2MT.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",z=t=>void 0!==t.dataset.live?"false"!==t.dataset.live:g.current.live,F=(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})}};F();const L=()=>I?.dark()??(!v||a(v))?"dark":"light",T=()=>({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}),j=()=>{const{cellSize:t=f,cellAspect:e=1}=T(),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 H=[0,0];const P=new Map;let I=null,R="";function q(){for(;S.length;)S.pop()();b.restore()}I=v?e({host:v,layer:w?"under":"over",look:T,ink:()=>g.current.ink,kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const{cw:n,ch:o}=j();return[Math.max(2,Math.round(2*t/n)),Math.max(2,Math.round(2*e/o))]},onFail:()=>{I=null,q()},onTheme:()=>I?.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}=j(),F=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*F)-1,Math.round((n+.5)*S*F)-1,2,2))};let T=!1;const q=y.map(t=>"count"!==A(t)&&d.indicator?t.querySelector("[data-dot]"):null),B=y.map((t,e)=>{const n=a(t),o=q[e]?a(q[e]):null,[r,i]=P.get(t)??[0,0],l=t=>({...t,x:t.x+H[0]-r,y:t.y+H[1]-i});return{b:l(n),dot:o&&l(o)}}),N=B.find((t,e)=>t.dot&&"status"===A(y[e]))??B.find(t=>t.dot)??B[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]-H[0])>.01||Math.abs(e[1]-H[1])>.01)&&(H=e,I.canvas.style.translate=`${H[0].toFixed(2)}px ${H[1].toFixed(2)}px`)}const W=I.canvas.style,Z=(t,e,n)=>Math.max(1,Math.floor((t-e)/n))*n+"px",G=Z(v.clientWidth,H[0],w),O=Z(v.clientHeight,H[1],S);W.width===G&&W.height===O||(W.width=G,W.height=O,I.field.resize(),T=!0);const D=B.map((t,e)=>{const n=t=>({...t,x:t.x-H[0],y:t.y-H[1]});return((t,e,n,o,r)=>{const[a,i]=P.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)&&(P.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)}),J=D.map(t=>t.b).map(t=>m(t,0,S)),K=x(J,S);return K!==R&&(R=K,I.canvas.style.clipPath=K),y.forEach((t,r)=>{const i=J[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=D[r].dot;if(!a)return;const i=k.get(t),l=e-i.at,u=o?1:n(l/240);u<1&&(T=!0);const y=(m=p[i.from],x=p[i.to],g=u,m.map((t,e)=>t+(x[e]-t)*g)),v=!o&&z(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&&z(t)?M("◐"):M("●",$);"red"===i.to&&!o&&l<640?(T=!0,Math.floor(l/160)%2==0&&(C=M("○"))):v&&"amber"===i.to?(T=!0,C=M(h[Math.floor((e+90*r)/130)%4])):v&&(T=!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=D[r].dot;if(!n)return;const a=(e-($.get(t)??-1e6))/720,i=Math.floor((n.x+n.w/2)/w);a<1&&!o&&(T=!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}T=!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]))})}}),T}}):null;const B=t=>[...t].map(t=>Object.assign(document.createElement("span"),{textContent:" "===t?"":t}));if(I){w||(I.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(...B(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(()=>I?.kick()),v.addEventListener("pointermove",G),v.addEventListener("pointerleave",O)}function N(t){"static"===getComputedStyle(t).position&&b.set(t,"position","relative"),b.set(t,"z-index","2")}function W(t){const e=performance.now();for(const n of t?[t]:y.filter(t=>"new"===A(t)))$.set(n,e);I?.kick()}let Z=null;function G(t){const e=t.target,n=y.find(t=>e&&t.contains(e))??null;n!==Z&&(Z=n,n&&"new"===A(n)&&g.current.sheen&&W(n))}function O(){Z=null}return r(()=>I,g,()=>{F(performance.now()),I?.refresh()},{sheen:W,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=I?.still()??!0;r.text=o,r.live.textContent=o,r.digits.replaceChildren(...B(l)),E.set(n,{at:s?-1e6:performance.now(),changed:[...l].map((t,e)=>t!==i[e])}),I?.kick()},refresh:()=>{F(performance.now()),I?.kick()}},()=>{v?.removeEventListener("pointermove",G),v?.removeEventListener("pointerleave",O),q()})}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-DFOWXOZR.js.map
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=(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-DAJSBX6H.js.map
@@ -1 +1 @@
1
- import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-4OT66HSZ.js";import{clamp as i,styleKeeper as a,srOnly as r,mountSurface as s,house as c,hash as d,handle as l,hexRgb as p,resolveColor as m,isDark as h}from"./chunk-S7RZP2MT.js";var u={max:3,duration:6e3,label:"Notifications",swipe:!0},f="cubic-bezier(.16, 1, .3, 1)",x=`\n:where(.ascii-toasts){position:relative;margin:0;padding:0;list-style:none;min-height:52px}\n:where(.ascii-toast){position:absolute;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 8px 8px 10px;border-radius:14px;background:var(--ascii-toast-bg,Canvas);color:var(--ascii-toast-ink,CanvasText);box-shadow:var(--ascii-toast-shadow,0 1px 2px rgb(0 0 0 / .06),0 10px 28px -10px rgb(0 0 0 / .22));z-index:calc(10 - var(--d,0));transform-origin:50% 0;translate:0 calc(var(--d,0) * -12px);scale:calc(1 - var(--d,0) * .05);touch-action:pan-y;transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f},transform 300ms ${f},filter 380ms ${f}}\n:where(.ascii-toast)::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}\n:where(.ascii-toast) > *{transition:opacity 200ms ${f}}\n:where(.ascii-toast[data-back]) > *{opacity:0}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]){filter:brightness(calc(1 - var(--d,0) * .04))}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]) > *{pointer-events:none}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast){translate:0 calc(var(--d,0) * (-100% - 8px));scale:1}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast[data-back]) > *{opacity:1}\n:where(.ascii-toast[data-forming]){animation:ascii-toast-in 420ms ${f} both}\n:where(.ascii-toast[data-forming],.ascii-toast[data-gone]) > *{opacity:0;transition:none}\n:where(.ascii-toast[data-gone]){opacity:0;scale:.97;pointer-events:none}\n:where(.ascii-toast[data-swiping]){transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f}}\n@keyframes ascii-toast-in{from{opacity:0;translate:0 14px}}\n:where(.ascii-toast-icon){display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:rgb(128 128 128 / .14)}\n:where(.ascii-toast-text){display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}\n:where(.ascii-toast-title){overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-body){overflow:hidden;font-size:13px;opacity:.68;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-action,.ascii-toast-close){flex:none;border:0;background:rgb(128 128 128 / .14);color:inherit;font:inherit;cursor:pointer}\n:where(.ascii-toast-action){height:32px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500}\n:where(.ascii-toast-close){display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:transparent;font-size:18px;line-height:1;opacity:.6}\n@media (prefers-reduced-motion:reduce){:where(.ascii-toast){transition:none}:where(.ascii-toast[data-forming]){animation:none}}\n`,g=t=>{const[e,n,o]=p(t).map(t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*n+.0722*o};function b(t,e){const n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(t.trim());if(!n)return!1;if(!((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5))return!1;const o=`#${[n[1],n[2],n[3]].map(t=>Math.round(i(+t,0,255)).toString(16).padStart(2,"0")).join("")}`,[a,r]=[g(o),g(e)].sort((t,e)=>e-t);return(a+.05)/(r+.05)<3}function v(p,f={}){const g={current:{...u,...f}},v=a(),w=document.createElement("ol"),y=r("",!1);y.setAttribute("role","status");let k=[],E=[],C=0,L=!1,$=!1,M=!1,P=!1,T=null;const S=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const z=new WeakSet,A=t=>{delete t.dataset.forming,z.delete(t)&&(t.style.removeProperty("transition"),t.style.removeProperty("background-color"),t.style.removeProperty("box-shadow"))};T=s({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...g.current.look}),outset:24,resolution:2,ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,onFail:()=>{T=null,E=[];for(const t of k)A(t.node)},paint:({pen:t,now:n,scale:o,still:a,box:r})=>(t.setTransform(o,0,0,o,0,0),E=E.filter(o=>{const a=(n-o.start)/o.ms;if(o.form&&a>=.62&&A(o.node),a>=1)return!1;if(o.form)e(t,o.snap,o.blocks,o.order,1.04*c(a),(t,e)=>[70*(t.seed-.5)*e,(14+26*d(t.x,t.y))*e],1-i((a-.62)/.28));else{const n=o.dir;e(t,o.snap,o.blocks,o.order,1-1.04*(1-(1-a)**3),(t,e)=>[n*(14+34*t.seed+.5*Math.abs(o.throw))*e,14*(d(t.y,t.x)-.35)*e],1-i((a-.75)/.25))}return!0}),E.length>0)}),T&&(T.canvas.style.zIndex="11");const I=()=>!!T&&T.live&&!T.still(),W=()=>{const t=k.filter(t=>void 0===t.node.dataset.gone);t.forEach((e,n)=>{const o=t.length-1-n;v.set(e.node,"--d",String(o)),0===o?(e.node.dataset.front="",delete e.node.dataset.back):(e.node.dataset.back="",delete e.node.dataset.front)})},F=(t,e,i=0)=>{if(!T)return;const a=T.canvas.clientWidth||p.clientWidth+48,r=T.canvas.clientHeight||p.clientHeight+48,s=n(t,a,r,T.box),c=o(s.rects),d=Math.max(1,...c.map(t=>t.x)),l=i<0?-1:1,m=l>0?t=>t.x/d:t=>1-t.x/d,h=Float32Array.from(c,t=>e?t.x/d*.3+.7*t.seed:.62*m(t)+.38*t.seed);E.push({start:performance.now(),ms:e?340:440,snap:s.canvas,blocks:c,order:h,form:e,node:t,dir:l,throw:i}),T.kick()},X=t=>{t.timer&&clearTimeout(t.timer),t.timer=0,L||t.left<=0||(t.since=performance.now(),t.timer=setTimeout(()=>G(t.id),t.left))},j=()=>(t=>{if(t!==L){L=t,t?w.dataset.open="":delete w.dataset.open;for(const e of k)t&&e.timer&&(clearTimeout(e.timer),e.timer=0,e.left=Math.max(400,e.left-(performance.now()-e.since))),t||X(e)}})($||M),H=()=>{$=!0,j()},N=()=>{$=!1,j()},Z=()=>{M=!0,j()},D=t=>{w.contains(t.relatedTarget)||(M=!1,j())};function G(t,e=0){const n=k.find(e=>e.id===t);if(!n||void 0!==n.node.dataset.gone)return;n.timer&&clearTimeout(n.timer);const o=()=>{k=k.filter(t=>t!==n),E=E.filter(t=>t.node!==n.node),n.node.remove(),W(),T?.kick(),k.some(t=>void 0===t.node.dataset.gone)||($=M=!1,j())},i=k[k.length-1]===n;I()&&(i||L||e)?(A(n.node),F(n.node,!1,e),n.node.dataset.gone="",W(),S.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",H),w.addEventListener("pointerleave",N),w.addEventListener("focusin",Z),w.addEventListener("focusout",D);let O=null;const R=t=>{if(!g.current.swipe||0!==t.button||O)return;const e=t.target;if(e?.closest?.('button, a, input, textarea, select, [role="button"]'))return;const n=e?.closest?.("[data-toast]"),o=n&&k.find(t=>t.node===n);o&&void 0===n.dataset.gone&&void 0===n.dataset.forming&&(O={item:o,id:t.pointerId,x0:t.clientX,dx:0,t:performance.now(),v:0},n.dataset.swiping="",n.setPointerCapture?.(t.pointerId))},q=t=>{if(!O||t.pointerId!==O.id)return;const e=performance.now(),n=t.clientX-O.x0;O.v=(n-O.dx)/Math.max(1,e-O.t),O.dx=n,O.t=e,O.item.node.style.setProperty("transform",`translateX(${n}px)`),O.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},B=t=>{if(!O||t.pointerId!==O.id)return;const{item:e,dx:n}=O,o=e.node,i=performance.now()-O.t>90?0:O.v;O=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(G(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",R),w.addEventListener("pointermove",q),w.addEventListener("pointerup",B),w.addEventListener("pointercancel",B);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(P)return-1;const e=++C,n=k.filter(t=>void 0===t.node.dataset.gone),o=n.length+1-Math.max(1,g.current.max);o>0&&n.slice(0,o).forEach(t=>G(t.id));const i=g.current.render?g.current.render(t,e):function(t,e){const n=(t,e,n)=>{const o=document.createElement(t);return o.className=e,n&&(o.dataset.paint=n),o},o=n("li","ascii-toast");if(void 0!==t.icon){const e=n("span","ascii-toast-icon","tile");e.setAttribute("aria-hidden","true"),"string"==typeof t.icon?e.textContent=t.icon:e.appendChild(t.icon),o.appendChild(e)}const i=n("span","ascii-toast-text"),a=n("b","ascii-toast-title","strong");if(a.textContent=t.title,i.appendChild(a),t.body){const e=n("span","ascii-toast-body","meta");e.textContent=t.body,i.appendChild(e)}if(o.appendChild(i),t.action){const{label:i,onClick:a}=t.action,r=n("button","ascii-toast-action","text");r.type="button",r.textContent=i,r.addEventListener("click",()=>{a(),e()}),o.appendChild(r)}const r=n("button","ascii-toast-close","none");return r.type="button",r.setAttribute("aria-label",`Dismiss ${t.title}`),r.textContent="×",r.addEventListener("click",e),o.appendChild(r),o}(t,()=>G(e));i.dataset.toast=String(e);const a={id:e,node:i,timer:0,left:t.duration??g.current.duration,since:0,born:performance.now()};return k.push(a),w.appendChild(i),W(),y.textContent=t.body?`${t.title}. ${t.body}`:t.title,I()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(z.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),F(i,!0)):T?.kick(),X(a),e},dismiss:t=>G(t),clear(){[...k].forEach(t=>G(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{P=!0;for(const t of k)t.timer&&clearTimeout(t.timer);S.forEach(clearTimeout),w.removeEventListener("pointerenter",H),w.removeEventListener("pointerleave",N),w.removeEventListener("focusin",Z),w.removeEventListener("focusout",D),w.removeEventListener("pointerdown",R),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",B),w.removeEventListener("pointercancel",B),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-IUKSHYED.js.map
1
+ import{injectStyle as t,drawBlocks as e,snapshot as n,blocksOf as o}from"./chunk-LE53AVKR.js";import{clamp as i,styleKeeper as a,srOnly as r,mountSurface as s,house as c,hash as d,handle as l,hexRgb as p,resolveColor as m,isDark as h}from"./chunk-GF72XM4C.js";var u={max:3,duration:6e3,label:"Notifications",swipe:!0},f="cubic-bezier(.16, 1, .3, 1)",x=`\n:where(.ascii-toasts){position:relative;margin:0;padding:0;list-style:none;min-height:52px}\n:where(.ascii-toast){position:absolute;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 8px 8px 10px;border-radius:14px;background:var(--ascii-toast-bg,Canvas);color:var(--ascii-toast-ink,CanvasText);box-shadow:var(--ascii-toast-shadow,0 1px 2px rgb(0 0 0 / .06),0 10px 28px -10px rgb(0 0 0 / .22));z-index:calc(10 - var(--d,0));transform-origin:50% 0;translate:0 calc(var(--d,0) * -12px);scale:calc(1 - var(--d,0) * .05);touch-action:pan-y;transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f},transform 300ms ${f},filter 380ms ${f}}\n:where(.ascii-toast)::after{content:"";position:absolute;left:0;right:0;top:100%;height:10px}\n:where(.ascii-toast) > *{transition:opacity 200ms ${f}}\n:where(.ascii-toast[data-back]) > *{opacity:0}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]){filter:brightness(calc(1 - var(--d,0) * .04))}\n:where(.ascii-toasts:not([data-open])) :where(.ascii-toast[data-back]) > *{pointer-events:none}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast){translate:0 calc(var(--d,0) * (-100% - 8px));scale:1}\n:where(.ascii-toasts[data-open]) :where(.ascii-toast[data-back]) > *{opacity:1}\n:where(.ascii-toast[data-forming]){animation:ascii-toast-in 420ms ${f} both}\n:where(.ascii-toast[data-forming],.ascii-toast[data-gone]) > *{opacity:0;transition:none}\n:where(.ascii-toast[data-gone]){opacity:0;scale:.97;pointer-events:none}\n:where(.ascii-toast[data-swiping]){transition:translate 380ms ${f},scale 380ms ${f},opacity 220ms ${f}}\n@keyframes ascii-toast-in{from{opacity:0;translate:0 14px}}\n:where(.ascii-toast-icon){display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:rgb(128 128 128 / .14)}\n:where(.ascii-toast-text){display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}\n:where(.ascii-toast-title){overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-body){overflow:hidden;font-size:13px;opacity:.68;text-overflow:ellipsis;white-space:nowrap}\n:where(.ascii-toast-action,.ascii-toast-close){flex:none;border:0;background:rgb(128 128 128 / .14);color:inherit;font:inherit;cursor:pointer}\n:where(.ascii-toast-action){height:32px;padding:0 12px;border-radius:999px;font-size:14px;font-weight:500}\n:where(.ascii-toast-close){display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:transparent;font-size:18px;line-height:1;opacity:.6}\n@media (prefers-reduced-motion:reduce){:where(.ascii-toast){transition:none}:where(.ascii-toast[data-forming]){animation:none}}\n`,g=t=>{const[e,n,o]=p(t).map(t=>{const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e+.7152*n+.0722*o};function b(t,e){const n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?/i.exec(t.trim());if(!n)return!1;if(!((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5))return!1;const o=`#${[n[1],n[2],n[3]].map(t=>Math.round(i(+t,0,255)).toString(16).padStart(2,"0")).join("")}`,[a,r]=[g(o),g(e)].sort((t,e)=>e-t);return(a+.05)/(r+.05)<3}function v(p,f={}){const g={current:{...u,...f}},v=a(),w=document.createElement("ol"),y=r("",!1);y.setAttribute("role","status");let k=[],E=[],C=0,L=!1,$=!1,M=!1,P=!1,T=null;const z=[];t("ascii-kit-toast",x),w.className="ascii-toasts",w.setAttribute("aria-label",g.current.label),p.append(w,y);const S=new WeakSet,A=t=>{delete t.dataset.forming,S.delete(t)&&(t.style.removeProperty("transition"),t.style.removeProperty("background-color"),t.style.removeProperty("box-shadow"))};T=s({host:p,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...g.current.look}),outset:24,resolution:2,ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,onFail:()=>{T=null,E=[];for(const t of k)A(t.node)},paint:({pen:t,now:n,scale:o,still:a,box:r})=>(t.setTransform(o,0,0,o,0,0),E=E.filter(o=>{const a=(n-o.start)/o.ms;if(o.form&&a>=.62&&A(o.node),a>=1)return!1;if(o.form)e(t,o.snap,o.blocks,o.order,1.04*c(a),(t,e)=>[70*(t.seed-.5)*e,(14+26*d(t.x,t.y))*e],1-i((a-.62)/.28));else{const n=o.dir;e(t,o.snap,o.blocks,o.order,1-1.04*(1-(1-a)**3),(t,e)=>[n*(14+34*t.seed+.5*Math.abs(o.throw))*e,14*(d(t.y,t.x)-.35)*e],1-i((a-.75)/.25))}return!0}),E.length>0)}),T&&(T.canvas.style.zIndex="11");const F=()=>!!T&&T.live&&!T.still(),I=()=>{const t=k.filter(t=>void 0===t.node.dataset.gone);t.forEach((e,n)=>{const o=t.length-1-n;v.set(e.node,"--d",String(o)),0===o?(e.node.dataset.front="",delete e.node.dataset.back):(e.node.dataset.back="",delete e.node.dataset.front)})},W=(t,e,i=0)=>{if(!T)return;const a=T.canvas.clientWidth||p.clientWidth+48,r=T.canvas.clientHeight||p.clientHeight+48,s=n(t,a,r,T.box),c=o(s.rects),d=Math.max(1,...c.map(t=>t.x)),l=i<0?-1:1,m=l>0?t=>t.x/d:t=>1-t.x/d,h=Float32Array.from(c,t=>e?t.x/d*.3+.7*t.seed:.62*m(t)+.38*t.seed);E.push({start:performance.now(),ms:e?340:440,snap:s.canvas,blocks:c,order:h,form:e,node:t,dir:l,throw:i}),T.kick()},X=t=>{t.timer&&clearTimeout(t.timer),t.timer=0,L||t.left<=0||(t.since=performance.now(),t.timer=setTimeout(()=>K(t.id),t.left))},j=()=>(t=>{if(t!==L){L=t,t?w.dataset.open="":delete w.dataset.open;for(const e of k)t&&e.timer&&(clearTimeout(e.timer),e.timer=0,e.left=Math.max(400,e.left-(performance.now()-e.since))),t||X(e)}})($||M),N=()=>{$=!0,j()},G=()=>{$=!1,j()},H=()=>{M=!0,j()},D=t=>{w.contains(t.relatedTarget)||(M=!1,j())};function K(t,e=0){const n=k.find(e=>e.id===t);if(!n||void 0!==n.node.dataset.gone)return;n.timer&&clearTimeout(n.timer);const o=()=>{k=k.filter(t=>t!==n),E=E.filter(t=>t.node!==n.node),n.node.remove(),I(),T?.kick(),k.some(t=>void 0===t.node.dataset.gone)||($=M=!1,j())},i=k[k.length-1]===n;F()&&(i||L||e)?(A(n.node),W(n.node,!1,e),n.node.dataset.gone="",I(),z.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",N),w.addEventListener("pointerleave",G),w.addEventListener("focusin",H),w.addEventListener("focusout",D);let R=null;const V=t=>{if(!g.current.swipe||0!==t.button||R)return;const e=t.target;if(e?.closest?.('button, a, input, textarea, select, [role="button"]'))return;const n=e?.closest?.("[data-toast]"),o=n&&k.find(t=>t.node===n);o&&void 0===n.dataset.gone&&void 0===n.dataset.forming&&(R={item:o,id:t.pointerId,x0:t.clientX,dx:0,t:performance.now(),v:0},n.dataset.swiping="",n.setPointerCapture?.(t.pointerId))},q=t=>{if(!R||t.pointerId!==R.id)return;const e=performance.now(),n=t.clientX-R.x0;R.v=(n-R.dx)/Math.max(1,e-R.t),R.dx=n,R.t=e,R.item.node.style.setProperty("transform",`translateX(${n}px)`),R.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},B=t=>{if(!R||t.pointerId!==R.id)return;const{item:e,dx:n}=R,o=e.node,i=performance.now()-R.t>90?0:R.v;R=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(K(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",V),w.addEventListener("pointermove",q),w.addEventListener("pointerup",B),w.addEventListener("pointercancel",B);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(P)return-1;const e=++C,n=k.filter(t=>void 0===t.node.dataset.gone),o=n.length+1-Math.max(1,g.current.max);o>0&&n.slice(0,o).forEach(t=>K(t.id));const i=g.current.render?g.current.render(t,e):function(t,e){const n=(t,e,n)=>{const o=document.createElement(t);return o.className=e,n&&(o.dataset.paint=n),o},o=n("li","ascii-toast");if(void 0!==t.icon){const e=n("span","ascii-toast-icon","tile");e.setAttribute("aria-hidden","true"),"string"==typeof t.icon?e.textContent=t.icon:e.appendChild(t.icon),o.appendChild(e)}const i=n("span","ascii-toast-text"),a=n("b","ascii-toast-title","strong");if(a.textContent=t.title,i.appendChild(a),t.body){const e=n("span","ascii-toast-body","meta");e.textContent=t.body,i.appendChild(e)}if(o.appendChild(i),t.action){const{label:i,onClick:a}=t.action,r=n("button","ascii-toast-action","text");r.type="button",r.textContent=i,r.addEventListener("click",()=>{a(),e()}),o.appendChild(r)}const r=n("button","ascii-toast-close","none");return r.type="button",r.setAttribute("aria-label",`Dismiss ${t.title}`),r.textContent="×",r.addEventListener("click",e),o.appendChild(r),o}(t,()=>K(e));i.dataset.toast=String(e);const a={id:e,node:i,timer:0,left:t.duration??g.current.duration,since:0,born:performance.now()};return k.push(a),w.appendChild(i),I(),y.textContent=t.body?`${t.title}. ${t.body}`:t.title,F()?(i.dataset.forming="",(t=>{const e=m(g.current.ink??"--ascii-ink-strong",p,h(p)?"#d8d6cf":"#1d1d1b");e&&b(getComputedStyle(t).backgroundColor,e)&&(S.add(t),t.style.setProperty("transition","none","important"),t.style.setProperty("background-color","transparent","important"),t.style.setProperty("box-shadow","none","important"))})(i),W(i,!0)):T?.kick(),X(a),e},dismiss:t=>K(t),clear(){[...k].forEach(t=>K(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{P=!0;for(const t of k)t.timer&&clearTimeout(t.timer);z.forEach(clearTimeout),w.removeEventListener("pointerenter",N),w.removeEventListener("pointerleave",G),w.removeEventListener("focusin",H),w.removeEventListener("focusout",D),w.removeEventListener("pointerdown",V),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",B),w.removeEventListener("pointercancel",B),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-DCLJHSWM.js.map
@@ -1 +1 @@
1
- import{scenePreset as e,FIELD_GRAPHITE as r,narrow as t}from"./chunk-C3C7AYKL.js";var a=e({id:"halftone",name:"Halftone",description:"The drifting ground drawn as dots, clear around your content.",cellSize:14,scene:"drift",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:r,middle:!1,feather:.2,tune:e=>({scale:t()?1.8:1,blend:"auto",dotScale:.64,lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:.4},...e.clear?{clear:{element:e.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as halftone};//# sourceMappingURL=chunk-W2STAN6V.js.map
1
+ import{scenePreset as e,FIELD_GRAPHITE as r,narrow as t}from"./chunk-3VEMKDBW.js";var a=e({id:"halftone",name:"Halftone",description:"The drifting ground drawn as dots, clear around your content.",cellSize:14,scene:"drift",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:r,middle:!1,feather:.2,tune:e=>({scale:t()?1.8:1,blend:"auto",dotScale:.64,lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:.4},...e.clear?{clear:{element:e.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as halftone};//# sourceMappingURL=chunk-DMRPBFLW.js.map
@@ -1 +1 @@
1
- import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";import{mixHex as l}from"./chunk-S7RZP2MT.js";var r=1,i=2,n=4,f=8,c={3:"─",12:"│",9:"┌",10:"┐",5:"└",6:"┘",11:"┬",7:"┴",13:"├",14:"┤",15:"┼",[r]:"╶",[i]:"╴",[n]:"╵",[f]:"╷"};function a(e,l,r,i,n={}){const{fontSize:f=13,pulseColor:a="#ffffff",color:s="#00ff88",density:h=.38,speed:g=1,lightMode:p=!1}=n,u=.62*f,b=1.4*f,m=Math.ceil(l/u),M=Math.ceil(r/b),d=t(s)??{r:0,g:255,b:136},S=t(a)??{r:255,g:255,b:255},$=(t,e)=>{if(o(17*t+1,7*e+2)>h)return 0;let l=0;return t+1<m&&o(17*t+1,7*e+2)>.15&&(l|=1),t-1>=0&&o(17*(t-1)+1,7*e+2)>.15&&(l|=2),e+1<M&&o(17*t+1,7*(e+1)+2)>.15&&(l|=8),e-1>=0&&o(17*t+1,7*(e-1)+2)>.15&&(l|=4),l};e.clearRect(0,0,l,r),e.font=`${f}px "JetBrains Mono", monospace`,e.textBaseline="top";const C=i*g;for(let t=0;t<M;t++)for(let l=0;l<m;l++){const r=$(l,t);if(0===r)continue;const i=c[r]??"·",n=(8*C+40*o(l,23*t))%m,f=(6*C+40*o(17*t,11*l))%M,a=(1&r||2&r)&&Math.abs(l-n)<1.5,s=(4&r||8&r)&&Math.abs(t-f)<1.5,h=a||s,g=.25+.35*o(3*l,5*t);h?(e.globalAlpha=.95,e.fillStyle=`rgb(${S.r},${S.g},${S.b})`):(e.globalAlpha=g,e.fillStyle=`rgb(${d.r},${d.g},${d.b})`),e.fillText(i,l*u,t*b)}e.globalAlpha=1}var s={id:"circuit",name:"Circuit",description:"Circuit traces with signals running along them.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,r,i,n)=>a(t,o,e,r,{fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink,pulseColor:n.accent??l(n.ink,"#ffffff",.7)}))};export{s as circuit,a as renderCircuitBackground};//# sourceMappingURL=chunk-XANKANGR.js.map
1
+ import{parseColor as t,hash2 as o}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-3OD5BMF5.js";import{mixHex as l}from"./chunk-GF72XM4C.js";var r=1,i=2,n=4,f=8,c={3:"─",12:"│",9:"┌",10:"┐",5:"└",6:"┘",11:"┬",7:"┴",13:"├",14:"┤",15:"┼",[r]:"╶",[i]:"╴",[n]:"╵",[f]:"╷"};function a(e,l,r,i,n={}){const{fontSize:f=13,pulseColor:a="#ffffff",color:s="#00ff88",density:h=.38,speed:g=1,lightMode:p=!1}=n,u=.62*f,b=1.4*f,m=Math.ceil(l/u),M=Math.ceil(r/b),d=t(s)??{r:0,g:255,b:136},C=t(a)??{r:255,g:255,b:255},$=(t,e)=>{if(o(17*t+1,7*e+2)>h)return 0;let l=0;return t+1<m&&o(17*t+1,7*e+2)>.15&&(l|=1),t-1>=0&&o(17*(t-1)+1,7*e+2)>.15&&(l|=2),e+1<M&&o(17*t+1,7*(e+1)+2)>.15&&(l|=8),e-1>=0&&o(17*t+1,7*(e-1)+2)>.15&&(l|=4),l};e.clearRect(0,0,l,r),e.font=`${f}px "JetBrains Mono", monospace`,e.textBaseline="top";const S=i*g;for(let t=0;t<M;t++)for(let l=0;l<m;l++){const r=$(l,t);if(0===r)continue;const i=c[r]??"·",n=(8*S+40*o(l,23*t))%m,f=(6*S+40*o(17*t,11*l))%M,a=(1&r||2&r)&&Math.abs(l-n)<1.5,s=(4&r||8&r)&&Math.abs(t-f)<1.5,h=a||s,g=.25+.35*o(3*l,5*t);h?(e.globalAlpha=.95,e.fillStyle=`rgb(${C.r},${C.g},${C.b})`):(e.globalAlpha=g,e.fillStyle=`rgb(${d.r},${d.g},${d.b})`),e.fillText(i,l*u,t*b)}e.globalAlpha=1}var s={id:"circuit",name:"Circuit",description:"Circuit traces with signals running along them.",cellSize:13,speed:1,cursor:!1,mount:t=>e(t,(t,o,e,r,i,n)=>a(t,o,e,r,{fontSize:n.fontSize,chars:n.chars,lightMode:n.lightMode,color:n.ink,pulseColor:n.accent??l(n.ink,"#ffffff",.7)}))};export{s as circuit,a as renderCircuitBackground};//# sourceMappingURL=chunk-E3FPFANJ.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"interference",name:"Interference",description:"Two fine ring grids from slowly orbiting centres; where they cross, moiré bands open and close.",cellSize:11,scene:"interference",charset:" .:-=+*#",hover:"lantern"});export{r as interference};//# sourceMappingURL=chunk-VC2ZQG63.js.map
1
+ import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"interference",name:"Interference",description:"Two fine ring grids from slowly orbiting centres; where they cross, moiré bands open and close.",cellSize:11,scene:"interference",charset:" .:-=+*#",hover:"lantern"});export{r as interference};//# sourceMappingURL=chunk-EKYEA7Z4.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var t=e({id:"caustics",name:"Caustics",description:"Light focused by moving water: fine bright lines that fold, part and meet again.",cellSize:11,scene:"caustics",charset:" .:-=+*#",hover:"lantern",tune:()=>({blend:"off",lantern:{radius:.14,strength:.22,trail:.8,follow:9}})});export{t as caustics};//# sourceMappingURL=chunk-IQTGJRDX.js.map
1
+ import{scenePreset as e}from"./chunk-3VEMKDBW.js";var t=e({id:"caustics",name:"Caustics",description:"Light focused by moving water: fine bright lines that fold, part and meet again.",cellSize:11,scene:"caustics",charset:" .:-=+*#",hover:"lantern",tune:()=>({blend:"off",lantern:{radius:.14,strength:.22,trail:.8,follow:9}})});export{t as caustics};//# sourceMappingURL=chunk-F6F2C3RH.js.map
@@ -0,0 +1 @@
1
+ import{currentFieldContext as e,prewarmGlyphAtlas as t,mountGlyphField as r,isSharedFieldCanvas as n}from"../field.js";var o={ascii:{mark:"glyph",charset:" .:-=+*#%@"},blocks:{mark:"glyph",charset:" ░▒▓█"},braille:{mark:"glyph",charset:" ⠁⠃⠇⡇⣇⣧⣷⣿"},dots:{mark:"dot"},lines:{mark:"glyph",charset:" -═╪╬"},cross:{mark:"glyph",charset:" ·+xX#"},diagonal:{mark:"glyph",charset:" /╱╳"},diamond:{mark:"glyph",charset:" ·◇◈◆"},mixed:{mark:"glyph",charset:" .:+/◇#@"},pixel:{mark:"pixel"},mosaic:{mark:"mosaic"},lego:{mark:"lego"},voxel:{mark:"voxel"},disco:{mark:"disco"},dither:{mark:"dither"},hex:{mark:"hex"},led:{mark:"led"},cmyk:{mark:"cmyk"},stipple:{mark:"stipple"},engraving:{mark:"engraving"},crosshatch:{mark:"crosshatch"},woodblock:{mark:"woodblock"},risograph:{mark:"risograph"},pointillism:{mark:"pointillism"}},a=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(o,e),s=/\p{L}/u,i=null,l=new Set,c=new Set;function u(e){const{charset:t,style:r}=e??{};i=e?{...t?{charset:t}:{},...a(r)?{style:r}:{}}:null;for(const e of c)e.relook();for(const e of[...l])e(i)}var m=()=>i;function h(e){return l.add(e),()=>{l.delete(e)}}var d=12,f=new Set,p=null,g=null,y=0,v=-1e9,k=0,w=0,b=!1,x=!1,E=()=>{const e=g?.timeline?.currentTime;return"number"==typeof e?e:null};function C(e){d=Number.isFinite(e)&&e>=1?Math.floor(e):12,N()}var S=()=>d,M=()=>"undefined"!=typeof performance?performance.now():Date.now(),A=()=>"number"==typeof innerHeight?innerHeight:0;function P(e,t=e.getBoundingClientRect()){if(!1===e.isConnected)return 1/0;if("function"==typeof e.getClientRects&&0===e.getClientRects().length)return 1/0;const r=t.bottom<0?-t.bottom:t.top-A();return r>0?r:0}function W(){try{const e=g?.querySelectorAll?.("dialog:modal");return e?.length?e[e.length-1]:null}catch{return null}}var L=1e8;function R(e,t){if(e.eager)return void(e.wanted=!0);const r=A(),n=P(e.host,t);!r||n<=2*r?e.wanted=!0:n>3*r&&(e.wanted=!1)}function q(e){let t=!1;for(const r of e)if(r?.target)for(const e of f)e.host===r.target&&(R(e,r.boundingClientRect??void 0),t=!0);t&&N()}var B=()=>N(),F=0,I=0,T=()=>{const e="number"==typeof scrollY?scrollY:0;e!==I&&(F=e>I?1:-1),I=e};function O(e,t){if(!t||!F)return t;return e.getBoundingClientRect().top>0===F>0?t:2*t}var $=null,j=e=>{$!==e&&($?.removeEventListener?.("close",B,!0),$?.removeEventListener?.("scroll",T,!0),e?.addEventListener?.("close",B,!0),e?.addEventListener?.("scroll",T,{capture:!0,passive:!0}),$=e)},z=new WeakSet,Y=0;function D(){Y||"function"!=typeof requestIdleCallback||(Y=requestIdleCallback(X,{timeout:2e3}))}function X(e){Y=0;const t=[...f].filter(e=>!e.live&&e.prewarm&&!z.has(e)).sort((e,t)=>P(e.host)-P(t.host));for(const r of t){if(e.timeRemaining()<2&&!e.didTimeout)return void D();z.add(r);try{r.prewarm()}catch{}}}function H(e){g!==e.doc&&(g=e.doc,f.clear(),y=k=w=F=0,v=-1e9,I="number"==typeof scrollY?scrollY:0),j(g),f.add(e);const t=function(){const e="function"==typeof IntersectionObserver?IntersectionObserver:null;if(!e)return null;if(p?.ctor!==e){p?.list.forEach(e=>e.disconnect()),p={ctor:e,list:["200% 0px","300% 0px","0px"].map(t=>new e(q,{rootMargin:t}))};for(const e of f)p.list.forEach(t=>t.observe(e.host))}return p.list}();t?.forEach(t=>t.observe(e.host)),t?R(e):e.wanted=!0,N(),e.live||D()}function N(t=!1){if(b)x=!0;else{b=!0;try{do{x=!1;const r=M(),n=E();(t||(null===n?r-v>16||r<v:n!==v))&&(v=n??r,k=w=0);for(const e of f)!1===e.host.isConnected&&(e.wanted=!1);for(const e of f)e.live&&!e.wanted&&e.release();const o=[...f].filter(e=>e.live&&!e.shared),a=W(),s=e=>!!a&&!a.contains(e.host),i=e=>P(e.host)+(s(e)?L:0),l=e=>e.eager&&!s(e),c=()=>o.filter(e=>e.live&&!e.shared).map(e=>[e,i(e)+(l(e)?0:1e9)]).sort((e,t)=>t[1]-e[1]);for(let e=o.length-d,t=e>0?c():[];e>0;e--)t.shift()?.[0].release();const u=e(),m=1*A(),h=()=>[...f].filter(e=>e.live&&e.shared&&i(e)>m).sort((e,t)=>i(t)-i(e));if(u?.overBudget)for(const e of h()){if(!u.overBudget)break;e.release()}const p=[...f].filter(e=>e.wanted&&!e.live).map(e=>[e,e.eager?-1:i(e)]).map(([e,t])=>[e,t,t>0?O(e.host,t):t]).sort((e,t)=>e[2]-t[2]);let g=0;for(const[e,r]of p){if(!f.has(e)||e.live)continue;if(u&&!u.roomy){const t=h()[0];if(!t||i(t)<=i(e))break;if(t.release(),!u.roomy)break}if(!e.eager&&(k>=4||w>=2)&&(!t||g)){y||(y=requestAnimationFrame(()=>{y=0,N(!0)}));break}if(o.filter(e=>e.live&&!e.shared).length>=d){const t=c()[0]?.[0];if(!t||(l(t)?!e.eager||i(t)<=i(e):!e.eager&&i(t)<=r))break;t.release()}const n=M();e.mount(),k+=M()-n,g++,e.eager||w++,e.live&&!e.shared&&o.push(e)}}while(x)}finally{b=!1}}}var V='ui-monospace, "SF Mono", Menlo, Consolas, monospace',_=new Map;function G(e,t=V){const r=`${t}\0${e}`,n=_.get(r);if(n)return n;let o={max:1,mean:1};try{const r="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:48,height:48}).getContext("2d",{willReadFrequently:!0});if(r&&"function"==typeof r.getImageData){r.font=`500 36px ${t}`,r.textAlign="center",r.textBaseline="middle";const n=e=>{r.clearRect(0,0,48,48),r.fillStyle="#000",r.fillText(e,24,25);const t=r.getImageData(0,0,48,48).data;let n=0;for(let e=3;e<t.length;e+=4)n+=t[e];return n/255},a=e=>[...e].filter(e=>e.trim()).map(n),s=e=>e.reduce((e,t)=>e+t,0)/Math.max(1,e.length),i=a(e),l=a(".:-=+*#%@"),c=n("@");i.length&&c>0&&s(l)>0&&(o={max:Math.max(...i)/c,mean:s(i)/s(l)})}}catch{}return _.set(r,o),o}function J(e,t){const{max:r,mean:n}=G(e,t.font??V),o=t.glyphScale??.8,a=t.gamma??1,s=t.fontWeight??500;return r>1.15?{glyphScale:Math.max(.3,o*Math.max(.62,r**-.36)),gamma:a,fontWeight:s}:n>1.5?{glyphScale:Math.max(.3,o*n**-.25),gamma:a,fontWeight:s}:r<.85?{glyphScale:Math.min(1.6,o*Math.min(1.3,r**-.3)),gamma:a,fontWeight:r<.6?Math.max(s,700):s}:{glyphScale:o,gamma:a,fontWeight:s}}var K=new WeakMap;function Q(e,t){for(const r of K.get(e)?.keys()??[])r.getAttribute("src")!==t&&(r.src=t)}function U(e){const t=K.get(e);K.delete(e),t?.forEach(e=>e())}function Z(e,t,r,n,o){const a=document.createElement("img");a.alt="",a.decoding="async",a.setAttribute("aria-hidden","true"),a.setAttribute("style",`${r};object-fit:cover`),a.style.opacity="1",a.dataset.asciiPoster="",a.src=t;const s=e.style.getPropertyValue("position"),i="function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position;i&&e.style.setProperty("position","relative");const l=e.style.getPropertyValue("isolation"),c=/z-index:\s*-1/.test(r)&&"function"==typeof getComputedStyle&&"auto"===getComputedStyle(e).isolation;c&&e.style.setProperty("isolation","isolate"),o?.parentElement===e?e.insertBefore(a,o):e.appendChild(a);let u=!1;const m=()=>{u||(u=!0,a.remove(),K.get(n)?.delete(a),i&&(s?e.style.setProperty("position",s):e.style.removeProperty("position")),c&&(l?e.style.setProperty("isolation",l):e.style.removeProperty("isolation")))},h=K.get(n)??new Map;return h.set(a,m),K.set(n,h),{show(e){a.style.opacity=e?"1":"0"},remove:m}}function ee(e){const t=document.createElement("canvas");for(const r of e.getAttributeNames?.()??[])"width"!==r&&"height"!==r&&t.setAttribute(r,e.getAttribute(r));return t.style.cssText=e.style.cssText,Object.assign(t.dataset,e.dataset),e.replaceWith?e.replaceWith(t):e.parentElement&&(e.parentElement.insertBefore(t,e),e.remove()),t}function te(e){const{host:a,kit:l}=e;let u,m=e.canvas,h=null,d=!1,g=!1,y=!1,v=!1,k={},w={},b=e.source,x=!1,E={},C=null,S=null,M=!1,A=null,P=()=>{};const W=!e.ownPoster&&l?.current.poster?Z(a,l.current.poster,e.place,l,m):null,L=()=>{if(!i||!1===l?.current.globalLook||"glyph"!==(w.mark??"glyph")&&!e.glyphs||s.test(w.charset??""))return;const t=i.style?o[i.style]:void 0,r=t?.mark??"glyph",n="glyph"===r?i.charset||(t&&"charset"in t?t.charset:void 0):void 0;return t||n?{mark:r,charset:n}:void 0},R=()=>({...e.glyphs?Object.fromEntries(Object.keys(e.glyphs()).map(e=>[e,w[e]]).filter(([,e])=>void 0!==e)):{},mark:w.mark??"glyph",charset:w.charset??" .,:-=+*#%@",glyphScale:w.glyphScale??.8,gamma:w.gamma??1,fontWeight:w.fontWeight??500}),q=t=>{if(!t.charset)return{...R(),mark:t.mark};const r=e.glyphs&&"glyph"!==(w.mark??"glyph")?e.glyphs():{};return{...r,mark:t.mark,charset:t.charset,...J(t.charset,{...w,...r})}},B=()=>{const e=L(),t=e&&`${e.mark}\0${e.charset??""}`;return t===u?null:(u=t,e?q(e):R())},F={host:a,doc:document,eager:!1===l?.current.lazy,wanted:!1,live:!1,poster:!!W||!!e.ownPoster,mount(){if(g||h)return;d&&(m=e.canvas=ee(m)),d=!0,w={...e.options(),...k},u=void 0;const t=B();let o;try{o=r(m,{...w,...t,...void 0===b?{}:{source:b},onError:()=>{h===o&&I()}})}catch{return void I()}h=o,F.live=!0,F.shared=n(m);const a=m;if(F.shared)P=()=>{};else{let e=0;const t=()=>{h===o&&(W?.show(!0),clearTimeout(e),e=setTimeout(()=>{h===o&&m===a&&(F.release(),N())},1e3))},r=()=>{clearTimeout(e),requestAnimationFrame(()=>requestAnimationFrame(()=>{h===o&&W?.show(!1)}))};a.addEventListener?.("webglcontextlost",t),a.addEventListener?.("webglcontextrestored",r),P=()=>{clearTimeout(e),a.removeEventListener?.("webglcontextlost",t),a.removeEventListener?.("webglcontextrestored",r)}}x&&o.pause(),o.ready.then(()=>{h===o&&(M=!0,W?.show(!1),C?.(),C=S=null)},()=>{}),e.onMount?.(o,m)},release(){if(!h)return;const t=h;h=null,F.live=!1,M=!1,P(),A?.clear(),A=null,E=t.settings,t.destroy(),F.shared?g||(m.width=m.width,d=!1):((e=>{try{const t=e.getContext("webgl2");t&&!t.isContextLost?.()&&t.getExtension("WEBGL_lose_context")?.loseContext()}catch{}})(m),g||(m=e.canvas=ee(m),d=!1)),W?.show(!0),e.onRelease?.()},prewarm(){if(g||h)return;w={...e.options(),...k};const r=L();t(m,{...w,...r?q(r):{}})}};function I(){y||(y=!0,T(),v||e.onFail())}function T(){g||(g=!0,F.release(),function(e){f.delete(e)&&([...f].some(t=>t.host===e.host)||p?.list.forEach(t=>t.unobserve(e.host)),!f.size&&p&&(p.list.forEach(e=>e.disconnect()),p=null),f.size||(j(null),Y&&"function"==typeof cancelIdleCallback&&cancelIdleCallback(Y),Y=0),N())}(F),c.delete(O),m.remove(),y?W?.show(!0):W?.remove())}const O={relook(){h||(e=>{z.delete(e),f.has(e)&&D()})(F);const t=B();if(!t||!h)return;const r=h,n=M&&!(l?.current.reducedMotion??("function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches));A?.clear(),A=null,n&&(r.redraw(),A=function(e,t){if(!e.width||!e.height||"undefined"==typeof document)return null;const r=document.createElement("canvas");r.width=e.width,r.height=e.height;const n=r.getContext("2d");if(!n||"function"!=typeof r.animate)return null;try{n.drawImage(e,0,0)}catch{return null}r.setAttribute("aria-hidden","true"),r.dataset.asciiSweep="",r.setAttribute("style",t);const o=document.createElement("span");let a,s;o.setAttribute("aria-hidden","true"),o.dataset.asciiSweep="",o.setAttribute("style",`${t};right:auto;width:2px;margin-left:-1px;opacity:0;background:var(--ascii-sweep, #f3ba32);box-shadow:0 0 10px 1px color-mix(in srgb, var(--ascii-sweep, #f3ba32) 40%, transparent)`),e.after(r,o);const i=()=>{a?.cancel(),s?.cancel(),r.remove(),o.remove()};return{clear:i,reveal(){if(!r.isConnected)return;const t={duration:200,delay:40,easing:"cubic-bezier(.23,1,.32,1)",fill:"both"};a=r.animate([{clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 0% 0% 100%)"}],t);const n=e.clientWidth||e.getBoundingClientRect().width;s=o.animate([{transform:"translateX(0px)",opacity:.35},{opacity:.35,offset:.7},{transform:`translateX(${n}px)`,opacity:0}],t),a.onfinish=i}}}(m,e.place)),r.update(t);const o=A;o&&requestAnimationFrame(()=>requestAnimationFrame(()=>{A===o&&h===r?o.reveal():o.clear()}))}};return{field:{get canvas(){return m},get ready(){return h?h.ready:S??(S=new Promise(e=>{C=e}))},get settings(){return h?.settings??E},update(e){if(k={...k,...e},w={...w,...e},!h)return;const t=B(),r=L();h.update(r?{...e,...q(r)}:t?{...e,...t}:e)},setSource:e=>(b=e,h?h.setSource(e):Promise.resolve()),pointer(e,t){h?.pointer(e,t)},redraw(){h?.redraw()},pulse(e){h?.pulse(e)},play(){x=!1,h?.play()},pause(){x=!0,h?.pause()},resize(){h?.resize()},destroy(){T()}},get canvas(){return m},get live(){return!!h},get failed(){return y},start(){c.add(O),v=!0;try{H(F)}finally{v=!1}},destroy:T}}export{o as KIT_STYLES,J as balanceCharset,U as disposeKit,S as getFieldBudget,m as getGlobalLook,G as inkWeight,te as liveField,Z as poster,C as setFieldBudget,u as setGlobalLook,Q as setPosterSource,h as subscribeGlobalLook};//# sourceMappingURL=chunk-FEAFQY7O.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"aurora",name:"Aurora",description:"Curtains of light at three depths hang from the top in tall vertical rays, brightest along their hems.",cellSize:11,scene:"aurora",charset:" .:¦|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.2,y:.42,width:.6,height:.5,feather:.3,shape:"ellipse"}});export{r as aurora};//# sourceMappingURL=chunk-FUI5AVIF.js.map
1
+ import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"aurora",name:"Aurora",description:"Curtains of light at three depths hang from the top in tall vertical rays, brightest along their hems.",cellSize:11,scene:"aurora",charset:" .:¦|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.2,y:.42,width:.6,height:.5,feather:.3,shape:"ellipse"}});export{r as aurora};//# sourceMappingURL=chunk-FHN3PPSI.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"contour",name:"Contour",description:"Survey lines over a slowly shifting terrain, every fifth an index line.",cellSize:11,scene:"contour",charset:" .·-~=",hover:"lantern"});export{r as contour};//# sourceMappingURL=chunk-QRCXXS5Z.js.map
1
+ import{scenePreset as e}from"./chunk-3VEMKDBW.js";var r=e({id:"contour",name:"Contour",description:"Survey lines over a slowly shifting terrain, every fifth an index line.",cellSize:11,scene:"contour",charset:" .·-~=",hover:"lantern"});export{r as contour};//# sourceMappingURL=chunk-FPCCX4FM.js.map
@@ -1 +1 @@
1
- import{velocity as t,stepSpring as e}from"./chunk-2NVKPXPL.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-S7RZP2MT.js";var l={cards:"[data-card]",loop:!0,threshold:.4,outset:56},h=(t,e,r)=>t+(e-t)*r,s=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r}),c=Array.from({length:96},(t,e)=>{const r=43758.5453*Math.sin(127.1*e+311.7);return r-Math.floor(r)});function d(t,e,n=.04){if(!t.complete||!t.naturalWidth)return null;const o=Math.min(1,420/Math.max(t.naturalWidth,t.naturalHeight)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(t.naturalWidth*o)),a.height=Math.max(1,Math.round(t.naturalHeight*o));const i=a.getContext("2d",{willReadFrequently:!0});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);const o=i.getImageData(0,0,a.width,a.height),l=o.data,h=new Uint32Array(256),s=l.length/4,c=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)h[Math.round(c(t))]++;let d=0,u=255,g=0;for(let t=0;t<256;t++)if(g+=h[t],g>=.02*s){d=t;break}g=0;for(let t=255;t>=0;t--)if(g+=h[t],g>=.02*s){u=t;break}const m=Math.max(1,u-d);for(let t=0;t<l.length;t+=4){let o=r((c(t)-d)/m);e&&(o=1-o),l[t]=l[t+1]=l[t+2]=Math.round(255*(n+(1-n)*o)),l[t+3]=255}return i.putImageData(o,0,0),a}catch{return null}}function u(u,g={}){const m={current:{...l,...g}},p=n(),f=()=>!!(m.current.reducedMotion??i()),v=()=>[...u.querySelectorAll(m.current.cards)];let x=0,M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9),y=!1,k=0,A=0,E=null,L=[],I=0,S=0,C=-1,R=new Map,$=null,P=null;const W=t=>v()[F(t)]??null,q=()=>u.clientWidth||160,F=t=>{const e=v().length;return e?(t%e+e)%e:0},T=(t,e,r,n)=>{const o=W(t);if(!o||!m.current.loop&&t>=v().length)return null;const a="IMG"===o.tagName?o:o.querySelector("img"),i=`${a?.currentSrc||a?.src||""}|${a?.complete}|${Math.round(e)}x${Math.round(r)}|${n}`,l=R.get(o);if(l?.key===i)return l.canvas;const h=document.createElement("canvas");h.width=Math.max(1,Math.round(e)),h.height=Math.max(1,Math.round(r));const s=h.getContext("2d");if(!s)return null;const c=m.current.radius??(parseFloat(getComputedStyle(u).borderTopLeftRadius)||16);s.beginPath(),s.roundRect(0,0,h.width,h.height,Math.min(c,h.width/2,h.height/2)),s.clip();const g=a?d(a,n):null;if(g){const t=Math.max(h.width/g.width,h.height/g.height),e=h.width/t,r=h.height/t;s.drawImage(g,(g.width-e)/2,(g.height-r)/2,e,r,0,0,h.width,h.height)}else s.fillStyle="rgb(60 60 60)",s.fillRect(0,0,h.width,h.height);return s.strokeStyle="rgb(150 150 150)",s.lineWidth=6,s.stroke(),R.set(o,{key:i,canvas:h}),h};function D(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:W(e);t.forEach(t=>{P?(p.set(t,"opacity","0"),t!==r?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")):t.hidden=t!==r}),u.setAttribute("aria-label",r?`${r.getAttribute("aria-label")||r.querySelector("img")?.alt||r.textContent?.trim()||"Card"}. Left arrow to pass, right arrow to keep.`:"No more cards")}P=o({host:u,outset:m.current.outset,look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,contrast:1.3,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{P=null,p.restore(),D()},onTheme:()=>{R=new Map},paint:({pen:t,w:e,now:n,dark:o,box:a})=>{const i=a(u),l=i.w,s=i.h,d=i.x+l/2,g=i.y+s/2,m=r(b.x),p=(e,r,n,a,i=0)=>{const h=T(e,l,s,!o);!h||a<=0||(t.save(),t.translate(d,g+n),t.scale(r,r),t.globalAlpha=a,t.drawImage(h,-l/2,-s/2),i>0&&(t.globalCompositeOperation="destination-out",t.globalAlpha=i,t.drawImage(((t,e)=>{let r=$;if(!r||r.width!==Math.round(t)||r.height!==Math.round(e)){r=$=document.createElement("canvas"),r.width=Math.max(1,Math.round(t)),r.height=Math.max(1,Math.round(e));const n=r.getContext("2d");if(n)for(let t=0;t<r.height;t+=6)for(let e=0;e<r.width;e+=4){const r=43758.5453*Math.sin(12.9898*e+78.233*t);r-Math.floor(r)<.55&&(n.fillStyle="#000",n.fillRect(e,t,4,6))}}return r})(l,s),-l/2,-s/2)),t.restore())};p(x+2,h(.86,.93,m),h(24,12,m),h(.3,.55,m),.3),p(x+1,h(.93,1,m),h(12,0,m),h(.55,1,m),.4*(1-m));const f=T(x,l,s,!o);if(!f)return!1;const v=E?r((n-E.start)/620):0,y=E?.dir??1,k=E?E.x0+y*l*.9*(1-(1-v)**3):M.x,A=E?E.y0:w.x;if(t.save(),t.translate(d+k,g+A),t.rotate(.22*r(k/l,-1.6,1.6)),!E)return t.drawImage(f,-l/2,-s/2),t.restore(),!1;const L=Math.ceil(s/6);for(let n=0;n<L;n++){const o=c[n%c.length],a=r(1.55*v-.55*o);if(a>=1)continue;const i=y*a*a*l*(.5+.9*o),h=6*n,u=Math.min(6,s-h),g=y>0?d+k+i+.62*l:d+k+i-.62*l,m=y>0?e-4-g:g-4;t.globalAlpha=(1-a*a)*r(m/56),t.drawImage(f,0,h,l,u,-l/2+i,-s/2+h,l,u)}return t.restore(),!1}});const N=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-S)/1e3));S=t;let o=!1;y||E||(o=e(M,n,.3),o=e(w,n,.3)||o),o=e(b,n,.002)||o,E&&t-E.start>=620&&(E=null,x+=1,j()),(()=>{(m.current.leanTarget??u).style.setProperty("--ascii-lean",String(E?0:r(M.x/(.4*q()),-1,1)));const t=W(x);!P&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),P?.kick(),(o||y||E)&&(I=requestAnimationFrame(N))},X=()=>{I||(S=performance.now(),I=requestAnimationFrame(N))},j=()=>{M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9)},z=(t=1)=>{const e=v();if(E||!e.length||!m.current.loop&&x>=e.length)return!1;const r=W(x),n=F(x);return y=!1,f()||!P?(x+=1,j(),P||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),D(),X(),m.current.onSwipe?.(t,n,r),!0},G=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==C)return;y=!1;const n=t(L,performance.now()),o=q();Math.abs(M.x)>o*m.current.threshold||Math.abs(n)>650&&Math.sign(n)===Math.sign(M.x)&&Math.abs(M.x)>16?z(M.x<0?-1:1):(M.to=0,w.to=0,b.to=0,M.v=.2*r(n,-1600,1600),f()&&(M.x=w.x=b.x=0,M.v=w.v=b.v=0),X())},H=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,Y=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}C=t.pointerId;const e=H();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],X()},B=t=>{if(!y||t.pointerId!==C)return;const e=H();M.x=M.to=(t.clientX-k)/e,w.x=w.to=(t.clientY-A)/e*.3,M.v=w.v=0,b.to=.5*r(Math.abs(M.x)/q()),L.push([M.x,performance.now()]),L.length>8&&L.shift(),X()},K=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),z("ArrowRight"===t.key?1:-1))},O=()=>P?.kick(),U=t=>t.preventDefault();return u.hasAttribute("tabindex")||(u.tabIndex=0),u.setAttribute("role",u.getAttribute("role")??"group"),u.setAttribute("aria-roledescription","card"),p.set(u,"touch-action","none"),D(),u.addEventListener("pointerdown",Y),u.addEventListener("pointermove",B),u.addEventListener("pointerup",G),u.addEventListener("pointercancel",G),u.addEventListener("lostpointercapture",G),u.addEventListener("keydown",K),u.addEventListener("load",O,!0),u.addEventListener("dragstart",U),a(()=>P,m,()=>{R=new Map,D(),P?.refresh()},{next:z,get index(){return F(x+(E?1:0))}},()=>{I&&cancelAnimationFrame(I),I=0,p.restore(),v().forEach(t=>{t.hidden=!1,t.removeAttribute("aria-hidden")}),(m.current.leanTarget??u).style.removeProperty("--ascii-lean"),u.removeAttribute("aria-roledescription"),u.removeEventListener("pointerdown",Y),u.removeEventListener("pointermove",B),u.removeEventListener("pointerup",G),u.removeEventListener("pointercancel",G),u.removeEventListener("lostpointercapture",G),u.removeEventListener("keydown",K),u.removeEventListener("load",O,!0),u.removeEventListener("dragstart",U)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-TTGMK4EA.js.map
1
+ import{velocity as t,stepSpring as e}from"./chunk-K6JX64AS.js";import{clamp as r,styleKeeper as n,mountSurface as o,handle as a,prefersReduced as i}from"./chunk-GF72XM4C.js";var l={cards:"[data-card]",loop:!0,threshold:.4,outset:56},h=(t,e,r)=>t+(e-t)*r,s=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r}),c=Array.from({length:96},(t,e)=>{const r=43758.5453*Math.sin(127.1*e+311.7);return r-Math.floor(r)});function d(t,e,n=.04){if(!t.complete||!t.naturalWidth)return null;const o=Math.min(1,420/Math.max(t.naturalWidth,t.naturalHeight)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(t.naturalWidth*o)),a.height=Math.max(1,Math.round(t.naturalHeight*o));const i=a.getContext("2d",{willReadFrequently:!0});if(!i)return null;try{i.drawImage(t,0,0,a.width,a.height);const o=i.getImageData(0,0,a.width,a.height),l=o.data,h=new Uint32Array(256),s=l.length/4,c=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)h[Math.round(c(t))]++;let d=0,u=255,g=0;for(let t=0;t<256;t++)if(g+=h[t],g>=.02*s){d=t;break}g=0;for(let t=255;t>=0;t--)if(g+=h[t],g>=.02*s){u=t;break}const m=Math.max(1,u-d);for(let t=0;t<l.length;t+=4){let o=r((c(t)-d)/m);e&&(o=1-o),l[t]=l[t+1]=l[t+2]=Math.round(255*(n+(1-n)*o)),l[t+3]=255}return i.putImageData(o,0,0),a}catch{return null}}function u(u,g={}){const m={current:{...l,...g}},p=n(),f=()=>!!(m.current.reducedMotion??i()),v=()=>[...u.querySelectorAll(m.current.cards)];let x=0,M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9),y=!1,k=0,A=0,E=null,L=[],I=0,S=0,C=-1,$=new Map,R=null,F=null;const W=t=>v()[D(t)]??null,q=()=>u.clientWidth||160,D=t=>{const e=v().length;return e?(t%e+e)%e:0},P=(t,e,r,n)=>{const o=W(t);if(!o||!m.current.loop&&t>=v().length)return null;const a="IMG"===o.tagName?o:o.querySelector("img"),i=`${a?.currentSrc||a?.src||""}|${a?.complete}|${Math.round(e)}x${Math.round(r)}|${n}`,l=$.get(o);if(l?.key===i)return l.canvas;const h=document.createElement("canvas");h.width=Math.max(1,Math.round(e)),h.height=Math.max(1,Math.round(r));const s=h.getContext("2d");if(!s)return null;const c=m.current.radius??(parseFloat(getComputedStyle(u).borderTopLeftRadius)||16);s.beginPath(),s.roundRect(0,0,h.width,h.height,Math.min(c,h.width/2,h.height/2)),s.clip();const g=a?d(a,n):null;if(g){const t=Math.max(h.width/g.width,h.height/g.height),e=h.width/t,r=h.height/t;s.drawImage(g,(g.width-e)/2,(g.height-r)/2,e,r,0,0,h.width,h.height)}else s.fillStyle="rgb(60 60 60)",s.fillRect(0,0,h.width,h.height);return s.strokeStyle="rgb(150 150 150)",s.lineWidth=6,s.stroke(),$.set(o,{key:i,canvas:h}),h};function T(){const t=v(),e=x+(E?1:0),r=!m.current.loop&&e>=t.length?null:W(e);t.forEach(t=>{F?(p.set(t,"opacity","0"),t!==r?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")):t.hidden=t!==r}),u.setAttribute("aria-label",r?`${r.getAttribute("aria-label")||r.querySelector("img")?.alt||r.textContent?.trim()||"Card"}. Left arrow to pass, right arrow to keep.`:"No more cards")}F=o({host:u,outset:m.current.outset,look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,contrast:1.3,...m.current.look}),ink:()=>m.current.ink??"--ascii-ink-strong",kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{F=null,p.restore(),T()},onTheme:()=>{$=new Map},paint:({pen:t,w:e,now:n,dark:o,box:a})=>{const i=a(u),l=i.w,s=i.h,d=i.x+l/2,g=i.y+s/2,m=r(b.x),p=(e,r,n,a,i=0)=>{const h=P(e,l,s,!o);!h||a<=0||(t.save(),t.translate(d,g+n),t.scale(r,r),t.globalAlpha=a,t.drawImage(h,-l/2,-s/2),i>0&&(t.globalCompositeOperation="destination-out",t.globalAlpha=i,t.drawImage(((t,e)=>{let r=R;if(!r||r.width!==Math.round(t)||r.height!==Math.round(e)){r=R=document.createElement("canvas"),r.width=Math.max(1,Math.round(t)),r.height=Math.max(1,Math.round(e));const n=r.getContext("2d");if(n)for(let t=0;t<r.height;t+=6)for(let e=0;e<r.width;e+=4){const r=43758.5453*Math.sin(12.9898*e+78.233*t);r-Math.floor(r)<.55&&(n.fillStyle="#000",n.fillRect(e,t,4,6))}}return r})(l,s),-l/2,-s/2)),t.restore())};p(x+2,h(.86,.93,m),h(24,12,m),h(.3,.55,m),.3),p(x+1,h(.93,1,m),h(12,0,m),h(.55,1,m),.4*(1-m));const f=P(x,l,s,!o);if(!f)return!1;const v=E?r((n-E.start)/620):0,y=E?.dir??1,k=E?E.x0+y*l*.9*(1-(1-v)**3):M.x,A=E?E.y0:w.x;if(t.save(),t.translate(d+k,g+A),t.rotate(.22*r(k/l,-1.6,1.6)),!E)return t.drawImage(f,-l/2,-s/2),t.restore(),!1;const L=Math.ceil(s/6);for(let n=0;n<L;n++){const o=c[n%c.length],a=r(1.55*v-.55*o);if(a>=1)continue;const i=y*a*a*l*(.5+.9*o),h=6*n,u=Math.min(6,s-h),g=y>0?d+k+i+.62*l:d+k+i-.62*l,m=y>0?e-4-g:g-4;t.globalAlpha=(1-a*a)*r(m/56),t.drawImage(f,0,h,l,u,-l/2+i,-s/2+h,l,u)}return t.restore(),!1}});const X=t=>{I=0;const n=Math.min(1/30,Math.max(0,(t-S)/1e3));S=t;let o=!1;y||E||(o=e(M,n,.3),o=e(w,n,.3)||o),o=e(b,n,.002)||o,E&&t-E.start>=620&&(E=null,x+=1,j()),(()=>{(m.current.leanTarget??u).style.setProperty("--ascii-lean",String(E?0:r(M.x/(.4*q()),-1,1)));const t=W(x);!F&&t&&p.set(t,"transform",`translate(${M.x}px, ${w.x}px) rotate(${.22*r(M.x/q(),-1.6,1.6)}rad)`)})(),F?.kick(),(o||y||E)&&(I=requestAnimationFrame(X))},G=()=>{I||(S=performance.now(),I=requestAnimationFrame(X))},j=()=>{M=s(0,380,.72),w=s(0,380,.8),b=s(0,260,.9)},z=(t=1)=>{const e=v();if(E||!e.length||!m.current.loop&&x>=e.length)return!1;const r=W(x),n=D(x);return y=!1,f()||!F?(x+=1,j(),F||p.set(r,"transform","")):(E={dir:t,start:performance.now(),x0:M.x,y0:w.x},b.to=1),T(),G(),m.current.onSwipe?.(t,n,r),!0},H=e=>{if(!y||void 0!==e&&void 0!==e.pointerId&&e.pointerId!==C)return;y=!1;const n=t(L,performance.now()),o=q();Math.abs(M.x)>o*m.current.threshold||Math.abs(n)>650&&Math.sign(n)===Math.sign(M.x)&&Math.abs(M.x)>16?z(M.x<0?-1:1):(M.to=0,w.to=0,b.to=0,M.v=.2*r(n,-1600,1600),f()&&(M.x=w.x=b.x=0,M.v=w.v=b.v=0),G())},N=()=>u.getBoundingClientRect().width/(u.clientWidth||1)||1,Y=t=>{if(0!==t.button||E)return;try{u.setPointerCapture?.(t.pointerId)}catch{}C=t.pointerId;const e=N();y=!0,k=t.clientX-M.x*e,A=t.clientY-w.x/.3*e,L=[],G()},B=t=>{if(!y||t.pointerId!==C)return;const e=N();M.x=M.to=(t.clientX-k)/e,w.x=w.to=(t.clientY-A)/e*.3,M.v=w.v=0,b.to=.5*r(Math.abs(M.x)/q()),L.push([M.x,performance.now()]),L.length>8&&L.shift(),G()},J=t=>{"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),z("ArrowRight"===t.key?1:-1))},K=()=>F?.kick(),O=t=>t.preventDefault();return u.hasAttribute("tabindex")||(u.tabIndex=0),u.setAttribute("role",u.getAttribute("role")??"group"),u.setAttribute("aria-roledescription","card"),p.set(u,"touch-action","none"),T(),u.addEventListener("pointerdown",Y),u.addEventListener("pointermove",B),u.addEventListener("pointerup",H),u.addEventListener("pointercancel",H),u.addEventListener("lostpointercapture",H),u.addEventListener("keydown",J),u.addEventListener("load",K,!0),u.addEventListener("dragstart",O),a(()=>F,m,()=>{$=new Map,T(),F?.refresh()},{next:z,get index(){return D(x+(E?1:0))}},()=>{I&&cancelAnimationFrame(I),I=0,p.restore(),v().forEach(t=>{t.hidden=!1,t.removeAttribute("aria-hidden")}),(m.current.leanTarget??u).style.removeProperty("--ascii-lean"),u.removeAttribute("aria-roledescription"),u.removeEventListener("pointerdown",Y),u.removeEventListener("pointermove",B),u.removeEventListener("pointerup",H),u.removeEventListener("pointercancel",H),u.removeEventListener("lostpointercapture",H),u.removeEventListener("keydown",J),u.removeEventListener("load",K,!0),u.removeEventListener("dragstart",O)})}var g=l;export{g as SWIPE_DECK_DEFAULTS,u as swipeDeck,d as toneImage};//# sourceMappingURL=chunk-FWODCYYJ.js.map
@@ -1 +1 @@
1
- import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-C3C7AYKL.js";var a=r({id:"drift",name:"Drift",description:"Characters that drift slowly in broad lobes and stay clear around your content.",cellSize:11,scene:"drift",charset:" .:-=+*#",hover:"trail",graphite:e,middle:!1,feather:.2,tune:r=>({scale:t()?"dot"===r.mark?1.8:1.6:1,brightness:"dot"===r.mark?0:.05,blend:"auto",lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:"dot"===r.mark?.4:.32},...r.clear?{clear:{element:r.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as drift};//# sourceMappingURL=chunk-AIM3J2US.js.map
1
+ import{scenePreset as r,FIELD_GRAPHITE as e,narrow as t}from"./chunk-3VEMKDBW.js";var a=r({id:"drift",name:"Drift",description:"Characters that drift slowly in broad lobes and stay clear around your content.",cellSize:11,scene:"drift",charset:" .:-=+*#",hover:"trail",graphite:e,middle:!1,feather:.2,tune:r=>({scale:t()?"dot"===r.mark?1.8:1.6:1,brightness:"dot"===r.mark?0:.05,blend:"auto",lantern:{radius:.16,strength:.35,trail:.6,follow:9},trail:{strength:.9,radius:"dot"===r.mark?.4:.32},...r.clear?{clear:{element:r.clear,padding:32,feather:.2,shape:"rect"}}:{}})});export{a as drift};//# sourceMappingURL=chunk-GBNV3GXG.js.map
@@ -0,0 +1 @@
1
+ import{poster as e,liveField as t,disposeKit as n,setPosterSource as o}from"./chunk-FEAFQY7O.js";import{isGlyphFieldSupported as r,watchPointer as i,requestFieldFrame as a,watchVisibility as s,watchTheme as c,watchMotionPreference as l,cancelFieldFrame as u,ambientFactor as d}from"../field.js";var p,f,h=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),m=(e,t)=>{const n=43758.5453*Math.sin(127.1*e+311.7*t);return n-Math.floor(n)},g=(e,t=3)=>1-(1-h(e))**t,y=(e,t,n)=>{const o=h((n-e)/(t-e));return o*o*(3-2*o)},v=e=>{if(e<=0)return 0;if(e>=1)return 1;const t=(e,t,n)=>3*t*e*(1-e)**2+3*n*e*e*(1-e)+e**3;let n=0,o=1,r=e;for(let i=0;i<22;i++)r=(n+o)/2,t(r,.16,.3)<e?n=r:o=r;return t(r,1,1)},b=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches,x=e=>e??b(),w={scene:"none",background:"transparent",color:"ink",levels:"none",fit:"cover",focus:{x:.5,y:.5},vignette:0,drift:0,hover:"none",shade:0,contrast:1,brightness:0,gamma:1,maxPixelRatio:2,clear:!1};function M(e,t,n){let o=(e??"").trim();const r=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/.exec(o);if(r?o=k(t,r[1])||(r[2]??"").trim():o.startsWith("--")&&(o=k(t,o)),!o)return n?M(n,t):null;if(/^#[\da-f]{6}$/i.test(o))return o.toLowerCase();if(/^#[\da-f]{3}$/i.test(o))return`#${[...o.slice(1)].map(e=>e+e).join("")}`.toLowerCase();const i=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(o);if(i)return C([+i[1],+i[2],+i[3]]);if(void 0===f)try{f="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0})}catch{f=null}if(!f)return n?M(n,t):null;f.clearRect(0,0,1,1),f.fillStyle="#000",f.fillStyle=o,f.fillRect(0,0,1,1);const[a,s,c]=f.getImageData(0,0,1,1).data;return C([a,s,c])}var k=(e,t)=>"function"==typeof getComputedStyle?getComputedStyle(e).getPropertyValue(t).trim():"",C=e=>`#${e.map(e=>Math.round(h(e,0,255)).toString(16).padStart(2,"0")).join("")}`,R=e=>{const t=parseInt(e.slice(1,7),16);return[t>>16&255,t>>8&255,255&t]},S=(e,t,n)=>{const o=R(e),r=R(t);return C(o.map((e,t)=>e+(r[t]-e)*n))};function $(e){const t="function"==typeof getComputedStyle?getComputedStyle(e):null,n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?/i.exec(t?.backgroundColor??"");if(n){if((void 0===n[4]?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]))>=.5)return.2126*+n[1]+.7152*+n[2]+.0722*+n[3]<128}const o=M(t?.color??"",e);if(!o)return"function"==typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches;const[r,i,a]=R(o);return.2126*r+.7152*i+.0722*a>140}function O(){const e=[];return{set(t,n,o){e.some(([e,o])=>e===t&&o===n)||e.push([t,n,t.style.getPropertyValue(n)]),t.style.setProperty(n,o)},restore(){for(const[t,n,o]of e.reverse())o?t.style.setProperty(n,o):t.style.removeProperty(n);e.length=0}}}function j(e="",t=!1){const n=document.createElement("span");return n.setAttribute("style","position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0"),t&&n.setAttribute("aria-live","polite"),n.textContent=e,n}function E(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.width/(e.offsetWidth||n.width||1)||1;return{x:(o.left-n.left)/r,y:(o.top-n.top)/r,w:o.width/r,h:o.height/r}}function F(e,t){const n={...e,...t},o=e.look,r=t.look;return r&&(n.look=Object.fromEntries(Object.entries({...o,...r}).filter(([,e])=>void 0!==e))),n}var P=new WeakMap,W=e=>P.get(e)?.()??null;function A(n){const{host:o,layer:f="over",outset:h=0,kit:m}=n;if("undefined"==typeof document)return null;const g=`position:absolute;left:${-h}px;top:${-h}px;width:calc(100% + ${2*h}px);height:calc(100% + ${2*h}px);pointer-events:none;z-index:${"under"===f?-1:"auto"}`;if(!r())return m?.current.poster&&e(o,m.current.poster,g,m),null;const y=O(),v=document.createElement("canvas"),x=document.createElement("canvas"),k=x.getContext("2d");if(!k)return null;"static"===getComputedStyle(o).position&&y.set(o,"position","relative"),"under"===f&&y.set(o,"isolation","isolate"),v.setAttribute("aria-hidden","true"),v.dataset.asciiKit="";const C=v.style;C.position="absolute",C.left=C.top=-h+"px",C.width=C.height=`calc(100% + ${2*h}px)`,C.pointerEvents="none",C.zIndex="under"===f?"-1":"",o.appendChild(v);const R=()=>{const e=getComputedStyle(o);H.canvas.style.borderRadius=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(e=>h&&/^[\d.]+px$/.test(e)?`${parseFloat(e)+h}px`:e).join(" ")};let S=$(o);const j=()=>M(n.ink(S),o)??M(getComputedStyle(o).color,o)??(S?"#d8d6cf":"#1d1d1b");let F=!1,W=!1,A=!0,I=!1,z=-1/0,T=-1/0;const B=i({target:o,move:e=>{T=e.timeStamp},leave(){}}),H=t({host:o,canvas:v,kit:m,place:g,options:()=>({...w,...n.look(),ink:j(),interactionTarget:o,label:""}),onMount:(e,t)=>{P.set(t,K),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(Y,()=>{}),Y()},onRelease:()=>{F&&u(Q),F=!1},onFail:()=>{ee(),n.onFail?.()}}),L=H.field;R();const D=()=>!!(n.reducedMotion()??b()),V=e=>E(H.canvas,e),q=e=>{const t=H.canvas,r=Math.max(1,t.clientWidth||o.clientWidth+2*h),i=Math.max(1,t.clientHeight||o.clientHeight+2*h),a=n.resolution??1,[s,c]="function"==typeof a?a(r,i):[Math.max(1,Math.round(r*a)),Math.max(1,Math.round(i*a))];x.width===s&&x.height===c||(x.width=s,x.height=c),k.setTransform(1,0,0,1,0,0),k.globalAlpha=1,k.globalCompositeOperation="source-over",k.filter="none",k.fillStyle="#000",k.fillRect(0,0,s,c);let l=!1;try{l=n.paint({pen:k,width:s,height:c,w:r,h:i,scale:s/r,now:e,still:D(),dark:S,box:V})}catch(e){"undefined"!=typeof console&&console.error(e)}return L.setSource(x),I||L.redraw(),l};function K(){const e=H.canvas,t=Math.max(1,e.clientWidth||o.clientWidth+2*h),r=Math.max(1,e.clientHeight||o.clientHeight+2*h),i=n.resolution??1,[a,s]="function"==typeof i?i(t,r):[Math.max(1,Math.round(t*i)),Math.max(1,Math.round(r*i))],c=document.createElement("canvas");c.width=a,c.height=s;const l=c.getContext("2d");if(!l)return null;l.fillStyle="#000",l.fillRect(0,0,a,s);try{n.paint({pen:l,width:a,height:s,w:t,h:r,scale:a/t,now:performance.now(),still:!0,dark:S,box:V})}catch{return null}return c}function Q(e){if(F=!1,I||W||!H.live)return;if(e-z<(p??(p=(()=>{const e="undefined"==typeof navigator?void 0:navigator;return 1e3/(e&&(e.hardwareConcurrency>0&&e.hardwareConcurrency<=2||e.deviceMemory&&e.deviceMemory<=2||e.connection?.saveData)?30:60)-2})()))*d()&&e-T>1e3)return F=!0,void a(Q);z=e;!q(e)||D()||!A||"undefined"!=typeof document&&document.hidden||(F=!0,a(Q))}function Y(){F||I||W||!H.live||(F=!0,a(Q))}P.set(v,K);const G="function"==typeof ResizeObserver?new ResizeObserver(()=>{R(),L.resize(),!H.live||I||W||q(performance.now()),Y()}):null;G?.observe(o);const J="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{A=e.isIntersecting,A&&Y()},{rootMargin:"64px"}):null;J?.observe(o);const N=s(()=>{document.hidden||Y()});let U=!1;const X=()=>{U=!1,I||(S=$(o),L.update({ink:j()}),n.onTheme?.(),Y())},Z=c(()=>{U||I||(U=!0,a(X))}),_=l(Y);function ee(){I||(I=!0,F&&u(Q),U&&u(X),F=U=!1,G?.disconnect(),J?.disconnect(),N(),B(),Z(),_(),H.destroy(),y.restore(),x.width=x.height=1)}return H.start(),H.failed?(ee(),null):{field:L,get canvas(){return H.canvas},get live(){return H.live},kick:Y,refresh(){I||(S=$(o),L.update({...w,...n.look(),ink:j()}),Y())},still:D,dark:()=>S,box:V,play(){W&&(W=!1,L.play(),Y())},pause(){W=!0,F&&u(Q),F=!1,L.pause()},destroy:ee}}function I(e,t,r,i,a=()=>{}){let s=!1;const c={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(e){if(s)return;t.current=F(t.current,e);const n=e.poster;n&&o(t,n),r(t.current)},play(){s||e()?.play()},pause(){s||e()?.pause()},destroy(){s||(s=!0,e()?.destroy(),n(t),a())}};return Object.defineProperties(i,Object.getOwnPropertyDescriptors(c))}export{w as BASE_LOOK,E as boxIn,h as clamp,g as easeOut,I as handle,m as hash,R as hexRgb,v as house,$ as isDark,F as mergeOptions,S as mixHex,A as mountSurface,b as prefersReduced,x as reducedFrom,M as resolveColor,W as settledSource,y as smoothstep,j as srOnly,O as styleKeeper,C as toHex};//# sourceMappingURL=chunk-GF72XM4C.js.map
@@ -1 +1 @@
1
- import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-BR6ZNJZW.js";function r(o,r,c,n,l={}){const{fontSize:i=14,chars:s=" ·∙•:-=+*#",color:a,accentColor:h,speed:f=.5,harmonics:m=3,lightMode:p=!1}=l,g=h??(p?"#6b8700":"#d4ff00"),M=.62*i,d=1.4*i,$=Math.ceil(r/M),u=Math.ceil(c/d);o.clearRect(0,0,r,c),o.font=`${i}px monospace`,o.textBaseline="top";let b=255,S=255,x=255;if(p&&(b=55,S=55,x=55),a){const e=t(a);e&&(b=e.r,S=e.g,x=e.b)}let z=212,C=255,k=0;const y=t(g);y&&(z=y.r,C=y.g,k=y.b);const Z=n*f,j=Array.from({length:m},(t,e)=>1/(e+1)).reduce((t,e)=>t+e,0);for(let t=0;t<u;t++)for(let r=0;r<$;r++){let c=0;for(let o=0;o<m;o++){const n=.18+1.4*e(r*(o+3)+7,t*(o+5)+11),l=e(r*(o+7),t*(o+9)+3)*Math.PI*2,i=1/(o+1);c+=Math.sin(Z*n+l)*i}const n=.5*(c/j+1);if(n<.28)continue;const l=(n-.28)/.72,i=s[Math.min(s.length-1,Math.floor(l*s.length))],a=n>.88,h=p?.82*l:.13*l;o.fillStyle=a?`rgba(${z},${C},${k},${p?.92:.28})`:`rgba(${b},${S},${x},${h})`,o.fillText(i,r*M,t*d)}}var c={id:"morph",name:"Morph",description:"Every cell shimmers at its own frequencies.",cellSize:14,speed:1,cursor:!1,mount:t=>o(t,(t,e,o,c,n,l)=>r(t,e,o,c,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{c as morph,r as renderMorphBackground};//# sourceMappingURL=chunk-SARCZMLN.js.map
1
+ import{parseColor as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-3OD5BMF5.js";function r(o,r,c,n,l={}){const{fontSize:i=14,chars:s=" ·∙•:-=+*#",color:a,accentColor:h,speed:f=.5,harmonics:m=3,lightMode:p=!1}=l,M=h??(p?"#6b8700":"#d4ff00"),g=.62*i,d=1.4*i,$=Math.ceil(r/g),u=Math.ceil(c/d);o.clearRect(0,0,r,c),o.font=`${i}px monospace`,o.textBaseline="top";let b=255,S=255,x=255;if(p&&(b=55,S=55,x=55),a){const e=t(a);e&&(b=e.r,S=e.g,x=e.b)}let z=212,C=255,k=0;const y=t(M);y&&(z=y.r,C=y.g,k=y.b);const j=n*f,v=Array.from({length:m},(t,e)=>1/(e+1)).reduce((t,e)=>t+e,0);for(let t=0;t<u;t++)for(let r=0;r<$;r++){let c=0;for(let o=0;o<m;o++){const n=.18+1.4*e(r*(o+3)+7,t*(o+5)+11),l=e(r*(o+7),t*(o+9)+3)*Math.PI*2,i=1/(o+1);c+=Math.sin(j*n+l)*i}const n=.5*(c/v+1);if(n<.28)continue;const l=(n-.28)/.72,i=s[Math.min(s.length-1,Math.floor(l*s.length))],a=n>.88,h=p?.82*l:.13*l;o.fillStyle=a?`rgba(${z},${C},${k},${p?.92:.28})`:`rgba(${b},${S},${x},${h})`,o.fillText(i,r*g,t*d)}}var c={id:"morph",name:"Morph",description:"Every cell shimmers at its own frequencies.",cellSize:14,speed:1,cursor:!1,mount:t=>o(t,(t,e,o,c,n,l)=>r(t,e,o,c,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{c as morph,r as renderMorphBackground};//# sourceMappingURL=chunk-GKR3ROYR.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-S7RZP2MT.js";var a={blocks:"[data-block]",shimmer:1400,resolve:420,stagger:60,develop:640},r=t=>`rgb(${255*t} ${255*t} ${255*t})`,l=(t,e,n)=>t<0?0:o((t-e)/n,3),i=t=>parseFloat(t)||0;function s(t,e,o=1){const n=getComputedStyle(t),a=t.getBoundingClientRect(),r=n.borderTopLeftRadius,l=r.endsWith("%")?i(r)/100*Math.min(a.width,a.height):i(r);if("text"!==e)return{radius:l/o,lines:[]};const s=i(n.fontSize)||14,c="normal"===n.lineHeight?1.2*s:i(n.lineHeight),u=Math.min(c,.62*s),h=new Map,m="undefined"!=typeof document&&"function"==typeof document.createRange?document.createRange():null;m?.selectNodeContents(t);for(const t of m?[...m.getClientRects()]:[]){if(!t.width)continue;const e=Math.round((t.top+t.bottom)/2/Math.max(1,c/2)),o=h.get(e);h.set(e,o?{left:Math.min(o.left,t.left),right:Math.max(o.right,t.right),top:Math.min(o.top,t.top),bottom:Math.max(o.bottom,t.bottom)}:{left:t.left,right:t.right,top:t.top,bottom:t.bottom})}const d=[...h.values()].map(t=>{const e=Math.max(t.left,a.left),n=Math.min(t.right,a.right),r=(t.top+t.bottom)/2;return{x:(e-a.left)/o,y:(r-u/2-a.top)/o,w:Math.max(0,n-e)/o,h:u/o}}).filter(t=>t.w>0);return d.length||d.push({x:0,y:(a.height-u)/2/o,w:a.width/o,h:u/o}),{radius:(l||u/2)/o,lines:d}}function c(t){const e=t.dataset.block;return"text"===e||"photo"===e||"avatar"===e?e:"IMG"===t.tagName||"PICTURE"===t.tagName||"VIDEO"===t.tagName?/^50%|^9999px/.test(getComputedStyle(t).borderTopLeftRadius)?"avatar":"photo":"text"}function u(i,u={}){const h={current:{...a,...u}},m=t();let d=0,f=null,g=null,p=null,b=null;const M=()=>[...i.querySelectorAll(h.current.blocks)].map((t,e)=>({el:t,kind:c(t),delay:void 0!==t.dataset.delay?Number(t.dataset.delay):80+e*h.current.stagger})),y=["mask-image","-webkit-mask-image"],k=()=>{m.restore(),i.removeAttribute("aria-busy"),g?.(),g=null};b=e({host:i,look:()=>({mark:"glyph",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.92,font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,contrast:1.15,shade:.35,...h.current.look}),ink:()=>h.current.ink??"--ascii-ink-strong",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{b=null,k()},paint:({pen:t,now:e,still:n,box:a,w:i})=>{if(null!==f&&n)return k(),!1;const c=h.current,u=null===f?-1:e-f;if(null!==f&&u>Math.max(h.current.develop,...M().map(t=>t.delay+h.current.resolve))+16)return k(),!1;null!==f&&(t=>{for(const{el:e,kind:o,delay:n}of M()){const a=l(t,n,h.current.resolve);if(m.set(e,"opacity",String("text"===o?Math.min(1,1.6*a):a)),"text"===o){const t=128*a-14;for(const o of y)m.set(e,o,a>=1?"none":`linear-gradient(90deg, #000 ${t-14}%, transparent ${t+14}%)`)}}})(u);const g=Math.max(140,.42*i),p=i+g,b=-g+(n?.4:(e-d)/c.shimmer%1)*p,x=n?1:o((e-d)/280,3),v=t.createLinearGradient(b-p,0,b+p,.08*p);for(let t=0;t<=32;t++){const e=Math.abs(t/16-1)*p,o=Math.min(e,Math.abs(p-e)),n=o<g?.5+.5*Math.cos(o/g*Math.PI):0;v.addColorStop(t/32,r(.24+(.54-.24)*n))}const w=(e,o,n,a,r)=>{t.beginPath(),t.roundRect(e,o,Math.max(0,n),a,Math.min(r,a/2,Math.max(0,n)/2))};for(const{el:e,kind:n,delay:r}of M()){const{x:i,y:h,w:m,h:d}=a(e),f=e.getBoundingClientRect().width,g=s(e,n,f&&m?f/m:1),p=l(u,r,c.resolve);if(t.fillStyle=v,"photo"===n){const n=u<0?0:o(u/c.develop,4);t.globalAlpha=(1-p)*x,w(i,h,m,d,g.radius),t.fill();const a=e instanceof HTMLImageElement?e:e.querySelector("img");if(n>0&&a?.complete&&a.naturalWidth){const e=Math.max(m/a.naturalWidth,d/a.naturalHeight),o=a.naturalWidth*e,r=a.naturalHeight*e;t.save(),w(i,h,m,d,g.radius),t.clip(),t.globalAlpha=n*(1-p),t.drawImage(a,i+(m-o)/2,h+(d-r)/2,o,r),t.restore()}}else if("avatar"===n)t.globalAlpha=(1-p)*x,t.beginPath(),t.arc(i+m/2,h+d/2,Math.min(m,d)/2,0,2*Math.PI),t.fill();else{t.globalAlpha=x*(1-p);for(const e of g.lines){const o=i+e.x,n=o+e.w*p;w(n,h+e.y,o+e.w-n,e.h,g.radius),t.fill()}}t.globalAlpha=1}return!0}});const x=()=>{const t=null!==f;if(d=performance.now(),f=null,i.setAttribute("aria-busy","true"),b){if(t&&!b.still())for(const{el:t}of M())t.animate?.([{opacity:1},{opacity:0}],{duration:240,easing:"cubic-bezier(.16, 1, .3, 1)"});(()=>{for(const{el:t}of M()){m.set(t,"opacity","0");for(const e of y)t.style.removeProperty(e)}})(),b.kick()}};return x(),n(()=>b,h,()=>b?.refresh(),{resolve:()=>b?(null!==f&&p||(f=performance.now(),p=new Promise(t=>{g=t}),b.kick()),p):(i.removeAttribute("aria-busy"),Promise.resolve()),reset(){g?.(),g=null,p=null,x()},get loading(){return null===f}},()=>{k()})}var h=a;export{h as SKELETON_DEFAULTS,c as blockKind,s as blockShape,u as skeleton};//# sourceMappingURL=chunk-ROR6MG3K.js.map
1
+ import{styleKeeper as t,mountSurface as e,easeOut as o,handle as n}from"./chunk-GF72XM4C.js";var a={blocks:"[data-block]",shimmer:1400,resolve:420,stagger:60,develop:640},r=t=>`rgb(${255*t} ${255*t} ${255*t})`,l=(t,e,n)=>t<0?0:o((t-e)/n,3),i=t=>parseFloat(t)||0;function s(t,e,o=1){const n=getComputedStyle(t),a=t.getBoundingClientRect(),r=n.borderTopLeftRadius,l=r.endsWith("%")?i(r)/100*Math.min(a.width,a.height):i(r);if("text"!==e)return{radius:l/o,lines:[]};const s=i(n.fontSize)||14,c="normal"===n.lineHeight?1.2*s:i(n.lineHeight),u=Math.min(c,.62*s),h=new Map,m="undefined"!=typeof document&&"function"==typeof document.createRange?document.createRange():null;m?.selectNodeContents(t);for(const t of m?[...m.getClientRects()]:[]){if(!t.width)continue;const e=Math.round((t.top+t.bottom)/2/Math.max(1,c/2)),o=h.get(e);h.set(e,o?{left:Math.min(o.left,t.left),right:Math.max(o.right,t.right),top:Math.min(o.top,t.top),bottom:Math.max(o.bottom,t.bottom)}:{left:t.left,right:t.right,top:t.top,bottom:t.bottom})}const d=[...h.values()].map(t=>{const e=Math.max(t.left,a.left),n=Math.min(t.right,a.right),r=(t.top+t.bottom)/2;return{x:(e-a.left)/o,y:(r-u/2-a.top)/o,w:Math.max(0,n-e)/o,h:u/o}}).filter(t=>t.w>0);return d.length||d.push({x:0,y:(a.height-u)/2/o,w:a.width/o,h:u/o}),{radius:(l||u/2)/o,lines:d}}function c(t){const e=t.dataset.block;return"text"===e||"photo"===e||"avatar"===e?e:"IMG"===t.tagName||"PICTURE"===t.tagName||"VIDEO"===t.tagName?/^50%|^9999px/.test(getComputedStyle(t).borderTopLeftRadius)?"avatar":"photo":"text"}function u(i,u={}){const h={current:{...a,...u}},m=t();let d=0,f=null,g=null,p=null,b=null;const M=()=>[...i.querySelectorAll(h.current.blocks)].map((t,e)=>({el:t,kind:c(t),delay:void 0!==t.dataset.delay?Number(t.dataset.delay):80+e*h.current.stagger})),y=["mask-image","-webkit-mask-image"],k=()=>{m.restore(),i.removeAttribute("aria-busy"),g?.(),g=null};b=e({host:i,look:()=>({mark:"glyph",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.92,font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,contrast:1.15,shade:.35,...h.current.look}),ink:()=>h.current.ink??"--ascii-ink-strong",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{b=null,k()},paint:({pen:t,now:e,still:n,box:a,w:i})=>{if(null!==f&&n)return k(),!1;const c=h.current,u=null===f?-1:e-f;if(null!==f&&u>Math.max(h.current.develop,...M().map(t=>t.delay+h.current.resolve))+16)return k(),!1;null!==f&&(t=>{for(const{el:e,kind:o,delay:n}of M()){const a=l(t,n,h.current.resolve);if(m.set(e,"opacity",String("text"===o?Math.min(1,1.6*a):a)),"text"===o){const t=128*a-14;for(const o of y)m.set(e,o,a>=1?"none":`linear-gradient(90deg, #000 ${t-14}%, transparent ${t+14}%)`)}}})(u);const g=Math.max(140,.42*i),p=i+g,b=-g+(n?.4:(e-d)/c.shimmer%1)*p,x=n?1:o((e-d)/280,3),v=t.createLinearGradient(b-p,0,b+p,.08*p);for(let t=0;t<=32;t++){const e=Math.abs(t/16-1)*p,o=Math.min(e,Math.abs(p-e)),n=o<g?.5+.5*Math.cos(o/g*Math.PI):0;v.addColorStop(t/32,r(.24+(.54-.24)*n))}const w=(e,o,n,a,r)=>{t.beginPath(),t.roundRect(e,o,Math.max(0,n),a,Math.min(r,a/2,Math.max(0,n)/2))};for(const{el:e,kind:n,delay:r}of M()){const{x:i,y:h,w:m,h:d}=a(e),f=e.getBoundingClientRect().width,g=s(e,n,f&&m?f/m:1),p=l(u,r,c.resolve);if(t.fillStyle=v,"photo"===n){const n=u<0?0:o(u/c.develop,4);t.globalAlpha=(1-p)*x,w(i,h,m,d,g.radius),t.fill();const a=e instanceof HTMLImageElement?e:e.querySelector("img");if(n>0&&a?.complete&&a.naturalWidth){const e=Math.max(m/a.naturalWidth,d/a.naturalHeight),o=a.naturalWidth*e,r=a.naturalHeight*e;t.save(),w(i,h,m,d,g.radius),t.clip(),t.globalAlpha=n*(1-p),t.drawImage(a,i+(m-o)/2,h+(d-r)/2,o,r),t.restore()}}else if("avatar"===n)t.globalAlpha=(1-p)*x,t.beginPath(),t.arc(i+m/2,h+d/2,Math.min(m,d)/2,0,2*Math.PI),t.fill();else{t.globalAlpha=x*(1-p);for(const e of g.lines){const o=i+e.x,n=o+e.w*p;w(n,h+e.y,o+e.w-n,e.h,g.radius),t.fill()}}t.globalAlpha=1}return!0}});const x=()=>{const t=null!==f;if(d=performance.now(),f=null,i.setAttribute("aria-busy","true"),b){if(t&&!b.still())for(const{el:t}of M())t.animate?.([{opacity:1},{opacity:0}],{duration:240,easing:"cubic-bezier(.16, 1, .3, 1)"});(()=>{for(const{el:t}of M()){m.set(t,"opacity","0");for(const e of y)t.style.removeProperty(e)}})(),b.kick()}};return x(),n(()=>b,h,()=>b?.refresh(),{resolve:()=>b?(null!==f&&p||(f=performance.now(),p=new Promise(t=>{g=t}),b.kick()),p):(i.removeAttribute("aria-busy"),Promise.resolve()),reset(){g?.(),g=null,p=null,x()},get loading(){return null===f}},()=>{k()})}var h=a;export{h as SKELETON_DEFAULTS,c as blockKind,s as blockShape,u as skeleton};//# sourceMappingURL=chunk-H5KHXZWR.js.map
@@ -1 +1 @@
1
- import{blank as t,mountPageField as e,pageHandle as n}from"./chunk-BTD6EFAW.js";import{styleKeeper as r}from"./chunk-S7RZP2MT.js";var o={font:'Georgia, "Times New Roman", serif',fontWeight:600};function i(e,n=o.font,r=o.fontWeight,i=520){const{canvas:c,pen:l}=t(1800,Math.max(1,Math.round(i))),s=Math.min(400,1700/Math.max(3,.56*[...e].length));return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=`${r} ${s}px ${n}`,l.fillText(e||" ",c.width/2,c.height/2+.05*s),c}function c(t,c={}){const l=(t.textContent??"").trim(),s={current:{...o,...c}};let a=s.current.text??l;const u=r(),f=()=>i(a,s.current.font,s.current.fontWeight,s.current.artHeight),d=!l;let h=null;h=e({host:t,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"contain",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.62,radius:.22},...s.current.look}),ink:()=>s.current.ink??"--ascii-ink-strong",source:f(),label:d?s.current.label??a:void 0,kit:s,reducedMotion:()=>s.current.reducedMotion,onFail:()=>{h=null,u.restore()}}),h&&l&&u.set(t,"color","transparent"),h&&document.fonts?.load?.(`${s.current.fontWeight} 100px ${s.current.font}`).then(()=>{h&&h.field.setSource(f())},()=>{});const x=e=>{if(e!==a)if(a=e,void 0!==s.current.text&&(s.current={...s.current,text:a}),h)if(h.field.setSource(f()),d)h.field.update({label:s.current.label??(a||" ")});else{for(const e of[...t.childNodes])e!==h.canvas&&e.remove();t.prepend(document.createTextNode(a))}else l&&(t.textContent=a)};return n(()=>h,s,t=>{void 0!==t.text&&t.text!==a?x(t.text):h&&h.field.setSource(f())},{setText:x,get text(){return a}},()=>u.restore())}export{i as wordArt,c as wordmark};//# sourceMappingURL=chunk-PCIAA2LL.js.map
1
+ import{blank as t,mountPageField as e,pageHandle as n}from"./chunk-7DXSG526.js";import{styleKeeper as r}from"./chunk-GF72XM4C.js";var o={font:'Georgia, "Times New Roman", serif',fontWeight:600};function i(e,n=o.font,r=o.fontWeight,i=520){const{canvas:c,pen:l}=t(1800,Math.max(1,Math.round(i))),s=Math.min(400,1700/Math.max(3,.56*[...e].length));return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=`${r} ${s}px ${n}`,l.fillText(e||" ",c.width/2,c.height/2+.05*s),c}function c(t,c={}){const l=(t.textContent??"").trim(),s={current:{...o,...c}};let a=s.current.text??l;const u=r(),f=()=>i(a,s.current.font,s.current.fontWeight,s.current.artHeight),d=!l;let h=null;h=e({host:t,layer:"over",look:()=>({mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.3,levels:"auto",fit:"contain",focus:{x:.5,y:.5},hover:"trail",trail:{strength:.62,radius:.22},...s.current.look}),ink:()=>s.current.ink??"--ascii-ink-strong",source:f(),label:d?s.current.label??a:void 0,kit:s,reducedMotion:()=>s.current.reducedMotion,onFail:()=>{h=null,u.restore()}}),h&&l&&u.set(t,"color","transparent"),h&&document.fonts?.load?.(`${s.current.fontWeight} 100px ${s.current.font}`).then(()=>{h&&h.field.setSource(f())},()=>{});const x=e=>{if(e!==a)if(a=e,void 0!==s.current.text&&(s.current={...s.current,text:a}),h)if(h.field.setSource(f()),d)h.field.update({label:s.current.label??(a||" ")});else{for(const e of[...t.childNodes])e!==h.canvas&&e.remove();t.prepend(document.createTextNode(a))}else l&&(t.textContent=a)};return n(()=>h,s,t=>{void 0!==t.text&&t.text!==a?x(t.text):h&&h.field.setSource(f())},{setText:x,get text(){return a}},()=>u.restore())}export{i as wordArt,c as wordmark};//# sourceMappingURL=chunk-I5R2347P.js.map
@@ -1 +1 @@
1
- import{injectStyle as e,imageReady as t,imageFor as n,drawCover as a}from"./chunk-4OT66HSZ.js";import{srOnly as o,mountSurface as r,handle as i,isDark as l,clamp as s}from"./chunk-S7RZP2MT.js";var c={maxBytes:10485760,develop:900};function d(e,t,n=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1)){const a=Math.max(2,Math.round(6*n)),o=Math.max(2,Math.round(1*a)),r=(e,t)=>{const a=Math.floor(e*n/t);for(let e=a;e>1;e--){const o=e*t/n;if(Math.abs(o-Math.round(o))<.01||e<a-8)return{n:e,css:Math.round(o)}}return{n:1,css:Math.round(t/n)}},i=r(e,o),l=r(t,a);return{cols:i.n,rows:l.n,w:i.css,h:l.css,cw:o/n,ch:a/n}}function p(e,t,n,a){const{cols:o,rows:r}=t,i=e.createImageData(2*o,2*r),l=i.data,{tone:s,glow:c=0,phase:d=0,near:p=null}=a,h=Math.max(1,n/t.cw),u=Math.max(1,n/t.ch),m=o-2,f=r-2,g=Math.max(0,m-1-2*h),x=Math.max(0,f-1-2*u),v=Math.PI/4*(h+u),y=.45*Math.hypot(o,r);for(let e=0;e<r;e++)for(let t=0;t<o;t++){const n=Math.max(1+h-t,0,t-(m-h)),a=Math.max(1+u-e,0,e-(f-u));let r;if(n>0&&a>0){const e=Math.hypot(n/h,a/u);r=Math.hypot(n,a)*(1-1/e)}else r=-Math.min(t-1,m-t,e-1,f-e);let i=0;if(Math.abs(r)<.5){if(i=s,c>0){const o=t>m-h,r=e>f-u,l=t<1+h,p=e<1+u,y=(e,t)=>Math.atan2(e,t)/(Math.PI/2);let M;M=!p||l||o?p&&o?g+v*y(n/h,a/u):!o||p||r?r&&o?g+v+x+v*y(a/u,n/h):r&&!l?g+2*v+x+(m-h-t):r&&l?2*g+2*v+x+v*y(n/h,a/u):l&&!p?2*g+3*v+x+(f-u-e):2*g+3*v+2*x+v*y(a/u,n/h):g+v+(e-(1+u)):t-(1+h);const b=((M-d)%9+9)%9;i=s+c*(.2+.32*Math.max(0,1-Math.abs(b-4.5)/2.2))}}else if(c>0&&r<-.5&&r>-3.5){i=c*(1-(-r-.5)/3)**1.6*(.1+.32*(p?Math.max(0,1-Math.hypot(t-p.x,e-p.y)/y):.4))}const M=Math.round(255*Math.min(1,i));for(let n=0;n<4;n++){const a=4*((2*e+(n>>1))*o*2+2*t+(1&n));l[a]=l[a+1]=l[a+2]=M,l[a+3]=255}}e.putImageData(i,0,0)}function h(h,u={}){const m={current:{...c,...u}};let f="empty",g=null,x="",v="",y="image",M=0,b=0,w=!1,k=0,C=0,E=0,L=0,R=null,S=null,z=null,$=null,U=null;const j=o("",!0),O=["left","top","width","height"],P=()=>{const e=$?.canvas;if(!e||!h.offsetWidth)return null;const t="empty"===f?d(h.offsetWidth,h.offsetHeight):null,n=t?[`${Math.round((h.offsetWidth-t.w)/2)}px`,`${Math.round((h.offsetHeight-t.h)/2)}px`,`${t.w}px`,`${t.h}px`]:["0px","0px","100%","100%"];let a=!1;return O.forEach((t,o)=>{e.style[t]!==n[o]&&(e.style[t]=n[o],a=!0)}),U=t,a?($?.field.resize(),$?.kick(),null):t},D=document.createElement("input"),I=[j,D];let B=null;const T=!h.children.length;$=r({host:h,layer:"under",look:()=>"empty"===f?{mark:"glyph",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:1,glyphScale:.9,...m.current.look}:{blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,background:l(h)?"transparent":"#0b0b0a",color:"source",saturation:1.15,contrast:1.15,levels:"auto",brightness:.08,hover:"trail",trail:{strength:.6,radius:.3},...m.current.look},ink:e=>m.current.ink??`var(--ascii-ink, ${e?"#7a7872":"#76746e"})`,kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:(e,t)=>"empty"===f&&U?[2*U.cols,2*U.rows]:[Math.max(1,Math.round(e)),Math.max(1,Math.round(t))],onFail:()=>{$=null,x&&N(x)},paint:({pen:e,w:t,h:n,now:o,still:r})=>{if("empty"!==f){if(!g)return!1;const i=r?1:s((o-M)/m.current.develop),l=1-(1-i)**2;return a(e,g,0,0,t,n),"developing"===f&&l<1&&function(e,t,n,a,o){const r=Math.max(Math.hypot(a.x,a.y),Math.hypot(t-a.x,a.y),Math.hypot(a.x,n-a.y),Math.hypot(t-a.x,n-a.y)),i=Math.max(24,.22*Math.min(t,n)),l=o*(r+i),s=Math.max(0,l-i),c=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l));c.addColorStop(0,"rgb(0 0 0 / 0)"),c.addColorStop(1,"rgb(0 0 0 / 1)"),e.globalCompositeOperation="source-over",e.fillStyle=c,e.fillRect(0,0,t,n);const d=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l)),p=1-o*o;d.addColorStop(0,"rgb(255 255 255 / 0)"),d.addColorStop(.55,`rgb(255 255 255 / ${.5*p})`),d.addColorStop(1,"rgb(255 255 255 / 0)"),e.globalCompositeOperation="lighter",e.fillStyle=d,e.fillRect(0,0,t,n),e.globalCompositeOperation="source-over"}(e,t,n,z??{x:t/2,y:n/2},l),i>=1&&"developing"===f&&G(),i<1}const i=E?Math.min(64,o-E):16;E=o;const l=w?1:0;C=r?l:C+(l-C)*(1-Math.exp(-i/90)),!r&&C>.004&&(L+=i/1e3*14);const c=Math.max(4,(parseFloat(getComputedStyle(h).borderTopLeftRadius)||16)-6),d=P();if(d){const t=$.canvas.getBoundingClientRect(),n=S&&t.width?{x:(S.x-t.left)/t.width*d.cols,y:(S.y-t.top)/t.height*d.rows}:null;p(e,d,c,{tone:.3,glow:C,phase:L,near:n})}const u=!r&&(w||Math.abs(l-C)>.004);return u||(E=0),u}});const W=e=>{const t=f;f=e,h.dataset.state=e,"empty"===t!=("empty"===e)&&(P(),$?.refresh()),t!==e&&m.current.onState?.(e,"empty"===e?"":y)},G=()=>{W("done"),j.textContent=`${y} ready`,g&&m.current.onImage?.({file:R,src:x,width:g.width,height:g.height})};function N(e){B??(B=Object.assign(document.createElement("img"),{className:"ascii-drop-img",alt:""})),B.src=e,B.parentElement!==h&&(h.prepend(B),I.push(B))}const A=async(e,a=null,o=null)=>{const r=++b;let i;z=o,v&&URL.revokeObjectURL(v),v="string"==typeof e?"":URL.createObjectURL(e),x=v||e,R=a??("undefined"!=typeof File&&e instanceof File?e:null),y=R?.name??("string"==typeof e&&e.split("/").pop()?.split("?")[0]||"image"),j.textContent=`Converting ${y}`;try{i=await t(n(x))}catch{return void(r===b&&(j.textContent=`Could not load ${y}`))}if(r===b){if(g=i,!$)return N(x),W("done"),void G();M=performance.now(),W($.still()?"done":"developing"),$.field.pulse({strength:1}),$.kick(),"done"===f&&G()}},F=(e,t=null)=>{const n=t=>{j.textContent=t,m.current.onError?.(t,e)};return e.type.startsWith("image/")?e.size>m.current.maxBytes?n(`${e.name} is over ${Math.round(m.current.maxBytes/1024/1024)} MB.`):void A(e,e,t):n(`${e.name} isn’t an image.`)},H=()=>{b++,g=null,x="",R=null,v&&URL.revokeObjectURL(v),v="",B?.remove(),W("empty"),j.textContent="",$?.kick()},X=()=>D.click(),Y=e=>new Promise(t=>{const n=$?.field;if(!n||!g||"done"!==f)return void t(null);const a=document.createElement("canvas");a.width=n.canvas.width,a.height=n.canvas.height;const o=a.getContext("2d");o?(o.fillStyle=getComputedStyle(h).backgroundColor||"#000",o.fillRect(0,0,a.width,a.height),n.redraw(),o.drawImage(n.canvas,0,0),a.toBlob(n=>{if(n){const t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e??m.current.filename??`${y.replace(/\.[^.]+$/,"")}-ascii.png`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3)}t(n)},"image/png")):t(null)}),Z=()=>{E=0,$?.kick()},J=e=>{e.preventDefault(),k++,S={x:e.clientX,y:e.clientY},w||(w=!0,h.dataset.over="",Z())},q=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),S={x:e.clientX,y:e.clientY}},K=()=>{k=Math.max(0,k-1),!k&&w&&(w=!1,S=null,delete h.dataset.over,Z())},Q=e=>{e.preventDefault(),k=0,w=!1,S=null,delete h.dataset.over;const t=h.getBoundingClientRect(),n={x:e.clientX-t.left,y:e.clientY-t.top};$?.field.pulse({...n,strength:1});const a=e.dataTransfer?.files?.[0];a?F(a,n):Z()},V=e=>{const t=e.target?.closest?.("[data-dropzone]")?.getAttribute("data-dropzone");"pick"===t?X():"clear"===t?H():"download"===t&&Y()},_=()=>{const e=D.files?.[0];D.value="",e&&F(e)};e("ascii-kit-dropzone",'\n:where(.ascii-drop-empty){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:inherit;padding:24px;box-sizing:border-box;text-align:center}\n:where([data-ascii-dropzone]:not([data-state="empty"])) :where(.ascii-drop-empty){display:none}\n:where(.ascii-drop-title){margin:0;font-weight:500}\n:where(.ascii-drop-hint){margin:0;font-size:14px;opacity:.65}\n:where(.ascii-drop-pick){margin-top:8px;height:34px;padding:0 14px;border:0;border-radius:999px;background:currentColor;font:inherit;font-size:14px;cursor:pointer}\n:where(.ascii-drop-pick) > span{color:Canvas}\n:where(.ascii-drop-img){position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n'),h.dataset.asciiDropzone="",D.type="file",D.accept="image/*",D.tabIndex=-1,D.hidden=!0,D.setAttribute("aria-hidden","true"),T&&I.push(function(){const e=document.createElement("div"),t=document.createElement("p"),n=document.createElement("p"),a=document.createElement("button"),o=document.createElement("span");return e.className="ascii-drop-empty",t.className="ascii-drop-title",t.textContent="Drop an image",n.className="ascii-drop-hint",n.textContent="PNG, JPG or WebP",a.type="button",a.className="ascii-drop-pick",a.dataset.dropzone="pick",o.textContent="Choose file",a.appendChild(o),e.append(t,n,a),e}());for(const e of I)h.appendChild(e);return W("empty"),h.addEventListener("dragenter",J),h.addEventListener("dragover",q),h.addEventListener("dragleave",K),h.addEventListener("drop",Q),h.addEventListener("click",V),D.addEventListener("change",_),i(()=>$,m,()=>$?.refresh(),{setImage:e=>A(e),clear:H,pick:X,download:Y,get state(){return f}},()=>{b++,v&&URL.revokeObjectURL(v),h.removeEventListener("dragenter",J),h.removeEventListener("dragover",q),h.removeEventListener("dragleave",K),h.removeEventListener("drop",Q),h.removeEventListener("click",V),D.removeEventListener("change",_),I.forEach(e=>e.remove()),delete h.dataset.asciiDropzone,delete h.dataset.state,delete h.dataset.over})}var u=c;export{u as DROPZONE_DEFAULTS,h as dropzone,p as paintRing,d as ringGrid};//# sourceMappingURL=chunk-4QHFEMFS.js.map
1
+ import{injectStyle as e,imageReady as t,imageFor as n,drawCover as a}from"./chunk-LE53AVKR.js";import{srOnly as o,mountSurface as r,handle as i,isDark as l,clamp as s}from"./chunk-GF72XM4C.js";var c={maxBytes:10485760,develop:900};function d(e,t,n=Math.min(2,"number"==typeof devicePixelRatio&&devicePixelRatio>0?devicePixelRatio:1)){const a=Math.max(2,Math.round(6*n)),o=Math.max(2,Math.round(1*a)),r=(e,t)=>{const a=Math.floor(e*n/t);for(let e=a;e>1;e--){const o=e*t/n;if(Math.abs(o-Math.round(o))<.01||e<a-8)return{n:e,css:Math.round(o)}}return{n:1,css:Math.round(t/n)}},i=r(e,o),l=r(t,a);return{cols:i.n,rows:l.n,w:i.css,h:l.css,cw:o/n,ch:a/n}}function p(e,t,n,a){const{cols:o,rows:r}=t,i=e.createImageData(2*o,2*r),l=i.data,{tone:s,glow:c=0,phase:d=0,near:p=null}=a,h=Math.max(1,n/t.cw),u=Math.max(1,n/t.ch),m=o-2,f=r-2,g=Math.max(0,m-1-2*h),x=Math.max(0,f-1-2*u),v=Math.PI/4*(h+u),y=.45*Math.hypot(o,r);for(let e=0;e<r;e++)for(let t=0;t<o;t++){const n=Math.max(1+h-t,0,t-(m-h)),a=Math.max(1+u-e,0,e-(f-u));let r;if(n>0&&a>0){const e=Math.hypot(n/h,a/u);r=Math.hypot(n,a)*(1-1/e)}else r=-Math.min(t-1,m-t,e-1,f-e);let i=0;if(Math.abs(r)<.5){if(i=s,c>0){const o=t>m-h,r=e>f-u,l=t<1+h,p=e<1+u,y=(e,t)=>Math.atan2(e,t)/(Math.PI/2);let M;M=!p||l||o?p&&o?g+v*y(n/h,a/u):!o||p||r?r&&o?g+v+x+v*y(a/u,n/h):r&&!l?g+2*v+x+(m-h-t):r&&l?2*g+2*v+x+v*y(n/h,a/u):l&&!p?2*g+3*v+x+(f-u-e):2*g+3*v+2*x+v*y(a/u,n/h):g+v+(e-(1+u)):t-(1+h);const b=((M-d)%9+9)%9;i=s+c*(.2+.32*Math.max(0,1-Math.abs(b-4.5)/2.2))}}else if(c>0&&r<-.5&&r>-3.5){i=c*(1-(-r-.5)/3)**1.6*(.1+.32*(p?Math.max(0,1-Math.hypot(t-p.x,e-p.y)/y):.4))}const M=Math.round(255*Math.min(1,i));for(let n=0;n<4;n++){const a=4*((2*e+(n>>1))*o*2+2*t+(1&n));l[a]=l[a+1]=l[a+2]=M,l[a+3]=255}}e.putImageData(i,0,0)}function h(h,u={}){const m={current:{...c,...u}};let f="empty",g=null,x="",v="",y="image",M=0,b=0,w=!1,k=0,C=0,E=0,L=0,R=null,S=null,z=null,$=null,U=null;const j=o("",!0),O=["left","top","width","height"],P=()=>{const e=$?.canvas;if(!e||!h.offsetWidth)return null;const t="empty"===f?d(h.offsetWidth,h.offsetHeight):null,n=t?[`${Math.round((h.offsetWidth-t.w)/2)}px`,`${Math.round((h.offsetHeight-t.h)/2)}px`,`${t.w}px`,`${t.h}px`]:["0px","0px","100%","100%"];let a=!1;return O.forEach((t,o)=>{e.style[t]!==n[o]&&(e.style[t]=n[o],a=!0)}),U=t,a?($?.field.resize(),$?.kick(),null):t},D=document.createElement("input"),I=[j,D];let B=null;const G=!h.children.length;$=r({host:h,layer:"under",look:()=>"empty"===f?{mark:"glyph",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:1,glyphScale:.9,...m.current.look}:{blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:6,cellAspect:.8,glyphScale:.8,background:l(h)?"transparent":"#0b0b0a",color:"source",saturation:1.15,contrast:1.15,levels:"auto",brightness:.08,hover:"trail",trail:{strength:.6,radius:.3},...m.current.look},ink:e=>m.current.ink??`var(--ascii-ink, ${e?"#7a7872":"#76746e"})`,kit:m,reducedMotion:()=>m.current.reducedMotion,resolution:(e,t)=>"empty"===f&&U?[2*U.cols,2*U.rows]:[Math.max(1,Math.round(e)),Math.max(1,Math.round(t))],onFail:()=>{$=null,x&&N(x)},paint:({pen:e,w:t,h:n,now:o,still:r})=>{if("empty"!==f){if(!g)return!1;const i=r?1:s((o-M)/m.current.develop),l=1-(1-i)**2;return a(e,g,0,0,t,n),"developing"===f&&l<1&&function(e,t,n,a,o){const r=Math.max(Math.hypot(a.x,a.y),Math.hypot(t-a.x,a.y),Math.hypot(a.x,n-a.y),Math.hypot(t-a.x,n-a.y)),i=Math.max(24,.22*Math.min(t,n)),l=o*(r+i),s=Math.max(0,l-i),c=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l));c.addColorStop(0,"rgb(0 0 0 / 0)"),c.addColorStop(1,"rgb(0 0 0 / 1)"),e.globalCompositeOperation="source-over",e.fillStyle=c,e.fillRect(0,0,t,n);const d=e.createRadialGradient(a.x,a.y,s,a.x,a.y,Math.max(s+1,l)),p=1-o*o;d.addColorStop(0,"rgb(255 255 255 / 0)"),d.addColorStop(.55,`rgb(255 255 255 / ${.5*p})`),d.addColorStop(1,"rgb(255 255 255 / 0)"),e.globalCompositeOperation="lighter",e.fillStyle=d,e.fillRect(0,0,t,n),e.globalCompositeOperation="source-over"}(e,t,n,z??{x:t/2,y:n/2},l),i>=1&&"developing"===f&&A(),i<1}const i=E?Math.min(64,o-E):16;E=o;const l=w?1:0;C=r?l:C+(l-C)*(1-Math.exp(-i/90)),!r&&C>.004&&(L+=i/1e3*14);const c=Math.max(4,(parseFloat(getComputedStyle(h).borderTopLeftRadius)||16)-6),d=P();if(d){const t=$.canvas.getBoundingClientRect(),n=S&&t.width?{x:(S.x-t.left)/t.width*d.cols,y:(S.y-t.top)/t.height*d.rows}:null;p(e,d,c,{tone:.3,glow:C,phase:L,near:n})}const u=!r&&(w||Math.abs(l-C)>.004);return u||(E=0),u}});const W=e=>{const t=f;f=e,h.dataset.state=e,"empty"===t!=("empty"===e)&&(P(),$?.refresh()),t!==e&&m.current.onState?.(e,"empty"===e?"":y)},A=()=>{W("done"),j.textContent=`${y} ready`,g&&m.current.onImage?.({file:R,src:x,width:g.width,height:g.height})};function N(e){B??(B=Object.assign(document.createElement("img"),{className:"ascii-drop-img",alt:""})),B.src=e,B.parentElement!==h&&(h.prepend(B),I.push(B))}const F=async(e,a=null,o=null)=>{const r=++b;let i;z=o,v&&URL.revokeObjectURL(v),v="string"==typeof e?"":URL.createObjectURL(e),x=v||e,R=a??("undefined"!=typeof File&&e instanceof File?e:null),y=R?.name??("string"==typeof e&&e.split("/").pop()?.split("?")[0]||"image"),j.textContent=`Converting ${y}`;try{i=await t(n(x))}catch{return void(r===b&&(j.textContent=`Could not load ${y}`))}if(r===b){if(g=i,!$)return N(x),W("done"),void A();M=performance.now(),W($.still()?"done":"developing"),$.field.pulse({strength:1}),$.kick(),"done"===f&&A()}},T=(e,t=null)=>{const n=t=>{j.textContent=t,m.current.onError?.(t,e)};return e.type.startsWith("image/")?e.size>m.current.maxBytes?n(`${e.name} is over ${Math.round(m.current.maxBytes/1024/1024)} MB.`):void F(e,e,t):n(`${e.name} isn’t an image.`)},X=()=>{b++,g=null,x="",R=null,v&&URL.revokeObjectURL(v),v="",B?.remove(),W("empty"),j.textContent="",$?.kick()},Y=()=>D.click(),H=e=>new Promise(t=>{const n=$?.field;if(!n||!g||"done"!==f)return void t(null);const a=document.createElement("canvas");a.width=n.canvas.width,a.height=n.canvas.height;const o=a.getContext("2d");o?(o.fillStyle=getComputedStyle(h).backgroundColor||"#000",o.fillRect(0,0,a.width,a.height),n.redraw(),o.drawImage(n.canvas,0,0),a.toBlob(n=>{if(n){const t=document.createElement("a");t.href=URL.createObjectURL(n),t.download=e??m.current.filename??`${y.replace(/\.[^.]+$/,"")}-ascii.png`,t.click(),setTimeout(()=>URL.revokeObjectURL(t.href),1e3)}t(n)},"image/png")):t(null)}),J=()=>{E=0,$?.kick()},K=e=>{e.preventDefault(),k++,S={x:e.clientX,y:e.clientY},w||(w=!0,h.dataset.over="",J())},V=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),S={x:e.clientX,y:e.clientY}},q=()=>{k=Math.max(0,k-1),!k&&w&&(w=!1,S=null,delete h.dataset.over,J())},Q=e=>{e.preventDefault(),k=0,w=!1,S=null,delete h.dataset.over;const t=h.getBoundingClientRect(),n={x:e.clientX-t.left,y:e.clientY-t.top};$?.field.pulse({...n,strength:1});const a=e.dataTransfer?.files?.[0];a?T(a,n):J()},Z=e=>{const t=e.target?.closest?.("[data-dropzone]")?.getAttribute("data-dropzone");"pick"===t?Y():"clear"===t?X():"download"===t&&H()},_=()=>{const e=D.files?.[0];D.value="",e&&T(e)};e("ascii-kit-dropzone",'\n:where(.ascii-drop-empty){position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;min-height:inherit;padding:24px;box-sizing:border-box;text-align:center}\n:where([data-ascii-dropzone]:not([data-state="empty"])) :where(.ascii-drop-empty){display:none}\n:where(.ascii-drop-title){margin:0;font-weight:500}\n:where(.ascii-drop-hint){margin:0;font-size:14px;opacity:.65}\n:where(.ascii-drop-pick){margin-top:8px;height:34px;padding:0 14px;border:0;border-radius:999px;background:currentColor;font:inherit;font-size:14px;cursor:pointer}\n:where(.ascii-drop-pick) > span{color:Canvas}\n:where(.ascii-drop-img){position:absolute;inset:0;width:100%;height:100%;object-fit:cover}\n'),h.dataset.asciiDropzone="",D.type="file",D.accept="image/*",D.tabIndex=-1,D.hidden=!0,D.setAttribute("aria-hidden","true"),G&&I.push(function(){const e=document.createElement("div"),t=document.createElement("p"),n=document.createElement("p"),a=document.createElement("button"),o=document.createElement("span");return e.className="ascii-drop-empty",t.className="ascii-drop-title",t.textContent="Drop an image",n.className="ascii-drop-hint",n.textContent="PNG, JPG or WebP",a.type="button",a.className="ascii-drop-pick",a.dataset.dropzone="pick",o.textContent="Choose file",a.appendChild(o),e.append(t,n,a),e}());for(const e of I)h.appendChild(e);return W("empty"),h.addEventListener("dragenter",K),h.addEventListener("dragover",V),h.addEventListener("dragleave",q),h.addEventListener("drop",Q),h.addEventListener("click",Z),D.addEventListener("change",_),i(()=>$,m,()=>$?.refresh(),{setImage:e=>F(e),clear:X,pick:Y,download:H,get state(){return f}},()=>{b++,v&&URL.revokeObjectURL(v),h.removeEventListener("dragenter",K),h.removeEventListener("dragover",V),h.removeEventListener("dragleave",q),h.removeEventListener("drop",Q),h.removeEventListener("click",Z),D.removeEventListener("change",_),I.forEach(e=>e.remove()),delete h.dataset.asciiDropzone,delete h.dataset.state,delete h.dataset.over})}var u=c;export{u as DROPZONE_DEFAULTS,h as dropzone,p as paintRing,d as ringGrid};//# sourceMappingURL=chunk-IBNDCKEX.js.map
@@ -1 +1 @@
1
- import{blank as e,mountPageField as t,pageHandle as n,pulseAt as r,sleep as o}from"./chunk-BTD6EFAW.js";import{hash as l}from"./chunk-S7RZP2MT.js";var a={preset:"hero",clear:!1,text:"404",ripple:!0},i=28,c='600 440px "Geist", Arial, sans-serif',s=()=>"number"==typeof innerWidth&&innerWidth<760,d=e=>({mark:"glyph",scene:"drift",levels:"auto",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:10,cellAspect:.62,glyphScale:.86,color:"ink",shade:0,hover:"trail",trail:{strength:.9,radius:.32},...e}),h={mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.4,fit:"contain",clear:!1,focus:{x:.5,y:.5},drift:.8,speed:.7,levels:"auto",hover:"trail",trail:{strength:1,radius:.42}};function f(t){const n=document.createElement("canvas").getContext("2d");n.font=c;const r=Math.max(320,Math.ceil(n.measureText(t).width)+160),{canvas:o,pen:l}=e(r,560);return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=c,l.letterSpacing="-10px",l.fillText(t,r/2,296),o}function u(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height).data,n=[];for(let r=0;r<e.height;r+=i)for(let o=0;o<e.width;o+=i){let a=!1;for(let n=0;n<i&&!a;n+=4)for(let l=0;l<i&&!a;l+=4)a=(t[4*((r+n)*e.width+o+l)]??0)>40;if(!a)continue;const c=n.length,s=l(c,1)*Math.PI*2,d=120+420*l(c,2);n.push({x:o,y:r,dx:Math.cos(s)*d+.5*(o-e.width/2),dy:Math.sin(s)*d*.6,lag:.35*l(c,3)})}return n}var p=[...Array.from({length:10},(e,t)=>(t+1)/10),1,1,1,...Array.from({length:14},(e,t)=>1-(t+1)/14)];function g(e,t,n,r){const o=t.getContext("2d");o.globalAlpha=1,o.fillStyle="#000",o.fillRect(0,0,t.width,t.height);for(const t of n){const n=Math.min(1,Math.max(0,(r-t.lag*(1-r))/(1-.5*t.lag))),l=n*n*(3-2*n);o.globalAlpha=1-.72*l,o.drawImage(e,t.x,t.y,i,i,t.x+t.dx*l,t.y+t.dy*l,i,i)}o.globalAlpha=1}function m(l,i={}){const m={current:{...a,...i}},x=()=>"notFound"===m.current.preset;let y=0,v=!1,b=0;const w={x:-1e4,y:-1e4,at:-1e6},k=()=>f(m.current.text);let M=null;M=t({host:l,look:()=>{const e=m.current,t=e.clear,n=e=>!!t&&{element:t,padding:-14,feather:e,shape:"ellipse"};return{..."notFound"===e.preset?h:"brand"===e.preset?d({scale:s()?1.4:1.6,brightness:.24,contrast:1.1,clear:n(.3)}):d({scale:s()?1.6:1.9,brightness:.26,contrast:1.15,clear:n(.22)}),...e.look}},ink:e=>{const t=m.current,n=t.palette,r="string"==typeof n?n:n?.[e?"dark":"light"];return r??t.ink?r??t.ink:"notFound"===t.preset?e?"#d8d6cf":"#1d1d1b":"brand"===t.preset?`var(--brand, ${e?"#8f80ff":"#5b4bd1"})`:e?"#8a8881":"#6b6964"},source:x()?k():null,label:m.current.label??(x()?m.current.text:void 0),kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null}}),M&&x()&&document.fonts?.load?.(c).then(()=>{M&&x()&&!v&&M.field.setSource(k())},()=>{});const S=(e,t=1.4)=>{M&&!M.still()&&(b=performance.now()+1400,r(M.field,e,t))},A=e=>{const t=m.current,n=performance.now();!M||x()||!t.ripple||M.still()||n<b||n-w.at<520||Math.hypot(e.clientX-w.x,e.clientY-w.y)<36||(Object.assign(w,{x:e.clientX,y:e.clientY,at:n}),r(M.field,{x:e.clientX,y:e.clientY},.65))};M&&l.addEventListener("pointermove",A);let F=m.current.preset,W=m.current.text;return n(()=>M,m,e=>{M&&((e.preset!==F||"notFound"===e.preset&&e.text!==W)&&(y++,v=!1,M.field.setSource("notFound"===e.preset?k():null)),F=e.preset,W=e.text)},{pulse:S,scatter:async t=>{const n=M?.field;if(!n)return;if(!x())return void S(t);if(t&&S(t,1.2),v||M.still())return;v=!0;const r=++y,l=k(),a=u(l),i=e(l.width,l.height).canvas;for(const e of p){const t=performance.now();if(g(l,i,a,e),await n.setSource(i),await o(Math.max(0,44-(performance.now()-t))),r!==y||!M)return void(v=!1)}await n.setSource(l),v=!1}},()=>{y++,l.removeEventListener("pointermove",A)})}var x=a;export{x as FIELD_BACKGROUND_DEFAULTS,p as SCATTER_STEPS,m as fieldBackground,f as lostArt,u as lostTiles};//# sourceMappingURL=chunk-J2YZBT3N.js.map
1
+ import{blank as e,mountPageField as t,pageHandle as n,pulseAt as r,sleep as o}from"./chunk-7DXSG526.js";import{hash as l}from"./chunk-GF72XM4C.js";var a={preset:"hero",clear:!1,text:"404",ripple:!0},i=28,c='600 440px "Geist", Arial, sans-serif',s=()=>"number"==typeof innerWidth&&innerWidth<760,d=e=>({mark:"glyph",scene:"drift",levels:"auto",charset:" .:+*#",font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:10,cellAspect:.62,glyphScale:.86,color:"ink",shade:0,hover:"trail",trail:{strength:.9,radius:.32},...e}),h={mark:"glyph",scene:"none",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,color:"ink",shade:0,contrast:1.4,fit:"contain",clear:!1,focus:{x:.5,y:.5},drift:.8,speed:.7,levels:"auto",hover:"trail",trail:{strength:1,radius:.42}};function f(t){const n=document.createElement("canvas").getContext("2d");n.font=c;const r=Math.max(320,Math.ceil(n.measureText(t).width)+160),{canvas:o,pen:l}=e(r,560);return l.fillStyle="#fff",l.textAlign="center",l.textBaseline="middle",l.font=c,l.letterSpacing="-10px",l.fillText(t,r/2,296),o}function u(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height).data,n=[];for(let r=0;r<e.height;r+=i)for(let o=0;o<e.width;o+=i){let a=!1;for(let n=0;n<i&&!a;n+=4)for(let l=0;l<i&&!a;l+=4)a=(t[4*((r+n)*e.width+o+l)]??0)>40;if(!a)continue;const c=n.length,s=l(c,1)*Math.PI*2,d=120+420*l(c,2);n.push({x:o,y:r,dx:Math.cos(s)*d+.5*(o-e.width/2),dy:Math.sin(s)*d*.6,lag:.35*l(c,3)})}return n}var p=[...Array.from({length:10},(e,t)=>(t+1)/10),1,1,1,...Array.from({length:14},(e,t)=>1-(t+1)/14)];function g(e,t,n,r){const o=t.getContext("2d");o.globalAlpha=1,o.fillStyle="#000",o.fillRect(0,0,t.width,t.height);for(const t of n){const n=Math.min(1,Math.max(0,(r-t.lag*(1-r))/(1-.5*t.lag))),l=n*n*(3-2*n);o.globalAlpha=1-.72*l,o.drawImage(e,t.x,t.y,i,i,t.x+t.dx*l,t.y+t.dy*l,i,i)}o.globalAlpha=1}function m(l,i={}){const m={current:{...a,...i}},x=()=>"notFound"===m.current.preset;let y=0,v=!1,b=0;const w={x:-1e4,y:-1e4,at:-1e6},k=()=>f(m.current.text);let M=null;M=t({host:l,look:()=>{const e=m.current,t=e.clear,n=e=>!!t&&{element:t,padding:-14,feather:e,shape:"ellipse"};return{..."notFound"===e.preset?h:"brand"===e.preset?d({scale:s()?1.4:1.6,brightness:.24,contrast:1.1,clear:n(.3)}):d({scale:s()?1.6:1.9,brightness:.26,contrast:1.15,clear:n(.22)}),...e.look}},ink:e=>{const t=m.current,n=t.palette,r="string"==typeof n?n:n?.[e?"dark":"light"];return r??t.ink?r??t.ink:"notFound"===t.preset?e?"#d8d6cf":"#1d1d1b":"brand"===t.preset?`var(--brand, ${e?"#8f80ff":"#5b4bd1"})`:e?"#8a8881":"#6b6964"},source:x()?k():null,label:m.current.label??(x()?m.current.text:void 0),kit:m,reducedMotion:()=>m.current.reducedMotion,onFail:()=>{M=null}}),M&&x()&&document.fonts?.load?.(c).then(()=>{M&&x()&&!v&&M.field.setSource(k())},()=>{});const S=(e,t=1.4)=>{M&&!M.still()&&(b=performance.now()+1400,r(M.field,e,t))},A=e=>{const t=m.current,n=performance.now();!M||x()||!t.ripple||M.still()||n<b||n-w.at<520||Math.hypot(e.clientX-w.x,e.clientY-w.y)<36||(Object.assign(w,{x:e.clientX,y:e.clientY,at:n}),r(M.field,{x:e.clientX,y:e.clientY},.65))};M&&l.addEventListener("pointermove",A);let F=m.current.preset,G=m.current.text;return n(()=>M,m,e=>{M&&((e.preset!==F||"notFound"===e.preset&&e.text!==G)&&(y++,v=!1,M.field.setSource("notFound"===e.preset?k():null)),F=e.preset,G=e.text)},{pulse:S,scatter:async t=>{const n=M?.field;if(!n)return;if(!x())return void S(t);if(t&&S(t,1.2),v||M.still())return;v=!0;const r=++y,l=k(),a=u(l),i=e(l.width,l.height).canvas;for(const e of p){const t=performance.now();if(g(l,i,a,e),await n.setSource(i),await o(Math.max(0,44-(performance.now()-t))),r!==y||!M)return void(v=!1)}await n.setSource(l),v=!1}},()=>{y++,l.removeEventListener("pointermove",A)})}var x=a;export{x as FIELD_BACKGROUND_DEFAULTS,p as SCATTER_STEPS,m as fieldBackground,f as lostArt,u as lostTiles};//# sourceMappingURL=chunk-ILXVBO7M.js.map
@@ -1 +1 @@
1
- import{snapshot as e}from"./chunk-4OT66HSZ.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-S7RZP2MT.js";var a={duration:620,collapse:!0,remove:!1},i=16,l=new WeakMap;function s(s,c={}){const d=l.get(s);if(d)return d;const h={...a,...c},p=t(),u=s.offsetHeight,g=()=>{for(const e of s.children)p.set(e,"opacity","0");p.set(s,"color","transparent"),p.set(s,"pointer-events","none"),s.setAttribute("aria-hidden","true")},f=e=>{h.collapse&&(p.set(s,"box-sizing","border-box"),p.set(s,"overflow","hidden"),p.set(s,"min-height","0"),p.set(s,"height",`${(u*(1-e)).toFixed(2)}px`),e>=1&&(p.set(s,"padding-block","0"),p.set(s,"margin-block","0"),p.set(s,"border-width","0")))},m=h.host??s.parentElement??s;let k=0,b=!1,w=null,v={x:0,y:0,w:0,h:0},x=()=>{};const y=o({host:m,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,contrast:1.6,drift:5,...h.look}),outset:i,resolution:2,ink:()=>h.ink??"--ascii-ink-strong",kit:{current:{lazy:!1,globalLook:h.globalLook}},reducedMotion:()=>h.reducedMotion,onFail:()=>x(),paint:({pen:e,now:t,still:o,scale:a})=>{if(o)return queueMicrotask(x),!1;if(!w||!b)return!1;const l=t-k,s=r(l/h.duration);e.setTransform(a,0,0,a,0,0),l>=300&&f(n(r((l-300)/260))),e.save(),e.globalAlpha=r(2.2*(1-s))*(1-.9*s*s),e.translate(8*s,-14*s),e.drawImage(w,0,0,w.width/2,w.height/2),e.globalCompositeOperation="destination-out";const c=v.x+v.w,d=c-(1.3*s-.3)*v.w,p=c-1.3*s*v.w,u=e.createLinearGradient(p,0,Math.max(p+1,d),0);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),e.globalAlpha=1,e.fillStyle=u,e.fillRect(v.x-i,v.y-i,v.w+32,v.h+32),e.restore();const g=l>=Math.max(h.duration,h.collapse?560:0);return g&&queueMicrotask(x),!g}}),M=new Promise(t=>{let o=!1;if(x=()=>{o||(o=!0,y?.destroy(),f(1),h.remove&&s.remove(),l.delete(s),t())},!y||y.still())return g(),void x();v=y.box(s),w=e(s,y.canvas.clientWidth||v.w+32,y.canvas.clientHeight||v.h+32,y.box).canvas;y.field.ready.then(()=>{o||b||(g(),b=!0,k=performance.now(),y.kick())},()=>{g(),x()})});return l.set(s,M),M}var c=a;export{c as DISINTEGRATE_DEFAULTS,s as disintegrate};//# sourceMappingURL=chunk-S62H7ZIU.js.map
1
+ import{snapshot as e}from"./chunk-LE53AVKR.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-GF72XM4C.js";var a={duration:620,collapse:!0,remove:!1},i=16,l=new WeakMap;function s(s,c={}){const d=l.get(s);if(d)return d;const h={...a,...c},p=t(),u=s.offsetHeight,g=()=>{for(const e of s.children)p.set(e,"opacity","0");p.set(s,"color","transparent"),p.set(s,"pointer-events","none"),s.setAttribute("aria-hidden","true")},f=e=>{h.collapse&&(p.set(s,"box-sizing","border-box"),p.set(s,"overflow","hidden"),p.set(s,"min-height","0"),p.set(s,"height",`${(u*(1-e)).toFixed(2)}px`),e>=1&&(p.set(s,"padding-block","0"),p.set(s,"margin-block","0"),p.set(s,"border-width","0")))},m=h.host??s.parentElement??s;let k=0,b=!1,w=null,v={x:0,y:0,w:0,h:0},x=()=>{};const y=o({host:m,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,contrast:1.6,drift:5,...h.look}),outset:i,resolution:2,ink:()=>h.ink??"--ascii-ink-strong",kit:{current:{lazy:!1,globalLook:h.globalLook}},reducedMotion:()=>h.reducedMotion,onFail:()=>x(),paint:({pen:e,now:t,still:o,scale:a})=>{if(o)return queueMicrotask(x),!1;if(!w||!b)return!1;const l=t-k,s=r(l/h.duration);e.setTransform(a,0,0,a,0,0),l>=300&&f(n(r((l-300)/260))),e.save(),e.globalAlpha=r(2.2*(1-s))*(1-.9*s*s),e.translate(8*s,-14*s),e.drawImage(w,0,0,w.width/2,w.height/2),e.globalCompositeOperation="destination-out";const c=v.x+v.w,d=c-(1.3*s-.3)*v.w,p=c-1.3*s*v.w,u=e.createLinearGradient(p,0,Math.max(p+1,d),0);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),e.globalAlpha=1,e.fillStyle=u,e.fillRect(v.x-i,v.y-i,v.w+32,v.h+32),e.restore();const g=l>=Math.max(h.duration,h.collapse?560:0);return g&&queueMicrotask(x),!g}}),M=new Promise(t=>{let o=!1;if(x=()=>{o||(o=!0,y?.destroy(),f(1),h.remove&&s.remove(),l.delete(s),t())},!y||y.still())return g(),void x();v=y.box(s),w=e(s,y.canvas.clientWidth||v.w+32,y.canvas.clientHeight||v.h+32,y.box).canvas;y.field.ready.then(()=>{o||b||(g(),b=!0,k=performance.now(),y.kick())},()=>{g(),x()})});return l.set(s,M),M}var c=a;export{c as DISINTEGRATE_DEFAULTS,s as disintegrate};//# sourceMappingURL=chunk-JELJEEJO.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,mountSurface as e,clamp as r,handle as n,resolveColor as o,mixHex as a,prefersReduced as i}from"./chunk-S7RZP2MT.js";var s={thumb:'[role="slider"]',label:"[data-label]",threshold:.9,resetAfter:0},l=720,c=(t,e,r)=>t+(e-t)*r,d=t=>1-(1-t)**3,u=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r});function m(t,e,r=.4){const n=2*Math.sqrt(t.k)*t.z,o=Math.max(1,Math.ceil(240*e)),a=e/o;for(let e=0;e<o;e++)t.v+=(-t.k*(t.x-t.to)-n*t.v)*a,t.x+=t.v*a;return!(Math.abs(t.x-t.to)<r&&Math.abs(t.v)<12*r)||(t.x=t.to,t.v=0,!1)}var f=t=>{t.x=t.to,t.v=0};function h(t,e){const r=t.filter(([,t])=>e-t<80);if(r.length<2)return 0;const[n,o]=r[0],[a,i]=r[r.length-1];return i>o?(a-n)/(i-o)*1e3:0}function p(p,v={}){const x={current:{...s,...v}},b=t(),g=p.querySelector(x.current.thumb)??p.firstElementChild,k=()=>p.querySelector(x.current.label),y=()=>!!(x.current.reducedMotion??i());let A=u(0,520,.8),w=u(0,150,1),M=!1,E=0,L=!1,S=0,C=0,I=[],T=0,P=0,R=0,q="",z=-1,D=null;const W=()=>{if(!g)return null;const t=Math.max(0,(p.clientHeight-g.offsetHeight)/2);return{pad:t,size:g.offsetHeight,max:Math.max(1,p.clientWidth-g.offsetWidth-2*t)}},$=()=>p.getBoundingClientRect().width/(p.clientWidth||1)||1,F=t=>o(x.current.ink??"--ascii-ink-strong",p)??o(getComputedStyle(p).color,p)??(t?"#d8d6cf":"#1d1d1b");D=e({host:p,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,...x.current.look}),ink:F,kit:x,reducedMotion:()=>x.current.reducedMotion,onFail:()=>{D=null},onTheme:()=>{q=""},paint:({pen:t,w:e,h:n,now:i,still:s,dark:u,box:m})=>{const f=W();if(!f)return!1;const h=L?s?1:r((i-S)/l):0,v=d(r(h/.5)),b=d(r((h-.36)/.3)),g=d(r((h-.46)/.4)),k=r((h-.5)/.5),y=1+.07*Math.sin(Math.PI*k)*(1-k),M=C?1-r((i-C)/260):1,E=x.current.mark?m(x.current.mark):{x:e/2-18,y:n/2-18,w:36,h:36},I=E.x+E.w/2,T=E.y+E.h/2,P=Math.min(E.w/2,n/2-2)*y,R=L?a(F(u),(t=>o(x.current.color??"--ascii-success",p,t?"#3ccf7e":"#17844a"))(u),d(r(s?1:(i-S)/360))):F(u);R!==q&&(q=R,D?.field.update({ink:R})),t.save(),t.globalAlpha=M,t.beginPath(),e>4&&n>4&&t.roundRect(2,2,e-4,n-4,(n-4)/2),t.clip(),t.fillStyle=`rgba(255,255,255,${.1*(1-v)})`,t.fillRect(0,0,e,n);const z=f.pad+A.x+f.size/2,$=L?1:w.x,H=c(0,I-P,v),G=c(z,I+P,v),X=c(0,T-P,v),j=c(n,T+P,v);if(G-H>1&&$>.004){const e=t.createLinearGradient(H,0,G,0);e.addColorStop(0,`rgba(255,255,255,${c(.14,1,v)*$})`),e.addColorStop(.62,`rgba(255,255,255,${c(.48,1,v)*$})`),e.addColorStop(1,`rgba(255,255,255,${$})`),t.fillStyle=e,t.globalAlpha=M*(1-.28*b),t.beginPath(),t.roundRect(H,X,G-H,j-X,c(0,P,v)),t.fill()}return b>0&&(t.globalAlpha=1,t.fillStyle="#000",t.beginPath(),t.arc(I,T,Math.max(0,P-5)*b,0,2*Math.PI),t.fill()),t.restore(),g>0&&function(t,e,r,n,o,a,i){if(o<=0||a<=0)return;const s=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([t,o])=>[e+t*n,r+o*n]),l=Math.hypot(s[1][0]-s[0][0],s[1][1]-s[0][1])+Math.hypot(s[2][0]-s[1][0],s[2][1]-s[1][1]);t.save(),t.globalAlpha=a,t.strokeStyle="#fff",t.lineWidth=i,t.lineCap="round",t.lineJoin="round",t.setLineDash([l*o,l]),t.beginPath(),t.moveTo(s[0][0],s[0][1]),t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]),t.stroke(),t.restore()}(t,I+.02*P,T+.07*P,.55*P,g,M,4.5),!1}});const H=()=>{const t=W();if(!t||!g)return;const e=A.x/t.max;b.set(g,"translate",`${A.x}px 0`),g.setAttribute("aria-valuenow",String(Math.round(100*r(e))));const n=k();n&&b.set(n,"opacity",String(L?0:1-r(1.7*e)))},G=t=>{T=0;const e=Math.min(1/30,Math.max(0,(t-P)/1e3));P=t;let r=!M&&m(A,e,.3);r=m(w,e,.003)||r,C&&(t-C>=260||y())&&(C=0,L=!1,A=u(0,520,.8),w=u(0,150,1),p.dataset.state="idle",delete p.dataset.confirmed,g&&(b.set(g,"opacity","1"),b.set(g,"scale","1"),g.tabIndex=0)),L&&t-S>302.4&&(p.dataset.confirmed=""),H(),D?.kick(),(r||M||L&&t-S<760||C>0)&&(T=requestAnimationFrame(G))},X=()=>{T||(P=performance.now(),T=requestAnimationFrame(G))},j=()=>{const t=W();if(!t||L)return;const e=t.max-A.x;M=!1,L=!0,A.to=t.max,w.to=1,S=performance.now()+(e>4?200:90),y()&&(f(A),f(w),S=-1e6,p.dataset.confirmed=""),p.dataset.state="confirmed",g&&(g.setAttribute("aria-valuetext","Confirmed"),g.tabIndex=-1,b.set(g,"transition","opacity 200ms 160ms, scale 240ms 160ms"),b.set(g,"opacity","0"),b.set(g,"scale",".6")),R&&clearTimeout(R),x.current.resetAfter>0&&(R=setTimeout(B,x.current.resetAfter)),H(),X(),x.current.onConfirm?.()};function B(){if(R&&clearTimeout(R),R=0,!L)return A.to=0,w.to=0,void X();C=performance.now(),p.dataset.state="resetting",g?.removeAttribute("aria-valuetext"),X()}const J=t=>{const e=W();if(!M||!e||void 0!==t&&void 0!==t.pointerId&&t.pointerId!==z)return;M=!1;const n=h(I,performance.now());A.x>=e.max*x.current.threshold||n>900&&A.x>.5*e.max?j():(A.to=0,A.v=.25*r(n,-1500,1500),w.to=0,y()&&(f(A),f(w)),p.dataset.state="idle",X())},U=t=>{if(0===t.button&&!L&&g)if(g.contains(t.target)){try{g.setPointerCapture?.(t.pointerId)}catch{}z=t.pointerId,M=!0,E=t.clientX-A.x*$(),w.to=1,I=[],p.dataset.state="dragging",X()}else M||y()||(A.v+=420,w.to=0,X())},Z=t=>{const e=W();M&&e&&t.pointerId===z&&(A.x=A.to=r((t.clientX-E)/$(),0,e.max),A.v=0,I.push([A.x,performance.now()]),I.length>8&&I.shift(),A.x>=e.max-.5?j():X())},K=t=>{const e=W();if(!e||L)return;if("Enter"===t.key||" "===t.key||"End"===t.key)return t.preventDefault(),void j();const n={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[t.key],o="Home"===t.key?0:void 0!==n?r(A.to+n*e.max/4,0,e.max):null;null!==o&&(t.preventDefault(),A.to=o,w.to=o>0?1:0,y()&&(f(A),f(w)),o>=e.max-.5?j():X())};g&&(g.hasAttribute("role")||g.setAttribute("role","slider"),g.hasAttribute("tabindex")||(g.tabIndex=0),g.hasAttribute("aria-label")||g.setAttribute("aria-label",k()?.textContent?.trim()||"Slide to confirm"),g.setAttribute("aria-valuemin","0"),g.setAttribute("aria-valuemax","100"),g.setAttribute("aria-valuenow","0"),b.set(g,"touch-action","none"),g.addEventListener("keydown",K));const N=t=>t.preventDefault();return p.dataset.state="idle",p.addEventListener("pointerdown",U),p.addEventListener("pointermove",Z),p.addEventListener("pointerup",J),p.addEventListener("pointercancel",J),p.addEventListener("lostpointercapture",J),p.addEventListener("dragstart",N),n(()=>D,x,()=>D?.refresh(),{confirm:j,reset:B,get confirmed(){return L}},()=>{T&&cancelAnimationFrame(T),R&&clearTimeout(R),T=R=0,g?.removeEventListener("keydown",K),p.removeEventListener("pointerdown",U),p.removeEventListener("pointermove",Z),p.removeEventListener("pointerup",J),p.removeEventListener("pointercancel",J),p.removeEventListener("lostpointercapture",J),p.removeEventListener("dragstart",N),b.restore(),delete p.dataset.state,delete p.dataset.confirmed})}var v=s;export{v as SLIDE_TO_CONFIRM_DEFAULTS,p as slideToConfirm,m as stepSpring,h as velocity};//# sourceMappingURL=chunk-2NVKPXPL.js.map
1
+ import{styleKeeper as t,mountSurface as e,clamp as r,handle as n,resolveColor as o,mixHex as a,prefersReduced as i}from"./chunk-GF72XM4C.js";var s={thumb:'[role="slider"]',label:"[data-label]",threshold:.9,resetAfter:0},l=720,c=(t,e,r)=>t+(e-t)*r,d=t=>1-(1-t)**3,u=(t,e,r)=>({x:t,v:0,to:t,k:e,z:r});function m(t,e,r=.4){const n=2*Math.sqrt(t.k)*t.z,o=Math.max(1,Math.ceil(240*e)),a=e/o;for(let e=0;e<o;e++)t.v+=(-t.k*(t.x-t.to)-n*t.v)*a,t.x+=t.v*a;return!(Math.abs(t.x-t.to)<r&&Math.abs(t.v)<12*r)||(t.x=t.to,t.v=0,!1)}var f=t=>{t.x=t.to,t.v=0};function h(t,e){const r=t.filter(([,t])=>e-t<80);if(r.length<2)return 0;const[n,o]=r[0],[a,i]=r[r.length-1];return i>o?(a-n)/(i-o)*1e3:0}function p(p,v={}){const x={current:{...s,...v}},b=t(),g=p.querySelector(x.current.thumb)??p.firstElementChild,k=()=>p.querySelector(x.current.label),y=()=>!!(x.current.reducedMotion??i());let A=u(0,520,.8),w=u(0,150,1),M=!1,E=0,L=!1,S=0,C=0,I=[],T=0,P=0,q=0,z="",D=-1,F=null;const R=()=>{if(!g)return null;const t=Math.max(0,(p.clientHeight-g.offsetHeight)/2);return{pad:t,size:g.offsetHeight,max:Math.max(1,p.clientWidth-g.offsetWidth-2*t)}},W=()=>p.getBoundingClientRect().width/(p.clientWidth||1)||1,$=t=>o(x.current.ink??"--ascii-ink-strong",p)??o(getComputedStyle(p).color,p)??(t?"#d8d6cf":"#1d1d1b");F=e({host:p,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.94,...x.current.look}),ink:$,kit:x,reducedMotion:()=>x.current.reducedMotion,onFail:()=>{F=null},onTheme:()=>{z=""},paint:({pen:t,w:e,h:n,now:i,still:s,dark:u,box:m})=>{const f=R();if(!f)return!1;const h=L?s?1:r((i-S)/l):0,v=d(r(h/.5)),b=d(r((h-.36)/.3)),g=d(r((h-.46)/.4)),k=r((h-.5)/.5),y=1+.07*Math.sin(Math.PI*k)*(1-k),M=C?1-r((i-C)/260):1,E=x.current.mark?m(x.current.mark):{x:e/2-18,y:n/2-18,w:36,h:36},I=E.x+E.w/2,T=E.y+E.h/2,P=Math.min(E.w/2,n/2-2)*y,q=L?a($(u),(t=>o(x.current.color??"--ascii-success",p,t?"#3ccf7e":"#17844a"))(u),d(r(s?1:(i-S)/360))):$(u);q!==z&&(z=q,F?.field.update({ink:q})),t.save(),t.globalAlpha=M,t.beginPath(),e>4&&n>4&&t.roundRect(2,2,e-4,n-4,(n-4)/2),t.clip(),t.fillStyle=`rgba(255,255,255,${.1*(1-v)})`,t.fillRect(0,0,e,n);const D=f.pad+A.x+f.size/2,W=L?1:w.x,H=c(0,I-P,v),G=c(D,I+P,v),X=c(0,T-P,v),j=c(n,T+P,v);if(G-H>1&&W>.004){const e=t.createLinearGradient(H,0,G,0);e.addColorStop(0,`rgba(255,255,255,${c(.14,1,v)*W})`),e.addColorStop(.62,`rgba(255,255,255,${c(.48,1,v)*W})`),e.addColorStop(1,`rgba(255,255,255,${W})`),t.fillStyle=e,t.globalAlpha=M*(1-.28*b),t.beginPath(),t.roundRect(H,X,G-H,j-X,c(0,P,v)),t.fill()}return b>0&&(t.globalAlpha=1,t.fillStyle="#000",t.beginPath(),t.arc(I,T,Math.max(0,P-5)*b,0,2*Math.PI),t.fill()),t.restore(),g>0&&function(t,e,r,n,o,a,i){if(o<=0||a<=0)return;const s=[[-.82,.02],[-.26,.56],[.86,-.6]].map(([t,o])=>[e+t*n,r+o*n]),l=Math.hypot(s[1][0]-s[0][0],s[1][1]-s[0][1])+Math.hypot(s[2][0]-s[1][0],s[2][1]-s[1][1]);t.save(),t.globalAlpha=a,t.strokeStyle="#fff",t.lineWidth=i,t.lineCap="round",t.lineJoin="round",t.setLineDash([l*o,l]),t.beginPath(),t.moveTo(s[0][0],s[0][1]),t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]),t.stroke(),t.restore()}(t,I+.02*P,T+.07*P,.55*P,g,M,4.5),!1}});const H=()=>{const t=R();if(!t||!g)return;const e=A.x/t.max;b.set(g,"translate",`${A.x}px 0`),g.setAttribute("aria-valuenow",String(Math.round(100*r(e))));const n=k();n&&b.set(n,"opacity",String(L?0:1-r(1.7*e)))},G=t=>{T=0;const e=Math.min(1/30,Math.max(0,(t-P)/1e3));P=t;let r=!M&&m(A,e,.3);r=m(w,e,.003)||r,C&&(t-C>=260||y())&&(C=0,L=!1,A=u(0,520,.8),w=u(0,150,1),p.dataset.state="idle",delete p.dataset.confirmed,g&&(b.set(g,"opacity","1"),b.set(g,"scale","1"),g.tabIndex=0)),L&&t-S>302.4&&(p.dataset.confirmed=""),H(),F?.kick(),(r||M||L&&t-S<760||C>0)&&(T=requestAnimationFrame(G))},X=()=>{T||(P=performance.now(),T=requestAnimationFrame(G))},j=()=>{const t=R();if(!t||L)return;const e=t.max-A.x;M=!1,L=!0,A.to=t.max,w.to=1,S=performance.now()+(e>4?200:90),y()&&(f(A),f(w),S=-1e6,p.dataset.confirmed=""),p.dataset.state="confirmed",g&&(g.setAttribute("aria-valuetext","Confirmed"),g.tabIndex=-1,b.set(g,"transition","opacity 200ms 160ms, scale 240ms 160ms"),b.set(g,"opacity","0"),b.set(g,"scale",".6")),q&&clearTimeout(q),x.current.resetAfter>0&&(q=setTimeout(B,x.current.resetAfter)),H(),X(),x.current.onConfirm?.()};function B(){if(q&&clearTimeout(q),q=0,!L)return A.to=0,w.to=0,void X();C=performance.now(),p.dataset.state="resetting",g?.removeAttribute("aria-valuetext"),X()}const J=t=>{const e=R();if(!M||!e||void 0!==t&&void 0!==t.pointerId&&t.pointerId!==D)return;M=!1;const n=h(I,performance.now());A.x>=e.max*x.current.threshold||n>900&&A.x>.5*e.max?j():(A.to=0,A.v=.25*r(n,-1500,1500),w.to=0,y()&&(f(A),f(w)),p.dataset.state="idle",X())},U=t=>{if(0===t.button&&!L&&g)if(g.contains(t.target)){try{g.setPointerCapture?.(t.pointerId)}catch{}D=t.pointerId,M=!0,E=t.clientX-A.x*W(),w.to=1,I=[],p.dataset.state="dragging",X()}else M||y()||(A.v+=420,w.to=0,X())},K=t=>{const e=R();M&&e&&t.pointerId===D&&(A.x=A.to=r((t.clientX-E)/W(),0,e.max),A.v=0,I.push([A.x,performance.now()]),I.length>8&&I.shift(),A.x>=e.max-.5?j():X())},N=t=>{const e=R();if(!e||L)return;if("Enter"===t.key||" "===t.key||"End"===t.key)return t.preventDefault(),void j();const n={ArrowRight:1,ArrowUp:1,ArrowLeft:-1,ArrowDown:-1}[t.key],o="Home"===t.key?0:void 0!==n?r(A.to+n*e.max/4,0,e.max):null;null!==o&&(t.preventDefault(),A.to=o,w.to=o>0?1:0,y()&&(f(A),f(w)),o>=e.max-.5?j():X())};g&&(g.hasAttribute("role")||g.setAttribute("role","slider"),g.hasAttribute("tabindex")||(g.tabIndex=0),g.hasAttribute("aria-label")||g.setAttribute("aria-label",k()?.textContent?.trim()||"Slide to confirm"),g.setAttribute("aria-valuemin","0"),g.setAttribute("aria-valuemax","100"),g.setAttribute("aria-valuenow","0"),b.set(g,"touch-action","none"),g.addEventListener("keydown",N));const O=t=>t.preventDefault();return p.dataset.state="idle",p.addEventListener("pointerdown",U),p.addEventListener("pointermove",K),p.addEventListener("pointerup",J),p.addEventListener("pointercancel",J),p.addEventListener("lostpointercapture",J),p.addEventListener("dragstart",O),n(()=>F,x,()=>F?.refresh(),{confirm:j,reset:B,get confirmed(){return L}},()=>{T&&cancelAnimationFrame(T),q&&clearTimeout(q),T=q=0,g?.removeEventListener("keydown",N),p.removeEventListener("pointerdown",U),p.removeEventListener("pointermove",K),p.removeEventListener("pointerup",J),p.removeEventListener("pointercancel",J),p.removeEventListener("lostpointercapture",J),p.removeEventListener("dragstart",O),b.restore(),delete p.dataset.state,delete p.dataset.confirmed})}var v=s;export{v as SLIDE_TO_CONFIRM_DEFAULTS,p as slideToConfirm,m as stepSpring,h as velocity};//# sourceMappingURL=chunk-K6JX64AS.js.map
@@ -1 +1 @@
1
- import{mountSurface as n,mixHex as t,handle as e,resolveColor as i}from"./chunk-S7RZP2MT.js";var r={colourByState:!0,ring:!0},o={success:["--ascii-success","#17844a","#3ccf7e"],warning:["--ascii-warning","#9a6700","#f5b83d"],error:["--ascii-error","#c93636","#ff6b6b"]},a=120,c=280,s=520,l=2*Math.PI,u=l/1050,d=n=>1-(1-n)**4,f=n=>`rgb(${255*n} ${255*n} ${255*n})`,h=n=>n*u-Math.PI/2,g=(n,t=0)=>78+5*Math.sin(n/1600*l)*(1-t);function p(n,t,e=78,i=24){n.strokeStyle=f(t),n.lineWidth=i,n.beginPath(),n.arc(a,a,e,0,l),n.stroke()}function k(n,t,e,i=0,r=1){if(p(n,(.3+(e-78)/100)*r,e,24-6*i),i>=1)return void p(n,.72*r,e,18);const o=3.4+(l-3.4)*i;n.lineCap="round";for(let c=0;c<32;c++){const s=c/32,l=.3+.7*(1-s)**1.6;n.strokeStyle=f((l+(.72-l)*i)*r),n.lineWidth=28-6*s+(18-(28-6*s))*i,n.beginPath(),n.arc(a,a,e,t-(s+1/32)*o,t-s*o),n.stroke()}}function m(n,t,e,i=800,r=0,o=!0){if("idle"===t)return void p(n,.34);if("loading"===t)return void k(n,h(e),g(e));const f=(n=>n<.5?4*n*n*n:1-(-2*n+2)**3/2)(Math.min(1,i/c)),m=Math.min(i,c),M=r+u*(m-m*m/560);o?k(n,M,g(e,f),f):f<1&&k(n,M,g(e,f),0,1-f);const b=(i-196)/s;o&&b>0&&b<1&&p(n,.5*(1-b)**2,88+24*b,16-8*b),function(n,t,e,i=30){n.strokeStyle="#fff",n.lineWidth=i,n.lineCap="round",n.lineJoin="round";const r=(t,e)=>{const i=t.slice(1).map((n,e)=>Math.hypot(n[0]-t[e][0],n[1]-t[e][1]));let r=e*i.reduce((n,t)=>n+t,0);n.beginPath(),n.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length&&r>0;e++){const o=Math.min(1,r/i[e-1]);n.lineTo(t[e-1][0]+(t[e][0]-t[e-1][0])*o,t[e-1][1]+(t[e][1]-t[e-1][1])*o),r-=i[e-1]}n.stroke()};"success"===t?r([[86,122],[110,146],[156,96]],e):"warning"===t?(n.lineWidth=i-4,r([[a,74],[a,114]],Math.min(1,e/.7)),e>.7&&(n.fillStyle="#fff",n.beginPath(),n.arc(a,152,i/2*d((e-.7)/.3),0,l),n.fill())):(r([[92,92],[148,148]],e),r([[148,92],[92,148]],e))}(n,t,d(Math.min(1,Math.max(0,(i-40)/260))),o?24:30)}function M(a,c={}){const s={current:{...r,...c}};let l="idle",u=0,f=0,g="",p="",k=-1e9,M="",b=null;const y=n=>{if(!s.current.colourByState||"idle"===l||"loading"===l)return(n=>i(s.current.ink??"--ascii-ink-strong",a,n?"#d8d6cf":"#1d1d1b"))(n);const[t,e,r]=o[l];return i(s.current.colors?.[l]??t,a,n?r:e)};b=n({host:a,look:()=>({mark:"glyph",fit:"contain",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.94,font:'"Geist Mono", ui-monospace, monospace',fontWeight:600,contrast:1.1,shade:.5,...s.current.look}),ink:n=>y(n),kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:()=>[240,240],onFail:()=>{b=null},onTheme:()=>{k=-1e9,M=""},paint:({pen:n,now:e,still:i,dark:r})=>{const o=e-u;m(n,l,i?380:e,i?800:o,f,s.current.ring);const a=y(r);a!==p&&(g=p||a,p=a,k=e);const c=i?1:d(Math.min(1,(e-k)/200)),h=c<1?t(g,p,c):p;return h!==M&&(M=h,b?.field.update({ink:h})),"loading"===l||o<800||c<1}});const S=n=>{const t=performance.now();"loading"===l&&"loading"!==n&&(f=h(t)),l=n,u=t,a.dataset.state=n,"error"===n&&b&&!b.still()&&"function"==typeof a.animate&&a.animate({translate:["0","-5px 0","4px 0","-2px 0","0"]},{duration:260,easing:"cubic-bezier(.16, 1, .3, 1)"}),b?.kick()};return e(()=>b,s,()=>b?.refresh(),{idle:()=>S("idle"),loading:()=>S("loading"),success:()=>S("success"),warning:()=>S("warning"),error:()=>S("error"),get state(){return l}},()=>{delete a.dataset.state})}var b=r;export{b as STATUS_ORB_DEFAULTS,m as orbFrame,M as statusOrb};//# sourceMappingURL=chunk-3473NPIN.js.map
1
+ import{mountSurface as n,mixHex as t,handle as e,resolveColor as i}from"./chunk-GF72XM4C.js";var r={colourByState:!0,ring:!0},o={success:["--ascii-success","#17844a","#3ccf7e"],warning:["--ascii-warning","#9a6700","#f5b83d"],error:["--ascii-error","#c93636","#ff6b6b"]},a=120,c=280,s=520,l=2*Math.PI,u=l/1050,d=n=>1-(1-n)**4,f=n=>`rgb(${255*n} ${255*n} ${255*n})`,h=n=>n*u-Math.PI/2,g=(n,t=0)=>78+5*Math.sin(n/1600*l)*(1-t);function p(n,t,e=78,i=24){n.strokeStyle=f(t),n.lineWidth=i,n.beginPath(),n.arc(a,a,e,0,l),n.stroke()}function k(n,t,e,i=0,r=1){if(p(n,(.3+(e-78)/100)*r,e,24-6*i),i>=1)return void p(n,.72*r,e,18);const o=3.4+(l-3.4)*i;n.lineCap="round";for(let c=0;c<32;c++){const s=c/32,l=.3+.7*(1-s)**1.6;n.strokeStyle=f((l+(.72-l)*i)*r),n.lineWidth=28-6*s+(18-(28-6*s))*i,n.beginPath(),n.arc(a,a,e,t-(s+1/32)*o,t-s*o),n.stroke()}}function m(n,t,e,i=800,r=0,o=!0){if("idle"===t)return void p(n,.34);if("loading"===t)return void k(n,h(e),g(e));const f=(n=>n<.5?4*n*n*n:1-(-2*n+2)**3/2)(Math.min(1,i/c)),m=Math.min(i,c),M=r+u*(m-m*m/560);o?k(n,M,g(e,f),f):f<1&&k(n,M,g(e,f),0,1-f);const b=(i-196)/s;o&&b>0&&b<1&&p(n,.5*(1-b)**2,88+24*b,16-8*b),function(n,t,e,i=30){n.strokeStyle="#fff",n.lineWidth=i,n.lineCap="round",n.lineJoin="round";const r=(t,e)=>{const i=t.slice(1).map((n,e)=>Math.hypot(n[0]-t[e][0],n[1]-t[e][1]));let r=e*i.reduce((n,t)=>n+t,0);n.beginPath(),n.moveTo(t[0][0],t[0][1]);for(let e=1;e<t.length&&r>0;e++){const o=Math.min(1,r/i[e-1]);n.lineTo(t[e-1][0]+(t[e][0]-t[e-1][0])*o,t[e-1][1]+(t[e][1]-t[e-1][1])*o),r-=i[e-1]}n.stroke()};"success"===t?r([[86,122],[110,146],[156,96]],e):"warning"===t?(n.lineWidth=i-4,r([[a,74],[a,114]],Math.min(1,e/.7)),e>.7&&(n.fillStyle="#fff",n.beginPath(),n.arc(a,152,i/2*d((e-.7)/.3),0,l),n.fill())):(r([[92,92],[148,148]],e),r([[148,92],[92,148]],e))}(n,t,d(Math.min(1,Math.max(0,(i-40)/260))),o?24:30)}function M(a,c={}){const s={current:{...r,...c}};let l="idle",u=0,f=0,g="",p="",k=-1e9,M="",b=null;const y=n=>{if(!s.current.colourByState||"idle"===l||"loading"===l)return(n=>i(s.current.ink??"--ascii-ink-strong",a,n?"#d8d6cf":"#1d1d1b"))(n);const[t,e,r]=o[l];return i(s.current.colors?.[l]??t,a,n?r:e)};b=n({host:a,look:()=>({mark:"glyph",fit:"contain",charset:" .:-=+*#%@",cellSize:5,cellAspect:.62,glyphScale:.94,font:'"Geist Mono", ui-monospace, monospace',fontWeight:600,contrast:1.1,shade:.5,...s.current.look}),ink:n=>y(n),kit:s,reducedMotion:()=>s.current.reducedMotion,resolution:()=>[240,240],onFail:()=>{b=null},onTheme:()=>{k=-1e9,M=""},paint:({pen:n,now:e,still:i,dark:r})=>{const o=e-u;m(n,l,i?380:e,i?800:o,f,s.current.ring);const a=y(r);a!==p&&(g=p||a,p=a,k=e);const c=i?1:d(Math.min(1,(e-k)/200)),h=c<1?t(g,p,c):p;return h!==M&&(M=h,b?.field.update({ink:h})),"loading"===l||o<800||c<1}});const S=n=>{const t=performance.now();"loading"===l&&"loading"!==n&&(f=h(t)),l=n,u=t,a.dataset.state=n,"error"===n&&b&&!b.still()&&"function"==typeof a.animate&&a.animate({translate:["0","-5px 0","4px 0","-2px 0","0"]},{duration:260,easing:"cubic-bezier(.16, 1, .3, 1)"}),b?.kick()};return e(()=>b,s,()=>b?.refresh(),{idle:()=>S("idle"),loading:()=>S("loading"),success:()=>S("success"),warning:()=>S("warning"),error:()=>S("error"),get state(){return l}},()=>{delete a.dataset.state})}var b=r;export{b as STATUS_ORB_DEFAULTS,m as orbFrame,M as statusOrb};//# sourceMappingURL=chunk-KCEYRIU4.js.map