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
package/dist/kit.d.cts CHANGED
@@ -1379,8 +1379,10 @@ declare const getGlobalLook: () => GlobalLook | null;
1379
1379
  /** Calls `listener` after each `setGlobalLook`. Returns the unsubscribe. */
1380
1380
  declare function subscribeGlobalLook(listener: (look: GlobalLook | null) => void): () => void;
1381
1381
  /**
1382
- * At most `n` kit fields hold a WebGL context at once (default 12; browsers drop the oldest past about 16).
1382
+ * At most `n` kit fields hold a WebGL context of their own at once (default 12; browsers drop the oldest past about 16).
1383
1383
  * Past it the live field farthest off screen is released first, and shows its poster until it is the nearer one again.
1384
+ * Fields drawn through the page's shared context hold none, so they don't count; only fields that fall back to a context
1385
+ * of their own (a canvas in another document, a browser without the shared path) do.
1384
1386
  */
1385
1387
  declare function setFieldBudget(n: number): void;
1386
1388
  declare const getFieldBudget: () => number;
package/dist/kit.d.ts CHANGED
@@ -1379,8 +1379,10 @@ declare const getGlobalLook: () => GlobalLook | null;
1379
1379
  /** Calls `listener` after each `setGlobalLook`. Returns the unsubscribe. */
1380
1380
  declare function subscribeGlobalLook(listener: (look: GlobalLook | null) => void): () => void;
1381
1381
  /**
1382
- * At most `n` kit fields hold a WebGL context at once (default 12; browsers drop the oldest past about 16).
1382
+ * At most `n` kit fields hold a WebGL context of their own at once (default 12; browsers drop the oldest past about 16).
1383
1383
  * Past it the live field farthest off screen is released first, and shows its poster until it is the nearer one again.
1384
+ * Fields drawn through the page's shared context hold none, so they don't count; only fields that fall back to a context
1385
+ * of their own (a canvas in another document, a browser without the shared path) do.
1384
1386
  */
1385
1387
  declare function setFieldBudget(n: number): void;
1386
1388
  declare const getFieldBudget: () => number;
package/dist/kit.js CHANGED
@@ -1 +1 @@
1
- export{wave}from"./kit/chunk-UO7RB7RC.js";export{weave}from"./kit/chunk-RFLIFKZ4.js";export{noise}from"./kit/chunk-XM56OTYT.js";export{pulse}from"./kit/chunk-5QE6UMXN.js";export{rain}from"./kit/chunk-XDKKCIIL.js";export{silk}from"./kit/chunk-BN7HL52Z.js";export{stars}from"./kit/chunk-5Z2EJAUV.js";export{terrain}from"./kit/chunk-UML6XQAR.js";export{veil}from"./kit/chunk-T3GWGPST.js";export{voidWell}from"./kit/chunk-H2UZBVKE.js";export{dna}from"./kit/chunk-XB4DKPGL.js";export{dune}from"./kit/chunk-E3TUOX2A.js";export{etch}from"./kit/chunk-3A5LID2G.js";export{facet}from"./kit/chunk-QALCXKU6.js";export{fire}from"./kit/chunk-73M2OESE.js";export{grid}from"./kit/chunk-I4QVLLRQ.js";export{moire}from"./kit/chunk-O7SGY4YJ.js";import"./kit/chunk-XPXMCXYI.js";export{morph}from"./kit/chunk-SARCZMLN.js";export{halo}from"./kit/chunk-2CF4PX6U.js";export{interference}from"./kit/chunk-VC2ZQG63.js";export{mesh}from"./kit/chunk-YBRP6BFW.js";export{cascade}from"./kit/chunk-DZ5XGHTJ.js";export{constellation}from"./kit/chunk-NURPDP3Y.js";export{aurora}from"./kit/chunk-FUI5AVIF.js";export{halftone}from"./kit/chunk-W2STAN6V.js";export{circuit}from"./kit/chunk-XANKANGR.js";import"./kit/chunk-ZCHGV2CV.js";export{mountCanvas}from"./kit/chunk-BR6ZNJZW.js";export{background,backgroundCharset}from"./kit/chunk-PIU2BMFU.js";export{swell}from"./kit/chunk-4ZQFDFEH.js";export{drift}from"./kit/chunk-AIM3J2US.js";export{wordField}from"./kit/chunk-MQJQIDO5.js";export{fluid}from"./kit/chunk-KWTF6Q5W.js";export{caustics}from"./kit/chunk-IQTGJRDX.js";export{contour}from"./kit/chunk-QRCXXS5Z.js";export{ripple}from"./kit/chunk-BQZCLGCY.js";import"./kit/chunk-C3C7AYKL.js";export{toastStack}from"./kit/chunk-IUKSHYED.js";export{thinking}from"./kit/chunk-IPVN22ZM.js";export{streamText}from"./kit/chunk-FR3ZJNOY.js";export{compare}from"./kit/chunk-VVW7LZT2.js";export{accordion}from"./kit/chunk-5BEBNKYM.js";export{dropzone}from"./kit/chunk-4QHFEMFS.js";export{disintegrate}from"./kit/chunk-S62H7ZIU.js";export{pullRefresh}from"./kit/chunk-7ABNWOW4.js";export{VOICE_PALETTES,voiceOrb}from"./kit/chunk-ENTDGT2V.js";export{commandPalette}from"./kit/chunk-4HWMQCAM.js";import"./kit/chunk-4OT66HSZ.js";export{likeBurst}from"./kit/chunk-5I4IZTL5.js";export{blockChart}from"./kit/chunk-YCWMOTYH.js";export{pageDissolve}from"./kit/chunk-WJLZM3DR.js";import"./kit/chunk-BNVRKD3V.js";export{swipeDeck}from"./kit/chunk-TTGMK4EA.js";export{slideToConfirm}from"./kit/chunk-2NVKPXPL.js";export{codeInput}from"./kit/chunk-MIZ2DUHU.js";export{tabs}from"./kit/chunk-G57QACJG.js";export{imageGenerate}from"./kit/chunk-HTUGMGVA.js";export{fieldBackground}from"./kit/chunk-J2YZBT3N.js";export{wordmark}from"./kit/chunk-PCIAA2LL.js";export{asciiVideo}from"./kit/chunk-C4KZYCPF.js";export{artPanel}from"./kit/chunk-MGVPLQ3Z.js";export{pricingGlow}from"./kit/chunk-PFKYKAIP.js";import"./kit/chunk-BTD6EFAW.js";export{BEAM_PALETTES,beam,beamPalette}from"./kit/chunk-SNCXU7KF.js";export{decode}from"./kit/chunk-ZRJVOUWH.js";export{odometer}from"./kit/chunk-OWEZV7TQ.js";export{buttonLoading}from"./kit/chunk-K563CCOL.js";export{statusOrb}from"./kit/chunk-3473NPIN.js";export{skeleton}from"./kit/chunk-ROR6MG3K.js";export{PILL_TONES,pill}from"./kit/chunk-DFOWXOZR.js";export{mountSurface,resolveColor}from"./kit/chunk-S7RZP2MT.js";export{KIT_STYLES,getFieldBudget,getGlobalLook,setFieldBudget,setGlobalLook,subscribeGlobalLook}from"./kit/chunk-3PCKMO6I.js";//# sourceMappingURL=kit.js.map
1
+ export{wave}from"./kit/chunk-2JQ4MRIP.js";export{weave}from"./kit/chunk-2KFBIOVS.js";export{noise}from"./kit/chunk-UO4U32P7.js";export{pulse}from"./kit/chunk-ODMQERGZ.js";export{rain}from"./kit/chunk-SAQJAH2I.js";export{silk}from"./kit/chunk-EK4GIXIO.js";export{stars}from"./kit/chunk-BJRPY7UB.js";export{terrain}from"./kit/chunk-GCIZKMJL.js";export{veil}from"./kit/chunk-KBXVIAWS.js";export{voidWell}from"./kit/chunk-L3P7ZDSK.js";export{dna}from"./kit/chunk-SVXRMHUJ.js";export{dune}from"./kit/chunk-ONVONNUH.js";export{etch}from"./kit/chunk-6XNIZ52V.js";export{facet}from"./kit/chunk-CA5J25SV.js";export{fire}from"./kit/chunk-EWPT56TR.js";export{grid}from"./kit/chunk-6YVZZ3DO.js";export{moire}from"./kit/chunk-XXPDXJMQ.js";import"./kit/chunk-XPXMCXYI.js";export{morph}from"./kit/chunk-MRDEO5HZ.js";export{halo}from"./kit/chunk-PND73YEV.js";export{interference}from"./kit/chunk-LUOIH2EM.js";export{mesh}from"./kit/chunk-6L2GAV5C.js";export{cascade}from"./kit/chunk-WT3XOWAI.js";export{constellation}from"./kit/chunk-SQGJ263V.js";export{aurora}from"./kit/chunk-A6EDU3UT.js";export{halftone}from"./kit/chunk-QTVMD62E.js";export{circuit}from"./kit/chunk-CR7QS3B3.js";import"./kit/chunk-ZCHGV2CV.js";export{mountCanvas}from"./kit/chunk-KTYCGGRO.js";export{background,backgroundCharset}from"./kit/chunk-JRSCTMFM.js";export{swell}from"./kit/chunk-PDNKLLBI.js";export{drift}from"./kit/chunk-PZAQLUAS.js";export{wordField}from"./kit/chunk-JAM46FF6.js";export{fluid}from"./kit/chunk-VFV7HZ3G.js";export{caustics}from"./kit/chunk-QKZYCROD.js";export{contour}from"./kit/chunk-FIWIUXNV.js";export{ripple}from"./kit/chunk-NPJ77LDC.js";import"./kit/chunk-OVCIHOOS.js";export{toastStack}from"./kit/chunk-PFNFW4ZI.js";export{thinking}from"./kit/chunk-IUX46UDR.js";export{streamText}from"./kit/chunk-2TQW2PIG.js";export{compare}from"./kit/chunk-EPVZIGEZ.js";export{accordion}from"./kit/chunk-XYLLL2PQ.js";export{dropzone}from"./kit/chunk-ZYYLWSPY.js";export{disintegrate}from"./kit/chunk-QZHZWO7N.js";export{pullRefresh}from"./kit/chunk-KJJJORN6.js";export{VOICE_PALETTES,voiceOrb}from"./kit/chunk-ANLBW5RI.js";export{commandPalette}from"./kit/chunk-4XT5IKM3.js";import"./kit/chunk-PCGRRX5P.js";export{likeBurst}from"./kit/chunk-G4BQYQJ6.js";export{blockChart}from"./kit/chunk-EHXSXMBE.js";export{pageDissolve}from"./kit/chunk-MIA6TUQC.js";import"./kit/chunk-V6GEQ5Y5.js";export{swipeDeck}from"./kit/chunk-EHYFSX5K.js";export{slideToConfirm}from"./kit/chunk-XDNCXCR7.js";export{codeInput}from"./kit/chunk-YBBYCUFP.js";export{tabs}from"./kit/chunk-P6S6HSN3.js";export{imageGenerate}from"./kit/chunk-SE6MQQLB.js";export{fieldBackground}from"./kit/chunk-A73S2BCE.js";export{wordmark}from"./kit/chunk-EJ3W4FN6.js";export{asciiVideo}from"./kit/chunk-3F6FTBMN.js";export{artPanel}from"./kit/chunk-HMW5NRUV.js";export{pricingGlow}from"./kit/chunk-H4DBJULW.js";import"./kit/chunk-4SHQA3CO.js";export{BEAM_PALETTES,beam,beamPalette}from"./kit/chunk-YL2AXWRA.js";export{decode}from"./kit/chunk-BBOSHBZK.js";export{odometer}from"./kit/chunk-KS3TL3S2.js";export{buttonLoading}from"./kit/chunk-B6GZ645M.js";export{statusOrb}from"./kit/chunk-2D2SG6FW.js";export{skeleton}from"./kit/chunk-D4KCZSIP.js";export{PILL_TONES,pill}from"./kit/chunk-YDP6566E.js";export{mountSurface,resolveColor}from"./kit/chunk-PFQBEWCF.js";export{KIT_STYLES,getFieldBudget,getGlobalLook,setFieldBudget,setGlobalLook,subscribeGlobalLook}from"./kit/chunk-XVB3B3FV.js";//# sourceMappingURL=kit.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciify-engine",
3
- "version": "4.24.0",
3
+ "version": "4.25.0",
4
4
  "description": "Framework-agnostic ASCII art engine. Convert images, videos, and GIFs into ASCII art rendered on canvas, or run full-bleed GPU character fields with a fluid cursor wake.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -74,6 +74,7 @@
74
74
  "skills/asciify-engine",
75
75
  "README.md",
76
76
  "LICENSE",
77
+ "CHANGELOG.md",
77
78
  "examples/media-background.ts",
78
79
  "examples/studio-composition.ts",
79
80
  "examples/layered-composition.ts",
@@ -2,13 +2,13 @@
2
2
  name: asciify-engine
3
3
  description: Apply Asciify the way asciify.org does - ASCII components and backgrounds that belong in a real interface, inked from the theme, clear around text, inside the page's radii and motion. Use for UI components in characters (loading, status, toasts, tabs, AI states, charts, transitions, pages), animated ASCII backgrounds, and also photo, video and GIF conversion, GPU character fields, artwork looks for wallpapers, posters and prints, art styles and export, hover and motion, layered typography and rendering performance.
4
4
  metadata:
5
- tested-engine: "4.24.0"
5
+ tested-engine: "4.25.0"
6
6
  updated: "2026-10-17"
7
7
  ---
8
8
 
9
9
  # Asciify Engine
10
10
 
11
- Use the published `asciify-engine` npm package. Tested against **4.24.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
11
+ Use the published `asciify-engine` npm package. Tested against **4.25.0**. Check the application's installed version and its public types before using newer options; a local checkout can contain unpublished changes.
12
12
 
13
13
  - Agent entry: https://asciify.org/skill (redirects to this Markdown document).
14
14
  - Components: https://asciify.org/components · Looks: https://asciify.org/looks · Backgrounds: https://asciify.org/backgrounds
@@ -149,7 +149,7 @@ decode(headline, { duration: 800, settle: 'text' }); // decorative, under the 80
149
149
 
150
150
  ## 7. Performance
151
151
 
152
- - **About 12 fields per page.** At most 12 kit fields hold a WebGL context at once (`setFieldBudget` changes it). asciify.org's home page runs 12. Past that, share: one `pill()` call over a list draws every pill with one field.
152
+ - **Fields share one context.** Every field on the page draws through one WebGL2 context, so the count of fields is bounded by what is animating on screen, not by contexts. Static fields draw once and stop. Sharing still helps: one `pill()` call over a list draws every pill with one field.
153
153
  - **Lazy by default.** Fields mount within half a viewport and release beyond one. Use `lazy: false` only for the hero in the first viewport.
154
154
  - **Posters.** Give every field above the fold, and every field that matters without WebGL, a still per theme, and swap it on theme change with `update({ poster })` rather than remounting.
155
155
  - **Canvas presets cost CPU, not contexts.** Count them toward the page anyway; one animated ground per viewport.
@@ -169,8 +169,8 @@ const s = mountSurface({ host: el, look: () => ({ mark: 'glyph', cellSize: 6 }),
169
169
 
170
170
  A page can hold every kit component at once. The shared core keeps the GPU cost to what is on screen:
171
171
 
172
- - **Lazy mounting.** A field mounts when its element comes within half a viewport of the screen and is released, freeing its WebGL context, beyond one viewport. Mounts that cost more than about 4 ms in a frame wait for the next one, nearest the screen first. The handle survives release and remount: its methods keep working, `update()` calls made while released apply on the next mount, `pause()` holds, and the component paints its current state when it mounts again. `handle.field` stays the same object throughout. A remount swaps a copy of the canvas, with its attributes and inline styles, into the same place. `lazy: false` mounts at once, anywhere on the page, and is never released by distance.
173
- - **Context budget.** At most 12 kit fields hold a WebGL context at once, across all components and page helpers (browsers drop the oldest past about 16). Past the budget the live field farthest off screen is released first, and a waiting field mounts as soon as it is nearer than the farthest live one. Change it with `setFieldBudget(n)`; `getFieldBudget()` reads it.
172
+ - **Lazy mounting.** A field mounts when its element comes within half a viewport of the screen and is released, freeing its GPU memory, beyond one viewport. Mounts that cost more than about 4 ms in a frame wait for the next one, nearest the screen first. The handle survives release and remount: its methods keep working, `update()` calls made while released apply on the next mount, `pause()` holds, and the component paints its current state when it mounts again. `handle.field` stays the same object throughout. A remount draws into the same canvas (a field with a context of its own swaps in a copy, with its attributes and inline styles). `lazy: false` mounts at once, anywhere on the page, and is never released by distance.
173
+ - **One context, and a budget for the rest.** Kit fields draw through the page's one shared WebGL2 context and hold none of their own. `setFieldBudget(n)` (default 12) limits fields that fall back to a context of their own (a canvas in another document, or one already holding a WebGL context; browsers drop the oldest past about 16): past it the live one farthest off screen is released first. `getFieldBudget()` reads it.
174
174
  - **Posters.** `poster: '/stills/hero.webp'` puts an `<img>` under the canvas (`update({ poster })` points it at another still, such as the other theme's), placed exactly where the field draws. It fades out (280 ms, none under reduced motion) when the first GPU frame lands, shows again while the field is released, and stays as the fallback without WebGL or after the field fails, until `destroy()`. `update({ poster })` swaps the still in place, for a theme change, on every component including the page helpers and `asciiVideo`. `asciiVideo` keeps its own poster.
175
175
  - **Pausing.** As before, a field draws nothing while the page is hidden or its element is off screen.
176
176
 
@@ -18,9 +18,12 @@ What `asciify-engine` promises a host page, and the default budgets. Measured by
18
18
 
19
19
  ## GPU and memory
20
20
 
21
- - **Context budget: 12.** At most 12 kit fields hold a WebGL context at once (`setFieldBudget(n)` changes it); past it the field farthest off screen is released to its `poster`. A context the browser takes back is remounted on a fresh canvas. 150 components on one page keep 12 contexts and lose none.
21
+ - **One context per page.** Every glyph field on the page (kit components, page helpers and `mountGlyphField`) draws through one shared WebGL2 context and one frame loop, and each field's canvas receives its frame with a 2D copy. Programs compile once for the page and glyph atlases are shared per charset, font and size, so mounting a field creates no context and compiles nothing; 150 components on one page hold one context. A context the browser takes back is replaced, and every field draws again. The context is let go three seconds after the page's last field.
22
+ - **GPU memory budget: 256 MB per page.** The shared context counts what every field holds on the GPU: its render targets, its source texture with mipmaps, its wake and trail buffers, its canvas, the shared atlases and the shared drawing buffer. Past 256 MB, kit fields off screen are released to their posters, farthest first, and fields waiting to mount keep their posters until there is room; a field on screen is never released for memory. Atlases are shared per charset, font and size; up to eight that no field uses are kept for a remount and evicted oldest first (all of them while over budget). The shared drawing buffer shrinks when the largest field leaves. Fields mounted directly with `mountGlyphField` count toward the total but are never released by it: destroy them yourself.
23
+ - **Context budget.** `setFieldBudget(n)` (default 12) still limits fields that fall back to a context of their own: a canvas from another document, or one that already holds a WebGL context. Past it the field farthest off screen is released to its `poster`.
24
+ - **Page listeners don't grow.** One pointer listener (capture, on the window), one visibility, motion, colour-scheme and font listener, and one ResizeObserver serve every field, so mounting and releasing fields while scrolling adds and removes none.
22
25
  - **Backing store capped.** Pixel ratio is at most 2 by default (`look.maxPixelRatio`), and one field's backing store at most about one 4K screen (8.3 million pixels): a full-bleed field on a 5K or 6K display keeps its cells and draws them at a lower ratio.
23
- - **Slow frames degrade, not stall.** About a second of frames slower than 24 fps drops the field to 1× pixels, then to no ambient motion; the pointer response keeps working.
26
+ - **Slow frames degrade, not stall.** The shared context times its own frames on the GPU (`EXT_disjoint_timer_query_webgl2`, or the frame loop's gaps where it is missing) and lowers the render scale in steps, down to one device pixel per CSS pixel, before any frame is given up; it climbs back once there is headroom. Past that, about a second of frames slower than 24 fps stops a field's ambient motion; the pointer response keeps working.
24
27
  - **Software WebGL counts as unsupported.** SwiftShader and llvmpipe report `isGlyphFieldSupported() === false` (pass `allowSoftware` to override), so components keep their HTML and poster instead of drawing every pixel on the CPU. Without WebGL2 the same fallback applies.
25
28
 
26
29
  ## What a host should still do
@@ -1 +0,0 @@
1
- import{mountGlyphField as e}from"../field.js";var t={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"}},n=e=>"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e),r=/\p{L}/u,o=null,a=new Set,s=new Set;function i(e){const{charset:t,style:r}=e??{};o=e?{...t?{charset:t}:{},...n(r)?{style:r}:{}}:null;for(const e of s)e.relook();for(const e of[...a])e(o)}var l=()=>o;function c(e){return a.add(e),()=>{a.delete(e)}}var u=12,m=new Set,h=null,d=null,p=0,f=-1e9,g=0,y=!1,v=!1,k=()=>{const e=d?.timeline?.currentTime;return"number"==typeof e?e:null};function b(e){u=Number.isFinite(e)&&e>=1?Math.floor(e):12,O()}var w=()=>u,x=()=>"undefined"!=typeof performance?performance.now():Date.now(),E=()=>"number"==typeof innerHeight?innerHeight:0;function S(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-E();return n>0?n:0}function C(){try{const e=d?.querySelectorAll?.("dialog:modal");return e?.length?e[e.length-1]:null}catch{return null}}var M=1e8;function A(e,t){if(e.eager)return void(e.wanted=!0);const n=E(),r=S(e.host,t);!n||r<=.5*n?e.wanted=!0:r>1*n&&(e.wanted=!1)}function P(e){let t=!1;for(const n of e)if(n?.target)for(const e of m)e.host===n.target&&(A(e,n.boundingClientRect??void 0),t=!0);t&&O()}var W=()=>O(),L=null,$=e=>{L!==e&&(L?.removeEventListener?.("close",W,!0),e?.addEventListener?.("close",W,!0),L=e)};function z(e){d!==e.doc&&(d=e.doc,m.clear(),p=g=0,f=-1e9),$(d),m.add(e);const t=function(){const e="function"==typeof IntersectionObserver?IntersectionObserver:null;if(!e)return null;if(h?.ctor!==e){h?.list.forEach(e=>e.disconnect()),h={ctor:e,list:["50% 0px","100% 0px","0px"].map(t=>new e(P,{rootMargin:t}))};for(const e of m)h.list.forEach(t=>t.observe(e.host))}return h.list}();t?.forEach(t=>t.observe(e.host)),t?A(e):e.wanted=!0,O()}function O(e=!1){if(y)v=!0;else{y=!0;try{do{v=!1;const t=x(),n=k();(e||(null===n?t-f>16||t<f:n!==f))&&(f=n??t,g=0);for(const e of m)!1===e.host.isConnected&&(e.wanted=!1);for(const e of m)e.live&&!e.wanted&&e.release();const r=[...m].filter(e=>e.live),o=C(),a=e=>!!o&&!o.contains(e.host),s=e=>S(e.host)+(a(e)?M:0),i=e=>e.eager&&!a(e),l=()=>r.filter(e=>e.live).map(e=>[e,s(e)+(i(e)?0:1e9)]).sort((e,t)=>t[1]-e[1]);for(let e=r.length-u,t=e>0?l():[];e>0;e--)t.shift()?.[0].release();const c=[...m].filter(e=>e.wanted&&!e.live).map(e=>[e,e.eager?-1:s(e)]).sort((e,t)=>e[1]-t[1]);let h=0;for(const[t,n]of c){if(!m.has(t)||t.live)continue;if(!t.eager&&g>=4&&(!e||h)){p||(p=requestAnimationFrame(()=>{p=0,O(!0)}));break}if(r.filter(e=>e.live).length>=u){const e=l()[0]?.[0];if(!e||!t.eager&&(i(e)||s(e)<=n))break;e.release()}const o=x();t.mount(),g+=x()-o,h++,t.live&&r.push(t)}}while(v)}finally{y=!1}}}var R='ui-monospace, "SF Mono", Menlo, Consolas, monospace',T=new Map;function j(e,t=R){const n=`${t}\0${e}`,r=T.get(n);if(r)return r;let o={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 r=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 r=0;for(let e=3;e<t.length;e+=4)r+=t[e];return r/255},a=e=>[...e].filter(e=>e.trim()).map(r),s=e=>e.reduce((e,t)=>e+t,0)/Math.max(1,e.length),i=a(e),l=a(".:-=+*#%@"),c=r("@");i.length&&c>0&&s(l)>0&&(o={max:Math.max(...i)/c,mean:s(i)/s(l)})}}catch{}return T.set(n,o),o}function F(e,t){const{max:n,mean:r}=j(e,t.font??R),o=t.glyphScale??.8,a=t.gamma??1,s=t.fontWeight??500;return n>1.15?{glyphScale:Math.max(.3,o*Math.max(.62,n**-.36)),gamma:a,fontWeight:s}:r>1.5?{glyphScale:Math.max(.3,o*r**-.25),gamma:a,fontWeight:s}:n<.85?{glyphScale:Math.min(1.6,o*Math.min(1.3,n**-.3)),gamma:a,fontWeight:n<.6?Math.max(s,700):s}:{glyphScale:o,gamma:a,fontWeight:s}}var B=new WeakMap;function q(e,t){for(const n of B.get(e)?.keys()??[])n.getAttribute("src")!==t&&(n.src=t)}function I(e){const t=B.get(e);B.delete(e),t?.forEach(e=>e())}var D=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches;function X(e,t,n,r,o){const a=document.createElement("img");a.alt="",a.decoding="async",a.setAttribute("aria-hidden","true"),a.setAttribute("style",`${n};object-fit:cover${D()?"":";transition:opacity 280ms cubic-bezier(.23, 1, .32, 1)"}`),a.style.opacity="1",a.dataset.asciiPoster="",a.src=t;const s=e.style.getPropertyValue("position"),i="function"==typeof getComputedStyle&&"static"===getComputedStyle(e).position;i&&e.style.setProperty("position","relative");const l=e.style.getPropertyValue("isolation"),c=/z-index:\s*-1/.test(n)&&"function"==typeof getComputedStyle&&"auto"===getComputedStyle(e).isolation;c&&e.style.setProperty("isolation","isolate"),o?.parentElement===e?e.insertBefore(a,o):e.appendChild(a);let u=!1;const m=()=>{u||(u=!0,a.remove(),B.get(r)?.delete(a),i&&(s?e.style.setProperty("position",s):e.style.removeProperty("position")),c&&(l?e.style.setProperty("isolation",l):e.style.removeProperty("isolation")))},h=B.get(r)??new Map;return h.set(a,m),B.set(r,h),{show(e){a.style.opacity=e?"1":"0"},remove:m}}function H(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 N(n){const{host:a,kit:i}=n;let l,c=n.canvas,u=null,d=!1,p=!1,f=!1,g=!1,y={},v={},k=n.source,b=!1,w={},x=null,E=null,S=!1,C=null,M=()=>{};const A=!n.ownPoster&&i?.current.poster?X(a,i.current.poster,n.place,i,c):null,P=()=>{if(!o||!1===i?.current.globalLook||"glyph"!==(v.mark??"glyph")&&!n.glyphs||r.test(v.charset??""))return;const e=o.style?t[o.style]:void 0,a=e?.mark??"glyph",s="glyph"===a?o.charset||(e&&"charset"in e?e.charset:void 0):void 0;return e||s?{mark:a,charset:s}:void 0},W=()=>({...n.glyphs?Object.fromEntries(Object.keys(n.glyphs()).map(e=>[e,v[e]]).filter(([,e])=>void 0!==e)):{},mark:v.mark??"glyph",charset:v.charset??" .,:-=+*#%@",glyphScale:v.glyphScale??.8,gamma:v.gamma??1,fontWeight:v.fontWeight??500}),L=e=>{if(!e.charset)return{...W(),mark:e.mark};const t=n.glyphs&&"glyph"!==(v.mark??"glyph")?n.glyphs():{};return{...t,mark:e.mark,charset:e.charset,...F(e.charset,{...v,...t})}},R=()=>{const e=P(),t=e&&`${e.mark}\0${e.charset??""}`;return t===l?null:(l=t,e?L(e):W())},T={host:a,doc:document,eager:!1===i?.current.lazy,wanted:!1,live:!1,mount(){if(p||u)return;d&&(c=n.canvas=H(c)),d=!0,v={...n.options(),...y},l=void 0;const t=R();let r;try{r=e(c,{...v,...t,...void 0===k?{}:{source:k},onError:()=>{u===r&&j()}})}catch{return void j()}u=r,T.live=!0;const o=c;let a=0;const s=()=>{u===r&&(clearTimeout(a),a=setTimeout(()=>{u===r&&c===o&&(T.release(),O())},1e3))},i=()=>clearTimeout(a);o.addEventListener?.("webglcontextlost",s),o.addEventListener?.("webglcontextrestored",i),M=()=>{clearTimeout(a),o.removeEventListener?.("webglcontextlost",s),o.removeEventListener?.("webglcontextrestored",i)},b&&r.pause(),r.ready.then(()=>{u===r&&(S=!0,A?.show(!1),x?.(),x=E=null)},()=>{}),n.onMount?.(r,c)},release(){if(!u)return;const e=u;u=null,T.live=!1,S=!1,M(),C?.clear(),C=null,w=e.settings,e.destroy(),(e=>{try{const t=e.getContext("webgl2");t&&!t.isContextLost?.()&&t.getExtension("WEBGL_lose_context")?.loseContext()}catch{}})(c),p||(c=n.canvas=H(c),d=!1),A?.show(!0),n.onRelease?.()}};function j(){f||(f=!0,B(),g||n.onFail())}function B(){p||(p=!0,T.release(),function(e){m.delete(e)&&([...m].some(t=>t.host===e.host)||h?.list.forEach(t=>t.unobserve(e.host)),!m.size&&h&&(h.list.forEach(e=>e.disconnect()),h=null),m.size||$(null),O())}(T),s.delete(q),c.remove(),f?A?.show(!0):A?.remove())}const q={relook(){const e=R();if(!e||!u)return;const t=u,r=S&&!(i?.current.reducedMotion??D());C?.clear(),C=null,r&&(t.redraw(),C=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 r=n.getContext("2d");if(!r||"function"!=typeof n.animate)return null;try{r.drawImage(e,0,0)}catch{return null}n.setAttribute("aria-hidden","true"),n.dataset.asciiSweep="",n.setAttribute("style",t);const o=document.createElement("span");let a,s;o.setAttribute("aria-hidden","true"),o.dataset.asciiSweep="",o.setAttribute("style",`${t};right:auto;width:2px;margin-left:-1px;opacity:0;background:var(--ascii-sweep, #f3ba32);box-shadow:0 0 10px 1px color-mix(in srgb, var(--ascii-sweep, #f3ba32) 40%, transparent)`),e.after(n,o);const i=()=>{a?.cancel(),s?.cancel(),n.remove(),o.remove()};return{clear:i,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 r=e.clientWidth||e.getBoundingClientRect().width;s=o.animate([{transform:"translateX(0px)",opacity:.35},{opacity:.35,offset:.7},{transform:`translateX(${r}px)`,opacity:0}],t),a.onfinish=i}}}(c,n.place)),t.update(e);const o=C;o&&requestAnimationFrame(()=>requestAnimationFrame(()=>{C===o&&u===t?o.reveal():o.clear()}))}};return{field:{get canvas(){return c},get ready(){return u?u.ready:E??(E=new Promise(e=>{x=e}))},get settings(){return u?.settings??w},update(e){if(y={...y,...e},v={...v,...e},!u)return;const t=R(),n=P();u.update(n?{...e,...L(n)}:t?{...e,...t}:e)},setSource:e=>(k=e,u?u.setSource(e):Promise.resolve()),pointer(e,t){u?.pointer(e,t)},redraw(){u?.redraw()},pulse(e){u?.pulse(e)},play(){b=!1,u?.play()},pause(){b=!0,u?.pause()},resize(){u?.resize()},destroy(){B()}},get canvas(){return c},get live(){return!!u},get failed(){return f},start(){s.add(q),g=!0;try{z(T)}finally{g=!1}},destroy:B}}export{t as KIT_STYLES,F as balanceCharset,I as disposeKit,w as getFieldBudget,l as getGlobalLook,j as inkWeight,N as liveField,X as poster,b as setFieldBudget,i as setGlobalLook,q as setPosterSource,c as subscribeGlobalLook};//# sourceMappingURL=chunk-3PCKMO6I.js.map
@@ -1 +0,0 @@
1
- import{injectStyle as e}from"./chunk-4OT66HSZ.js";import{drawBlocks as t,snapshot as n,blocksOf as r,BLOCK_W as o,BLOCK_H as s}from"./chunk-BNVRKD3V.js";import{styleKeeper as i,mountSurface as a,house as c,clamp as l,handle as u,hash as d,boxIn as f,prefersReduced as p}from"./chunk-S7RZP2MT.js";var h={input:"input",rows:'[role="option"]',hotkey:"k",manage:!0,closeOnRun:!0,highlight:!0,ai:"[data-ai]"},m=200,g=3600,y=40,v="cubic-bezier(.16, 1, .3, 1)",x=`\n:where([data-ascii-cmd-highlight]){position:absolute;left:0;top:0;z-index:-1;pointer-events:none;opacity:0;background:var(--ascii-cmd-highlight,color-mix(in oklab,currentColor 7%,transparent));transition:translate 240ms ${v},width 240ms ${v},height 240ms ${v},opacity 160ms ${v}}\n:where([data-ascii-cmd-highlight][data-on]){opacity:1}\n@media (prefers-reduced-motion:reduce){:where([data-ascii-cmd-highlight]){transition:none}}\n`;function k(k,w={}){const b={current:{...h,...w}},E=i(),$=()=>[...k.querySelectorAll(b.current.rows)],M=()=>k.querySelector(b.current.input),A=i();let L=b.current.open??!k.hasAttribute("hidden"),S=0,T=null,C=!1,O=0,H=null,R=[],W=null,D=0,P=0;const z=new WeakMap,K=()=>!!(b.current.reducedMotion??p());e("ascii-kit-command",x),"static"===getComputedStyle(k).position&&A.set(k,"position","relative"),A.set(k,"isolation","isolate");const j=document.createElement("div");j.setAttribute("aria-hidden","true"),j.dataset.asciiCmdHighlight="",b.current.highlight&&k.insertBefore(j,k.firstElementChild);const F=e=>{if(void 0===e.offsetParent)return f(k,e);let t=0,n=0;for(let r=e;r&&r!==k;r=r.offsetParent)t+=r.offsetLeft,n+=r.offsetTop;for(let r=e.parentElement;r&&r!==k;r=r.parentElement)t-=r.scrollLeft,n-=r.scrollTop;return{x:t,y:n,w:e.offsetWidth,h:e.offsetHeight}},N=e=>{const t=$()[S];if(!j.parentElement)return;if(!t||!L)return void delete j.dataset.on;const n=F(t),r=!e||void 0===j.dataset.on||K();r&&(j.style.transition="none"),j.style.translate=`${n.x}px ${n.y}px`,j.style.width=`${n.w}px`,j.style.height=`${n.h}px`,j.style.borderRadius=getComputedStyle(t).borderTopLeftRadius,j.dataset.on="",r&&(j.offsetWidth,j.style.removeProperty("transition"))};let V=null;const q=i();H=a({host:k,layer:"under",look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.62,glyphScale:.92,...b.current.look}),ink:()=>b.current.ink??"--ascii-ink-strong",kit:b,reducedMotion:()=>b.current.reducedMotion,resolution:2,onFail:()=>{H=null},paint:({pen:e,now:i,still:a,box:u})=>{if(e.setTransform(2,0,0,2,0,0),T){const n=T,r=(i-n.start)/(n.closing?m:260);if(!(r>=1||a)){const o=n.closing?1-1.02*c(r):1.04*c(r);return t(e,n.snap,n.blocks,n.order,o,(e,t)=>[(n.ox-e.x)*t*.9,(n.oy-e.y)*t*.9],n.closing?1:1-l((r-.72)/.28),.4),!0}T=null}if(!L||C)return!1;let f=!1;R=R.filter(n=>{const r=(i-n.start)/280;return(r>=.7||a)&&n.styles.restore(),r>=1||a||!k.contains(n.row)?(n.styles.restore(),!1):(f=!0,r>0&&t(e,n.snap,n.blocks,n.order,1.04*c(r),(e,t)=>[14*t,0],1-l((r-.7)/.3),.42),!0)});const p=$()[S];if(p&&!a&&p.matches(b.current.ai)){p!==W&&(W=p,D=i+160);const t=i-D,a=t>=0?t%g/1100:-1;if(a>=0&&a<1&&!R.some(e=>e.row===p))((e,t,i,a,c)=>{const l=H,u=`${t.textContent}|${i.x}|${i.y}|${i.w}`;if(V?.row!==t||V.key!==u){const e=n(t,l.box,l.canvas.clientWidth||k.offsetWidth,l.canvas.clientHeight||k.offsetHeight,2);V={row:t,key:u,snap:e,blocks:r(e,2)}}const f=i.x-y+(i.w+80)*(e=>e<.5?4*e**3:1-(-2*e+2)**3/2)(a),p=Math.floor(c/70);for(const t of V.blocks){const n=(t.x+2-f)/y;if(n<=-1||n>=1)continue;const r=1-n*n;d(t.x+p,t.y)>.35+.65*r||(e.globalAlpha=Math.min(1,1.6*r),e.drawImage(V.snap,2*t.x,2*t.y,2*o,2*s,t.x,t.y,o,s))}e.globalAlpha=1;const h=f-i.x;q.set(t,"mask-image",`linear-gradient(90deg, #000 ${h-y}px, transparent ${h-14}px, transparent ${h+14}px, #000 ${h+y}px)`)})(e,p,u(p),a,i),f=!0;else{if(q.restore(),f)return!0;P&&clearTimeout(P);const e=t>=0?g-t%g:-t;P=setTimeout(()=>{P=0,H?.kick()},Math.max(16,e))}}else W=null,q.restore();return f}}),H&&(k.dataset.gpu="");const B=(e=!0)=>{const t=$();if(S=t.length?Math.min(Math.max(0,S),t.length-1):0,N(e),!b.current.manage)return;t.forEach((e,t)=>e.setAttribute("aria-selected",String(t===S)));const n=M(),r=t[S]?.id;n&&r&&n.setAttribute("aria-activedescendant",r)},Z=()=>`inset(0 round ${getComputedStyle(k).borderTopLeftRadius||"0px"})`,G=()=>{const e=b.current.trigger,t=k.offsetWidth,n=k.offsetHeight;if(!e)return`inset(0 ${Math.max(0,t/2-40)}px ${Math.max(0,n-36)}px round 18px)`;const r=f(k,e);return`inset(${r.y}px ${t-r.x-r.w}px ${n-r.y-r.h}px ${r.x}px round ${r.h/2}px)`},I=e=>{const t=H;if(!t)return;const o=k.offsetWidth,s=k.offsetHeight,i=n(k,t.box,o,s,2),a=r(i,2),c=b.current.trigger,l=c?t.box(c):{x:o/2,y:0,w:0,h:0},u=l.x+l.w/2,d=l.y+l.h/2,f=Math.hypot(o,s)||1;T={snap:i,blocks:a,order:Float32Array.from(a,e=>Math.hypot(e.x-u,e.y-d)/f*.7+.3*e.seed),ox:u,oy:d,start:performance.now(),closing:e},t.kick()},U=e=>{if(e)for(const e of[...k.children])"CANVAS"===e.tagName&&void 0!==e.dataset.asciiKit||E.set(e,"opacity","0");else E.restore()},J=(e,t,n="none")=>"function"!=typeof k.animate?null:k.animate(e.map(e=>({clipPath:e})),{duration:t,easing:v,fill:n}),Q=()=>{O&&clearTimeout(O),O=0},X=(e=!0)=>{!L||C?(Q(),L=!0,C=!1,S=0,k.removeAttribute("hidden"),k.dataset.open="",b.current.trigger?.setAttribute("aria-expanded","true"),B(!1),(()=>{for(const e of $())z.set(e,F(e).y)})(),e&&M()?.focus({preventScroll:!0}),b.current.onOpenChange?.(!0),K()?H?.kick():(k.dataset.state="opening",J([G(),Z()],260),H&&(C=!0,U(!0),I(!1)),O=setTimeout(()=>{O=0,delete k.dataset.state,C=!1,U(!1),H?.kick()},143))):e&&M()?.focus({preventScroll:!0})},Y=()=>{if(!L)return;Q();const e=k.contains(document.activeElement),t=()=>{O=0,C=!1,L=!1,T=null,delete k.dataset.state,delete k.dataset.open,U(!1),N(!1);for(const e of R)e.styles.restore();R=[],q.restore(),V=null,k.setAttribute("hidden",""),b.current.trigger?.setAttribute("aria-expanded","false"),e&&b.current.trigger?.focus({preventScroll:!0}),H?.kick(),b.current.onOpenChange?.(!1)};if(K())return void t();C=!0,k.dataset.state="closing",H&&(I(!0),U(!0));const n=J([Z(),G()],m,"forwards"),r="function"==typeof k.animate?k.animate([{opacity:1},{opacity:1,offset:.4},{opacity:0}],{duration:m,fill:"forwards"}):null;O=setTimeout(()=>{t(),n?.cancel(),r?.cancel()},m)},_=e=>{const t=$().length;t&&(S=(Math.round(e)%t+t)%t,B(),H?.kick())},ee=(e=S)=>{const t=$()[e];if(!t||C)return;_(e),H?.field.pulse({element:t,strength:.6}),t.matches(b.current.ai)&&(W=t,D=performance.now()),t.dataset.run="",b.current.onRun?.(e,t);const n=()=>{delete t.dataset.run,b.current.closeOnRun&&Y()};K()?n():setTimeout(n,240)},te=e=>{if(!b.current.manage)return;const t=$().length;if("Escape"===e.key&&L)return e.preventDefault(),e.stopPropagation(),void Y();if(e.target!==M()&&!$().includes(e.target))return;const n="ArrowDown"===e.key?S+1:"ArrowUp"===e.key?S-1:"Home"===e.key?0:"End"===e.key?t-1:null;if(null!==n)return e.preventDefault(),void _(n);"Enter"===e.key&&(e.preventDefault(),ee())},ne=e=>{const t=e.target?.closest?.(b.current.rows);return t?$().indexOf(t):-1},re=e=>{if(!b.current.manage)return;const t=ne(e);t<0||t!==S&&_(t)},oe=e=>{if(!b.current.manage)return;const t=ne(e);t>=0&&ee(t)},se=()=>{b.current.manage&&(S=0,B(!1))},ie="function"==typeof MutationObserver?new MutationObserver(()=>{L&&(B(!1),(()=>{const e=H,t=$(),o=t.filter(e=>{const t=F(e).y,n=z.get(e);return z.set(e,t),void 0===n||Math.abs(n-t)>1});for(const e of R)t.includes(e.row)&&!o.includes(e.row)||e.styles.restore();if(R=R.filter(e=>t.includes(e.row)&&!o.includes(e.row)),!e||!e.live||e.still()||C||!L)return;const s=e.canvas.clientWidth||k.offsetWidth,a=e.canvas.clientHeight||k.offsetHeight,c=performance.now();o.forEach((t,o)=>{const l=n(t,e.box,s,a,2),u=r(l,2);if(!u.length)return;const d=Math.min(...u.map(e=>e.x)),f=Math.max(1,Math.max(...u.map(e=>e.x))-d),p=i();for(const e of[...t.children])p.set(e,"opacity","0");R.push({row:t,snap:l,blocks:u,order:Float32Array.from(u,e=>(e.x-d)/f*.72+.28*e.seed),start:c+28*o,styles:p})}),e.kick()})())}):null;ie?.observe(k,{childList:!0,subtree:!0});const ae="function"==typeof ResizeObserver?new ResizeObserver(()=>N(!1)):null;ae?.observe(k);const ce=()=>{L?Y():X(!0)},le=e=>{const t=b.current.hotkey;t&&e.key?.toLowerCase()===t.toLowerCase()&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),L?document.activeElement===M()?Y():M()?.focus():X(!0))},ue=e=>{if(!b.current.manage||!L||C)return;const t=e.target;k.contains(t)||b.current.trigger?.contains(t)||Y()};k.addEventListener("keydown",te),k.addEventListener("pointermove",re),k.addEventListener("click",oe),k.addEventListener("input",se);const de=b.current.trigger;return de?.addEventListener("click",ce),de?.setAttribute("aria-expanded",String(L)),de?.setAttribute("aria-haspopup","dialog"),document.addEventListener("keydown",le),document.addEventListener("pointerdown",ue),L?k.dataset.open="":k.setAttribute("hidden",""),B(),u(()=>H,b,()=>{B(),H?.refresh()},{open:X,close:Y,select:_,run:ee,toggle(){L?Y():X(!0)},get isOpen(){return L},get selected(){return S}},()=>{Q(),P&&clearTimeout(P),U(!1);for(const e of R)e.styles.restore();q.restore(),ie?.disconnect(),ae?.disconnect(),j.remove(),A.restore(),k.removeEventListener("keydown",te),k.removeEventListener("pointermove",re),k.removeEventListener("click",oe),k.removeEventListener("input",se),de?.removeEventListener("click",ce),document.removeEventListener("keydown",le),document.removeEventListener("pointerdown",ue),delete k.dataset.gpu,delete k.dataset.state})}var w=h;export{w as COMMAND_PALETTE_DEFAULTS,k as commandPalette};//# sourceMappingURL=chunk-4HWMQCAM.js.map
@@ -1 +0,0 @@
1
- import{parseColor as t}from"./chunk-ZCHGV2CV.js";import{mountCanvas as o}from"./chunk-BR6ZNJZW.js";import{mixHex as e}from"./chunk-S7RZP2MT.js";function n(o,e,n,a,r={}){const{fontSize:i=13,chars:l=" .,:;i+xX#&@",color:h="#ff4500",hotColor:f="#ffe066",intensity:c=.85,wind:s=0,speed:m=1,lightMode:M=!1}=r,p=.62*i,d=1.4*i,g=Math.ceil(e/p),u=Math.ceil(n/d),b=g*u,x="__fire_heat__",S=o.canvas;let k=S[x];k&&k.length===b||(k=new Float32Array(b),S[x]=k);const A=.18*(.016*m),_=s*m*.8,y=u-1,z=a*m;for(let t=0;t<g;t++){const o=(.6*(.5*Math.sin(.31*t+4.1*z)+.5)+.4*(.5*Math.sin(.73*t-2.7*z)+.5))*c;k[y*g+t]=Math.min(1,o+.15*Math.random()*c),y>0&&(k[(y-1)*g+t]=Math.min(1,.85*o+.1*Math.random()*c))}const C=new Float32Array(b);for(let t=0;t<u-2;t++)for(let o=0;o<g;o++){const e=.4*k[(t+1)*g+o]+.25*k[(t+2)*g+Math.max(0,Math.min(g-1,o+Math.round(_)))]+.175*k[(t+1)*g+Math.max(0,o-1)]+.175*k[(t+1)*g+Math.min(g-1,o+1)];C[t*g+o]=Math.max(0,e-A-.02*Math.random()*m)}for(let t=0;t<g;t++)C[(u-1)*g+t]=k[(u-1)*g+t],u>1&&(C[(u-2)*g+t]=k[(u-2)*g+t]);S[x]=C;const Z=t(h)??{r:255,g:69,b:0},$=t(f)??{r:255,g:224,b:102};o.clearRect(0,0,e,n),o.font=`${i}px "JetBrains Mono", monospace`,o.textBaseline="top";for(let t=0;t<u;t++)for(let e=0;e<g;e++){const n=C[t*g+e];if(n<.03)continue;const a=l[Math.min(l.length-1,Math.floor(n*l.length))];if(" "===a)continue;const r=Math.min(1,1.2*n),i=Z.r+($.r-Z.r)*r|0,h=Z.g+($.g-Z.g)*r|0,f=Z.b+($.b-Z.b)*r|0,c=M?1-.3*n:Math.min(1,n+.15);o.globalAlpha=c,o.fillStyle=`rgb(${i},${h},${f})`,o.fillText(a,e*p,t*d)}o.globalAlpha=1}var a={id:"fire",name:"Fire",description:"A cellular flame rising from the bottom edge.",cellSize:13,speed:1,cursor:!1,mount:t=>o(t,(t,o,a,r,i,l)=>n(t,o,a,l.elapsed,{fontSize:l.fontSize,chars:l.chars,color:l.ink,hotColor:l.accent??e(l.ink,"#ffffff",.6),speed:l.speed}),48)};export{a as fire,n as renderFireBackground};//# sourceMappingURL=chunk-73M2OESE.js.map
@@ -1 +0,0 @@
1
- import{styleKeeper as e,isDark as t,BASE_LOOK as n,prefersReduced as r,resolveColor as o,mergeOptions as i}from"./chunk-S7RZP2MT.js";import{poster as s,liveField as l,disposeKit as u,setPosterSource as a}from"./chunk-3PCKMO6I.js";import{isGlyphFieldSupported as c}from"../field.js";var d=e=>new Promise(t=>setTimeout(t,e));function p(i){const{host:u,layer:a="under",kit:d}=i;if("undefined"==typeof document)return null;const p=`position:absolute;inset:0;width:100%;height:100%;pointer-events:none;border-radius:inherit;z-index:${"under"===a?-1:"auto"}`;if(!c())return d?.current.poster&&!i.ownPoster&&s(u,d.current.poster,p,d),null;const f=e(),m=document.createElement("canvas");"static"===getComputedStyle(u).position&&f.set(u,"position","relative"),"under"===a&&f.set(u,"isolation","isolate"),m.dataset.asciiKit="",m.setAttribute("style",p),u.appendChild(m);let h=t(u),g=!1;const v=()=>{const e=i.reducedMotion();return!0===e?{speed:0,drift:0,respectReducedMotion:!0}:{respectReducedMotion:!1!==e}},b=()=>o(i.ink(h),u,h?"#d8d6cf":"#1d1d1b")??"#888888",y=l({host:u,canvas:m,kit:d,place:p,ownPoster:i.ownPoster,glyphs:i.glyphs,source:i.source??null,options:()=>({...n,...i.look(h),...v(),ink:b(),interactionTarget:u,label:i.label??""}),onMount:(e,t)=>{i.label||(t.removeAttribute("role"),t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")),i.onMount?.()},onRelease:i.onRelease,onFail:()=>{j(),i.onFail?.()}}),M=y.field;let k=0;const w=()=>{g||(h=t(u),M.update({...n,...i.look(h),...v(),ink:b()}))},P=()=>{k||g||(k=requestAnimationFrame(()=>{k=0,w()}))},R="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;R?.addEventListener?.("change",P);const O="function"==typeof MutationObserver?new MutationObserver(P):null;for(const e of[document.documentElement,document.body])e&&O?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});function j(){g||(g=!0,k&&cancelAnimationFrame(k),O?.disconnect(),R?.removeEventListener?.("change",P),y.destroy(),f.restore())}return y.start(),y.failed?(j(),null):{field:M,get canvas(){return y.canvas},get live(){return y.live},dark:()=>h,still:()=>!!(i.reducedMotion()??r()),refresh:w,destroy:j}}function f(e,t,n,r,o=()=>{}){let s=!1;const l={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(r){if(s)return;t.current=i(t.current,r);const o=r.poster;o&&a(t,o),n(t.current),e()?.refresh()},play(){s||e()?.field.play()},pause(){s||e()?.field.pause()},destroy(){s||(s=!0,o(),e()?.destroy(),u(t))}};return Object.defineProperties(r,Object.getOwnPropertyDescriptors(l))}function m(e,t){const n=Object.assign(document.createElement("canvas"),{width:e,height:t}),r=n.getContext("2d");return r.fillStyle="#000",r.fillRect(0,0,e,t),{canvas:n,pen:r}}function h(e,t,n){if(!t)return void e.pulse({strength:n});if("getBoundingClientRect"in t)return void e.pulse({element:t,strength:n});const r=e.canvas.getBoundingClientRect();e.pulse({x:t.x-r.left,y:t.y-r.top,strength:n})}export{m as blank,p as mountPageField,f as pageHandle,h as pulseAt,d as sleep};//# sourceMappingURL=chunk-BTD6EFAW.js.map
@@ -1 +0,0 @@
1
- import{styleKeeper as t,srOnly as e,mountSurface as n,house as o,handle as r,clamp as l,smoothstep as a,hash as i}from"./chunk-S7RZP2MT.js";var c={value:0,duration:360,stagger:60,glyphs:"#%*+=-:",format:t=>t.toLocaleString(),face:"text"};function s(t,e){const n=(t,e)=>t[t.length-1-e]??"";for(let o=e.length-1;o>=0;o--)if(/\d/.test(n(e,o))&&n(t,o)!==n(e,o))return o;return-1}function f(f,u={}){const p=parseFloat((f.textContent??"").replace(/[^\d.-]/g,"")),h={current:{...c,...u,value:u.value??(Number.isFinite(p)?p:0)}},g=t();let d=h.current.value,m=h.current.format(d),y={from:m,to:m,t0:-1e9,up:!0,first:-1},x=null;const v=e(m,!0),S=document.createElement("span"),k=()=>{S.replaceChildren(...[...m].map(t=>Object.assign(document.createElement("span"),{textContent:t}))),v.textContent=m};x=n({host:f,look:()=>({mark:"glyph",charset:" .:-=+*#%@",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:3,cellAspect:.66,glyphScale:1,shade:.2,contrast:1.1,...h.current.look}),ink:()=>h.current.ink??getComputedStyle(f).color,kit:h,reducedMotion:()=>h.current.reducedMotion,resolution:2,onFail:()=>{x=null,f.textContent=m,g.restore()},paint:({pen:t,now:e,still:n,box:r,scale:c})=>{const s=getComputedStyle(S),f=parseFloat(s.fontSize),u=parseFloat(s.letterSpacing)||0,p=`${s.fontStyle} ${s.fontWeight} ${s.fontSize} ${s.fontFamily}`;t.setTransform(c,0,0,c,0,0),t.font=p,t.textAlign="center",t.textBaseline="alphabetic";const g=t.measureText("0"),d=g.fontBoundingBoxAscent||.8*f,m=g.fontBoundingBoxDescent||.2*f,{from:x,to:v,t0:k,up:b,first:C}=y,A=[...S.children],F=h.current,M="glyph"===F.face,w=(t,e)=>t[t.length-1-e]??"";let B=!1;return A.forEach((c,s)=>{const h=A.length-1-s,g=r(c),y=g.x+(g.w-u)/2,S=g.y,T=g.h,$=S+(T-d-m)/2+d,E=w(v,h),z=C-h,G=!n&&C>=0&&z>=0&&/\d/.test(E)?l((e-k)/(F.duration+z*F.stagger)):1,N=o(G),P=G<1&&!M?a(.72,1,G).toFixed(3):"";if(c.style.opacity!==P&&(c.style.opacity=P),G>=1)return void(M&&(t.globalAlpha=1,t.font=p,t.fillStyle="#fff",t.fillText(E,y,$)));B=!0,t.globalAlpha=M?1:1-a(.72,1,G);const j=5+2*z,W=[w(x,h),...Array.from({length:j},(t,e)=>F.glyphs[Math.floor(i(e+7*h,k)*F.glyphs.length)]??""),E];b||W.reverse();const D=(W.length-1)*T,I=b?N*D:D-N*D;t.save(),t.beginPath(),t.rect(y-g.w,S,2*g.w,T),t.clip(),W.forEach((e,n)=>{const o=$+n*T-I;if(o<S-T||o>S+2*T)return;const r=n>0&&n<W.length-1;t.font=r?`600 ${.84*f}px "Geist Mono", ui-monospace, monospace`:p,t.fillStyle=r?"#d0d0d0":"#fff",t.fillText(e,y,o)}),t.restore()}),t.globalAlpha=1,B}});const b=()=>{x&&g.set(S,"color","glyph"===h.current.face?"transparent":"inherit")};x&&(g.set(S,"display","inline-flex"),b(),S.setAttribute("aria-hidden","true"),f.replaceChildren(v,S,...(t=>[...t.children].filter(t=>"IMG"===t.tagName&&void 0!==t.dataset?.asciiPoster))(f),x.canvas),k(),document.fonts?.ready.then(()=>x?.kick()));const C=t=>{if(!Number.isFinite(t))return;const e=d,n=m;d=h.current.value=t,m=h.current.format(t),x?n!==m&&(y={from:n,to:m,up:t>=e,first:s(n,m),t0:performance.now()},k(),x.kick()):f.textContent=m};return r(()=>x,h,t=>{b(),t.value!==d?C(t.value):(m=t.format(d),k(),x?.refresh())},{set:C,get value(){return d}},()=>{x&&(f.textContent=m),g.restore()})}var u=c;export{u as ODOMETER_DEFAULTS,s as firstChanged,f as odometer};//# sourceMappingURL=chunk-OWEZV7TQ.js.map
@@ -1 +0,0 @@
1
- import{poster as e,liveField as t,disposeKit as n,setPosterSource as o}from"./chunk-3PCKMO6I.js";import{isGlyphFieldSupported as r}from"../field.js";var i,a,s=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),c=(e,t)=>{const n=43758.5453*Math.sin(127.1*e+311.7*t);return n-Math.floor(n)},l=(e,t=3)=>1-(1-s(e))**t,d=(e,t,n)=>{const o=s((n-e)/(t-e));return o*o*(3-2*o)},u=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)},p=()=>"function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion: reduce)").matches,h=e=>e??p(),f={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=v(t,r[1])||(r[2]??"").trim():o.startsWith("--")&&(o=v(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 g([+i[1],+i[2],+i[3]]);if(void 0===a)try{a="undefined"==typeof document?null:Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0})}catch{a=null}if(!a)return n?m(n,t):null;a.clearRect(0,0,1,1),a.fillStyle="#000",a.fillStyle=o,a.fillRect(0,0,1,1);const[s,c,l]=a.getImageData(0,0,1,1).data;return g([s,c,l])}var v=(e,t)=>"function"==typeof getComputedStyle?getComputedStyle(e).getPropertyValue(t).trim():"",g=e=>`#${e.map(e=>Math.round(s(e,0,255)).toString(16).padStart(2,"0")).join("")}`,y=e=>{const t=parseInt(e.slice(1,7),16);return[t>>16&255,t>>8&255,255&t]},b=(e,t,n)=>{const o=y(e),r=y(t);return g(o.map((e,t)=>e+(r[t]-e)*n))};function x(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]=y(o);return.2126*r+.7152*i+.0722*a>140}function w(){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 M(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 k(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 C(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,R=e=>E.get(e)?.()??null;function F(n){const{host:o,layer:a="over",outset:s=0,kit:c}=n;if("undefined"==typeof document)return null;const l=`position:absolute;left:${-s}px;top:${-s}px;width:calc(100% + ${2*s}px);height:calc(100% + ${2*s}px);pointer-events:none;z-index:${"under"===a?-1:"auto"}`;if(!r())return c?.current.poster&&e(o,c.current.poster,l,c),null;const d=w(),u=document.createElement("canvas"),h=document.createElement("canvas"),v=h.getContext("2d");if(!v)return null;"static"===getComputedStyle(o).position&&d.set(o,"position","relative"),"under"===a&&d.set(o,"isolation","isolate"),u.setAttribute("aria-hidden","true"),u.dataset.asciiKit="";const g=u.style;g.position="absolute",g.left=g.top=-s+"px",g.width=g.height=`calc(100% + ${2*s}px)`,g.pointerEvents="none",g.zIndex="under"===a?"-1":"",o.appendChild(u);const y=()=>{const e=getComputedStyle(o);$.canvas.style.borderRadius=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(e=>s&&/^[\d.]+px$/.test(e)?`${parseFloat(e)+s}px`:e).join(" ")};let b=x(o);const M=()=>m(n.ink(b),o)??m(getComputedStyle(o).color,o)??(b?"#d8d6cf":"#1d1d1b");let C=0,R=!1,F=!0,S=!1,A=-1/0,L=-1/0;const O=e=>{L=e.timeStamp};o.addEventListener("pointermove",O,{passive:!0}),o.addEventListener("pointerdown",O,{passive:!0});const $=t({host:o,canvas:u,kit:c,place:l,options:()=>({...f,...n.look(),ink:M(),interactionTarget:o,label:""}),onMount:(e,t)=>{E.set(t,q),t.removeAttribute("role"),t.removeAttribute("aria-label"),e.ready.then(T,()=>{}),T()},onRelease:()=>{C&&cancelAnimationFrame(C),C=0},onFail:()=>{Q(),n.onFail?.()}}),j=$.field;y();const P=()=>!!(n.reducedMotion()??p()),W=e=>k($.canvas,e),I=e=>{const t=$.canvas,r=Math.max(1,t.clientWidth||o.clientWidth+2*s),i=Math.max(1,t.clientHeight||o.clientHeight+2*s),a=n.resolution??1,[c,l]="function"==typeof a?a(r,i):[Math.max(1,Math.round(r*a)),Math.max(1,Math.round(i*a))];h.width===c&&h.height===l||(h.width=c,h.height=l),v.setTransform(1,0,0,1,0,0),v.globalAlpha=1,v.globalCompositeOperation="source-over",v.filter="none",v.fillStyle="#000",v.fillRect(0,0,c,l);let d=!1;try{d=n.paint({pen:v,width:c,height:l,w:r,h:i,scale:c/r,now:e,still:P(),dark:b,box:W})}catch(e){"undefined"!=typeof console&&console.error(e)}return j.setSource(h).then(()=>{S||j.redraw()}),d};function q(){const e=$.canvas,t=Math.max(1,e.clientWidth||o.clientWidth+2*s),r=Math.max(1,e.clientHeight||o.clientHeight+2*s),i=n.resolution??1,[a,c]="function"==typeof i?i(t,r):[Math.max(1,Math.round(t*i)),Math.max(1,Math.round(r*i))],l=document.createElement("canvas");l.width=a,l.height=c;const d=l.getContext("2d");if(!d)return null;d.fillStyle="#000",d.fillRect(0,0,a,c);try{n.paint({pen:d,width:a,height:c,w:t,h:r,scale:a/t,now:performance.now(),still:!0,dark:b,box:W})}catch{return null}return l}E.set(u,q);const z=e=>{if(C=0,S||R||!$.live)return;if(e-A<(i??(i=(()=>{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})()))&&e-L>1e3)return void(C=requestAnimationFrame(z));A=e;!I(e)||P()||!F||"undefined"!=typeof document&&document.hidden||(C=requestAnimationFrame(z))};function T(){C||S||R||!$.live||(C=requestAnimationFrame(z))}const B="function"==typeof ResizeObserver?new ResizeObserver(()=>{y(),j.resize(),!$.live||S||R||I(performance.now()),T()}):null;B?.observe(o);const H="function"==typeof IntersectionObserver?new IntersectionObserver(([e])=>{F=e.isIntersecting,F&&T()},{rootMargin:"64px"}):null;H?.observe(o);const D=()=>{document.hidden||T()};document.addEventListener("visibilitychange",D);let K=0;const V=()=>{K||S||(K=requestAnimationFrame(()=>{K=0,S||(b=x(o),j.update({ink:M()}),n.onTheme?.(),T())}))},G="function"==typeof matchMedia?matchMedia("(prefers-color-scheme: dark)"):null;G?.addEventListener?.("change",V);const J="function"==typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null;J?.addEventListener?.("change",T);const N="function"==typeof MutationObserver?new MutationObserver(V):null;for(const e of[document.documentElement,document.body])e&&N?.observe(e,{attributes:!0,attributeFilter:["class","data-theme","data-mode","style"]});function Q(){S||(S=!0,C&&cancelAnimationFrame(C),K&&cancelAnimationFrame(K),C=K=0,B?.disconnect(),H?.disconnect(),N?.disconnect(),document.removeEventListener("visibilitychange",D),o.removeEventListener("pointermove",O),o.removeEventListener("pointerdown",O),G?.removeEventListener?.("change",V),J?.removeEventListener?.("change",T),$.destroy(),d.restore(),h.width=h.height=1)}return $.start(),$.failed?(Q(),null):{field:j,get canvas(){return $.canvas},get live(){return $.live},kick:T,refresh(){S||(b=x(o),j.update({...f,...n.look(),ink:M()}),T())},still:P,dark:()=>b,box:W,play(){R&&(R=!1,j.play(),T())},pause(){R=!0,C&&cancelAnimationFrame(C),C=0,j.pause()},destroy:Q}}function S(e,t,r,i,a=()=>{}){let s=!1;const c={get supported(){return!!e()&&!s},get field(){return s?null:e()?.field??null},update(e){if(s)return;t.current=C(t.current,e);const n=e.poster;n&&o(t,n),r(t.current)},play(){s||e()?.play()},pause(){s||e()?.pause()},destroy(){s||(s=!0,e()?.destroy(),n(t),a())}};return Object.defineProperties(i,Object.getOwnPropertyDescriptors(c))}export{f as BASE_LOOK,k as boxIn,s as clamp,l as easeOut,S as handle,c as hash,y as hexRgb,u as house,x as isDark,C as mergeOptions,b as mixHex,F as mountSurface,p as prefersReduced,h as reducedFrom,m as resolveColor,R as settledSource,d as smoothstep,M as srOnly,w as styleKeeper,g as toHex};//# sourceMappingURL=chunk-S7RZP2MT.js.map
@@ -1 +0,0 @@
1
- import{clamp as t,hash as e,mountSurface as r,handle as a,smoothstep as n}from"./chunk-S7RZP2MT.js";var o={colorful:["#22c55e","#06b6d4","#6366f1","#d946ef","#f43f5e","#f59e0b"],mono:["#ffffff"],ocean:["#22d3ee","#3b82f6","#2dd4bf","#818cf8"],sunset:["#f97316","#f43f5e","#ec4899","#fbbf24"]},s={palette:"colorful",mode:"rotate",grain:"dots",speed:1,hover:!0,depth:18},i=["rotate","pulse","progress"],l=t=>{const e=/^#[\da-f]{3}$/i.test(t)?`#${[...t.slice(1)].map(t=>t+t).join("")}`:t;return[1,3,5].map(t=>(parseInt(e.slice(t,t+2),16)||0)/255)},h=(t,e,r)=>t.map((t,a)=>t+(e[a]-t)*r),c=l("#ff4a4a"),u=l("#2fd67b");function p(t){const e=("string"==typeof t?o[t]??o.colorful:t.length?t:o.colorful).map(l),r=new Float32Array(1024);for(let t=0;t<256;t++){const a=t/256*e.length,n=Math.floor(a),o=a-n,s=1===e.length?e[0]:h(e[n%e.length],e[(n+1)%e.length],o*o*(3-2*o)),i=Math.max(...s,.01);r.set([s[0]/i,s[1]/i,s[2]/i,(.2126*s[0]+.7152*s[1]+.0722*s[2])/i],4*t)}return r}var m=(t,e)=>{const r=(-t%1+1)%1,a=1-r;return Math.max(r<e?(1-r/e)**2.2:0,a<.03?(1-a/.03)**2:0)},M=t=>Math.max(m(t,.3),.75*m(t-.5,.22)),f=(t,e)=>t<=e?.42+.4*(t/Math.max(e,.001))**1.6+.38*Math.exp(-(((e-t)/.03)**2)):t-e<.014?1.2*(1-(t-e)/.014)**2:0,d=(e,r)=>t((e-.68*r)/.07);function g(t,r,a,n,o,s,i){const l=Math.ceil(t/a),h=t/2,c=r/2,u=Math.min(h,c),[p,m,M,f]=[0,1,2,3].map(t=>Math.max(0,Math.min(s[t]??s[0]??0,u))),d=new Int32Array(l*Math.ceil(r/n)).fill(-1),g=[],x=[],v=[];for(let t=0;t<d.length;t++){const r=(t%l+.5)*a-h,s=(Math.floor(t/l)+.5)*n-c,u=r<0?s<0?p:f:s<0?m:M,k=Math.abs(r)-h+u,b=Math.abs(s)-c+u,y=-(Math.hypot(Math.max(k,0),Math.max(b,0))+Math.min(Math.max(k,b),0)-u),L=y>0?Math.min(Math.max(0,1-y/Math.max(1,o))**1.7,y/Math.max(.1,i)):0;if(L<.004)continue;d[t]=g.length,g.push(L);const w=Math.atan2(s/Math.max(1,c),r/Math.max(1,h))/(2*Math.PI)+.25,A=w-Math.floor(w);x.push(A),v.push(.78*e(Math.floor(46*A),5)+.22*e(t,9))}const k=Math.max(1,Math.round(t)),b=Math.max(1,Math.round(r)),y=[],L=[];for(let t=0;t<b;t++)for(let e=0;e<k;e++){const r=d[Math.min(l-1,Math.floor((e+.5)/a))+l*Math.floor((t+.5)/n)];r>=0&&(y.push(t*k+e),L.push(r))}return{W:k,H:b,weight:Float32Array.from(g),turn:Float32Array.from(x),crack:Float32Array.from(v),pixel:Int32Array.from(y),owner:Int32Array.from(L)}}function x(o,l={}){const h={current:{...s,...l}};let m="idle",x=0,v=p(h.current.palette),k=!1;const b=()=>"mono"===h.current.palette,y=()=>({..."glyphs"===h.current.grain?{mark:"glyph",charset:" ·.:-+*",font:'"Geist Mono", ui-monospace, monospace',fontWeight:500,cellSize:5,cellAspect:.6,glyphScale:1}:{mark:"dot",cellSize:3.5,cellAspect:1,dotScale:.82},color:b()?"ink":"source",saturation:1.25,shade:.55,contrast:2.4,brightness:.58,...h.current.look}),L=t=>{const e=!t.dark();t.canvas.style.opacity=e?"0.72":"",t.canvas.style.filter=e&&!b()?"brightness(1.45) saturate(.9)":""};let w=null,A=null,I=new Uint8Array(0),$="",E=0,F=null,P=0,R=.62,S=0,T=0,W=0,j=0,z=0,H=0;const B={rotate:0,pulse:0,progress:0};B[h.current.mode]=1;let D=null;D=r({host:o,look:y,ink:t=>h.current.ink??(t?"#b3b1aa":"#8a8882"),kit:h,reducedMotion:()=>h.current.reducedMotion,onTheme:()=>D&&L(D),onFail:()=>{D=null},resolution:(t,e)=>[Math.max(1,Math.round(t)),Math.max(1,Math.round(e))],paint:r=>{const{pen:a,w:s,h:l,now:p,still:b,dark:L}=r,U=h.current,C=getComputedStyle(o),G=Math.min(o.clientWidth||s,o.clientHeight||l),N=Math.max(2,Math.min(U.depth,Math.min(parseFloat(C.paddingTop)||U.depth,parseFloat(C.paddingLeft)||U.depth)-2)),Z=[C.borderTopLeftRadius,C.borderTopRightRadius,C.borderBottomRightRadius,C.borderBottomLeftRadius].map(t=>((t,e)=>t.endsWith("%")?parseFloat(t)/100*e:parseFloat(t)||0)(t??"",G)),q=y(),J="dot"!==q.mark,K=q.cellSize??(J?5:3.5),O=q.cellAspect??(J?.6:1),Q=`${s}x${l}:${U.grain}:${N}:${Z.join(",")}:${K}:${O}`;if(Q!==$){$=Q,D.canvas.style.clipPath=`inset(0 round ${Z.map(t=>`${t}px`).join(" ")})`;const t=Math.min(globalThis.devicePixelRatio||1,q.maxPixelRatio??2),e=Math.max(2,Math.round(K*t)),r=Math.max(2,Math.round(e*O))/t,n=e/t;w=g(s,l,r,n,N,Z,J?Math.min(r,n)/2:(q.dotScale??.82)*r/2),A=a.createImageData(w.W,w.H),I=new Uint8Array(3*w.weight.length)}const V=w,X=A.data,Y=V.crack,_=(e,r,n,o,s)=>{I.fill(0);for(let a=0;a<V.weight.length;a++){const i=V.turn[a],l=t(V.weight[a]*e(i,a))*(L?1.12:.8);if(l<.03)continue;const h=4*(255&Math.floor(((i-r)%1+1)%1*256));let p=v[h],m=v[h+1],M=v[h+2],f=v[h+3];const d=s&&L?s(i):0;(o>0||n>0||d>0)&&(o>0&&(p+=(u[0]-p)*o,m+=(u[1]-m)*o,M+=(u[2]-M)*o),n>0&&(p+=(c[0]-p)*n,m+=(c[1]-m)*n,M+=(c[2]-M)*n),d>0&&(p+=(1-p)*d,m+=(1-m)*d,M+=(1-M)*d),f=.2126*p+.7152*m+.0722*M);const g=255*Math.min(1,(l+.12)/2.4/Math.max(f,.01));I[3*a]=p*g,I[3*a+1]=m*g,I[3*a+2]=M*g}X.fill(0);for(let t=0;t<V.pixel.length;t++){const e=4*V.pixel[t],r=3*V.owner[t];X[e]=I[r],X[e+1]=I[r+1],X[e+2]=I[r+2],X[e+3]=255}a.putImageData(A,0,0)};if(b){const t="progress"===U.mode?t=>"running"===m||"error"===m?f(t,x):.14:t=>("running"===m?.75:.55)*(.7+.3*Math.cos(2*Math.PI*(t-.12)));return"success"===m?_(()=>.62,0,0,.9):"error"===m?_((e,r)=>.5*t(e)*d(Y[r],1),0,.9,0):_(t,0,0,0),!1}const tt=E?Math.min(48,p-E):16;E=p,m!==F&&("running"===m&&"running"!==F&&(z=0),P=p,F=m);let et=p-P;"success"===m&&et>2700&&(m=F="idle",x=0,P=p,et=0);const rt="running"===m,at="error"===m,nt="success"===m,ot=U.hover&&k;for(const t of i)B[t]+=((t===U.mode?1:0)-B[t])*(1-Math.exp(-tt/260));if(at)T=0;else{const t=(rt?1500-500*x:"pulse"===U.mode?9e3:2600)/Math.max(.05,U.speed);T+=(1/t*(ot?1.35:1)-T)*(1-Math.exp(-tt/320)),R+=T*tt,H+=tt,S+=tt/("pulse"===U.mode?14e3:26e3)*(1-B.progress),(rt||nt)&&(z+=((nt?1:x)-z)*(1-Math.exp(-tt/110)))}W+=((ot?1:0)-W)*(1-Math.exp(-tt/220)),j=at?.9*n(0,60,et):j*Math.exp(-tt/180);const st=1+.22*W,it=.32+.68*(.5-.5*Math.cos(2*Math.PI*H/2400)),lt=.05+.1*(.5-.5*Math.cos(2*Math.PI*H/5200)),ht=rt||nt||at,ct=t=>st*(B.rotate*M(t-R)+B.pulse*(rt||at?M(t-R):it*(.78+.22*Math.cos(2*Math.PI*(t-R))))+B.progress*(ht?f(t,z):lt));if(nt){const e=n(0,260,et),r=t((et-240)/620),a=1-n(860,1060,et),o=n(780,1e3,et),s=n(1350,2450,et),i=(L?.86:.55)*e*(1-o)+.62*o*(1-s),l=1-e*(1-n(1900,2700,et)*(1-B.progress)),h=t=>{if(et<240)return 0;const e=r-t;return a*(e>=0?e<.2?(1-e/.2)**2:0:e>-.02?(1+e/.02)**2:0)};return _(t=>Math.max(ct(t)*l,i*(.9+.1*Math.cos(2*Math.PI*(t-.1))),1.3*h(t),B.progress*lt*s),S,0,.9*o*(1-s),e=>t(.8*h(e))),!0}if(at){const t=et<90?1.2:et<170?.1:et<260?1.2:et<340?.1:1,r=n(380,1150,et),a=1-.5*n(700,1500,et),o=Math.floor(et/50);return _((n,s)=>{const i=d(Y[s],r);return i<=0?0:ct(n)*t*i*a*(1-1.4*r*(1-r)*e(s,o))},S,j,0),et<1600||Math.abs(W-(ot?1:0))>.01}return _(ct,S,j,0),!0}});const U=()=>{k||(k=!0,D?.kick())},C=()=>{k=!1,D?.kick()},G=t=>{k=t.target?.matches?.(":focus-visible")??!1,D?.kick()};D&&(L(D),o.addEventListener("pointerenter",U),o.addEventListener("pointermove",U),o.addEventListener("pointerleave",C),o.addEventListener("focusin",G),o.addEventListener("focusout",C));const N=t=>{m=t,D?.kick()};return a(()=>D,h,t=>{v=p(t.palette),D?.refresh(),D&&L(D)},{progress(e){x=t(Number.isFinite(e)?e:0),N("running")},success(){N("success")},error(){N("error")},reset(){x=0,N("idle")}},()=>{o.removeEventListener("pointerenter",U),o.removeEventListener("pointermove",U),o.removeEventListener("pointerleave",C),o.removeEventListener("focusin",G),o.removeEventListener("focusout",C)})}var v=s;export{v as BEAM_DEFAULTS,o as BEAM_PALETTES,x as beam,M as beamArcs,g as beamBand,d as beamCracked,p as beamPalette,f as beamRing};//# sourceMappingURL=chunk-SNCXU7KF.js.map
@@ -1 +0,0 @@
1
- import{parseColor as o,fbm as t,hash2 as e}from"./chunk-ZCHGV2CV.js";import{mountCanvas as r}from"./chunk-BR6ZNJZW.js";import{mixHex as l}from"./chunk-S7RZP2MT.js";function n(r,l,n,a,i={}){const{fontSize:c=13,chars:s=" .,:;+*#@",color:f="#4caf50",skyColor:h="#1a237e",peakColor:g="#e0e0e0",speed:p=1,roughness:M=.55,heightScale:b=.55,stars:d=!0,lightMode:m=!1}=i,k=.62*c,u=1.4*c,S=Math.ceil(l/k),x=Math.ceil(n/u),$=o(f)??{r:76,g:175,b:80},y=o(h)??{r:26,g:35,b:126},C=o(g)??{r:224,g:224,b:224};r.clearRect(0,0,l,n),r.font=`${c}px "JetBrains Mono", monospace`,r.textBaseline="top";const A=a*p*.4,z=new Array(S);for(let o=0;o<S;o++){const e=(.5*t((o/S+A)*M*3,.5)+.5)*b;z[o]=Math.floor(e*x)}for(let o=0;o<x;o++)for(let t=0;t<S;t++){const l=x-1-z[t],n=o===l;if(!(o>=l)){if(d){const l=e(7*t+Math.floor(.3*A),13*o);if(l>.97){const e=.3*Math.sin(2*a+100*l)+.7;r.globalAlpha=.5*e,r.fillStyle=`rgb(${y.r+60},${y.g+60},${y.b+80})`,r.fillText("·",t*k,o*u)}}continue}const i=(o-l)/Math.max(1,z[t]),c=s[Math.min(s.length-1,Math.floor(i*s.length))];if(" "===c&&!n)continue;const f=n?1:Math.max(0,1-4*i),h=$.r+(C.r-$.r)*f|0,g=$.g+(C.g-$.g)*f|0,p=$.b+(C.b-$.b)*f|0;r.globalAlpha=.5+.5*i,r.fillStyle=`rgb(${h},${g},${p})`,r.fillText(n?s[s.length-1]:c,t*k,o*u)}r.globalAlpha=1}var a={id:"terrain",name:"Terrain",description:"A side-scrolling landscape drawn in density characters.",cellSize:13,speed:1,cursor:!1,mount:o=>r(o,(o,t,e,r,a,i)=>n(o,t,e,r,{fontSize:i.fontSize,chars:i.chars,lightMode:i.lightMode,color:i.ink,peakColor:i.accent??l(i.ink,"#ffffff",.65),skyColor:l(i.ink,"#0c0d0b",.55)}))};export{n as renderTerrainBackground,a as terrain};//# sourceMappingURL=chunk-UML6XQAR.js.map
@@ -1 +0,0 @@
1
- import{parseColor as t,MONO as e,pixelSnap as n,fbm as o,hash2 as a,band as r,ditherIndex as i,toneAlpha as c}from"./chunk-ZCHGV2CV.js";import{mountCanvas as h}from"./chunk-BR6ZNJZW.js";import{hexRgb as s}from"./chunk-S7RZP2MT.js";function l(h,s,l,f,M={x:.5,y:.5},m={}){const{fontSize:g=13,charAspect:u=.62,lineHeightRatio:d=1.3,chars:p=" .:-=+*#%@",baseColor:x=null,accentColor:$,accentThreshold:S=.52,mouseInfluence:b=.4,mouseFalloff:C=2.8,speed:k=1,vortex:v=!0,sparkles:y=!1,breathe:z=!0,lightMode:R=!1}=m,Z=Array.from(p),j=g*u,w=g*d,A=Math.ceil(s/j),T=Math.ceil(l/w),B=M.x,H=M.y,V=$?t($):null;h.clearRect(0,0,s,l),h.font=`${g}px ${e}`;const W=n(h);h.textBaseline="top";const q=f*k,F=z?.12*(.5*Math.sin(.22*q)+.5):0;for(let t=0;t<T;t++)for(let e=0;e<A;e++){const n=e/A,s=t/T,l=.045,f=.08*q,M=.06,g=.45*((.5*Math.sin(.08*e+.05*t+.6*q)+.5+(.5*Math.sin(.03*e-.07*t+.4*q)+.5)+(.5*Math.sin(.05*e+.03*t+.8*q)+.5))/3)+.35*(.5*o(e*l+f,t*l*1.4-.7*f)+.5)+.2*(.5*Math.sin((e+.65*t)*M+1.1*q)+.5)+F,u=n-B,d=s-H,p=Math.sqrt(u*u+d*d);let $=0;if(v&&p<.35){const t=Math.atan2(d,u),e=Math.sin(4*t+2.2*q-14*p),n=Math.max(0,1-p/.35);$=e*n*n*.22}const k=g*(1-b)+(Math.max(0,1-p*C)+.5*$)*b+.15*$,z=Math.min(1,Math.max(0,k));let G=z;if(y&&z>.72){const n=Math.floor(8*q),o=a(7*e+3*n,11*t+n);o>.88&&(G=Math.min(1,z+4*(o-.88)))}const I=r(G,.32,.9);if(I<=0)continue;const J=i(I,Z.length,e,t,m.ditherStrength);if(" "===Z[J])continue;const N=c(I);h.fillStyle=V&&G>S?`rgba(${V.r},${V.g},${V.b},${N})`:x?x.replace("{a}",String(N)):R?`rgba(111,109,103,${N})`:`rgba(143,141,134,${N})`,h.fillText(Z[J],W(e*j),W(t*w))}}var f={id:"wave",name:"Wave",description:"An interference field with a soft vortex at the cursor and a slow breath.",cellSize:13,speed:.6,cursor:!0,mount:t=>h(t,(t,e,n,o,a,r)=>{const[i,c,h]=s(r.ink);l(t,e,n,o,a,{ditherStrength:r.ditherStrength,fontSize:r.fontSize,chars:r.chars,lightMode:r.lightMode,baseColor:`rgba(${i},${c},${h},{a})`,accentColor:r.accent})})};export{l as renderWaveBackground,f as wave};//# sourceMappingURL=chunk-UO7RB7RC.js.map
@@ -1 +0,0 @@
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-BR6ZNJZW.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:y=.9,mouseWarp:z=.3,lightMode:C=!1}=u,k=Array.from(M),Z=.62*m,j=1.3*m,v=Math.ceil(h/Z),w=Math.ceil(f/j);s.clearRect(0,0,h,f),s.font=`${m}px ${t}`,s.textBaseline="top";const A=C?e:o;let B=A.r,N=A.g,R=A.b;const T=r(s);if($){const t=n($);t&&(B=t.r,N=t.g,R=t.b)}let V=B,W=N,q=R;const G=p?n(p):null;G&&(V=G.r,W=G.g,q=G.b);const H=.035*b,J=d*S,D=Math.min(6,Math.max(1,x)),E=(t,e)=>{let o=0,r=.5,n=1,c=0;for(let i=0;i<D;i++)o+=l(t*n,e*n)*r,c+=r,r*=.5,n*=2.1;return o/c};for(let t=0;t<w;t++)for(let e=0;e<v;e++){const o=e*H+.06*J,r=t*H*1.3-.04*J,n=e/v-g.x,l=t/w-g.y,h=Math.sqrt(n*n+l*l),f=z>0?.12*Math.max(0,1-h/z):0,d=E(o+f*Math.sin(1.3*J+8*l),r+f*Math.cos(.9*J+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=!!G&&m>y,$=a(m);s.fillStyle=p?`rgba(${V},${W},${q},${$})`:`rgba(${B},${N},${R},${$})`,s.fillText(M,T(e*Z),T(t*j))}}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-XM56OTYT.js.map