asciify-engine 4.24.0 → 4.25.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 (102) hide show
  1. package/CHANGELOG.md +315 -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 +4 -1
  7. package/dist/field.d.ts +4 -1
  8. package/dist/field.js +1 -1
  9. package/dist/hover.cjs +1 -1
  10. package/dist/hover.js +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/kit/{chunk-3473NPIN.js → chunk-2D2SG6FW.js} +1 -1
  14. package/dist/kit/chunk-2JQ4MRIP.js +1 -0
  15. package/dist/kit/{chunk-RFLIFKZ4.js → chunk-2KFBIOVS.js} +1 -1
  16. package/dist/kit/{chunk-FR3ZJNOY.js → chunk-2TQW2PIG.js} +1 -1
  17. package/dist/kit/{chunk-C4KZYCPF.js → chunk-3F6FTBMN.js} +1 -1
  18. package/dist/kit/chunk-4SHQA3CO.js +1 -0
  19. package/dist/kit/chunk-4XT5IKM3.js +1 -0
  20. package/dist/kit/{chunk-YBRP6BFW.js → chunk-6L2GAV5C.js} +1 -1
  21. package/dist/kit/{chunk-3A5LID2G.js → chunk-6XNIZ52V.js} +1 -1
  22. package/dist/kit/{chunk-I4QVLLRQ.js → chunk-6YVZZ3DO.js} +1 -1
  23. package/dist/kit/{chunk-FUI5AVIF.js → chunk-A6EDU3UT.js} +1 -1
  24. package/dist/kit/{chunk-J2YZBT3N.js → chunk-A73S2BCE.js} +1 -1
  25. package/dist/kit/{chunk-ENTDGT2V.js → chunk-ANLBW5RI.js} +1 -1
  26. package/dist/kit/{chunk-K563CCOL.js → chunk-B6GZ645M.js} +1 -1
  27. package/dist/kit/{chunk-ZRJVOUWH.js → chunk-BBOSHBZK.js} +1 -1
  28. package/dist/kit/{chunk-5Z2EJAUV.js → chunk-BJRPY7UB.js} +1 -1
  29. package/dist/kit/{chunk-QALCXKU6.js → chunk-CA5J25SV.js} +1 -1
  30. package/dist/kit/{chunk-XANKANGR.js → chunk-CR7QS3B3.js} +1 -1
  31. package/dist/kit/{chunk-ROR6MG3K.js → chunk-D4KCZSIP.js} +1 -1
  32. package/dist/kit/{chunk-YCWMOTYH.js → chunk-EHXSXMBE.js} +1 -1
  33. package/dist/kit/{chunk-TTGMK4EA.js → chunk-EHYFSX5K.js} +1 -1
  34. package/dist/kit/{chunk-PCIAA2LL.js → chunk-EJ3W4FN6.js} +1 -1
  35. package/dist/kit/{chunk-BN7HL52Z.js → chunk-EK4GIXIO.js} +1 -1
  36. package/dist/kit/{chunk-VVW7LZT2.js → chunk-EPVZIGEZ.js} +1 -1
  37. package/dist/kit/chunk-EWPT56TR.js +1 -0
  38. package/dist/kit/{chunk-QRCXXS5Z.js → chunk-FIWIUXNV.js} +1 -1
  39. package/dist/kit/{chunk-5I4IZTL5.js → chunk-G4BQYQJ6.js} +1 -1
  40. package/dist/kit/chunk-GCIZKMJL.js +1 -0
  41. package/dist/kit/{chunk-PFKYKAIP.js → chunk-H4DBJULW.js} +1 -1
  42. package/dist/kit/{chunk-MGVPLQ3Z.js → chunk-HMW5NRUV.js} +1 -1
  43. package/dist/kit/{chunk-IPVN22ZM.js → chunk-IUX46UDR.js} +1 -1
  44. package/dist/kit/{chunk-MQJQIDO5.js → chunk-JAM46FF6.js} +1 -1
  45. package/dist/kit/{chunk-PIU2BMFU.js → chunk-JRSCTMFM.js} +1 -1
  46. package/dist/kit/{chunk-T3GWGPST.js → chunk-KBXVIAWS.js} +1 -1
  47. package/dist/kit/{chunk-7ABNWOW4.js → chunk-KJJJORN6.js} +1 -1
  48. package/dist/kit/chunk-KS3TL3S2.js +1 -0
  49. package/dist/kit/{chunk-BR6ZNJZW.js → chunk-KTYCGGRO.js} +1 -1
  50. package/dist/kit/{chunk-H2UZBVKE.js → chunk-L3P7ZDSK.js} +1 -1
  51. package/dist/kit/{chunk-VC2ZQG63.js → chunk-LUOIH2EM.js} +1 -1
  52. package/dist/kit/{chunk-WJLZM3DR.js → chunk-MIA6TUQC.js} +1 -1
  53. package/dist/kit/{chunk-SARCZMLN.js → chunk-MRDEO5HZ.js} +1 -1
  54. package/dist/kit/{chunk-BQZCLGCY.js → chunk-NPJ77LDC.js} +1 -1
  55. package/dist/kit/{chunk-5QE6UMXN.js → chunk-ODMQERGZ.js} +1 -1
  56. package/dist/kit/{chunk-E3TUOX2A.js → chunk-ONVONNUH.js} +1 -1
  57. package/dist/kit/{chunk-C3C7AYKL.js → chunk-OVCIHOOS.js} +1 -1
  58. package/dist/kit/{chunk-G57QACJG.js → chunk-P6S6HSN3.js} +1 -1
  59. package/dist/kit/{chunk-4OT66HSZ.js → chunk-PCGRRX5P.js} +1 -1
  60. package/dist/kit/{chunk-4ZQFDFEH.js → chunk-PDNKLLBI.js} +1 -1
  61. package/dist/kit/{chunk-IUKSHYED.js → chunk-PFNFW4ZI.js} +1 -1
  62. package/dist/kit/chunk-PFQBEWCF.js +1 -0
  63. package/dist/kit/{chunk-2CF4PX6U.js → chunk-PND73YEV.js} +1 -1
  64. package/dist/kit/{chunk-AIM3J2US.js → chunk-PZAQLUAS.js} +1 -1
  65. package/dist/kit/{chunk-IQTGJRDX.js → chunk-QKZYCROD.js} +1 -1
  66. package/dist/kit/{chunk-W2STAN6V.js → chunk-QTVMD62E.js} +1 -1
  67. package/dist/kit/{chunk-S62H7ZIU.js → chunk-QZHZWO7N.js} +1 -1
  68. package/dist/kit/{chunk-XDKKCIIL.js → chunk-SAQJAH2I.js} +1 -1
  69. package/dist/kit/{chunk-HTUGMGVA.js → chunk-SE6MQQLB.js} +1 -1
  70. package/dist/kit/{chunk-NURPDP3Y.js → chunk-SQGJ263V.js} +1 -1
  71. package/dist/kit/{chunk-XB4DKPGL.js → chunk-SVXRMHUJ.js} +1 -1
  72. package/dist/kit/chunk-UO4U32P7.js +1 -0
  73. package/dist/kit/{chunk-BNVRKD3V.js → chunk-V6GEQ5Y5.js} +1 -1
  74. package/dist/kit/{chunk-KWTF6Q5W.js → chunk-VFV7HZ3G.js} +1 -1
  75. package/dist/kit/{chunk-DZ5XGHTJ.js → chunk-WT3XOWAI.js} +1 -1
  76. package/dist/kit/{chunk-2NVKPXPL.js → chunk-XDNCXCR7.js} +1 -1
  77. package/dist/kit/chunk-XVB3B3FV.js +1 -0
  78. package/dist/kit/{chunk-O7SGY4YJ.js → chunk-XXPDXJMQ.js} +1 -1
  79. package/dist/kit/{chunk-5BEBNKYM.js → chunk-XYLLL2PQ.js} +1 -1
  80. package/dist/kit/{chunk-MIZ2DUHU.js → chunk-YBBYCUFP.js} +1 -1
  81. package/dist/kit/{chunk-DFOWXOZR.js → chunk-YDP6566E.js} +1 -1
  82. package/dist/kit/chunk-YL2AXWRA.js +1 -0
  83. package/dist/kit/{chunk-4QHFEMFS.js → chunk-ZYYLWSPY.js} +1 -1
  84. package/dist/kit.cjs +1 -1
  85. package/dist/kit.d.cts +3 -1
  86. package/dist/kit.d.ts +3 -1
  87. package/dist/kit.js +1 -1
  88. package/package.json +2 -1
  89. package/skills/asciify-engine/SKILL.md +2 -2
  90. package/skills/asciify-engine/references/applying-asciify.md +1 -1
  91. package/skills/asciify-engine/references/kit.md +2 -2
  92. package/skills/asciify-engine/references/performance.md +5 -2
  93. package/dist/kit/chunk-3PCKMO6I.js +0 -1
  94. package/dist/kit/chunk-4HWMQCAM.js +0 -1
  95. package/dist/kit/chunk-73M2OESE.js +0 -1
  96. package/dist/kit/chunk-BTD6EFAW.js +0 -1
  97. package/dist/kit/chunk-OWEZV7TQ.js +0 -1
  98. package/dist/kit/chunk-S7RZP2MT.js +0 -1
  99. package/dist/kit/chunk-SNCXU7KF.js +0 -1
  100. package/dist/kit/chunk-UML6XQAR.js +0 -1
  101. package/dist/kit/chunk-UO7RB7RC.js +0 -1
  102. package/dist/kit/chunk-XM56OTYT.js +0 -1
@@ -1 +1 @@
1
- import{snapshot as t}from"./chunk-BNVRKD3V.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-S7RZP2MT.js";var r={dissolve:300,condense:300},c=10,l=16,h=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),d=t=>i(Math.min(1,Math.max(0,t))),u=()=>{let t=()=>{};return[new Promise(e=>{t=e}),t]};function g(t,a,n,o,i,s=!1){const r=a.width,h=a.height,d=Math.ceil(r/c),u=Math.ceil(h/l),g=[],m=[],f=Math.max(...[[0,0],[r,0],[0,h],[r,h]].map(([t,e])=>Math.hypot(t-o.x,e-o.y)))||1,x=function(t,e,a){const n=p.get(t);if(n)return n;const o=Object.assign(document.createElement("canvas"),{width:e,height:a}),i=Object.assign(document.createElement("canvas"),{width:t.width,height:t.height}),s=o.getContext("2d"),r=i.getContext("2d"),c={mask:o,maskPen:s,data:s.createImageData(e,a),clip:i,clipPen:r};return p.set(t,c),c}(a,d,u),M=x.data.data;let w=0;for(let t=0;t<u;t++)for(let a=0;a<d;a++){const i=a*c,r=t*l,h=Math.hypot(i+5-o.x,r+8-o.y)/f*.72+.28*e(i,r),u=s?n-h-.12:h-n;M[4*(t*d+a)+3]=u>0?255:0,u>0&&w++,u>0&&u<.07?g.push([i,r]):u<=0&&u>-.12&&m.push([i,r,-u/.12])}if(w){x.maskPen.putImageData(x.data,0,0);const e=x.clipPen;e.globalCompositeOperation="source-over",e.clearRect(0,0,r,h),e.drawImage(a,0,0),e.globalCompositeOperation="destination-in",e.imageSmoothingEnabled=!1,e.drawImage(x.mask,0,0,d*c,u*l),e.globalCompositeOperation="source-over",t.drawImage(x.clip,0,0)}for(const[n,o,r]of m)t.globalAlpha=(1-r)*(s?.7:1),t.drawImage(a,n,o,c,l,n+18*(e(o,n+i)-.5)*r,o-10*r*(s?-.6:1),c,l);t.globalAlpha=1,t.globalCompositeOperation="lighter",t.globalAlpha=s?.5:1;for(const[e,n]of g)t.drawImage(a,e,n,c,l,e,n,c,l);t.globalAlpha=1,t.globalCompositeOperation="source-over"}var p=new WeakMap;function m(e,i={}){const c={current:{...r,...i}},l=a();let p=null,m=0,f=0,x=Promise.resolve(),M=0,w=null;const b="function"==typeof matchMedia&&matchMedia("(pointer: coarse)").matches?1:2,k=t=>{t.handed(),t.landing(),t.done()};w=n({host:e,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:8,cellAspect:.6,glyphScale:.9,contrast:1.15,shade:.55,...c.current.look}),ink:()=>c.current.ink??"--ascii-ink-strong",kit:{get current(){return{...c.current,poster:void 0}}},reducedMotion:()=>c.current.reducedMotion,resolution:b,onFail:()=>{w=null;const t=p;p=null,l.restore(),t&&k(t)},paint:({pen:t,width:e,height:a,now:n})=>{const o=p;if(!o)return!1;const i=n-o.start,s=i/o.outMs,r=o.next?(n-o.nextAt)/o.nextMs:0;var c;s<1&&g(t,o.out,1.12*h(s),o.at,++f),o.next&&r>0&&g(t,o.next,.1+1.14*(c=r,1-(1-Math.min(1,Math.max(0,c)))**2),o.at,f,!0);const l=o.next?(n-o.nextAt-o.nextMs+o.hand)/o.hand:-1,u=d(i/o.hand)*(1-d(l));u<1&&(t.globalAlpha=1-u,t.fillStyle="#000",t.fillRect(0,0,e,a),t.globalAlpha=1);const x=Math.round(-160*h(2*s)*(o.next?1-h(r):1))/1e3;return x!==m&&(m=x,w?.field.update({brightness:x})),0===o.stage&&i>=o.hand&&(o.stage=1,o.handed()),1===o.stage&&l>=0&&(o.stage=2,o.landing()),!(l>=1)||(p=null,o.done(),!1)}});const v=(t,a)=>{if(t&&"getBoundingClientRect"in t){const e=a.box(t);return{x:(e.x+e.w/2)*b,y:(e.y+e.h/2)*b}}return t?{x:t.x*b,y:t.y*b}:{x:e.offsetWidth/2*b,y:0}},y=a=>t(e,a.box,e.offsetWidth,e.offsetHeight,b,{skip:a.canvas}),A=(t,a)=>{for(const n of[...e.children].filter(t=>void 0===t.dataset.asciiKit&&void 0===t.dataset.asciiPoster))l.set(n,"transition",a?`opacity ${a}ms cubic-bezier(.16, 1, .3, 1)`:"none"),l.set(n,"opacity",t?"1":"0")},C=async(t,a)=>{const n=w;if(!n||(c.current.reducedMotion??s())||!n.live)return void await t();const{dissolve:o,condense:i}=c.current,r=Math.max(1,Math.min(110,o/2,i/2)),[h,d]=u(),[g,f]=u(),[x,M]=u(),b=p={at:v(a??c.current.origin,n),start:performance.now(),hand:r,out:y(n),outMs:Math.max(1,o),next:null,nextAt:0,nextMs:Math.max(1,i),handed:d,landing:f,done:M,stage:0};if(e.dataset.state="out",A(!1,r),n.kick(),await h,p===b){try{await t()}catch(t){throw p===b&&(p=null,l.restore(),w?.field.update({brightness:0})),t}w&&p===b&&(n.canvas.isConnected&&n.canvas.parentElement===e||e.appendChild(n.canvas),A(!1,0),e.dataset.state="in",b.next=y(n),b.nextAt=performance.now(),n.kick(),await g,p===b&&A(!0,r),await x,l.restore(),m=0,w?.field.update({brightness:0}),w?.kick())}};return o(()=>w,c,()=>w?.refresh(),{swap(t,a){M++;const n=x.then(()=>C(t,a)).finally(()=>{0===--M&&delete e.dataset.state});return x=n.catch(()=>{}),n},get busy(){return M>0}},()=>{const t=p;p=null,l.restore(),delete e.dataset.state,t&&k(t)})}var f=r;export{f as PAGE_DISSOLVE_DEFAULTS,g as dissolveFrame,m as pageDissolve};//# sourceMappingURL=chunk-WJLZM3DR.js.map
1
+ import{snapshot as t}from"./chunk-V6GEQ5Y5.js";import{hash as e,styleKeeper as a,mountSurface as n,handle as o,house as i,prefersReduced as s}from"./chunk-PFQBEWCF.js";var r={dissolve:300,condense:300},c=10,l=16,h=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),d=t=>i(Math.min(1,Math.max(0,t))),u=()=>{let t=()=>{};return[new Promise(e=>{t=e}),t]};function g(t,a,n,o,i,s=!1){const r=a.width,h=a.height,d=Math.ceil(r/c),u=Math.ceil(h/l),g=[],m=[],f=Math.max(...[[0,0],[r,0],[0,h],[r,h]].map(([t,e])=>Math.hypot(t-o.x,e-o.y)))||1,x=function(t,e,a){const n=p.get(t);if(n)return n;const o=Object.assign(document.createElement("canvas"),{width:e,height:a}),i=Object.assign(document.createElement("canvas"),{width:t.width,height:t.height}),s=o.getContext("2d"),r=i.getContext("2d"),c={mask:o,maskPen:s,data:s.createImageData(e,a),clip:i,clipPen:r};return p.set(t,c),c}(a,d,u),M=x.data.data;let w=0;for(let t=0;t<u;t++)for(let a=0;a<d;a++){const i=a*c,r=t*l,h=Math.hypot(i+5-o.x,r+8-o.y)/f*.72+.28*e(i,r),u=s?n-h-.12:h-n;M[4*(t*d+a)+3]=u>0?255:0,u>0&&w++,u>0&&u<.07?g.push([i,r]):u<=0&&u>-.12&&m.push([i,r,-u/.12])}if(w){x.maskPen.putImageData(x.data,0,0);const e=x.clipPen;e.globalCompositeOperation="source-over",e.clearRect(0,0,r,h),e.drawImage(a,0,0),e.globalCompositeOperation="destination-in",e.imageSmoothingEnabled=!1,e.drawImage(x.mask,0,0,d*c,u*l),e.globalCompositeOperation="source-over",t.drawImage(x.clip,0,0)}for(const[n,o,r]of m)t.globalAlpha=(1-r)*(s?.7:1),t.drawImage(a,n,o,c,l,n+18*(e(o,n+i)-.5)*r,o-10*r*(s?-.6:1),c,l);t.globalAlpha=1,t.globalCompositeOperation="lighter",t.globalAlpha=s?.5:1;for(const[e,n]of g)t.drawImage(a,e,n,c,l,e,n,c,l);t.globalAlpha=1,t.globalCompositeOperation="source-over"}var p=new WeakMap;function m(e,i={}){const c={current:{...r,...i}},l=a();let p=null,m=0,f=0,x=Promise.resolve(),M=0,w=null;const b="function"==typeof matchMedia&&matchMedia("(pointer: coarse)").matches?1:2,k=t=>{t.handed(),t.landing(),t.done()};w=n({host:e,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:8,cellAspect:.6,glyphScale:.9,contrast:1.15,shade:.55,...c.current.look}),ink:()=>c.current.ink??"--ascii-ink-strong",kit:{get current(){return{...c.current,poster:void 0}}},reducedMotion:()=>c.current.reducedMotion,resolution:b,onFail:()=>{w=null;const t=p;p=null,l.restore(),t&&k(t)},paint:({pen:t,width:e,height:a,now:n})=>{const o=p;if(!o)return!1;const i=n-o.start,s=i/o.outMs,r=o.next?(n-o.nextAt)/o.nextMs:0;var c;s<1&&g(t,o.out,1.12*h(s),o.at,++f),o.next&&r>0&&g(t,o.next,.1+1.14*(c=r,1-(1-Math.min(1,Math.max(0,c)))**2),o.at,f,!0);const l=o.next?(n-o.nextAt-o.nextMs+o.hand)/o.hand:-1,u=d(i/o.hand)*(1-d(l));u<1&&(t.globalAlpha=1-u,t.fillStyle="#000",t.fillRect(0,0,e,a),t.globalAlpha=1);const x=Math.round(-160*h(2*s)*(o.next?1-h(r):1))/1e3;return x!==m&&(m=x,w?.field.update({brightness:x})),0===o.stage&&i>=o.hand&&(o.stage=1,o.handed()),1===o.stage&&l>=0&&(o.stage=2,o.landing()),!(l>=1)||(p=null,o.done(),!1)}});const v=(t,a)=>{if(t&&"getBoundingClientRect"in t){const e=a.box(t);return{x:(e.x+e.w/2)*b,y:(e.y+e.h/2)*b}}return t?{x:t.x*b,y:t.y*b}:{x:e.offsetWidth/2*b,y:0}},y=a=>t(e,a.box,e.offsetWidth,e.offsetHeight,b,{skip:a.canvas}),A=(t,a)=>{for(const n of[...e.children].filter(t=>void 0===t.dataset.asciiKit&&void 0===t.dataset.asciiPoster))l.set(n,"transition",a?`opacity ${a}ms cubic-bezier(.16, 1, .3, 1)`:"none"),l.set(n,"opacity",t?"1":"0")},C=async(t,a)=>{const n=w;if(!n||(c.current.reducedMotion??s())||!n.live)return void await t();const{dissolve:o,condense:i}=c.current,r=Math.max(1,Math.min(110,o/2,i/2)),[h,d]=u(),[g,f]=u(),[x,M]=u(),b=p={at:v(a??c.current.origin,n),start:performance.now(),hand:r,out:y(n),outMs:Math.max(1,o),next:null,nextAt:0,nextMs:Math.max(1,i),handed:d,landing:f,done:M,stage:0};if(e.dataset.state="out",A(!1,r),n.kick(),await h,p===b){try{await t()}catch(t){throw p===b&&(p=null,l.restore(),w?.field.update({brightness:0})),t}w&&p===b&&(n.canvas.isConnected&&n.canvas.parentElement===e||e.appendChild(n.canvas),A(!1,0),e.dataset.state="in",b.next=y(n),b.nextAt=performance.now(),n.kick(),await g,p===b&&A(!0,r),await x,l.restore(),m=0,w?.field.update({brightness:0}),w?.kick())}};return o(()=>w,c,()=>w?.refresh(),{swap(t,a){M++;const n=x.then(()=>C(t,a)).finally(()=>{0===--M&&delete e.dataset.state});return x=n.catch(()=>{}),n},get busy(){return M>0}},()=>{const t=p;p=null,l.restore(),delete e.dataset.state,t&&k(t)})}var f=r;export{f as PAGE_DISSOLVE_DEFAULTS,g as dissolveFrame,m as pageDissolve};//# sourceMappingURL=chunk-MIA6TUQC.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-KTYCGGRO.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,C=255,S=255;if(p&&(b=55,C=55,S=55),a){const e=t(a);e&&(b=e.r,C=e.g,S=e.b)}let x=212,z=255,k=0;const y=t(g);y&&(x=y.r,z=y.g,k=y.b);const G=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(G*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(${x},${z},${k},${p?.92:.28})`:`rgba(${b},${C},${S},${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-MRDEO5HZ.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-BQZCLGCY.js.map
1
+ import{scenePreset as e}from"./chunk-OVCIHOOS.js";var t=e({id:"ripple",name:"Ripple",description:"Still water: drops land here and there and ring outward, and the pointer drops its own.",cellSize:11,scene:"ripple",charset:" .·:-~=",hover:"none",extra(e,t){const{host:n}=e;let r=-1e9,i=-1e4,o=-1e4;const s=n=>{const s=performance.now();if(!1===e.settings().cursor||s-r<260||Math.hypot(n.clientX-i,n.clientY-o)<48)return;r=s,i=n.clientX,o=n.clientY;const c=t.canvas.getBoundingClientRect();t.field?.pulse({x:n.clientX-c.left,y:n.clientY-c.top,strength:.5})};return n.addEventListener("pointermove",s,{passive:!0}),()=>n.removeEventListener("pointermove",s)}});export{t as ripple};//# sourceMappingURL=chunk-NPJ77LDC.js.map
@@ -1 +1 @@
1
- import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-BR6ZNJZW.js";function o(e,o,n,c,r={x:.5,y:.5},l={}){const{fontSize:s=14,chars:a=". · ○ ◎ ●",accentColor:i,color:h,rings:f=5,speed:M=1,sharpness:g=4,lightMode:p=!1}=l,m=i??(p?"#007a5e":"#00ffcc");e.clearRect(0,0,o,n),e.textBaseline="middle",e.textAlign="center";const u=o*r.x,d=n*r.y,x=1.6*Math.sqrt(u*u+d*d)+.2*Math.sqrt(o*o+n*n);let $=255,b=255,S=255;if(p&&($=55,b=55,S=55),h){const e=t(h);e&&($=e.r,b=e.g,S=e.b)}let z=0,C=255,k=204;const q=t(m);q&&(z=q.r,C=q.g,k=q.b);const y=a.replace(/ /g,"").split("");if(0===y.length)return;const R=Math.ceil(o/s),Z=Math.ceil(n/s);for(let t=0;t<Z;t++)for(let o=0;o<R;o++){const n=o*s+.5*s,r=t*s+.5*s,l=n-u,a=r-d,i=Math.sqrt(l*l+a*a)/x;let h=0;for(let t=0;t<f;t++){const e=(c*M*.38+t/f)%1,o=Math.abs(i-e),n=Math.max(0,1-o*x/(s*(12-g)));h+=Math.cos(n*Math.PI*.5)*n}if(h=Math.min(1,h),h<.02)continue;const m=h>.6;e.font=`${s}px monospace`;const q=Math.floor(h*(y.length-1)),R=y[Math.min(q,y.length-1)],Z=p?.88*h:.22*h;e.fillStyle=m?`rgba(${z},${C},${k},${Math.min(p?.95:.4,.55*h)})`:`rgba(${$},${b},${S},${Z})`,e.fillText(R,n,r)}e.textAlign="left"}var n={id:"pulse",name:"Pulse",description:"Rings of characters ripple out from the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>e(t,(t,e,n,c,r,l)=>o(t,e,n,c,r,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{n as pulse,o as renderPulseBackground};//# sourceMappingURL=chunk-5QE6UMXN.js.map
1
+ import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as e}from"./chunk-KTYCGGRO.js";function o(e,o,n,c,r={x:.5,y:.5},l={}){const{fontSize:s=14,chars:a=". · ○ ◎ ●",accentColor:i,color:h,rings:f=5,speed:M=1,sharpness:g=4,lightMode:p=!1}=l,m=i??(p?"#007a5e":"#00ffcc");e.clearRect(0,0,o,n),e.textBaseline="middle",e.textAlign="center";const u=o*r.x,d=n*r.y,x=1.6*Math.sqrt(u*u+d*d)+.2*Math.sqrt(o*o+n*n);let $=255,b=255,C=255;if(p&&($=55,b=55,C=55),h){const e=t(h);e&&($=e.r,b=e.g,C=e.b)}let S=0,z=255,k=204;const q=t(m);q&&(S=q.r,z=q.g,k=q.b);const y=a.replace(/ /g,"").split("");if(0===y.length)return;const G=Math.ceil(o/s),R=Math.ceil(n/s);for(let t=0;t<R;t++)for(let o=0;o<G;o++){const n=o*s+.5*s,r=t*s+.5*s,l=n-u,a=r-d,i=Math.sqrt(l*l+a*a)/x;let h=0;for(let t=0;t<f;t++){const e=(c*M*.38+t/f)%1,o=Math.abs(i-e),n=Math.max(0,1-o*x/(s*(12-g)));h+=Math.cos(n*Math.PI*.5)*n}if(h=Math.min(1,h),h<.02)continue;const m=h>.6;e.font=`${s}px monospace`;const q=Math.floor(h*(y.length-1)),G=y[Math.min(q,y.length-1)],R=p?.88*h:.22*h;e.fillStyle=m?`rgba(${S},${z},${k},${Math.min(p?.95:.4,.55*h)})`:`rgba(${$},${b},${C},${R})`,e.fillText(G,n,r)}e.textAlign="left"}var n={id:"pulse",name:"Pulse",description:"Rings of characters ripple out from the cursor.",cellSize:14,speed:1,cursor:!0,mount:t=>e(t,(t,e,n,c,r,l)=>o(t,e,n,c,r,{fontSize:l.fontSize,chars:l.chars,lightMode:l.lightMode,color:l.ink,accentColor:l.accent}))};export{n as pulse,o as renderPulseBackground};//# sourceMappingURL=chunk-ODMQERGZ.js.map
@@ -1 +1 @@
1
- import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-BR6ZNJZW.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-E3TUOX2A.js.map
1
+ import{renderMaterial as t}from"./chunk-XPXMCXYI.js";import{mountCanvas as i}from"./chunk-KTYCGGRO.js";var n=(t,i,n,e)=>{const r=7*i+.55*Math.sin(2.2*t+.09*e)+.22*Math.sin(4.8*t-.07*e),o=.5+.5*Math.sin(r);return Math.pow(o,5)*(.35+.65*i)+.08*Math.pow(.5+.5*Math.sin(17*r),3)*o},e={id:"dune",name:"Dune",description:"Layered sand ridges with slow-moving light and fine grain.",cellSize:12,speed:1,cursor:!1,mount:e=>i(e,(i,e,r,o,h,s)=>t(n,i,e,r,o,{ditherStrength:s.ditherStrength,fontSize:s.fontSize,chars:s.chars,lightMode:s.lightMode,color:s.ink}))};export{e as dune};//# sourceMappingURL=chunk-ONVONNUH.js.map
@@ -1 +1 @@
1
- import{mountPageField as e}from"./chunk-BTD6EFAW.js";var r=(e,r)=>!1===e.cursor?"none":"string"==typeof e.cursor?e.cursor:r;function t(r,t,n,l){let o=null;if(o=e({host:r.host,kit:r.kit,layer:"under",glyphs:l&&(()=>l(r.settings())),look:e=>{const n=r.settings();return{...t(n,e),...n.look}},ink:e=>r.ink(e)??(e?n.dark:n.light),reducedMotion:r.reducedMotion,onFail:()=>{o=null,r.onFail()}}),!o)return null;const i=o.canvas;return{get field(){return o?.field??null},get canvas(){return o?.canvas??i},refresh(){o?.refresh()},play(){o?.field.play()},pause(){o?.field.pause()},destroy(){o?.destroy(),o=null}}}var n=()=>"number"==typeof innerWidth&&innerWidth<760,l={light:"#86847e",dark:"#7c7a74"},o={light:"#8f8d86",dark:"#64625d"},i=e=>({font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:e.cellSize,cellAspect:.62,glyphScale:.86}),s=e=>({cellSize:e.cellSize,cellAspect:1,dotScale:.68}),a={x:.18,y:.2,width:.64,height:.6,feather:.3,shape:"ellipse"};function c(e){const{scene:n,charset:o,hover:c,middle:d=a,feather:h=.3,graphite:u=l}=e,p=e.mark??"glyph";return{id:e.id,name:e.name,description:e.description,cellSize:e.cellSize,speed:e.speed??1,cursor:e.cursor??!0,opacity:e.opacity,mount(l){const a=t(l,(t,l)=>{const a=((e,r)=>e.mark??(e.charset||e.look?.charset?"glyph":r))(t,p);return{scene:n,color:"ink",shade:0,background:"transparent",vignette:0,speed:t.speed,maxPixelRatio:2,levels:"none",blend:"on",..."dot"===a?{mark:"dot",...s(t)}:{mark:"glyph",charset:t.charset??o,...i(t)},hover:r(t,c),lantern:{radius:.14,strength:.45,trail:.8,follow:9},trail:{strength:.8,radius:.35},fluid:{radius:.09,refraction:.03,glow:.6},clear:t.clear?{element:t.clear,padding:0,feather:h,shape:"ellipse"}:d,...e.tune?.(t,l)}},u,"dot"===p?e=>({...i(e),charset:o}):void 0);if(!a||!e.extra)return a;const g=e.extra(l,a),f=a.destroy.bind(a);return Object.assign(a,{destroy(){g(),f()}})}}}export{o as FIELD_GRAPHITE,r as hoverOf,t as mountField,n as narrow,c as scenePreset};//# sourceMappingURL=chunk-C3C7AYKL.js.map
1
+ import{mountPageField as e}from"./chunk-4SHQA3CO.js";var r=(e,r)=>!1===e.cursor?"none":"string"==typeof e.cursor?e.cursor:r;function t(r,t,n,l){let o=null;if(o=e({host:r.host,kit:r.kit,layer:"under",glyphs:l&&(()=>l(r.settings())),look:e=>{const n=r.settings();return{...t(n,e),...n.look}},ink:e=>r.ink(e)??(e?n.dark:n.light),reducedMotion:r.reducedMotion,onFail:()=>{o=null,r.onFail()}}),!o)return null;const i=o.canvas;return{get field(){return o?.field??null},get canvas(){return o?.canvas??i},refresh(){o?.refresh()},play(){o?.field.play()},pause(){o?.field.pause()},destroy(){o?.destroy(),o=null}}}var n=()=>"number"==typeof innerWidth&&innerWidth<760,l={light:"#86847e",dark:"#7c7a74"},o={light:"#8f8d86",dark:"#64625d"},i=e=>({font:'"Geist Mono", ui-monospace, monospace',fontWeight:400,cellSize:e.cellSize,cellAspect:.62,glyphScale:.86}),s=e=>({cellSize:e.cellSize,cellAspect:1,dotScale:.68}),a={x:.18,y:.2,width:.64,height:.6,feather:.3,shape:"ellipse"};function c(e){const{scene:n,charset:o,hover:c,middle:d=a,feather:h=.3,graphite:u=l}=e,p=e.mark??"glyph";return{id:e.id,name:e.name,description:e.description,cellSize:e.cellSize,speed:e.speed??1,cursor:e.cursor??!0,opacity:e.opacity,mount(l){const a=t(l,(t,l)=>{const a=((e,r)=>e.mark??(e.charset||e.look?.charset?"glyph":r))(t,p);return{scene:n,color:"ink",shade:0,background:"transparent",vignette:0,speed:t.speed,maxPixelRatio:2,levels:"none",blend:"on",..."dot"===a?{mark:"dot",...s(t)}:{mark:"glyph",charset:t.charset??o,...i(t)},hover:r(t,c),lantern:{radius:.14,strength:.45,trail:.8,follow:9},trail:{strength:.8,radius:.35},fluid:{radius:.09,refraction:.03,glow:.6},clear:t.clear?{element:t.clear,padding:0,feather:h,shape:"ellipse"}:d,...e.tune?.(t,l)}},u,"dot"===p?e=>({...i(e),charset:o}):void 0);if(!a||!e.extra)return a;const g=e.extra(l,a),f=a.destroy.bind(a);return Object.assign(a,{destroy(){g(),f()}})}}}export{o as FIELD_GRAPHITE,r as hoverOf,t as mountField,n as narrow,c as scenePreset};//# sourceMappingURL=chunk-OVCIHOOS.js.map
@@ -1 +1 @@
1
- import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-S7RZP2MT.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:S,x0:L}=s(f.w,E),R=t=>u<1?t:Math.round(t*b)/b,z=R(f.x+L),F=R(f.y+f.h-7-$),P=(z%E+E)%E-E,I=(F%$+$)%$-$,O=A.canvas,T=`${P.toFixed(3)}px ${I.toFixed(3)}px`;O.style.translate!==T&&(O.style.translate=T);const H=t=>`${Math.max(0,t).toFixed(2)}px`,W=z-P,j=F-I,q=`inset(${H(j)} ${H(O.clientWidth-W-S*E)} ${H(O.clientHeight-j-$)} ${H(W)})`;O.style.clipPath!==q&&(O.style.clipPath=q);const B=u<1?1-t(u,2):0;for(let t=0;t<S;t++){const n=S>1?t/(S-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+B*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(z-P+t*E,F-I,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},S=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},L=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},R="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return R?.observe(u),u.addEventListener("click",S),u.addEventListener("keydown",L),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",S),u.removeEventListener("keydown",L),R?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-G57QACJG.js.map
1
+ import{easeOut as t,styleKeeper as e,mountSurface as n,smoothstep as r,handle as o,boxIn as i,clamp as a}from"./chunk-PFQBEWCF.js";var l={tabs:'[role="tab"]',duration:440,panels:"hidden",manage:!0};function c(e,n,r){const o=Math.sign(n.x+n.w/2-(e.x+e.w/2))||1,i=t(r/.78,4),a=t((r-.14)/.86,4);return{left:e.x+(n.x-e.x)*(o>0?a:i),right:e.x+e.w+(n.x+n.w-e.x-e.w)*(o>0?i:a),dir:o}}function s(t,e,n=20){const r=Math.max(0,Math.floor((t-2*n)/e));return{n:r,x0:(t-r*e)/2}}function u(u,d={}){const h={current:{...l,...d}},x=()=>[...u.querySelectorAll(h.current.tabs)],f=x().findIndex(t=>"true"===t.getAttribute("aria-selected"));let g=Math.max(0,h.current.active??(f>=0?f:0)),p=-1e6,v=null,y=null;const b=e(),m=()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:6,cellAspect:.62,glyphScale:.96,blend:"off",...h.current.look}),M=t=>{const e=i(u,t);return{...e,x:e.x-u.clientLeft,y:e.y-u.clientTop}},w=t=>{y=t;const e=t=>Math.round(100*t)/100+"px";b.set(u,"--tabs-x",e(t.x)),b.set(u,"--tabs-y",e(t.y)),b.set(u,"--tabs-w",e(t.w)),b.set(u,"--tabs-h",e(t.h))},k=()=>{const t=x()[g];t&&w(M(t))};let A=null;A=n({host:u,layer:"under",look:m,ink:()=>h.current.ink??"--ascii-ink",kit:h,reducedMotion:()=>h.current.reducedMotion,onFail:()=>{A=null,k()},paint:({pen:e,now:n,still:o})=>{const i=x()[g];if(!i)return!1;const l=M(i),u=o||!v?1:a((n-p)/h.current.duration),d=u<1?c(v,l,u):{left:l.x,right:l.x+l.w,dir:1},f={x:d.left,y:l.y,w:d.right-d.left,h:l.h};w(f),u>=1&&(v=null);const y=m(),b=Math.min(2,globalThis.devicePixelRatio||1),k=Math.max(2,Math.round((y.cellSize??6)*b)),$=k/b,E=Math.max(2,Math.round(k*(y.cellAspect??.62)))/b,{n:F,x0:L}=s(f.w,E),S=t=>u<1?t:Math.round(t*b)/b,R=S(f.x+L),z=S(f.y+f.h-7-$),P=(R%E+E)%E-E,I=(z%$+$)%$-$,O=A.canvas,W=`${P.toFixed(3)}px ${I.toFixed(3)}px`;O.style.translate!==W&&(O.style.translate=W);const B=t=>`${Math.max(0,t).toFixed(2)}px`,C=R-P,H=z-I,T=`inset(${B(H)} ${B(O.clientWidth-C-F*E)} ${B(O.clientHeight-H-$)} ${B(C)})`;O.style.clipPath!==T&&(O.style.clipPath=T);const j=u<1?1-t(u,2):0;for(let t=0;t<F;t++){const n=F>1?t/(F-1):.5,o=d.dir>0?n:1-n,i=r(0,.42,1-Math.abs(2*n-1))*(.5+j*(.5*o**1.4-.2));e.fillStyle=`rgb(${Math.round(255*i)} ${Math.round(255*i)} ${Math.round(255*i)})`,e.fillRect(R-P+t*E,z-I,E,$)}return u<1}});const $=()=>{const t=h.current;x().forEach((e,n)=>{const r=n===g;t.manage&&(e.setAttribute("aria-selected",String(r)),e.tabIndex=r?0:-1);const o=e.getAttribute("aria-controls")?document.getElementById(e.getAttribute("aria-controls")):null;o&&"none"!==t.panels&&("hidden"===t.panels?o.hidden=!r:o.toggleAttribute("data-active",r))})},E=(t,e=!1)=>{const n=x();if(!n.length)return;const r=(t%n.length+n.length)%n.length;e&&n[r].focus(),r!==g&&(v=y??M(n[g]),g=r,p=performance.now(),$(),A&&!A.still()||(v=null,k()),A.kick(),h.current.onChange?.(r,n[r]))},F=t=>{if(!h.current.manage)return;const e=t.target.closest?.(h.current.tabs),n=e?x().indexOf(e):-1;n>=0&&E(n)},L=t=>{if(!h.current.manage)return;const e={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:x().length-1};t.key in e&&(t.preventDefault(),E(e[t.key],!0))},S="function"==typeof ResizeObserver?new ResizeObserver(()=>{A?.live||k()}):null;return S?.observe(u),u.addEventListener("click",F),u.addEventListener("keydown",L),$(),k(),o(()=>A,h,t=>{void 0!==t.active&&t.active!==g&&E(t.active),$(),A?.refresh()},{select:E,get active(){return g}},()=>{u.removeEventListener("click",F),u.removeEventListener("keydown",L),S?.disconnect(),b.restore()})}var d=l;export{d as TABS_DEFAULTS,s as indicatorRow,c as streamSpan,u as tabs};//# sourceMappingURL=chunk-P6S6HSN3.js.map
@@ -1 +1 @@
1
- import{clamp as t,hash as e}from"./chunk-S7RZP2MT.js";function n(t){const e=()=>({image:t,width:t.naturalWidth,height:t.naturalHeight});return t.complete&&t.naturalWidth?Promise.resolve(e()):new Promise((n,o)=>{const a=()=>{r(),n(e())},i=()=>{r(),o(new Error(`Could not load ${t.src}`))},r=()=>{t.removeEventListener("load",a),t.removeEventListener("error",i)};t.addEventListener("load",a),t.addEventListener("error",i)})}function o(t,e=document.createElement("img")){return(t=>{try{return"undefined"!=typeof location&&new URL(t,location.href).origin!==location.origin}catch{return!1}})(t)&&!e.crossOrigin&&(e.crossOrigin="anonymous"),e.decoding="async",e.src=t,e}function a(t,e,n,o,a,i,r=.5,h=.5){if(a<=0||i<=0||!e.width||!e.height)return;const l=Math.max(a/e.width,i/e.height),c=a/l,d=i/l;t.drawImage(e.image,(e.width-c)*r,(e.height-d)*h,c,d,n,o,a,i)}function i(e,n,o=.08){const a=Math.min(1,420/Math.max(1,e.width,e.height)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(e.width*a)),i.height=Math.max(1,Math.round(e.height*a));const r=i.getContext("2d",{willReadFrequently:!0});if(!r)return e;let h;r.drawImage(e.image,0,0,i.width,i.height);try{h=r.getImageData(0,0,i.width,i.height)}catch{return e}const l=h.data,c=new Uint32Array(256),d=l.length/4,s=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)c[Math.round(s(t))]++;let u=0,f=255,g=0;for(let t=0;t<256;t++)if(g+=c[t],g>=.02*d){u=t;break}g=0;for(let t=255;t>=0;t--)if(g+=c[t],g>=.02*d){f=t;break}const m=Math.max(1,f-u);for(let e=0;e<l.length;e+=4){let a=t((s(e)-u)/m);n&&(a=1-a),l[e]=l[e+1]=l[e+2]=Math.round(255*(o+(1-o)*a)),l[e+3]=255}return r.putImageData(h,0,0),{image:i,width:i.width,height:i.height}}var r={strong:1,text:.82,meta:.55,tile:.42,icon:.62},h=new Set(["IMG","SVG","svg","VIDEO","PICTURE"]),l=t=>[...t.children].flatMap(t=>h.has(t.tagName)?[t]:[t,...l(t)]);function c(e,n,o,a){const i=document.createElement("canvas");i.width=Math.max(2,Math.round(2*n)),i.height=Math.max(2,Math.round(2*o));const c=[],d=i.getContext("2d");if(!d)return{canvas:i,rects:c};d.scale(2,2),d.fillStyle="#000",d.fillRect(0,0,n,o);const s=a(e),u=e.getBoundingClientRect(),f=u.width/(e.offsetWidth||u.width||1)||1,g=t=>{for(let n=t;n&&n!==e.parentElement;n=n.parentElement){const t=n.dataset?.paint;if(t&&void 0!==r[t])return r[t]}return parseFloat(t?getComputedStyle(t).fontWeight:"400")>=500?1:.7},m=e=>{const n=Math.round(255*t(e));return`rgb(${n} ${n} ${n})`},w=l(e),p=[e,...w].filter(t=>{const e=t.dataset?.paint;return"tile"===e||"icon"===e||!e&&h.has(t.tagName)&&!t.closest("[data-paint]")});for(const t of p){const e=a(t);if(e.w<=0||e.h<=0)continue;const n=t.dataset?.paint;d.fillStyle=m("icon"===n?r.icon:r.tile),d.beginPath(),"icon"===n||"svg"===t.tagName.toLowerCase()?d.arc(e.x+e.w/2,e.y+e.h/2,.4*Math.min(e.w,e.h),0,2*Math.PI):d.roundRect(e.x,e.y,e.w,e.h,Math.min(parseFloat(getComputedStyle(t).borderTopLeftRadius)||0,e.h/2)),d.fill(),c.push(e)}const y=document.createTreeWalker(e,4),x=document.createRange();d.textBaseline="middle";for(let t=y.nextNode();t;t=y.nextNode()){const e=t.parentElement;if(!e||e.closest('[data-paint="none"]'))continue;const n=getComputedStyle(e);d.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,d.fillStyle=m(g(e)),d.shadowColor=d.fillStyle,d.shadowBlur=4;for(const e of t.data.matchAll(/\S+/g)){x.setStart(t,e.index),x.setEnd(t,e.index+e[0].length);const n=x.getClientRects()[0];if(!n)continue;const o={x:s.x+(n.left-u.left)/f,y:s.y+(n.top-u.top)/f,w:n.width/f,h:n.height/f};d.fillText(e[0],o.x,o.y+o.h/2),c.push(o)}}return d.shadowBlur=0,x.detach?.(),{canvas:i,rects:c}}function d(t){const n=new Set,o=[];for(const a of t)for(let t=6*Math.floor((a.y-2)/6);t<a.y+a.h+2;t+=6)for(let i=4*Math.floor((a.x-2)/4);i<a.x+a.w+2;i+=4){const a=`${i},${t}`;n.has(a)||(n.add(a),o.push({x:i,y:t,seed:e(i,t)}))}return o}function s(t,e,n,o,a,i,r=1,h=.32){for(let l=0;l<n.length;l++){const c=n[l],d=(a-o[l]*(1-h))/h;if(d<=0)continue;const s=d>=1?0:1-d;let u=c.x,f=c.y;if(s>0){const[t,e]=i(c,s);u+=t,f+=e}t.globalAlpha=r*(1-s*s),t.drawImage(e,2*c.x,2*c.y,8,12,u,f,4,6)}t.globalAlpha=1}function u(t,e){if("undefined"==typeof document||document.getElementById(t))return;const n=document.createElement("style");n.setAttribute("id",t),n.textContent=e,(document.head??document.documentElement).appendChild(n)}export{d as blocksOf,s as drawBlocks,a as drawCover,o as imageFor,n as imageReady,u as injectStyle,c as snapshot,i as toneOf};//# sourceMappingURL=chunk-4OT66HSZ.js.map
1
+ import{clamp as t,hash as e}from"./chunk-PFQBEWCF.js";function n(t){const e=()=>({image:t,width:t.naturalWidth,height:t.naturalHeight});return t.complete&&t.naturalWidth?Promise.resolve(e()):new Promise((n,o)=>{const a=()=>{r(),n(e())},i=()=>{r(),o(new Error(`Could not load ${t.src}`))},r=()=>{t.removeEventListener("load",a),t.removeEventListener("error",i)};t.addEventListener("load",a),t.addEventListener("error",i)})}function o(t,e=document.createElement("img")){return(t=>{try{return"undefined"!=typeof location&&new URL(t,location.href).origin!==location.origin}catch{return!1}})(t)&&!e.crossOrigin&&(e.crossOrigin="anonymous"),e.decoding="async",e.src=t,e}function a(t,e,n,o,a,i,r=.5,h=.5){if(a<=0||i<=0||!e.width||!e.height)return;const l=Math.max(a/e.width,i/e.height),c=a/l,d=i/l;t.drawImage(e.image,(e.width-c)*r,(e.height-d)*h,c,d,n,o,a,i)}function i(e,n,o=.08){const a=Math.min(1,420/Math.max(1,e.width,e.height)),i=document.createElement("canvas");i.width=Math.max(1,Math.round(e.width*a)),i.height=Math.max(1,Math.round(e.height*a));const r=i.getContext("2d",{willReadFrequently:!0});if(!r)return e;let h;r.drawImage(e.image,0,0,i.width,i.height);try{h=r.getImageData(0,0,i.width,i.height)}catch{return e}const l=h.data,c=new Uint32Array(256),d=l.length/4,s=t=>.2126*l[t]+.7152*l[t+1]+.0722*l[t+2];for(let t=0;t<l.length;t+=4)c[Math.round(s(t))]++;let u=0,f=255,g=0;for(let t=0;t<256;t++)if(g+=c[t],g>=.02*d){u=t;break}g=0;for(let t=255;t>=0;t--)if(g+=c[t],g>=.02*d){f=t;break}const m=Math.max(1,f-u);for(let e=0;e<l.length;e+=4){let a=t((s(e)-u)/m);n&&(a=1-a),l[e]=l[e+1]=l[e+2]=Math.round(255*(o+(1-o)*a)),l[e+3]=255}return r.putImageData(h,0,0),{image:i,width:i.width,height:i.height}}var r={strong:1,text:.82,meta:.55,tile:.42,icon:.62},h=new Set(["IMG","SVG","svg","VIDEO","PICTURE"]),l=t=>[...t.children].flatMap(t=>h.has(t.tagName)?[t]:[t,...l(t)]);function c(e,n,o,a){const i=document.createElement("canvas");i.width=Math.max(2,Math.round(2*n)),i.height=Math.max(2,Math.round(2*o));const c=[],d=i.getContext("2d");if(!d)return{canvas:i,rects:c};d.scale(2,2),d.fillStyle="#000",d.fillRect(0,0,n,o);const s=a(e),u=e.getBoundingClientRect(),f=u.width/(e.offsetWidth||u.width||1)||1,g=t=>{for(let n=t;n&&n!==e.parentElement;n=n.parentElement){const t=n.dataset?.paint;if(t&&void 0!==r[t])return r[t]}return parseFloat(t?getComputedStyle(t).fontWeight:"400")>=500?1:.7},m=e=>{const n=Math.round(255*t(e));return`rgb(${n} ${n} ${n})`},w=l(e),p=[e,...w].filter(t=>{const e=t.dataset?.paint;return"tile"===e||"icon"===e||!e&&h.has(t.tagName)&&!t.closest("[data-paint]")});for(const t of p){const e=a(t);if(e.w<=0||e.h<=0)continue;const n=t.dataset?.paint;d.fillStyle=m("icon"===n?r.icon:r.tile),d.beginPath(),"icon"===n||"svg"===t.tagName.toLowerCase()?d.arc(e.x+e.w/2,e.y+e.h/2,.4*Math.min(e.w,e.h),0,2*Math.PI):d.roundRect(e.x,e.y,e.w,e.h,Math.min(parseFloat(getComputedStyle(t).borderTopLeftRadius)||0,e.h/2)),d.fill(),c.push(e)}const y=document.createTreeWalker(e,4),x=document.createRange();d.textBaseline="middle";for(let t=y.nextNode();t;t=y.nextNode()){const e=t.parentElement;if(!e||e.closest('[data-paint="none"]'))continue;const n=getComputedStyle(e);d.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,d.fillStyle=m(g(e)),d.shadowColor=d.fillStyle,d.shadowBlur=4;for(const e of t.data.matchAll(/\S+/g)){x.setStart(t,e.index),x.setEnd(t,e.index+e[0].length);const n=x.getClientRects()[0];if(!n)continue;const o={x:s.x+(n.left-u.left)/f,y:s.y+(n.top-u.top)/f,w:n.width/f,h:n.height/f};d.fillText(e[0],o.x,o.y+o.h/2),c.push(o)}}return d.shadowBlur=0,x.detach?.(),{canvas:i,rects:c}}function d(t){const n=new Set,o=[];for(const a of t)for(let t=6*Math.floor((a.y-2)/6);t<a.y+a.h+2;t+=6)for(let i=4*Math.floor((a.x-2)/4);i<a.x+a.w+2;i+=4){const a=`${i},${t}`;n.has(a)||(n.add(a),o.push({x:i,y:t,seed:e(i,t)}))}return o}function s(t,e,n,o,a,i,r=1,h=.32){for(let l=0;l<n.length;l++){const c=n[l],d=(a-o[l]*(1-h))/h;if(d<=0)continue;const s=d>=1?0:1-d;let u=c.x,f=c.y;if(s>0){const[t,e]=i(c,s);u+=t,f+=e}t.globalAlpha=r*(1-s*s),t.drawImage(e,2*c.x,2*c.y,8,12,u,f,4,6)}t.globalAlpha=1}function u(t,e){if("undefined"==typeof document||document.getElementById(t))return;const n=document.createElement("style");n.setAttribute("id",t),n.textContent=e,(document.head??document.documentElement).appendChild(n)}export{d as blocksOf,s as drawBlocks,a as drawCover,o as imageFor,n as imageReady,u as injectStyle,c as snapshot,i as toneOf};//# sourceMappingURL=chunk-PCGRRX5P.js.map
@@ -1 +1 @@
1
- import{scenePreset as e,FIELD_GRAPHITE as t,narrow as r}from"./chunk-C3C7AYKL.js";var l=e({id:"swell",name:"Swell",description:"A fine grid that swells in slow rolling waves, quiet in the middle. Dots by default, or characters.",cellSize:10,opacity:.6,scene:"swell",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:t,tune:()=>({scale:r()?1.5:1,contrast:.62,brightness:-.19,blend:"auto",lantern:{radius:.12,strength:.5,trail:1,follow:8},trail:{strength:.7,radius:.35}})});export{l as swell};//# sourceMappingURL=chunk-4ZQFDFEH.js.map
1
+ import{scenePreset as e,FIELD_GRAPHITE as t,narrow as r}from"./chunk-OVCIHOOS.js";var l=e({id:"swell",name:"Swell",description:"A fine grid that swells in slow rolling waves, quiet in the middle. Dots by default, or characters.",cellSize:10,opacity:.6,scene:"swell",mark:"dot",charset:" .:-=+*#",hover:"lantern",graphite:t,tune:()=>({scale:r()?1.5:1,contrast:.62,brightness:-.19,blend:"auto",lantern:{radius:.12,strength:.5,trail:1,follow:8},trail:{strength:.7,radius:.35}})});export{l as swell};//# sourceMappingURL=chunk-PDNKLLBI.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-PCGRRX5P.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-PFQBEWCF.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,P=!1,M=!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(),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)})},I=(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(()=>B(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)}})($||P),N=()=>{$=!0,j()},G=()=>{$=!1,j()},H=()=>{P=!0,j()},R=t=>{w.contains(t.relatedTarget)||(P=!1,j())};function B(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)||($=P=!1,j())},i=k[k.length-1]===n;F()&&(i||L||e)?(A(n.node),I(n.node,!1,e),n.node.dataset.gone="",W(),z.push(setTimeout(o,220))):o()}w.addEventListener("pointerenter",N),w.addEventListener("pointerleave",G),w.addEventListener("focusin",H),w.addEventListener("focusout",R);let D=null;const Q=t=>{if(!g.current.swipe||0!==t.button||D)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&&(D={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(!D||t.pointerId!==D.id)return;const e=performance.now(),n=t.clientX-D.x0;D.v=(n-D.dx)/Math.max(1,e-D.t),D.dx=n,D.t=e,D.item.node.style.setProperty("transform",`translateX(${n}px)`),D.item.node.style.setProperty("opacity",String(i(1-Math.abs(n)/260,.2)))},J=t=>{if(!D||t.pointerId!==D.id)return;const{item:e,dx:n}=D,o=e.node,i=performance.now()-D.t>90?0:D.v;D=null,delete o.dataset.swiping;const a=Math.abs(n)>64||Math.abs(i)>.45&&Math.abs(n)>8;o.style.removeProperty("opacity"),a?(B(e.id,n||i),o.style.setProperty("transform",`translateX(${n+48*Math.sign(n||i)}px)`)):o.style.removeProperty("transform")};w.addEventListener("pointerdown",Q),w.addEventListener("pointermove",q),w.addEventListener("pointerup",J),w.addEventListener("pointercancel",J);return l(()=>T,g,t=>{w.setAttribute("aria-label",t.label),T?.refresh()},{push:t=>{if(M)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=>B(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,()=>B(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,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),I(i,!0)):T?.kick(),X(a),e},dismiss:t=>B(t),clear(){[...k].forEach(t=>B(t.id))},get toasts(){return k.filter(t=>void 0===t.node.dataset.gone).map(t=>t.id)}},()=>{M=!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",R),w.removeEventListener("pointerdown",Q),w.removeEventListener("pointermove",q),w.removeEventListener("pointerup",J),w.removeEventListener("pointercancel",J),k=[],E=[],w.remove(),y.remove(),v.restore()})}var w=u;export{w as TOAST_DEFAULTS,b as hidesInk,v as toastStack};//# sourceMappingURL=chunk-PFNFW4ZI.js.map
@@ -0,0 +1 @@
1
+ import{poster as e,watchPointer as t,liveField as n,requestFieldFrame as o,watchVisibility as r,watchTheme as i,watchMotionPreference as a,cancelFieldFrame as s,disposeKit as c,setPosterSource as l,ambientFactor as u}from"./chunk-XVB3B3FV.js";import{isGlyphFieldSupported 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 P(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 W(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 E=new WeakMap,F=e=>E.get(e)?.()??null;function A(c){const{host:l,layer:f="over",outset:h=0,kit:m}=c;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(!d())return m?.current.poster&&e(l,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(l).position&&y.set(l,"position","relative"),"under"===f&&y.set(l,"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":"",l.appendChild(v);const R=()=>{const e=getComputedStyle(l);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=$(l);const j=()=>M(c.ink(S),l)??M(getComputedStyle(l).color,l)??(S?"#d8d6cf":"#1d1d1b");let W=!1,F=!1,A=!0,B=!1,I=-1/0,z=-1/0;const T=t({target:l,move:e=>{z=e.timeStamp},leave(){}}),H=n({host:l,canvas:v,kit:m,place:g,options:()=>({...w,...c.look(),ink:j(),interactionTarget:l,label:""}),onMount:(e,t)=>{E.set(t,K),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(G,()=>{}),G()},onRelease:()=>{W&&s(X),W=!1},onFail:()=>{ee(),c.onFail?.()}}),L=H.field;R();const V=()=>!!(c.reducedMotion()??b()),D=e=>P(H.canvas,e),q=e=>{const t=H.canvas,n=Math.max(1,t.clientWidth||l.clientWidth+2*h),o=Math.max(1,t.clientHeight||l.clientHeight+2*h),r=c.resolution??1,[i,a]="function"==typeof r?r(n,o):[Math.max(1,Math.round(n*r)),Math.max(1,Math.round(o*r))];x.width===i&&x.height===a||(x.width=i,x.height=a),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,i,a);let s=!1;try{s=c.paint({pen:k,width:i,height:a,w:n,h:o,scale:i/n,now:e,still:V(),dark:S,box:D})}catch(e){"undefined"!=typeof console&&console.error(e)}return L.setSource(x),B||L.redraw(),s};function K(){const e=H.canvas,t=Math.max(1,e.clientWidth||l.clientWidth+2*h),n=Math.max(1,e.clientHeight||l.clientHeight+2*h),o=c.resolution??1,[r,i]="function"==typeof o?o(t,n):[Math.max(1,Math.round(t*o)),Math.max(1,Math.round(n*o))],a=document.createElement("canvas");a.width=r,a.height=i;const s=a.getContext("2d");if(!s)return null;s.fillStyle="#000",s.fillRect(0,0,r,i);try{c.paint({pen:s,width:r,height:i,w:t,h:n,scale:r/t,now:performance.now(),still:!0,dark:S,box:D})}catch{return null}return a}function X(e){if(W=!1,B||F||!H.live)return;if(e-I<(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})()))*u()&&e-z>1e3)return W=!0,void o(X);I=e;!q(e)||V()||!A||"undefined"!=typeof document&&document.hidden||(W=!0,o(X))}function G(){W||B||F||!H.live||(W=!0,o(X))}E.set(v,K);const J="function"==typeof ResizeObserver?new ResizeObserver(()=>{R(),L.resize(),!H.live||B||F||q(performance.now()),G()}):null;J?.observe(l);const N="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{A=e.isIntersecting,A&&G()},{rootMargin:"64px"}):null;N?.observe(l);const Q=r(()=>{document.hidden||G()});let U=!1;const Y=()=>{U=!1,B||(S=$(l),L.update({ink:j()}),c.onTheme?.(),G())},Z=i(()=>{U||B||(U=!0,o(Y))}),_=a(G);function ee(){B||(B=!0,W&&s(X),U&&s(Y),W=U=!1,J?.disconnect(),N?.disconnect(),Q(),T(),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:G,refresh(){B||(S=$(l),L.update({...w,...c.look(),ink:j()}),G())},still:V,dark:()=>S,box:D,play(){F&&(F=!1,L.play(),G())},pause(){F=!0,W&&s(X),W=!1,L.pause()},destroy:ee}}function B(e,t,n,o,r=()=>{}){let i=!1;const a={get supported(){return!!e()&&!i},get field(){return i?null:e()?.field??null},update(e){if(i)return;t.current=W(t.current,e);const o=e.poster;o&&l(t,o),n(t.current)},play(){i||e()?.play()},pause(){i||e()?.pause()},destroy(){i||(i=!0,e()?.destroy(),c(t),r())}};return Object.defineProperties(o,Object.getOwnPropertyDescriptors(a))}export{w as BASE_LOOK,P as boxIn,h as clamp,g as easeOut,B as handle,m as hash,R as hexRgb,v as house,$ as isDark,W as mergeOptions,S as mixHex,A as mountSurface,b as prefersReduced,x as reducedFrom,M as resolveColor,F as settledSource,y as smoothstep,j as srOnly,O as styleKeeper,C as toHex};//# sourceMappingURL=chunk-PFQBEWCF.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var r=e({id:"halo",name:"Halo",description:"A corona breathes slowly round the middle, its rays turning; the centre stays empty for a headline.",cellSize:11,scene:"halo",charset:" .·:-=+*",hover:"lantern",middle:!1,feather:.12});export{r as halo};//# sourceMappingURL=chunk-2CF4PX6U.js.map
1
+ import{scenePreset as e}from"./chunk-OVCIHOOS.js";var r=e({id:"halo",name:"Halo",description:"A corona breathes slowly round the middle, its rays turning; the centre stays empty for a headline.",cellSize:11,scene:"halo",charset:" .·:-=+*",hover:"lantern",middle:!1,feather:.12});export{r as halo};//# sourceMappingURL=chunk-PND73YEV.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-OVCIHOOS.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-PZAQLUAS.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-OVCIHOOS.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-QKZYCROD.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-OVCIHOOS.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-QTVMD62E.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-PCGRRX5P.js";import{styleKeeper as t,mountSurface as o,clamp as r,house as n}from"./chunk-PFQBEWCF.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-QZHZWO7N.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-KTYCGGRO.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),C=Math.ceil(c/u);e.clearRect(0,0,n,c),e.font=`${r}px monospace`,e.textBaseline="top";let b=255,S=255,x=255;if($&&(b=55,S=55,x=55),f){const o=t(f);o&&(b=o.r,S=o.g,x=o.b)}let z=212,k=255,y=0;const G=t(p);G&&(z=G.r,k=G.g,y=G.b);const R=C+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>=C)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(${b},${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-SAQJAH2I.js.map
@@ -1 +1 @@
1
- import{driftNoise as t}from"./chunk-ZRJVOUWH.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-S7RZP2MT.js";var a=680,n=12,o={preview:[{k:.55,blur:6},{k:.8,blur:2.5}],final:{k:1,blur:0}},l=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),s=t=>{const e=t/1e3;return e<60?`${e.toFixed(1)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`},m=async t=>{if("function"==typeof createImageBitmap)return createImageBitmap("string"==typeof t?await(await fetch(t)).blob():t);const e=new Image;return e.crossOrigin="anonymous",e.src="string"==typeof t?t:URL.createObjectURL(t),await e.decode(),e};function c(c,u={}){const g={current:{...u}},h=e(),f=document.createElement("canvas");let b="idle",p=0,d=0,k="",M=null;const w={from:{img:null,k:0,blur:n},to:{img:null,k:0,blur:n},at:-1e6},y=()=>void 0===g.current.image?c.querySelector("img"):g.current.image,v=(t,e)=>{const r=e?1:l((t-w.at)/a),i="generating"===b&&!e&&w.to.img?1-.45*(1-Math.exp(-Math.max(0,t-w.at)/1600)):1,n=(w.from.blur+(w.to.blur-w.from.blur)*r)*i,o=(w.from.img?w.from.k:0)+((w.to.img?w.to.k:0)-(w.from.img?w.from.k:0))*r;return w.to.img??w.from.img?[{img:w.from.img,k:o,blur:n,mix:1},{img:w.to.img,k:o,blur:n,mix:w.from.img?r:1}].filter(t=>t.img):[]},x=(t,e,r)=>{const i=performance.now(),o=M?.still()?1:l((i-w.at)/a),[s]=v(i,!!M?.still());w.from={img:(o>=.5?w.to.img:w.from.img)??w.to.img??w.from.img,k:s?.k??0,blur:s?.blur??n},w.to={img:t,k:e,blur:r},w.at=i,M?.kick()};M=r({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,contrast:1.4,drift:.5,speed:.6,hover:"trail",trail:{strength:.9,radius:.35},...g.current.look}),ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const r=Math.min(480,Math.max(2,Math.round(t)));return[r,Math.max(2,Math.round(r*e/Math.max(1,t)))]},onFail:()=>{M=null,h.restore()},paint:({pen:e,width:r,height:i,now:n,still:o})=>{const l="generating"===b,m=o?0:(n-p)/1e3;l&&g.current.elapsed&&(g.current.elapsed.textContent=s(n-p));const c=l&&!o?1+.12*Math.sin(2.1*m)*(.7+.3*Math.sin(.37*m)):1,u=Math.max(2,Math.ceil(24*i/Math.max(1,r)));24===f.width&&f.height===u||(f.width=24,f.height=u),t(f,3.1+(l?.55*m:0),.35);const h=v(n,o),d=Math.min(1,h[0]?.k??0);e.imageSmoothingEnabled=!0,e.globalAlpha=Math.max(0,1-d),e.filter=`brightness(${1.7*c})`,e.drawImage(f,0,0,r,i);for(const{img:t,k:a,blur:n,mix:o=1}of h){if(!t||a<=0||o<=0)continue;const l=t.width,s=t.height,m=Math.min(s,l*i/r),c=Math.min(l,s*r/i);e.globalAlpha=Math.min(1,1.25*a)*o,e.filter=`brightness(1.3) blur(${n*r/480}px)`,e.drawImage(t,(l-c)/2,Math.max(0,.45*(s-m)),c,m,0,0,r,i)}const k=l&&!o?.6*Math.min(1,d)*(1-Math.max(0,d-.8)/.2):0;return k>.01&&(e.globalCompositeOperation="lighter",e.globalAlpha=k,e.filter=`brightness(${.9*c})`,e.drawImage(f,0,0,r,i),e.globalCompositeOperation="source-over"),e.filter="none",e.globalAlpha=1,l||n-w.at<a}});const R=(t,e)=>{b=t,c.dataset.state=t,c.setAttribute("aria-busy",String("generating"===t)),g.current.onState?.(t,e)},A=t=>{const e=y();e&&M&&(h.set(e,"transition",M.still()?"none":`opacity ${t?560:440}ms cubic-bezier(.45, 0, .25, 1)`),h.set(e,"opacity",t?"1":"0"))},S=t=>new Promise(e=>setTimeout(e,t)),U=t=>{const e=y();e&&(k&&URL.revokeObjectURL(k),k="string"==typeof t?"":URL.createObjectURL(t),e.src=k||t,M||h.set(e,"visibility","visible"))},L=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),R("generating"),A(!1),x(null,0,n);let a=0;try{for await(const e of"function"==typeof t?t():t){if(!r())return b;if(!(e.final??e.preview))continue;if(e.final){U(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){U(e.preview);continue}const t=o.preview[Math.min(a++,o.preview.length-1)];x(await m(e.preview),t.k,t.blur)}if(await S(i?0:544),!r())return b;R("done"),A(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await S(i?0:340),R("failed",t)}return b};{const t=y();t&&h.set(t,M?"opacity":"visibility",M?"0":t.getAttribute("src")?"visible":"hidden")}return g.current.stream&&L(),i(()=>M,g,()=>M?.refresh(),{run:L,reset(){d++,x(null,0,n),R("idle"),A(!1)},get state(){return b}},()=>{d++,k&&URL.revokeObjectURL(k),delete c.dataset.state,c.removeAttribute("aria-busy"),h.restore()})}export{s as elapsedLabel,c as imageGenerate};//# sourceMappingURL=chunk-HTUGMGVA.js.map
1
+ import{driftNoise as t}from"./chunk-BBOSHBZK.js";import{styleKeeper as e,mountSurface as r,handle as i}from"./chunk-PFQBEWCF.js";var a=680,n=12,o={preview:[{k:.55,blur:6},{k:.8,blur:2.5}],final:{k:1,blur:0}},l=t=>.5-.5*Math.cos(Math.PI*Math.min(1,Math.max(0,t))),s=t=>{const e=t/1e3;return e<60?`${e.toFixed(1)}s`:`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,"0")}`},m=async t=>{if("function"==typeof createImageBitmap)return createImageBitmap("string"==typeof t?await(await fetch(t)).blob():t);const e=new Image;return e.crossOrigin="anonymous",e.src="string"==typeof t?t:URL.createObjectURL(t),await e.decode(),e};function c(c,u={}){const g={current:{...u}},h=e(),f=document.createElement("canvas");let b="idle",p=0,d=0,k="",M=null;const w={from:{img:null,k:0,blur:n},to:{img:null,k:0,blur:n},at:-1e6},y=()=>void 0===g.current.image?c.querySelector("img"):g.current.image,v=(t,e)=>{const r=e?1:l((t-w.at)/a),i="generating"===b&&!e&&w.to.img?1-.45*(1-Math.exp(-Math.max(0,t-w.at)/1600)):1,n=(w.from.blur+(w.to.blur-w.from.blur)*r)*i,o=(w.from.img?w.from.k:0)+((w.to.img?w.to.k:0)-(w.from.img?w.from.k:0))*r;return w.to.img??w.from.img?[{img:w.from.img,k:o,blur:n,mix:1},{img:w.to.img,k:o,blur:n,mix:w.from.img?r:1}].filter(t=>t.img):[]},x=(t,e,r)=>{const i=performance.now(),o=M?.still()?1:l((i-w.at)/a),[s]=v(i,!!M?.still());w.from={img:(o>=.5?w.to.img:w.from.img)??w.to.img??w.from.img,k:s?.k??0,blur:s?.blur??n},w.to={img:t,k:e,blur:r},w.at=i,M?.kick()};M=r({host:c,layer:"under",look:()=>({blend:"coarse",mark:"glyph",charset:" .:-=+*#%@",font:'"Geist", Arial, sans-serif',fontWeight:500,cellSize:7,cellAspect:.8,glyphScale:.8,contrast:1.4,drift:.5,speed:.6,hover:"trail",trail:{strength:.9,radius:.35},...g.current.look}),ink:()=>g.current.ink??"--ascii-ink-strong",kit:g,reducedMotion:()=>g.current.reducedMotion,resolution:(t,e)=>{const r=Math.min(480,Math.max(2,Math.round(t)));return[r,Math.max(2,Math.round(r*e/Math.max(1,t)))]},onFail:()=>{M=null,h.restore()},paint:({pen:e,width:r,height:i,now:n,still:o})=>{const l="generating"===b,m=o?0:(n-p)/1e3;l&&g.current.elapsed&&(g.current.elapsed.textContent=s(n-p));const c=l&&!o?1+.12*Math.sin(2.1*m)*(.7+.3*Math.sin(.37*m)):1,u=Math.max(2,Math.ceil(24*i/Math.max(1,r)));24===f.width&&f.height===u||(f.width=24,f.height=u),t(f,3.1+(l?.55*m:0),.35);const h=v(n,o),d=Math.min(1,h[0]?.k??0);e.imageSmoothingEnabled=!0,e.globalAlpha=Math.max(0,1-d),e.filter=`brightness(${1.7*c})`,e.drawImage(f,0,0,r,i);for(const{img:t,k:a,blur:n,mix:o=1}of h){if(!t||a<=0||o<=0)continue;const l=t.width,s=t.height,m=Math.min(s,l*i/r),c=Math.min(l,s*r/i);e.globalAlpha=Math.min(1,1.25*a)*o,e.filter=`brightness(1.3) blur(${n*r/480}px)`,e.drawImage(t,(l-c)/2,Math.max(0,.45*(s-m)),c,m,0,0,r,i)}const k=l&&!o?.6*Math.min(1,d)*(1-Math.max(0,d-.8)/.2):0;return k>.01&&(e.globalCompositeOperation="lighter",e.globalAlpha=k,e.filter=`brightness(${.9*c})`,e.drawImage(f,0,0,r,i),e.globalCompositeOperation="source-over"),e.filter="none",e.globalAlpha=1,l||n-w.at<a}});const A=(t,e)=>{b=t,c.dataset.state=t,c.setAttribute("aria-busy",String("generating"===t)),g.current.onState?.(t,e)},S=t=>{const e=y();e&&M&&(h.set(e,"transition",M.still()?"none":`opacity ${t?560:440}ms cubic-bezier(.45, 0, .25, 1)`),h.set(e,"opacity",t?"1":"0"))},L=t=>new Promise(e=>setTimeout(e,t)),O=t=>{const e=y();e&&(k&&URL.revokeObjectURL(k),k="string"==typeof t?"":URL.createObjectURL(t),e.src=k||t,M||h.set(e,"visibility","visible"))},R=async(t=g.current.stream)=>{if(!t)return b;const e=++d,r=()=>e===d,i=!!M?.still();p=performance.now(),A("generating"),S(!1),x(null,0,n);let a=0;try{for await(const e of"function"==typeof t?t():t){if(!r())return b;if(!(e.final??e.preview))continue;if(e.final){O(e.final),M&&x(await m(e.final),o.final.k,o.final.blur);break}if(!M){O(e.preview);continue}const t=o.preview[Math.min(a++,o.preview.length-1)];x(await m(e.preview),t.k,t.blur)}if(await L(i?0:544),!r())return b;A("done"),S(!0),M?.kick()}catch(t){if(!r())return b;x(null,0,n),await L(i?0:340),A("failed",t)}return b};{const t=y();t&&h.set(t,M?"opacity":"visibility",M?"0":t.getAttribute("src")?"visible":"hidden")}return g.current.stream&&R(),i(()=>M,g,()=>M?.refresh(),{run:R,reset(){d++,x(null,0,n),A("idle"),S(!1)},get state(){return b}},()=>{d++,k&&URL.revokeObjectURL(k),delete c.dataset.state,c.removeAttribute("aria-busy"),h.restore()})}export{s as elapsedLabel,c as imageGenerate};//# sourceMappingURL=chunk-SE6MQQLB.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var n=e({id:"constellation",name:"Constellation",description:"Points wander and neighbours close enough are linked by fine lines that come and go.",cellSize:11,scene:"constellation",charset:" .·:+*#",hover:"lantern",tune:()=>({blend:"off"})});export{n as constellation};//# sourceMappingURL=chunk-NURPDP3Y.js.map
1
+ import{scenePreset as e}from"./chunk-OVCIHOOS.js";var n=e({id:"constellation",name:"Constellation",description:"Points wander and neighbours close enough are linked by fine lines that come and go.",cellSize:11,scene:"constellation",charset:" .·:+*#",hover:"lantern",tune:()=>({blend:"off"})});export{n as constellation};//# sourceMappingURL=chunk-SQGJ263V.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-KTYCGGRO.js";import{mixHex as e}from"./chunk-PFQBEWCF.js";function r(l,e,r,a,i={}){const{fontSize:n=13,baseChars:f="ATCG",bridgeChars:h="-=≡",color:c="#00e5ff",color2:s="#ff4081",bridgeColor:b="#88ffcc",speed:g=1,helixCount:M,lightMode:p=!1}=i,d=.62*n,m=1.4*n,u=Math.ceil(e/d),C=Math.ceil(r/m),$=M??Math.max(1,Math.floor(e/80)),x=u/$,S=o(c)??{r:0,g:229,b:255},k=o(s)??{r:255,g:64,b:129},A=o(b)??{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*g,z=.35*x;for(let o=0;o<$;o++){const e=x*(o+.5);for(let r=0;r<C;r++){const a=r/C*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 b=t(31*o+7*r,3),g=f[Math.floor(b*f.length)],M=.5*(Math.sin(a)+1),p=.5*(Math.sin(a+Math.PI)+1);if(l.globalAlpha=.35+.65*M,l.fillStyle=`rgb(${S.r},${S.g},${S.b})`,l.fillText(g,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*(M+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-SVXRMHUJ.js.map
@@ -0,0 +1 @@
1
+ import{MONO as t,GRAPHITE_LIGHT as e,GRAPHITE_DARK as o,pixelSnap as r,parseColor as n,band as c,ditherIndex as i,toneAlpha as a,vnoise as l}from"./chunk-ZCHGV2CV.js";import{mountCanvas as s}from"./chunk-KTYCGGRO.js";function h(s,h,f,d,g={x:.5,y:.5},u={}){const{fontSize:m=13,chars:M=" .:-=+*#%@",accentColor:p,color:$,octaves:x=4,speed:S=1,scale:b=1,accentThreshold:C=.9,mouseWarp:y=.3,lightMode:z=!1}=u,k=Array.from(M),G=.62*m,T=1.3*m,j=Math.ceil(h/G),v=Math.ceil(f/T);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const w=z?e:o;let A=w.r,R=w.g,V=w.b;const q=r(s);if($){const t=n($);t&&(A=t.r,R=t.g,V=t.b)}let B=A,H=R,K=V;const N=p?n(p):null;N&&(B=N.r,H=N.g,K=N.b);const O=.035*b,W=d*S,Y=Math.min(6,Math.max(1,x)),Z=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<Y;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<v;t++)for(let e=0;e<j;e++){const o=e*O+.06*W,r=t*O*1.3-.04*W,n=e/j-g.x,l=t/v-g.y,h=Math.sqrt(n*n+l*l),f=y>0?.12*Math.max(0,1-h/y):0,d=Z(o+f*Math.sin(1.3*W+8*l),r+f*Math.cos(.9*W+8*n)),m=c(.5*d+.5,.7,.83);if(m<=0)continue;const M=k[i(m,k.length,e,t,u.ditherStrength)];if(" "===M)continue;const p=!!N&&m>C,$=a(m);s.fillStyle=p?`rgba(${B},${H},${K},${$})`:`rgba(${A},${R},${V},${$})`,s.fillText(M,q(e*G),q(t*T))}}var f={id:"noise",name:"Noise",description:"A slow fractal noise field that warps around the cursor.",cellSize:13,speed:.5,cursor:!0,mount:t=>s(t,(t,e,o,r,n,c)=>h(t,e,o,r,n,{ditherStrength:c.ditherStrength,fontSize:c.fontSize,chars:c.chars,lightMode:c.lightMode,color:c.ink,accentColor:c.accent}))};export{f as noise,h as renderNoiseBackground};//# sourceMappingURL=chunk-UO4U32P7.js.map
@@ -1 +1 @@
1
- import{hash as t,settledSource as e}from"./chunk-S7RZP2MT.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-BNVRKD3V.js.map
1
+ import{hash as t,settledSource as e}from"./chunk-PFQBEWCF.js";var o=t=>{const e=Math.round(255*Math.min(1,Math.max(0,t)));return`rgb(${e} ${e} ${e})`},n=t=>{if(!t||"transparent"===t)return 0;const e=/\/\s*([\d.]+)(%?)\s*\)$/.exec(t);if(e)return parseFloat(e[1])/(e[2]?100:1);const o=/^rgba\([^)]*,\s*([\d.]+)\s*\)$/.exec(t);return o?parseFloat(o[1]):1},i=/^(IMG|PICTURE|VIDEO|CANVAS|SVG|svg)$/;function a(t,a,s,c){const d=(t,e)=>Math.max(0,Math.min(parseFloat(t.borderTopLeftRadius)||0,e.w/2,e.h/2)),f=[a,...a.querySelectorAll("*")];t.save();for(const l of f){if("CANVAS"===l.tagName&&void 0!==l.dataset?.asciiKit){if(!c||l===c.skip)continue;const o=s(l),n=o.w>0&&o.h>0?e(l):null;n&&(t.globalCompositeOperation="lighter",t.drawImage(n,o.x,o.y,o.w,o.h),t.globalCompositeOperation="source-over");continue}if(void 0!==l.dataset?.asciiPoster)continue;const f=s(l);if(f.w<=0||f.h<=0)continue;const h=getComputedStyle(l);if("hidden"===h.visibility||"none"===h.display)continue;const u=n(h.backgroundColor)>.03,g=(parseFloat(h.borderTopWidth)||0)>0&&n(h.borderTopColor)>.1;if(t.beginPath(),l===a)(u||g)&&(t.strokeStyle=o(.42),t.lineWidth=3,t.roundRect(f.x+1.5,f.y+1.5,f.w-3,f.h-3,d(h,f)),t.stroke());else{if(i.test(l.tagName)){t.fillStyle=o(.5),f.w<32&&f.h<32?t.arc(f.x+f.w/2,f.y+f.h/2,.36*Math.min(f.w,f.h),0,2*Math.PI):t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill();continue}u?(t.fillStyle=o(.22),t.roundRect(f.x,f.y,f.w,f.h,d(h,f)),t.fill()):g&&(t.strokeStyle=o(.32),t.lineWidth=1.5,t.roundRect(f.x+.75,f.y+.75,f.w-1.5,f.h-1.5,d(h,f)),t.stroke())}if("INPUT"===l.tagName||"TEXTAREA"===l.tagName){const e=l,o=e.value||e.placeholder||"";o&&r(t,o,f.x+(parseFloat(h.paddingLeft)||0),f.y,f.h,h,e.value?.82:.5)}}!function(t,e,o){if("function"!=typeof document.createTreeWalker)return;const n=document.createTreeWalker(e,4),i=document.createRange(),a=o(e),s=e.getBoundingClientRect(),c=s.width/(e.offsetWidth||s.width||1)||1;let d=0;for(let o=n.nextNode();o&&d<2e3;o=n.nextNode()){const n=o.parentElement;if(!n)continue;const f=getComputedStyle(n);if("hidden"===f.visibility||l(n,e))continue;const h=(parseFloat(f.fontWeight)||400)>=600||/^H[1-6]$/.test(n.tagName)?1:.8;for(const e of o.data.matchAll(/\S+/g)){i.setStart(o,e.index),i.setEnd(o,e.index+e[0].length);const n=i.getClientRects()[0];n&&(d++,r(t,e[0],a.x+(n.left-s.left)/c,a.y+(n.top-s.top)/c,n.height/c,f,h))}}i.detach?.()}(t,a,s),t.restore()}function r(t,e,n,i,a,r,l){const s=Math.min(900,(parseFloat(r.fontWeight)||400)+200);t.font=`${r.fontStyle||"normal"} ${s} ${r.fontSize} ${r.fontFamily}`,t.fillStyle=o(l),t.shadowColor=o(l),t.shadowBlur=3,t.textBaseline="middle",t.fillText(e,n,i+a/2),t.shadowBlur=0}function l(t,e){for(;t&&t!==e;t=t.parentElement){const e=t,o=getComputedStyle(e);if(e.offsetWidth<=1&&e.offsetHeight<=1&&"hidden"===o.overflow)return!0;if("inset(50%)"===o.clipPath||"rect(0px, 0px, 0px, 0px)"===o.clip)return!0}return!1}function s(t,e,o,n,i=2,r){const l=document.createElement("canvas");l.width=Math.max(2,Math.round(o*i)),l.height=Math.max(2,Math.round(n*i));const s=l.getContext("2d",{willReadFrequently:!0});return s?(s.setTransform(i,0,0,i,0,0),s.fillStyle="#000",s.fillRect(0,0,o,n),a(s,t,e,r),l):l}var c=4,d=6;function f(e,o=2){const n=e.getContext("2d",{willReadFrequently:!0});if(!n)return[];const i=e.width,a=e.height,r=n.getImageData(0,0,i,a).data,l=[];for(let e=0;e<a/o;e+=6)for(let n=0;n<i/o;n+=4){let s=!1;for(let t=0;t<6*o&&!s;t+=3)for(let l=0;l<4*o&&!s;l+=2){const c=Math.round(n*o+l),d=Math.round(e*o+t);c<i&&d<a&&r[4*(d*i+c)]>10&&(s=!0)}s&&l.push({x:n,y:e,seed:t(n,e)})}return l}function h(t,e,o,n,i,a,r=1,l=.32,s=2){for(let c=0;c<o.length;c++){const d=o[c],f=(i-n[c]*(1-l))/l;if(f<=0)continue;const h=f>=1?0:1-f;let u=d.x,g=d.y;if(h>0){const[t,e]=a(d,h);u+=t,g+=e}t.globalAlpha=r*(1-h*h),t.drawImage(e,d.x*s,d.y*s,4*s,6*s,u,g,4,6)}t.globalAlpha=1}export{d as BLOCK_H,c as BLOCK_W,f as blocksOf,h as drawBlocks,s as snapshot};//# sourceMappingURL=chunk-V6GEQ5Y5.js.map
@@ -1 +1 @@
1
- import{mountSurface as t}from"./chunk-S7RZP2MT.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-KWTF6Q5W.js.map
1
+ import{mountSurface as t}from"./chunk-PFQBEWCF.js";var e=class{constructor(t=1,e=3.5,s=!1){this.strokes=[],this.advected=[0,0,0],this.previous=null,this.energy=0,this.continuousWake=s,this.decayRate=e,this.aspect=Math.max(.25,Math.min(4,t));const i=s?96:64;this.columns=this.aspect>=1?i:Math.round(i*this.aspect),this.rows=this.aspect>=1?Math.round(i/this.aspect):i,this.front=new Float32Array(this.columns*this.rows*3),this.back=new Float32Array(this.front.length)}get active(){return this.energy>5e-4||this.strokes.length>0}move(t,e){if(!Number.isFinite(t+e))return;if(this.continuousWake&&!this.previous)return void(this.previous={x:t,y:e});const s=this.previous??{x:t-.004,y:e-.001},i=Math.max(-.09,Math.min(.09,t-s.x)),n=Math.max(-.09,Math.min(.09,e-s.y));if(this.previous={x:t,y:e},Math.abs(i)+Math.abs(n)<1e-4)return;const a=Math.min(1,25*Math.hypot(i*this.aspect,n)+.06);this.strokes.push({x:t,y:e,dx:i,dy:n,speed:a,fromX:s.x,fromY:s.y}),this.strokes.length>12&&this.strokes.shift()}leave(){this.previous=null}clear(){this.front.fill(0),this.back.fill(0),this.strokes.length=0,this.previous=null,this.energy=0}read(t,e,s,i){const n=Math.max(0,Math.min(this.columns-1.001,e*(this.columns-1))),a=Math.max(0,Math.min(this.rows-1.001,s*(this.rows-1))),h=Math.floor(n),o=Math.floor(a),r=n-h,c=a-o,l=3*(o*this.columns+h),m=l+3*this.columns,u=1-r,d=1-c;i[0]=(t[l]*u+t[l+3]*r)*d+(t[m]*u+t[m+3]*r)*c,i[1]=(t[l+1]*u+t[l+4]*r)*d+(t[m+1]*u+t[m+4]*r)*c,i[2]=(t[l+2]*u+t[l+5]*r)*d+(t[m+2]*u+t[m+5]*r)*c}sample(t,e,s){this.read(this.front,t,e,s)}step(t){if(!this.active)return;const e=Math.max(0,Math.min(.05,t)),s=Math.exp(-e*this.decayRate),i=Math.exp(-e*(this.decayRate+.5)),n=Math.max(1,this.aspect),a=Math.max(1,1/this.aspect);let h=0;for(let t=0;t<this.rows;t++)for(let o=0;o<this.columns;o++){const r=3*(t*this.columns+o),c=o/(this.columns-1),l=t/(this.rows-1),m=this.continuousWake?.65:2,u=c-this.front[r]*e*m,d=l-this.front[r+1]*e*m;this.read(this.front,u,d,this.advected);let M=this.advected[0]*s,f=this.advected[1]*s,p=this.advected[2]*i;for(const t of this.strokes){let e=(c-t.x)*n,s=(l-t.y)*a;if(this.continuousWake){const i=(c-t.fromX)*n,h=(l-t.fromY)*a,o=(t.x-t.fromX)*n,r=(t.y-t.fromY)*a,m=Math.max(0,Math.min(1,(i*o+h*r)/(o*o+r*r||1)));e=i-o*m,s=h-r*m;const u=e*e+s*s;if(u>.0225)continue;const d=Math.exp(-u/.0032),v=Math.hypot(t.dx*n,t.dy*a),x=Math.min(.025,.55*v);M+=(4.2*t.dx-s*x)*d,f+=(4.2*t.dy+e*x)*d,p=Math.max(p,Math.min(.7,18*v)*d);continue}const i=e*e+s*s;if(i>.045)continue;const h=Math.exp(-i/.0075),o=t.speed;M+=(2.8*t.dx-s*o*.16)*h,f+=(2.8*t.dy+e*o*.16)*h,p+=o*h*.3}this.back[r]=Math.max(-.18,Math.min(.18,M)),this.back[r+1]=Math.max(-.18,Math.min(.18,f)),this.back[r+2]=Math.min(.8,p),h=Math.max(h,Math.abs(M),Math.abs(f),p)}[this.front,this.back]=[this.back,this.front],this.strokes.length=0,this.energy=h,this.active||this.clear()}};var s=" .:+-=xICA$FY#@",i=.58,n=72649.5/59542.5;var a={id:"fluid",name:"Fluid",description:"Flowing folds with a soft wake behind the cursor. The original Asciify hero.",cellSize:7,speed:1,cursor:!0,opacity:.7,mount:function(a){const{host:h}=a;let o=new e(1),r=1,c=12,l=0,m=!1,u=null;const d=[],M=(t,e)=>((t,e,s)=>Math.max(t,Math.sqrt(e*s*i/26e3)))(a.settings().cellSize,t,e),f=t({host:h,kit:a.kit,layer:"under",look:()=>{const t=a.settings();return{mark:"glyph",charset:t.charset??s,font:'"JetBrains Mono", monospace',fontWeight:400,cellSize:M(h.clientWidth||1,h.clientHeight||1)/i,cellAspect:i,glyphScale:.9,cellFit:"fill",maxPixelRatio:1.5,clear:!!t.clear&&{element:t.clear,padding:8,feather:.22,shape:"ellipse"},color:"ink",shade:0,levels:"none",fit:"cover",gamma:1,contrast:n,brightness:-.0004316244699164449-.5/Math.max(1,Array.from(t.charset??s).length-1),...t.look}},ink:t=>a.ink(t)??"#8f8d86",resolution:(t,e)=>{const s=Math.max(192,Math.min(384,Math.ceil(Math.max(t,e*i)/M(t,e)))),n=t/e;return n>=1?[s,Math.max(1,Math.round(s/n))]:[Math.max(1,Math.round(s*n)),s]},reducedMotion:a.reducedMotion,onFail:()=>a.onFail(),paint:({pen:t,width:s,height:i,w:n,h:M,now:f,still:p})=>{const v=a.settings(),x=l?Math.min(.05,(f-l)/1e3):1/60;l=f,p||(c+=x*v.speed);const g=n/M;if(Math.abs(g-r)>.01&&(o=new e(g),r=g),p||!v.cursor)o.clear(),d.length=0;else{const t=h.getBoundingClientRect();if(t.width&&t.height)for(const e of d)o.move((e.x-t.left)/t.width,(e.y-t.top)/t.height);d.length=0,m&&(o.leave(),m=!1),o.step(x)}u&&u.width===s&&u.height===i||(u=t.createImageData(s,i));const y=u.data;!function(t,e,s,i,n,a){const h=[0,0,0],o=a.active;for(let r=0;r<s;r++)for(let c=0;c<e;c++){const l=c/e,m=r/s;o&&a.sample(l,m,h);const u=(l-.5-h[0])*i,d=m-.5-h[1],M=u+.22*Math.sin(5.2*d+.17*n)+.15*Math.sin(2.4*u-3.1*d-.1*n),f=d+.19*Math.sin(3.5*u+.13*n),p=Math.hypot(.8*M+.18,1.1*f),v=.5+.5*Math.sin(14*p-2.8*M+1.4*Math.sin(5*f)-.24*n),x=.5+.5*Math.sin(3.6*M-2.9*f+.09*n),g=Math.max(0,Math.min(1,v*v*(.48+.32*x)-.075+.75*h[2])),y=Math.round(255*g),k=4*(r*e+c);t[k]=t[k+1]=t[k+2]=y,t[k+3]=255}}(y,s,i,g,c,o);for(let t=0;t<y.length;t+=4){const e=y[t]<10?0:Math.min(255,1.45*y[t]);y[t]=y[t+1]=y[t+2]=.299*e+e*(185/232)*.587,y[t+3]=255}return t.putImageData(u,0,0),!0}});if(!f)return null;const p=t=>{if(t.target instanceof Element&&t.target.closest("button, a, input, select, summary, textarea"))return m=!0,void f.kick();d.push({x:t.clientX,y:t.clientY}),d.length>6&&d.shift(),f.kick()},v=()=>{m=!0,f.kick()};return h.addEventListener("pointermove",p),h.addEventListener("pointerdown",p),h.addEventListener("pointerleave",v),h.addEventListener("pointercancel",v),{get field(){return f.field},get canvas(){return f.canvas},refresh:()=>f.refresh(),play:()=>{l=0,f.play()},pause:()=>f.pause(),destroy(){h.removeEventListener("pointermove",p),h.removeEventListener("pointerdown",p),h.removeEventListener("pointerleave",v),h.removeEventListener("pointercancel",v),f.destroy()}}}};export{a as fluid};//# sourceMappingURL=chunk-VFV7HZ3G.js.map
@@ -1 +1 @@
1
- import{scenePreset as e}from"./chunk-C3C7AYKL.js";var a=e({id:"cascade",name:"Cascade",description:"Streaks fall in three depths: far ones faint and slow, near ones rare, bright and quick.",cellSize:11,scene:"cascade",charset:" .:;|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.22,y:.25,width:.56,height:.5,feather:.3,shape:"ellipse"}});export{a as cascade};//# sourceMappingURL=chunk-DZ5XGHTJ.js.map
1
+ import{scenePreset as e}from"./chunk-OVCIHOOS.js";var a=e({id:"cascade",name:"Cascade",description:"Streaks fall in three depths: far ones faint and slow, near ones rare, bright and quick.",cellSize:11,scene:"cascade",charset:" .:;|",hover:"lantern",tune:()=>({blend:"off"}),middle:{x:.22,y:.25,width:.56,height:.5,feather:.3,shape:"ellipse"}});export{a as cascade};//# sourceMappingURL=chunk-WT3XOWAI.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-PFQBEWCF.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=[],P=0,T=0,F=0,W="",q=-1,z=null;const D=()=>{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)}},R=()=>p.getBoundingClientRect().width/(p.clientWidth||1)||1,$=t=>o(x.current.ink??"--ascii-ink-strong",p)??o(getComputedStyle(p).color,p)??(t?"#d8d6cf":"#1d1d1b");z=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:()=>{z=null},onTheme:()=>{W=""},paint:({pen:t,w:e,h:n,now:i,still:s,dark:u,box:m})=>{const f=D();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,P=E.y+E.h/2,T=Math.min(E.w/2,n/2-2)*y,F=L?a($(u),(t=>o(x.current.color??"--ascii-success",p,t?"#3ccf7e":"#17844a"))(u),d(r(s?1:(i-S)/360))):$(u);F!==W&&(W=F,z?.field.update({ink:F})),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 q=f.pad+A.x+f.size/2,R=L?1:w.x,H=c(0,I-T,v),B=c(q,I+T,v),G=c(0,P-T,v),X=c(n,P+T,v);if(B-H>1&&R>.004){const e=t.createLinearGradient(H,0,B,0);e.addColorStop(0,`rgba(255,255,255,${c(.14,1,v)*R})`),e.addColorStop(.62,`rgba(255,255,255,${c(.48,1,v)*R})`),e.addColorStop(1,`rgba(255,255,255,${R})`),t.fillStyle=e,t.globalAlpha=M*(1-.28*b),t.beginPath(),t.roundRect(H,G,B-H,X-G,c(0,T,v)),t.fill()}return b>0&&(t.globalAlpha=1,t.fillStyle="#000",t.beginPath(),t.arc(I,P,Math.max(0,T-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*T,P+.07*T,.55*T,g,M,4.5),!1}});const H=()=>{const t=D();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)))},B=t=>{P=0;const e=Math.min(1/30,Math.max(0,(t-T)/1e3));T=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(),z?.kick(),(r||M||L&&t-S<760||C>0)&&(P=requestAnimationFrame(B))},G=()=>{P||(T=performance.now(),P=requestAnimationFrame(B))},X=()=>{const t=D();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")),F&&clearTimeout(F),x.current.resetAfter>0&&(F=setTimeout(j,x.current.resetAfter)),H(),G(),x.current.onConfirm?.()};function j(){if(F&&clearTimeout(F),F=0,!L)return A.to=0,w.to=0,void G();C=performance.now(),p.dataset.state="resetting",g?.removeAttribute("aria-valuetext"),G()}const J=t=>{const e=D();if(!M||!e||void 0!==t&&void 0!==t.pointerId&&t.pointerId!==q)return;M=!1;const n=h(I,performance.now());A.x>=e.max*x.current.threshold||n>900&&A.x>.5*e.max?X():(A.to=0,A.v=.25*r(n,-1500,1500),w.to=0,y()&&(f(A),f(w)),p.dataset.state="idle",G())},Q=t=>{if(0===t.button&&!L&&g)if(g.contains(t.target)){try{g.setPointerCapture?.(t.pointerId)}catch{}q=t.pointerId,M=!0,E=t.clientX-A.x*R(),w.to=1,I=[],p.dataset.state="dragging",G()}else M||y()||(A.v+=420,w.to=0,G())},U=t=>{const e=D();M&&e&&t.pointerId===q&&(A.x=A.to=r((t.clientX-E)/R(),0,e.max),A.v=0,I.push([A.x,performance.now()]),I.length>8&&I.shift(),A.x>=e.max-.5?X():G())},K=t=>{const e=D();if(!e||L)return;if("Enter"===t.key||" "===t.key||"End"===t.key)return t.preventDefault(),void X();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?X():G())};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",Q),p.addEventListener("pointermove",U),p.addEventListener("pointerup",J),p.addEventListener("pointercancel",J),p.addEventListener("lostpointercapture",J),p.addEventListener("dragstart",N),n(()=>z,x,()=>z?.refresh(),{confirm:X,reset:j,get confirmed(){return L}},()=>{P&&cancelAnimationFrame(P),F&&clearTimeout(F),P=F=0,g?.removeEventListener("keydown",K),p.removeEventListener("pointerdown",Q),p.removeEventListener("pointermove",U),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-XDNCXCR7.js.map
@@ -0,0 +1 @@
1
+ import{mountGlyphField as e}from"../field.js";var t=new Set,n=0,o=0,r=null,a=[],i=0,s=1,l=0,c=0;function u(e){n=0,i&&e>i&&(a.push(e-i),a.length>120&&a.shift()),i=e,o=performance.now();const r=[...t];t.clear();for(const t of r)try{t(e)}catch(e){"undefined"!=typeof console&&console.error(e)}const u=performance.now()-o;if(l=.9*l+.1*u,e-c>500){c=e;const t=function(){if(a.length<20)return 1e3/60;const e=[...a].sort((e,t)=>e-t);return Math.min(1e3/60,Math.max(1e3/360,e[Math.floor(.2*e.length)]))}(),n=!1;(l>.5*t||n)&&s<3?s++:l<.2*t&&!n&&s>1&&s--}t.size||(i=0)}var d=()=>s;function m(e){t.add(e),n&&r!==requestAnimationFrame&&(n=0),n||(r=requestAnimationFrame,n=requestAnimationFrame(u))}function f(e){t.delete(e),!t.size&&n&&(cancelAnimationFrame(n),n=0,i=0)}var h=new Set,p=new Set,g=new Set,y=new Set,v=new Set,w=!1,b=null,k=null,x=null,E=null,M=e=>{let t=null;for(const n of h){if(n.target===window){(!n.near||n.near()||n.inside)&&n.move(e);continue}t??(t=e.composedPath());t.includes(n.target)?(n.inside=!0,n.move(e)):n.inside&&(n.inside=!1,n.leave())}},S=()=>{for(const e of h)e.inside=!1,e.leave()},L=()=>{for(const e of[...p])e()},A=()=>{for(const e of[...g])e()},C=()=>{for(const e of[...y])e()},P=e=>{for(const t of[...v])t(e)};function z(){const e=h.size+p.size+g.size+y.size+v.size>0;if("undefined"==typeof document)return;if(b!==document&&(w=!1,b=document,k=x=null,E=null),e===w)return;w=e;const t=e?"addEventListener":"removeEventListener";if("undefined"!=typeof window&&(window[t]?.("pointermove",M,{capture:!0,passive:!0}),window[t]?.("pointerdown",M,{capture:!0,passive:!0})),document[t]?.("pointerleave",S),document[t]?.("visibilitychange",L),("undefined"==typeof document?void 0:document.fonts)?.[t]?.("loadingdone",P),k??(k="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null),x??(x="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null),k?.[t]?.("change",A),x?.[t]?.("change",C),e){E??(E="function"==typeof MutationObserver?new MutationObserver(C):null);for(const e of[document.documentElement,document.body])e&&E?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]})}else E?.disconnect()}var W=(e,t)=>(e.add(t),z(),()=>{e.delete(t)&&z()});function F(e){const t=e.target;if("undefined"==typeof window||t===window||"undefined"==typeof document)return W(h,e);const n=t,o=n.getRootNode?.();if(n.ownerDocument===document&&(!o||o===document))return W(h,e);const r=e.move,a=()=>e.leave();return n.addEventListener("pointermove",r,{passive:!0}),n.addEventListener("pointerdown",r,{passive:!0}),n.addEventListener("pointerleave",a),()=>{n.removeEventListener("pointermove",r),n.removeEventListener("pointerdown",r),n.removeEventListener("pointerleave",a)}}var T=e=>W(p,e),O=e=>W(g,e),R=e=>W(y,e),$=()=>null,q=new WeakSet,j={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"}},B=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(j,e),I=/\p{L}/u,D=null,N=new Set,X=new Set;function H(e){const{charset:t,style:n}=e??{};D=e?{...t?{charset:t}:{},...B(n)?{style:n}:{}}:null;for(const e of X)e.relook();for(const e of[...N])e(D)}var V=()=>D;function _(e){return N.add(e),()=>{N.delete(e)}}var G=12,J=new Set,K=null,Q=null,U=0,Y=-1e9,Z=0,ee=!1,te=!1,ne=()=>{const e=Q?.timeline?.currentTime;return"number"==typeof e?e:null};function oe(e){G=Number.isFinite(e)&&e>=1?Math.floor(e):12,be()}var re=()=>G,ae=()=>"undefined"!=typeof performance?performance.now():Date.now(),ie=()=>"number"==typeof innerHeight?innerHeight:0;function se(e,t=e.getBoundingClientRect()){if(!1===e.isConnected)return 1/0;if("function"==typeof e.getClientRects&&0===e.getClientRects().length)return 1/0;const n=t.bottom<0?-t.bottom:t.top-ie();return n>0?n:0}function le(){try{const e=Q?.querySelectorAll?.("dialog:modal");return e?.length?e[e.length-1]:null}catch{return null}}var ce=1e8;function ue(e,t){if(e.eager)return void(e.wanted=!0);const n=ie(),o=se(e.host,t);!n||o<=.5*n?e.wanted=!0:o>1*n&&(e.wanted=!1)}function de(e){let t=!1;for(const n of e)if(n?.target)for(const e of J)e.host===n.target&&(ue(e,n.boundingClientRect??void 0),t=!0);t&&be()}var me=()=>be(),fe=-1e9,he=0,pe=()=>{const e=ae();return e>=fe&&e-fe<140},ge=()=>{fe=ae(),clearTimeout(he),he=setTimeout(()=>be(),140)},ye=null,ve=e=>{ye!==e&&(ye?.removeEventListener?.("close",me,!0),ye?.removeEventListener?.("scroll",ge,!0),e?.addEventListener?.("close",me,!0),e?.addEventListener?.("scroll",ge,{capture:!0,passive:!0}),e||clearTimeout(he),ye=e)};function we(e){Q!==e.doc&&(Q=e.doc,J.clear(),U=Z=0,Y=fe=-1e9),ve(Q),J.add(e);const t=function(){const e="function"==typeof IntersectionObserver?IntersectionObserver:null;if(!e)return null;if(K?.ctor!==e){K?.list.forEach(e=>e.disconnect()),K={ctor:e,list:["50% 0px","100% 0px","0px"].map(t=>new e(de,{rootMargin:t}))};for(const e of J)K.list.forEach(t=>t.observe(e.host))}return K.list}();t?.forEach(t=>t.observe(e.host)),t?ue(e):e.wanted=!0,be()}function be(e=!1){if(ee)te=!0;else{ee=!0;try{do{te=!1;const t=ae(),n=ne();(e||(null===n?t-Y>16||t<Y:n!==Y))&&(Y=n??t,Z=0);for(const e of J)!1===e.host.isConnected&&(e.wanted=!1);for(const e of J)e.live&&!e.wanted&&e.release();const o=[...J].filter(e=>e.live&&!e.shared),r=le(),a=e=>!!r&&!r.contains(e.host),i=e=>se(e.host)+(a(e)?ce:0),s=e=>e.eager&&!a(e),l=()=>o.filter(e=>e.live&&!e.shared).map(e=>[e,i(e)+(s(e)?0:1e9)]).sort((e,t)=>t[1]-e[1]);for(let e=o.length-G,t=e>0?l():[];e>0;e--)t.shift()?.[0].release();const c=$(),u=[...J].filter(e=>e.wanted&&!e.live).map(e=>[e,e.eager?-1:i(e)]).sort((e,t)=>e[1]-t[1]);let d=0;const m=pe();for(const[t,n]of u){if(!J.has(t)||t.live)continue;if(m&&!t.eager&&(n>0||t.poster))continue;if(c&&c.roomy,!t.eager&&Z>=4&&(!e||d)){U||(U=requestAnimationFrame(()=>{U=0,be(!0)}));break}if(o.filter(e=>e.live&&!e.shared).length>=G){const e=l()[0]?.[0];if(!e||(s(e)?!t.eager||i(e)<=i(t):!t.eager&&i(e)<=n))break;e.release()}const r=ae();t.mount(),Z+=ae()-r,d++,t.live&&!t.shared&&o.push(t)}}while(te)}finally{ee=!1}}}var ke='ui-monospace, "SF Mono", Menlo, Consolas, monospace',xe=new Map;function Ee(e,t=ke){const n=`${t}\0${e}`,o=xe.get(n);if(o)return o;let r={max:1,mean:1};try{const n="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:48,height:48}).getContext("2d",{willReadFrequently:!0});if(n&&"function"==typeof n.getImageData){n.font=`500 36px ${t}`,n.textAlign="center",n.textBaseline="middle";const o=e=>{n.clearRect(0,0,48,48),n.fillStyle="#000",n.fillText(e,24,25);const t=n.getImageData(0,0,48,48).data;let o=0;for(let e=3;e<t.length;e+=4)o+=t[e];return o/255},a=e=>[...e].filter(e=>e.trim()).map(o),i=e=>e.reduce((e,t)=>e+t,0)/Math.max(1,e.length),s=a(e),l=a(".:-=+*#%@"),c=o("@");s.length&&c>0&&i(l)>0&&(r={max:Math.max(...s)/c,mean:i(s)/i(l)})}}catch{}return xe.set(n,r),r}function Me(e,t){const{max:n,mean:o}=Ee(e,t.font??ke),r=t.glyphScale??.8,a=t.gamma??1,i=t.fontWeight??500;return n>1.15?{glyphScale:Math.max(.3,r*Math.max(.62,n**-.36)),gamma:a,fontWeight:i}:o>1.5?{glyphScale:Math.max(.3,r*o**-.25),gamma:a,fontWeight:i}:n<.85?{glyphScale:Math.min(1.6,r*Math.min(1.3,n**-.3)),gamma:a,fontWeight:n<.6?Math.max(i,700):i}:{glyphScale:r,gamma:a,fontWeight:i}}var Se=new WeakMap;function Le(e,t){for(const n of Se.get(e)?.keys()??[])n.getAttribute("src")!==t&&(n.src=t)}function Ae(e){const t=Se.get(e);Se.delete(e),t?.forEach(e=>e())}var Ce=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches;function Pe(e,t,n,o,r){const a=document.createElement("img");a.alt="",a.decoding="async",a.setAttribute("aria-hidden","true"),a.setAttribute("style",`${n};object-fit:cover${Ce()?"":";transition:opacity 280ms cubic-bezier(.23, 1, .32, 1)"}`),a.style.opacity="1",a.dataset.asciiPoster="",a.src=t;const i=e.style.getPropertyValue("position"),s="function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position;s&&e.style.setProperty("position","relative");const l=e.style.getPropertyValue("isolation"),c=/z-index:\s*-1/.test(n)&&"function"==typeof getComputedStyle&&"auto"===getComputedStyle(e).isolation;c&&e.style.setProperty("isolation","isolate"),r?.parentElement===e?e.insertBefore(a,r):e.appendChild(a);let u=!1;const d=()=>{u||(u=!0,a.remove(),Se.get(o)?.delete(a),s&&(i?e.style.setProperty("position",i):e.style.removeProperty("position")),c&&(l?e.style.setProperty("isolation",l):e.style.removeProperty("isolation")))},m=Se.get(o)??new Map;return m.set(a,d),Se.set(o,m),{show(e){a.style.opacity=e?"1":"0"},remove:d}}function ze(e){const t=document.createElement("canvas");for(const n of e.getAttributeNames?.()??[])"width"!==n&&"height"!==n&&t.setAttribute(n,e.getAttribute(n));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 We(t){const{host:n,kit:o}=t;let r,a=t.canvas,i=null,s=!1,l=!1,c=!1,u=!1,d={},m={},f=t.source,h=!1,p={},g=null,y=null,v=!1,w=null,b=()=>{};const k=!t.ownPoster&&o?.current.poster?Pe(n,o.current.poster,t.place,o,a):null,x=()=>{if(!D||!1===o?.current.globalLook||"glyph"!==(m.mark??"glyph")&&!t.glyphs||I.test(m.charset??""))return;const e=D.style?j[D.style]:void 0,n=e?.mark??"glyph",r="glyph"===n?D.charset||(e&&"charset"in e?e.charset:void 0):void 0;return e||r?{mark:n,charset:r}:void 0},E=()=>({...t.glyphs?Object.fromEntries(Object.keys(t.glyphs()).map(e=>[e,m[e]]).filter(([,e])=>void 0!==e)):{},mark:m.mark??"glyph",charset:m.charset??" .,:-=+*#%@",glyphScale:m.glyphScale??.8,gamma:m.gamma??1,fontWeight:m.fontWeight??500}),M=e=>{if(!e.charset)return{...E(),mark:e.mark};const n=t.glyphs&&"glyph"!==(m.mark??"glyph")?t.glyphs():{};return{...n,mark:e.mark,charset:e.charset,...Me(e.charset,{...m,...n})}},S=()=>{const e=x(),t=e&&`${e.mark}\0${e.charset??""}`;return t===r?null:(r=t,e?M(e):E())},L={host:n,doc:document,eager:!1===o?.current.lazy,wanted:!1,live:!1,poster:!!k||!!t.ownPoster,mount(){if(l||i)return;s&&(a=t.canvas=ze(a)),s=!0,m={...t.options(),...d},r=void 0;const n=S();let o;try{o=e(a,{...m,...n,...void 0===f?{}:{source:f},onError:()=>{i===o&&A()}})}catch{return void A()}i=o,L.live=!0,L.shared=(e=>q.has(e))(a);const c=a;if(L.shared)b=()=>{};else{let e=0;const t=()=>{i===o&&(clearTimeout(e),e=setTimeout(()=>{i===o&&a===c&&(L.release(),be())},1e3))},n=()=>clearTimeout(e);c.addEventListener?.("webglcontextlost",t),c.addEventListener?.("webglcontextrestored",n),b=()=>{clearTimeout(e),c.removeEventListener?.("webglcontextlost",t),c.removeEventListener?.("webglcontextrestored",n)}}h&&o.pause(),o.ready.then(()=>{i===o&&(v=!0,k?.show(!1),g?.(),g=y=null)},()=>{}),t.onMount?.(o,a)},release(){if(!i)return;const e=i;i=null,L.live=!1,v=!1,b(),w?.clear(),w=null,p=e.settings,e.destroy(),L.shared?l||(a.width=a.width,s=!1):((e=>{try{const t=e.getContext("webgl2");t&&!t.isContextLost?.()&&t.getExtension("WEBGL_lose_context")?.loseContext()}catch{}})(a),l||(a=t.canvas=ze(a),s=!1)),k?.show(!0),t.onRelease?.()}};function A(){c||(c=!0,C(),u||t.onFail())}function C(){l||(l=!0,L.release(),function(e){J.delete(e)&&([...J].some(t=>t.host===e.host)||K?.list.forEach(t=>t.unobserve(e.host)),!J.size&&K&&(K.list.forEach(e=>e.disconnect()),K=null),J.size||ve(null),be())}(L),X.delete(P),a.remove(),c?k?.show(!0):k?.remove())}const P={relook(){const e=S();if(!e||!i)return;const n=i,r=v&&!(o?.current.reducedMotion??Ce());w?.clear(),w=null,r&&(n.redraw(),w=function(e,t){if(!e.width||!e.height||"undefined"==typeof document)return null;const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const o=n.getContext("2d");if(!o||"function"!=typeof n.animate)return null;try{o.drawImage(e,0,0)}catch{return null}n.setAttribute("aria-hidden","true"),n.dataset.asciiSweep="",n.setAttribute("style",t);const r=document.createElement("span");let a,i;r.setAttribute("aria-hidden","true"),r.dataset.asciiSweep="",r.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(n,r);const s=()=>{a?.cancel(),i?.cancel(),n.remove(),r.remove()};return{clear:s,reveal(){if(!n.isConnected)return;const t={duration:200,delay:40,easing:"cubic-bezier(.23,1,.32,1)",fill:"both"};a=n.animate([{clipPath:"inset(0% 0% 0% 0%)"},{clipPath:"inset(0% 0% 0% 100%)"}],t);const o=e.clientWidth||e.getBoundingClientRect().width;i=r.animate([{transform:"translateX(0px)",opacity:.35},{opacity:.35,offset:.7},{transform:`translateX(${o}px)`,opacity:0}],t),a.onfinish=s}}}(a,t.place)),n.update(e);const s=w;s&&requestAnimationFrame(()=>requestAnimationFrame(()=>{w===s&&i===n?s.reveal():s.clear()}))}};return{field:{get canvas(){return a},get ready(){return i?i.ready:y??(y=new Promise(e=>{g=e}))},get settings(){return i?.settings??p},update(e){if(d={...d,...e},m={...m,...e},!i)return;const t=S(),n=x();i.update(n?{...e,...M(n)}:t?{...e,...t}:e)},setSource:e=>(f=e,i?i.setSource(e):Promise.resolve()),pointer(e,t){i?.pointer(e,t)},redraw(){i?.redraw()},pulse(e){i?.pulse(e)},play(){h=!1,i?.play()},pause(){h=!0,i?.pause()},resize(){i?.resize()},destroy(){C()}},get canvas(){return a},get live(){return!!i},get failed(){return c},start(){X.add(P),u=!0;try{we(L)}finally{u=!1}},destroy:C}}export{j as KIT_STYLES,d as ambientFactor,Me as balanceCharset,f as cancelFieldFrame,Ae as disposeKit,re as getFieldBudget,V as getGlobalLook,Ee as inkWeight,We as liveField,Pe as poster,m as requestFieldFrame,oe as setFieldBudget,H as setGlobalLook,Le as setPosterSource,_ as subscribeGlobalLook,O as watchMotionPreference,F as watchPointer,R as watchTheme,T as watchVisibility};//# sourceMappingURL=chunk-XVB3B3FV.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-KTYCGGRO.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-XXPDXJMQ.js.map
@@ -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-PCGRRX5P.js";import{styleKeeper as i,clamp as o,mountSurface as c,smoothstep as s,handle as l,prefersReduced as p}from"./chunk-PFQBEWCF.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,F(A[a],e.x)}),o||(b=0),o}function F(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 L=()=>{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,L(),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 P=0,S=0,j=0,R=0,T=0;const q=()=>{P&&clearTimeout(P),P=0},N=A.map((e,t)=>{const a=e=>{if("mouse"!==e.pointerType)return;const a=e.timeStamp||performance.now(),n=Math.max(1,a-j);if(R=j&&n<100?.5*R+Math.abs(e.clientX-S)/n*.5:0,S=e.clientX,j=a,T!==t&&q(),T=t,t!==x)return R<.3?(q(),void C(t)):void(P||(P=setTimeout(()=>{P=0,C(T)},90)));q()},n=()=>{q(),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=()=>{q(),j=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"),B=u.getAttribute("aria-label");return X||u.setAttribute("role","group"),B||u.setAttribute("aria-label",m.current.label),A.forEach((e,t)=>{F(e,w[t].x),u.appendChild(e)}),L(),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=>{B||u.setAttribute("aria-label",e.label),E?.refresh()},{select:C,get open(){return x}},()=>{N.forEach(e=>e()),q(),g&&cancelAnimationFrame(g),u.removeEventListener("pointerleave",z),A.forEach(e=>e.remove()),delete u.dataset.asciiAccordion,delete u.dataset.asciiField,X||u.removeAttribute("role"),B||u.removeAttribute("aria-label"),f.restore()})}export{u as accordion};//# sourceMappingURL=chunk-XYLLL2PQ.js.map
@@ -1 +1 @@
1
- import{styleKeeper as t,mountSurface as e,handle as r,hash as n,prefersReduced as o,clamp as a,house as i}from"./chunk-S7RZP2MT.js";var s={length:6,accept:"digits",cells:"[data-cell]"},l=560,c=t=>{const e=Math.round(255*a(t));return`rgb(${e} ${e} ${e})`},u=(t,e,r="digits")=>("digits"===r?t.replace(/\D/g,""):t.replace(/[^a-z\d]/gi,"").toUpperCase()).slice(0,e);function d(d,h={}){const p={current:{...s,...h}},f=t(),m=t(),g=[],v=()=>!!(p.current.reducedMotion??o()),b=()=>Math.max(1,Math.round(p.current.length));let y="",x="idle",M=!1,A=[],w="",E=-1e9,S="",k=-1e9,C=[],$=[],L=0,P=null;const T=new Map;"static"===getComputedStyle(d).position&&f.set(d,"position","relative");let B=d.querySelector("input");B||(B=document.createElement("input"),B.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;font-size:16px;cursor:text"),d.appendChild(B),g.push(B));const q=B;q.setAttribute("inputmode","digits"===p.current.accept?"numeric":"text"),q.setAttribute("autocomplete","one-time-code"),q.setAttribute("maxlength",String(b())),"digits"===p.current.accept&&q.setAttribute("pattern","[0-9]*"),q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.setAttribute("aria-label",`Verification code, ${b()} ${"digits"===p.current.accept?"digits":"characters"}`);const z=()=>{const t=[...d.querySelectorAll(p.current.cells)];for(;t.length<b();){const e=document.createElement("span");e.dataset.cell="",e.setAttribute("aria-hidden","true"),q.parentElement===d?d.insertBefore(e,q):d.appendChild(e),g.push(e),t.push(e)}return t.slice(0,b())},I=t=>{let e=t.querySelector("[data-digit]");return e||(e=document.createElement("span"),e.dataset.digit="",t.appendChild(e),g.push(e)),e},W=(t,e,r,o,a,i,s,l=1,c=0,u=0,d=1)=>{const h=((t,e,r,n)=>{const o=`${t}|${Math.round(e)}x${Math.round(r)}|${n}`;let a=T.get(o);if(!a){a=document.createElement("canvas"),a.width=Math.max(2,Math.round(2*e)),a.height=Math.max(2,Math.round(2*r));const i=a.getContext("2d");i&&(i.scale(2,2),i.fillStyle="#fff",i.shadowColor="#fff",i.shadowBlur=3,i.font=`600 ${Math.round(.6*r)}px ${n}`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,e/2,r/2+1)),T.set(o,a)}return a})(e,r.w,r.h,s);t.globalAlpha=l;const p=r.w*d,f=r.h*d,m=r.x+(r.w-p)/2+c,g=r.y+(r.h-f)/2+u;for(let e=0;e<r.h;e+=4)for(let s=0;s<r.w;s+=3){if(n(s+31*i,e)>1.3*o-.12)continue;const r=3*(1-o);t.drawImage(h,2*s,2*e,6,8,m+s*d+(n(s,e+a)-.5)*r,g+e*d+(n(e,s+a)-.5)*r,3*d,4*d)}t.globalAlpha=1},F=(t,e)=>{t.toggleAttribute("data-shown",e),m.set(I(t),"opacity",e?"1":"0")};P=e({host:d,outset:16,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...p.current.look}),ink:()=>p.current.ink??"--ascii-ink-strong",kit:p,reducedMotion:()=>p.current.reducedMotion,resolution:2,onFail:()=>{P=null,m.restore(),z().forEach(t=>F(t,!0))},paint:({pen:t,w:e,h:r,now:n,still:o,box:s})=>{t.setTransform(2,0,0,2,0,0);const u=z(),h=o?0:Math.floor(n/110),p=getComputedStyle(d).fontFamily||"sans-serif";if("success"===x){const s=o?1:(n-k)/700,l=e/2,d=r/2;if(u.forEach(t=>F(t,!1)),s<.55){const e=(s/.55)**2;C.forEach((r,n)=>S[n]&&W(t,S[n],r,1,h,n,p,1-e**3,(l-r.x-r.w/2)*e,(d-r.y-r.h/2)*e,1-.65*e))}const f=a((s-.45)/.55);return f>0&&f<1&&(t.strokeStyle=c(.55*(1-f)),t.lineWidth=3,t.beginPath(),t.arc(l,d,18+44*(t=>1-(1-a(t))**3)(f),0,2*Math.PI),t.stroke()),((t,e,r,n)=>{if(n<=0)return;const o=[[e-20,r+1],[e-7,r+14],[e+21,r-14]],a=Math.hypot(13,13),i=Math.hypot(28,28);let s=n*(a+i);t.strokeStyle="#fff",t.lineWidth=8,t.lineCap="round",t.lineJoin="round",t.shadowColor="#fff",t.shadowBlur=4,t.beginPath(),t.moveTo(o[0][0],o[0][1]);const l=Math.min(1,s/a);if(t.lineTo(o[0][0]+(o[1][0]-o[0][0])*l,o[0][1]+(o[1][1]-o[0][1])*l),s-=a,s>0){const e=Math.min(1,s/i);t.lineTo(o[1][0]+(o[2][0]-o[1][0])*e,o[1][1]+(o[2][1]-o[1][1])*e)}t.stroke(),t.shadowBlur=0})(t,l,d+1,i(a((s-.4)/.45))),s<1}let f=!1;const m=n-E;return u.forEach((e,r)=>{const a=s(e),i=y[r];if(m<l&&w[r])return F(e,!1),W(t,w[r],a,1-m/l,h,r,p),void(f=!0);if(i){const s=o?1:(n-A[r])/300;if(F(e,s>=.7),s>=1)return;return f=!0,void(s>0&&W(t,i,a,s,h,r,p,s>.7?1-(s-.7)/.3:1))}if(F(e,!1),M&&r===y.length&&m>=l){const e=o?.6:.5-.5*Math.cos(n/1600*Math.PI*2);t.fillStyle=c(.2+.26*e),t.beginPath(),t.roundRect(a.x+a.w/2-1.5,a.y+a.h/2-11,3,22,1.5),t.fill(),f=!0}}),f}});const R=(t,e)=>{$.push(setTimeout(e,t))},j=()=>{$.forEach(clearTimeout),$=[]},D=()=>{d.dataset.state=x,"error"===x?q.setAttribute("aria-invalid","true"):q.removeAttribute("aria-invalid");const t=M&&"success"!==x?Math.min(y.length,b()-1):-1;z().forEach((e,r)=>{I(e).textContent=y[r]??"",e.toggleAttribute("data-active",r===t),P||F(e,!0),"success"===x&&P?(f.set(e,"transition","opacity 200ms, scale 240ms cubic-bezier(.16, 1, .3, 1)"),f.set(e,"opacity","0"),f.set(e,"scale",".86")):(e.style.removeProperty("opacity"),e.style.removeProperty("scale"))}),q.value!==y&&(q.value=y),P?.kick()},G=t=>{j(),"idle"!==x&&(x="idle",k=-1e9),w="",E=-1e9;const e=u(t,b(),p.current.accept),r=performance.now();let n=0;for(let t=0;t<e.length;t++)e[t]!==y[t]&&(A[t]=v()?-1e9:r+L*n++);y=e,D(),e.length===b()&&R(v()||!P?0:300+L*Math.max(0,n-1)+80,()=>p.current.onComplete?.(e)),L=0},J=()=>G(q.value),U=()=>{L=55},V=()=>{M=!0,D()},Z=()=>{M=!1,D()};return q.addEventListener("input",J),q.addEventListener("paste",U),q.addEventListener("focus",V),q.addEventListener("blur",Z),q.value?G(q.value):D(),r(()=>P,p,()=>{q.setAttribute("maxlength",String(b())),D(),P?.refresh()},{verify:t=>{j();const e=performance.now();if(t)return S=y,C=P?z().map(t=>P.box(t)):[],k=e,x="success",void D();w=y,E=v()||!P?e-l:e,x="error",D(),v()||"function"!=typeof d.animate||d.animate([{translate:"0"},{translate:"-9px"},{translate:"7px"},{translate:"-4px"},{translate:"2px"},{translate:"0"}],{duration:380,easing:"ease-out"});const r=y;R(v()||!P?0:l,()=>{w===r&&(w="",y="",D())})},clear:()=>{j(),w="",E=-1e9,k=-1e9,y="",x="idle",D()},fill(t){L=55,G(t)},get value(){return y},get state(){return x}},()=>{j(),q.removeEventListener("input",J),q.removeEventListener("paste",U),q.removeEventListener("focus",V),q.removeEventListener("blur",Z),m.restore(),f.restore();for(const t of g)t.remove();for(const t of d.querySelectorAll(p.current.cells))t.removeAttribute("data-shown"),t.removeAttribute("data-active");delete d.dataset.state})}var h=s;export{h as CODE_INPUT_DEFAULTS,u as cleanCode,d as codeInput};//# sourceMappingURL=chunk-MIZ2DUHU.js.map
1
+ import{styleKeeper as t,mountSurface as e,handle as r,hash as n,prefersReduced as o,clamp as a,house as i}from"./chunk-PFQBEWCF.js";var s={length:6,accept:"digits",cells:"[data-cell]"},l=560,c=t=>{const e=Math.round(255*a(t));return`rgb(${e} ${e} ${e})`},u=(t,e,r="digits")=>("digits"===r?t.replace(/\D/g,""):t.replace(/[^a-z\d]/gi,"").toUpperCase()).slice(0,e);function d(d,h={}){const p={current:{...s,...h}},f=t(),m=t(),g=[],v=()=>!!(p.current.reducedMotion??o()),b=()=>Math.max(1,Math.round(p.current.length));let y="",x="idle",M=!1,A=[],w="",E=-1e9,k="",S=-1e9,C=[],$=[],L=0,P=null;const T=new Map;"static"===getComputedStyle(d).position&&f.set(d,"position","relative");let B=d.querySelector("input");B||(B=document.createElement("input"),B.setAttribute("style","position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:0;opacity:0;font-size:16px;cursor:text"),d.appendChild(B),g.push(B));const q=B;q.setAttribute("inputmode","digits"===p.current.accept?"numeric":"text"),q.setAttribute("autocomplete","one-time-code"),q.setAttribute("maxlength",String(b())),"digits"===p.current.accept&&q.setAttribute("pattern","[0-9]*"),q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.setAttribute("aria-label",`Verification code, ${b()} ${"digits"===p.current.accept?"digits":"characters"}`);const z=()=>{const t=[...d.querySelectorAll(p.current.cells)];for(;t.length<b();){const e=document.createElement("span");e.dataset.cell="",e.setAttribute("aria-hidden","true"),q.parentElement===d?d.insertBefore(e,q):d.appendChild(e),g.push(e),t.push(e)}return t.slice(0,b())},F=t=>{let e=t.querySelector("[data-digit]");return e||(e=document.createElement("span"),e.dataset.digit="",t.appendChild(e),g.push(e)),e},W=(t,e,r,o,a,i,s,l=1,c=0,u=0,d=1)=>{const h=((t,e,r,n)=>{const o=`${t}|${Math.round(e)}x${Math.round(r)}|${n}`;let a=T.get(o);if(!a){a=document.createElement("canvas"),a.width=Math.max(2,Math.round(2*e)),a.height=Math.max(2,Math.round(2*r));const i=a.getContext("2d");i&&(i.scale(2,2),i.fillStyle="#fff",i.shadowColor="#fff",i.shadowBlur=3,i.font=`600 ${Math.round(.6*r)}px ${n}`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,e/2,r/2+1)),T.set(o,a)}return a})(e,r.w,r.h,s);t.globalAlpha=l;const p=r.w*d,f=r.h*d,m=r.x+(r.w-p)/2+c,g=r.y+(r.h-f)/2+u;for(let e=0;e<r.h;e+=4)for(let s=0;s<r.w;s+=3){if(n(s+31*i,e)>1.3*o-.12)continue;const r=3*(1-o);t.drawImage(h,2*s,2*e,6,8,m+s*d+(n(s,e+a)-.5)*r,g+e*d+(n(e,s+a)-.5)*r,3*d,4*d)}t.globalAlpha=1},I=(t,e)=>{t.toggleAttribute("data-shown",e),m.set(F(t),"opacity",e?"1":"0")};P=e({host:d,outset:16,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:4,cellAspect:.62,glyphScale:.92,...p.current.look}),ink:()=>p.current.ink??"--ascii-ink-strong",kit:p,reducedMotion:()=>p.current.reducedMotion,resolution:2,onFail:()=>{P=null,m.restore(),z().forEach(t=>I(t,!0))},paint:({pen:t,w:e,h:r,now:n,still:o,box:s})=>{t.setTransform(2,0,0,2,0,0);const u=z(),h=o?0:Math.floor(n/110),p=getComputedStyle(d).fontFamily||"sans-serif";if("success"===x){const s=o?1:(n-S)/700,l=e/2,d=r/2;if(u.forEach(t=>I(t,!1)),s<.55){const e=(s/.55)**2;C.forEach((r,n)=>k[n]&&W(t,k[n],r,1,h,n,p,1-e**3,(l-r.x-r.w/2)*e,(d-r.y-r.h/2)*e,1-.65*e))}const f=a((s-.45)/.55);return f>0&&f<1&&(t.strokeStyle=c(.55*(1-f)),t.lineWidth=3,t.beginPath(),t.arc(l,d,18+44*(t=>1-(1-a(t))**3)(f),0,2*Math.PI),t.stroke()),((t,e,r,n)=>{if(n<=0)return;const o=[[e-20,r+1],[e-7,r+14],[e+21,r-14]],a=Math.hypot(13,13),i=Math.hypot(28,28);let s=n*(a+i);t.strokeStyle="#fff",t.lineWidth=8,t.lineCap="round",t.lineJoin="round",t.shadowColor="#fff",t.shadowBlur=4,t.beginPath(),t.moveTo(o[0][0],o[0][1]);const l=Math.min(1,s/a);if(t.lineTo(o[0][0]+(o[1][0]-o[0][0])*l,o[0][1]+(o[1][1]-o[0][1])*l),s-=a,s>0){const e=Math.min(1,s/i);t.lineTo(o[1][0]+(o[2][0]-o[1][0])*e,o[1][1]+(o[2][1]-o[1][1])*e)}t.stroke(),t.shadowBlur=0})(t,l,d+1,i(a((s-.4)/.45))),s<1}let f=!1;const m=n-E;return u.forEach((e,r)=>{const a=s(e),i=y[r];if(m<l&&w[r])return I(e,!1),W(t,w[r],a,1-m/l,h,r,p),void(f=!0);if(i){const s=o?1:(n-A[r])/300;if(I(e,s>=.7),s>=1)return;return f=!0,void(s>0&&W(t,i,a,s,h,r,p,s>.7?1-(s-.7)/.3:1))}if(I(e,!1),M&&r===y.length&&m>=l){const e=o?.6:.5-.5*Math.cos(n/1600*Math.PI*2);t.fillStyle=c(.2+.26*e),t.beginPath(),t.roundRect(a.x+a.w/2-1.5,a.y+a.h/2-11,3,22,1.5),t.fill(),f=!0}}),f}});const j=(t,e)=>{$.push(setTimeout(e,t))},D=()=>{$.forEach(clearTimeout),$=[]},G=()=>{d.dataset.state=x,"error"===x?q.setAttribute("aria-invalid","true"):q.removeAttribute("aria-invalid");const t=M&&"success"!==x?Math.min(y.length,b()-1):-1;z().forEach((e,r)=>{F(e).textContent=y[r]??"",e.toggleAttribute("data-active",r===t),P||I(e,!0),"success"===x&&P?(f.set(e,"transition","opacity 200ms, scale 240ms cubic-bezier(.16, 1, .3, 1)"),f.set(e,"opacity","0"),f.set(e,"scale",".86")):(e.style.removeProperty("opacity"),e.style.removeProperty("scale"))}),q.value!==y&&(q.value=y),P?.kick()},J=t=>{D(),"idle"!==x&&(x="idle",S=-1e9),w="",E=-1e9;const e=u(t,b(),p.current.accept),r=performance.now();let n=0;for(let t=0;t<e.length;t++)e[t]!==y[t]&&(A[t]=v()?-1e9:r+L*n++);y=e,G(),e.length===b()&&j(v()||!P?0:300+L*Math.max(0,n-1)+80,()=>p.current.onComplete?.(e)),L=0},Q=()=>J(q.value),R=()=>{L=55},U=()=>{M=!0,G()},V=()=>{M=!1,G()};return q.addEventListener("input",Q),q.addEventListener("paste",R),q.addEventListener("focus",U),q.addEventListener("blur",V),q.value?J(q.value):G(),r(()=>P,p,()=>{q.setAttribute("maxlength",String(b())),G(),P?.refresh()},{verify:t=>{D();const e=performance.now();if(t)return k=y,C=P?z().map(t=>P.box(t)):[],S=e,x="success",void G();w=y,E=v()||!P?e-l:e,x="error",G(),v()||"function"!=typeof d.animate||d.animate([{translate:"0"},{translate:"-9px"},{translate:"7px"},{translate:"-4px"},{translate:"2px"},{translate:"0"}],{duration:380,easing:"ease-out"});const r=y;j(v()||!P?0:l,()=>{w===r&&(w="",y="",G())})},clear:()=>{D(),w="",E=-1e9,S=-1e9,y="",x="idle",G()},fill(t){L=55,J(t)},get value(){return y},get state(){return x}},()=>{D(),q.removeEventListener("input",Q),q.removeEventListener("paste",R),q.removeEventListener("focus",U),q.removeEventListener("blur",V),m.restore(),f.restore();for(const t of g)t.remove();for(const t of d.querySelectorAll(p.current.cells))t.removeAttribute("data-shown"),t.removeAttribute("data-active");delete d.dataset.state})}var h=s;export{h as CODE_INPUT_DEFAULTS,u as cleanCode,d as codeInput};//# sourceMappingURL=chunk-YBBYCUFP.js.map