nodality 1.2.7 → 1.2.8

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 (235) hide show
  1. package/dist/animator.cjs.js +1 -1
  2. package/dist/animator.cjs.js.LICENSE.txt +1 -1
  3. package/dist/animator.esm.js.LICENSE.txt +1 -1
  4. package/dist/audionew.cjs.js +1 -1
  5. package/dist/audionew.cjs.js.LICENSE.txt +1 -1
  6. package/dist/audionew.esm.js.LICENSE.txt +1 -1
  7. package/dist/base.cjs.js +1 -1
  8. package/dist/base.cjs.js.LICENSE.txt +1 -1
  9. package/dist/base.esm.js.LICENSE.txt +1 -1
  10. package/dist/beta-desktop-bar.cjs.js +1 -1
  11. package/dist/beta-desktop-bar.cjs.js.LICENSE.txt +1 -1
  12. package/dist/beta-desktop-bar.esm.js.LICENSE.txt +1 -1
  13. package/dist/beta-mobile-bar.cjs.js +1 -1
  14. package/dist/beta-mobile-bar.cjs.js.LICENSE.txt +1 -1
  15. package/dist/beta-mobile-bar.esm.js.LICENSE.txt +1 -1
  16. package/dist/bundle.umd.js +1 -1
  17. package/dist/bundle.umd.js.LICENSE.txt +1 -1
  18. package/dist/button.cjs.js +1 -1
  19. package/dist/button.cjs.js.LICENSE.txt +1 -1
  20. package/dist/button.esm.js.LICENSE.txt +1 -1
  21. package/dist/card-getter.cjs.js.LICENSE.txt +1 -1
  22. package/dist/card-getter.esm.js.LICENSE.txt +1 -1
  23. package/dist/center.cjs.js +1 -1
  24. package/dist/center.cjs.js.LICENSE.txt +1 -1
  25. package/dist/center.esm.js.LICENSE.txt +1 -1
  26. package/dist/checkbox.cjs.js +1 -1
  27. package/dist/checkbox.cjs.js.LICENSE.txt +1 -1
  28. package/dist/checkbox.esm.js.LICENSE.txt +1 -1
  29. package/dist/code.cjs.js +1 -1
  30. package/dist/code.cjs.js.LICENSE.txt +1 -1
  31. package/dist/code.esm.js.LICENSE.txt +1 -1
  32. package/dist/container.cjs.js +1 -1
  33. package/dist/container.cjs.js.LICENSE.txt +1 -1
  34. package/dist/container.esm.js.LICENSE.txt +1 -1
  35. package/dist/data-list.cjs.js +1 -1
  36. package/dist/data-list.cjs.js.LICENSE.txt +1 -1
  37. package/dist/data-list.esm.js.LICENSE.txt +1 -1
  38. package/dist/designer.cjs.js +1 -1
  39. package/dist/designer.cjs.js.LICENSE.txt +1 -1
  40. package/dist/designer.esm.js.LICENSE.txt +1 -1
  41. package/dist/element-mapper.cjs.js +1 -1
  42. package/dist/element-mapper.cjs.js.LICENSE.txt +1 -1
  43. package/dist/element-mapper.esm.js.LICENSE.txt +1 -1
  44. package/dist/finalresult.esm.js +1 -1
  45. package/dist/finalresult.esm.js.LICENSE.txt +1 -1
  46. package/dist/flex-card.cjs.js +1 -1
  47. package/dist/flex-card.cjs.js.LICENSE.txt +1 -1
  48. package/dist/flex-card.esm.js.LICENSE.txt +1 -1
  49. package/dist/flex-grid.cjs.js +1 -1
  50. package/dist/flex-grid.cjs.js.LICENSE.txt +1 -1
  51. package/dist/flex-grid.esm.js.LICENSE.txt +1 -1
  52. package/dist/flex-row.cjs.js +1 -1
  53. package/dist/flex-row.cjs.js.LICENSE.txt +1 -1
  54. package/dist/flex-row.esm.js.LICENSE.txt +1 -1
  55. package/dist/floating-input.cjs.js +1 -1
  56. package/dist/floating-input.cjs.js.LICENSE.txt +1 -1
  57. package/dist/floating-input.esm.js.LICENSE.txt +1 -1
  58. package/dist/free.cjs.js +1 -1
  59. package/dist/free.cjs.js.LICENSE.txt +1 -1
  60. package/dist/free.esm.js.LICENSE.txt +1 -1
  61. package/dist/horizontal-scroller.cjs.js.LICENSE.txt +1 -1
  62. package/dist/horizontal-scroller.esm.js.LICENSE.txt +1 -1
  63. package/dist/image-picker.cjs.js +1 -1
  64. package/dist/image-picker.cjs.js.LICENSE.txt +1 -1
  65. package/dist/image-picker.esm.js.LICENSE.txt +1 -1
  66. package/dist/image.cjs.js +1 -1
  67. package/dist/image.cjs.js.LICENSE.txt +1 -1
  68. package/dist/image.esm.js.LICENSE.txt +1 -1
  69. package/dist/index.cjs.js +1 -1
  70. package/dist/index.cjs.js.LICENSE.txt +1 -1
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.esm.js.LICENSE.txt +1 -1
  73. package/dist/keyframe-animation.cjs.js.LICENSE.txt +1 -1
  74. package/dist/keyframe-animation.esm.js.LICENSE.txt +1 -1
  75. package/dist/link-getter.cjs.js +1 -1
  76. package/dist/link-getter.cjs.js.LICENSE.txt +1 -1
  77. package/dist/link-getter.esm.js.LICENSE.txt +1 -1
  78. package/dist/link.cjs.js +1 -1
  79. package/dist/link.cjs.js.LICENSE.txt +1 -1
  80. package/dist/link.esm.js.LICENSE.txt +1 -1
  81. package/dist/meta-adder.cjs.js +1 -1
  82. package/dist/meta-adder.cjs.js.LICENSE.txt +1 -1
  83. package/dist/meta-adder.esm.js.LICENSE.txt +1 -1
  84. package/dist/modal-2025.cjs.js +1 -1
  85. package/dist/modal-2025.cjs.js.LICENSE.txt +1 -1
  86. package/dist/modal-2025.esm.js.LICENSE.txt +1 -1
  87. package/dist/multiswitcher.cjs.js +1 -1
  88. package/dist/multiswitcher.cjs.js.LICENSE.txt +1 -1
  89. package/dist/multiswitcher.esm.js.LICENSE.txt +1 -1
  90. package/dist/new-nav-bar.cjs.js +1 -1
  91. package/dist/new-nav-bar.cjs.js.LICENSE.txt +1 -1
  92. package/dist/new-nav-bar.esm.js.LICENSE.txt +1 -1
  93. package/dist/picker.cjs.js +1 -1
  94. package/dist/picker.cjs.js.LICENSE.txt +1 -1
  95. package/dist/picker.esm.js.LICENSE.txt +1 -1
  96. package/dist/progress.cjs.js +1 -1
  97. package/dist/progress.cjs.js.LICENSE.txt +1 -1
  98. package/dist/progress.esm.js.LICENSE.txt +1 -1
  99. package/dist/radio.cjs.js +1 -1
  100. package/dist/radio.cjs.js.LICENSE.txt +1 -1
  101. package/dist/radio.esm.js.LICENSE.txt +1 -1
  102. package/dist/range.cjs.js +1 -1
  103. package/dist/range.cjs.js.LICENSE.txt +1 -1
  104. package/dist/range.esm.js.LICENSE.txt +1 -1
  105. package/dist/scroll-video.cjs.js.LICENSE.txt +1 -1
  106. package/dist/scroll-video.esm.js.LICENSE.txt +1 -1
  107. package/dist/side-bar.cjs.js +1 -1
  108. package/dist/side-bar.cjs.js.LICENSE.txt +1 -1
  109. package/dist/side-bar.esm.js.LICENSE.txt +1 -1
  110. package/dist/side-nav-bar.cjs.js +1 -1
  111. package/dist/side-nav-bar.cjs.js.LICENSE.txt +1 -1
  112. package/dist/side-nav-bar.esm.js.LICENSE.txt +1 -1
  113. package/dist/simple-bar.cjs.js +1 -1
  114. package/dist/simple-bar.cjs.js.LICENSE.txt +1 -1
  115. package/dist/simple-bar.esm.js.LICENSE.txt +1 -1
  116. package/dist/slider-2025.cjs.js +1 -1
  117. package/dist/slider-2025.cjs.js.LICENSE.txt +1 -1
  118. package/dist/slider-2025.esm.js.LICENSE.txt +1 -1
  119. package/dist/spacer.cjs.js +1 -1
  120. package/dist/spacer.cjs.js.LICENSE.txt +1 -1
  121. package/dist/spacer.esm.js.LICENSE.txt +1 -1
  122. package/dist/stack.cjs.js +1 -1
  123. package/dist/stack.cjs.js.LICENSE.txt +1 -1
  124. package/dist/stack.esm.js.LICENSE.txt +1 -1
  125. package/dist/stacker.cjs.js.LICENSE.txt +1 -1
  126. package/dist/stacker.esm.js.LICENSE.txt +1 -1
  127. package/dist/table.cjs.js +1 -1
  128. package/dist/table.cjs.js.LICENSE.txt +1 -1
  129. package/dist/table.esm.js.LICENSE.txt +1 -1
  130. package/dist/text-field.cjs.js +1 -1
  131. package/dist/text-field.cjs.js.LICENSE.txt +1 -1
  132. package/dist/text-field.esm.js.LICENSE.txt +1 -1
  133. package/dist/text.cjs.js +1 -1
  134. package/dist/text.cjs.js.LICENSE.txt +1 -1
  135. package/dist/text.esm.js.LICENSE.txt +1 -1
  136. package/dist/theme.cjs.js.LICENSE.txt +1 -1
  137. package/dist/theme.esm.js.LICENSE.txt +1 -1
  138. package/dist/transform-anim.cjs.js.LICENSE.txt +1 -1
  139. package/dist/transform-anim.esm.js.LICENSE.txt +1 -1
  140. package/dist/ulist.cjs.js +1 -1
  141. package/dist/ulist.cjs.js.LICENSE.txt +1 -1
  142. package/dist/ulist.esm.js.LICENSE.txt +1 -1
  143. package/dist/video.cjs.js +1 -1
  144. package/dist/video.cjs.js.LICENSE.txt +1 -1
  145. package/dist/video.esm.js.LICENSE.txt +1 -1
  146. package/dist/wrap.cjs.js +1 -1
  147. package/dist/wrap.cjs.js.LICENSE.txt +1 -1
  148. package/dist/wrap.esm.js.LICENSE.txt +1 -1
  149. package/dist/zoom-card.cjs.js +1 -1
  150. package/dist/zoom-card.cjs.js.LICENSE.txt +1 -1
  151. package/dist/zoom-card.esm.js.LICENSE.txt +1 -1
  152. package/layout/animator.js +1 -1
  153. package/layout/audio.js +1 -1
  154. package/layout/audionew.js +1 -1
  155. package/layout/base.js +1 -1
  156. package/layout/beta-desktop-bar.js +1 -1
  157. package/layout/beta-mobile-bar.js +1 -1
  158. package/layout/button.js +1 -1
  159. package/layout/center.js +1 -1
  160. package/layout/checkbox.js +1 -1
  161. package/layout/circle.js +1 -1
  162. package/layout/code.js +1 -1
  163. package/layout/container.js +1 -1
  164. package/layout/dropdown-2025.js +1 -1
  165. package/layout/flex-card.js +1 -1
  166. package/layout/flex-grid.js +1 -1
  167. package/layout/flex-row.js +1 -1
  168. package/layout/form-components/custom.js +1 -1
  169. package/layout/form-components/data-list.js +1 -1
  170. package/layout/form-components/floating-input.js +1 -1
  171. package/layout/form-components/form-all.js +1 -1
  172. package/layout/form-components/form.js +1 -1
  173. package/layout/form-components/image-picker.js +1 -1
  174. package/layout/form-components/picker.js +1 -1
  175. package/layout/form-components/radio.js +1 -1
  176. package/layout/form-components/radiogroup.js +1 -1
  177. package/layout/form-components/range.js +1 -1
  178. package/layout/free.js +1 -1
  179. package/layout/grid-switcher.js +1 -1
  180. package/layout/grid.js +1 -1
  181. package/layout/horizontal-scroller.js +1 -1
  182. package/layout/image.js +1 -1
  183. package/layout/index.js +1 -1
  184. package/layout/link.js +1 -1
  185. package/layout/list.js +1 -1
  186. package/layout/meta-adder.js +1 -1
  187. package/layout/modal-2025.js +1 -1
  188. package/layout/morph.js +1 -1
  189. package/layout/multiswitcher.js +1 -1
  190. package/layout/nav-bar.js +1 -1
  191. package/layout/nav-factor/custom-div.js +1 -1
  192. package/layout/new-nav-bar.js +1 -1
  193. package/layout/polygon.js +1 -1
  194. package/layout/prerender-site.js +1 -1
  195. package/layout/prerender.js +1 -1
  196. package/layout/progress.js +1 -1
  197. package/layout/row.js +1 -1
  198. package/layout/scroll-video.js +1 -1
  199. package/layout/side-bar.js +1 -1
  200. package/layout/side-nav-bar.js +1 -1
  201. package/layout/simple-bar.js +1 -1
  202. package/layout/slider-2025.js +1 -1
  203. package/layout/spacer.js +1 -1
  204. package/layout/stack.js +1 -1
  205. package/layout/svg.js +1 -1
  206. package/layout/switcher.js +1 -1
  207. package/layout/table.js +1 -1
  208. package/layout/text-field.js +1 -1
  209. package/layout/text.js +1 -1
  210. package/layout/ulist.js +1 -1
  211. package/layout/video.js +1 -1
  212. package/layout/wrap.js +1 -1
  213. package/layout/zoom-card.js +1 -1
  214. package/lib/agent-surface.js +1 -1
  215. package/lib/card-getter.js +1 -1
  216. package/lib/codegen.js +1 -1
  217. package/lib/data.js +1 -1
  218. package/lib/designer.js +1 -1
  219. package/lib/element-mapper.js +1 -1
  220. package/lib/keyframe-animation.js +1 -1
  221. package/lib/link-getter.js +1 -1
  222. package/lib/morph-node.js +1 -1
  223. package/lib/raster-inspect.js +1 -1
  224. package/lib/raster-ops.js +19 -2
  225. package/lib/raster-presets.js +1 -1
  226. package/lib/scroll-video.js +1 -1
  227. package/lib/seo.js +1 -1
  228. package/lib/stacker.js +1 -1
  229. package/lib/suggest.js +1 -1
  230. package/lib/theme.js +1 -1
  231. package/lib/transform-anim.js +1 -1
  232. package/lib/transition.js +1 -1
  233. package/lib/validate-nodes.js +1 -1
  234. package/lib/webmcp-adapter.js +1 -1
  235. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * nodality v1.2.6
2
+ * nodality v1.2.7
3
3
  * (c) 2026 Filip Vabrousek
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * nodality v1.2.6
2
+ * nodality v1.2.7
3
3
  * (c) 2026 Filip Vabrousek
4
4
  * License: MIT
5
5
  */
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see data-list.cjs.js.LICENSE.txt */
2
- (()=>{"use strict";var e={d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataList:()=>y});function n(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}!function(){try{var e=localStorage.getItem("nodality.theme.mode");if("light"===e||"dark"===e)return e}catch(e){}"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}();var r={static:function(e){return{x:.5*e.w,y:.5*e.h,amt:1}},mouse:function(e){return{x:e.mouseX,y:e.mouseY,amt:1}},hover:function(e){return{x:e.mouseX,y:e.mouseY,amt:e.hover}},scroll:function(e){return{x:.5*e.w,y:e.h*e.scroll,amt:1}},time:function(e){return{x:e.w*(.5+.34*Math.cos(.6*e.t)),y:e.h*(.5+.34*Math.sin(.8*e.t)),amt:1}}},o=Object.keys(r),c={hexalize:{doc:{summary:"Hexagonal cell grid. Snaps sampling to a hex lattice and draws cell borders; with `lift`, cells near the driver swell toward the viewer and their content magnifies to match.",params:{size:{default:24,unit:"px",summary:"lattice pitch — the width of one cell"},lift:{default:0,unit:"ratio",structural:!0,summary:"how much bigger a cell gets at the focus: 0.3 renders the nearest hexagons at 1.3x. 0 compiles the cheap path entirely away, so crossing zero rebuilds."},radius:{default:200,unit:"px",summary:"falloff distance around the driver focus"}}},structuralOnToggle:["lift"],stage:"cell",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"lift;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return t.lift?"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n vec2 ").concat(e,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(e,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(e,"bestC = ").concat(e,"c0;\n float ").concat(e,"bestF = (1.0 - smoothstep(0.0, ").concat(e,"radius,\n length(").concat(e,"c0 * ").concat(e,"size - ").concat(e,"dpos))) * ").concat(e,"damt;\n float ").concat(e,"bestS = 1.0 + ").concat(e,"lift * ").concat(e,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(t){var a,r,o,c,i=(c=2,function(e){if(Array.isArray(e))return e}(o=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,c,i=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);s=!0);}catch(e){u=!0,r=e}finally{try{if(!s&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw r}}return i}}(o,c)||n(o,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return a=i[0],r=i[1],"\n {\n vec2 c = ".concat(e,"c0 + vec2(").concat(a.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(e,"radius,\n length(c * ").concat(e,"size - ").concat(e,"dpos));\n f *= ").concat(e,"damt;\n float s = 1.0 + ").concat(e,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(e,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(e,"bestS) {\n ").concat(e,"bestS = s; ").concat(e,"bestC = c; ").concat(e,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(e,"bestC * ").concat(e,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(e,"bestC) / max(").concat(e,"bestS, 1e-3);\n warped = center + gv * ").concat(e,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(e,"AX), gv.x)) * ").concat(e,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(e,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||24)*t],lift:["1f",null!=e.lift?e.lift:0],radius:["1f",(e.radius||200)*t]}},map:function(e,t){return t.lift?null:e}},offset:{doc:{summary:"Pushes the coordinate space away from the driver focus. Warp stage, so cell grids and borders move WITH the content instead of staying a fixed screen-space lattice.",params:{strength:{default:20,unit:"px",summary:"how far the space is pushed at full amount"},radius:{default:260,unit:"px",summary:"falloff distance around the focus"}}},stage:"warp",defaultDriver:"mouse",decl:function(e){return"uniform float ".concat(e,"strength; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e){return"\n {\n float d = length(warped - ".concat(e,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(e,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(e,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(e,"strength * fall * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{strength:["1f",(e.strength||20)*t],radius:["1f",(e.radius||260)*t]}},map:function(e,t,n){var a,r,o,c=(t.strength||20)*n.dpr,i=(t.radius||260)*n.dpr,s=e[0]-n.dpos[0],u=e[1]-n.dpos[1],l=Math.hypot(s,u),f=1-(a=i,r=l,(o=Math.min(1,Math.max(0,(r-0)/(a-0||1e-6))))*o*(3-2*o));if(!(l>.5))return e;var d=c*f*n.damt/l;return[e[0]-s*d,e[1]-u*d]}},flow:{doc:{summary:"Curl-noise current. The coordinate space drifts along a divergence-free field, so content slides as if carried by water. Divergence-free means the flow never piles up or tears.",params:{strength:{default:18,unit:"px",summary:"how far the current carries the space"},scale:{default:120,unit:"px",summary:"size of one eddy — small is turbulent, large is a slow drift"},speed:{default:.25,unit:"seconds",summary:"how fast the field evolves; 0 freezes it"},seed:{default:0,unit:"count",summary:"picks a different field of the same character"},radius:{default:320,unit:"px",summary:"falloff around the focus. Only used when `by` names a driver; without one the current covers the whole element."}}},structural:["by"],stage:"warp",decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"speed;\n uniform float ").concat(e,"seed;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;\n // Polynomial bit-mixing hash, deliberately NOT the usual\n // fract(sin(dot(...))). Trig-based hashes disagree across GPU\n // vendors — sin's precision at large arguments is not\n // specified — so the same seed would render a different field\n // on different hardware. This one is multiply/fract only, so\n // the field is at least stable per-device. (Determinism rule,\n // MORPH-IMPL-SPEC §2.9.5a.)\n float ").concat(e,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(e,"seed);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }\n // The potential. Two octaves: enough structure to read as a\n // current without the cost of a full fBm.\n float ").concat(e,"psi(vec2 v) {\n return ").concat(e,"n(v) * 0.65 + ").concat(e,"n(v * 2.3 + 11.0) * 0.35;\n }")},code:function(e,t){return"\n {\n float sc = max(".concat(e,"scale, 1.0);\n vec2 drift = vec2(0.0, u_time * ").concat(e,"speed);").concat(t.by?"\n float fall = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(warped - ").concat(e,"dpos));\n float amt = ").concat(e,"strength * fall * ").concat(e,"damt;"):"\n float amt = ".concat(e,"strength;"),"\n // Three fixed Euler steps along curl(psi). Fixed count, not\n // adaptive: the step budget is a compile-time property so the\n // shader cost cannot vary with the content.\n for (int i = 0; i < 3; i++) {\n vec2 q = warped / sc + drift;\n float e = 0.35;\n float dy = ").concat(e,"psi(q + vec2(0.0, e)) - ").concat(e,"psi(q - vec2(0.0, e));\n float dx = ").concat(e,"psi(q + vec2(e, 0.0)) - ").concat(e,"psi(q - vec2(e, 0.0));\n // curl of a 2D scalar potential = (dpsi/dy, -dpsi/dx)\n warped += vec2(dy, -dx) / (2.0 * e) * amt * 0.3333;\n }\n }")},uniforms:function(e,t){return{scale:["1f",(null!=e.scale?e.scale:120)*t],strength:["1f",(null!=e.strength?e.strength:18)*t],speed:["1f",null!=e.speed?e.speed:.25],seed:["1f",null!=e.seed?e.seed:0],radius:["1f",(null!=e.radius?e.radius:320)*t]}}},duotone:{doc:{summary:"Maps luminance onto a two-colour ramp. With `by`, the mapping is confined to a spot around the driver focus and the rest of the element keeps its own colour.",params:{colors:{default:["#104B87","#E8FF00"],unit:"color",summary:"[shadow, highlight] — the two ends of the ramp"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"a; uniform vec3 ").concat(e,"b; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(e,"a, ").concat(e,"b, lum);\n ").concat(t.by?"float mask = (1.0 - smoothstep(".concat(e,"radius * 0.35, ").concat(e,"radius,\n length(center - ").concat(e,"dpos))) * ").concat(e,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(e,t){var n=e.colors||["#104B87","#E8FF00"];return{a:["3fv",i(n[0])],b:["3fv",i(n[1])],radius:["1f",(e.radius||220)*t]}}},edges:{doc:{summary:"Draws the cell borders a cell-stage op produced. On its own it shows nothing — it colours `edge`, which only hexalize (or another cell op) writes.",params:{color:{default:"#FFFFFF",unit:"color",summary:"border colour"},strength:{default:1,unit:"ratio",summary:"border opacity"}}},stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"color; uniform float ").concat(e,"strength;")},code:function(e){return"\n {\n edgeCol = ".concat(e,"color;\n edgeCov = max(edgeCov, edge * ").concat(e,"strength);\n }")},uniforms:function(e){return{color:["3fv",i(e.color||"#FFFFFF")],strength:["1f",null!=e.strength?e.strength:1]}}},halftone:{doc:{summary:"Print halftone: the image is redrawn as a grid of ink dots on paper, dot size following local luminance.",params:{size:{default:6,unit:"px",summary:"dot pitch"},angle:{default:15,unit:"deg",summary:"screen angle of the dot grid"},ink:{default:"#0B1B2B",unit:"color",summary:"dot colour"},paper:{default:"#FFFFFF",unit:"color",summary:"background colour"},softness:{default:.08,unit:"ratio",summary:"dot edge softness — 0 is a hard stencil"},amount:{default:1,unit:"ratio",summary:"blend back toward the un-screened image; 0 is identity. Keyframe it to 0 at both ends of a transition so the shader hands over to the real element without a pop."},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"amount;\n uniform float ").concat(e,"angle;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform float ").concat(e,"soft;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(e,"size;").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(e,"angle), sa = sin(").concat(e,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(e,"soft, length(cell));\n col = mix(col, mix(").concat(e,"paper, ").concat(e,"ink, dm), clamp(").concat(e,"amount, 0.0, 1.0));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||6)*t],amount:["1f",null!=e.amount?e.amount:1],angle:["1f",(null!=e.angle?e.angle:15)*Math.PI/180],ink:["3fv",i(e.ink||"#0B1B2B")],paper:["3fv",i(e.paper||"#FFFFFF")],soft:["1f",null!=e.softness?e.softness:.08],radius:["1f",(e.radius||220)*t]}}},dither:{doc:{summary:"Ordered (Bayer) dithering to a small palette — the look of an 8-bit display, and the one op that gets sharper as the element gets smaller.",params:{size:{default:1,unit:"px",summary:"size of one dither cell; 1 is per-pixel"},levels:{default:6,unit:"count",summary:"quantisation steps per channel"},amount:{default:1,unit:"ratio",summary:"blend back toward the undithered image"},mono:{default:!1,unit:"bool",structural:!0,summary:"quantise luminance to ink/paper instead of per-channel colour. A different shader, so toggling rebuilds."},ink:{default:"#0B1B2B",unit:"color",summary:"dark end, mono only"},paper:{default:"#FFFFFF",unit:"color",summary:"light end, mono only"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by","mono"],stage:"color",decl:function(e){return"\n uniform float ".concat(e,"levels;\n uniform float ").concat(e,"size;\n uniform float ").concat(e,"amount;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(e,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(e,"b4(vec2 a) { return ").concat(e,"b2(0.5 * a) * 0.25 + ").concat(e,"b2(a); }\n float ").concat(e,"b8(vec2 a) { return ").concat(e,"b4(0.5 * a) * 0.25 + ").concat(e,"b2(a); }")},code:function(e,t){return"\n {\n float sz = max(".concat(e,"size, 1e-3);").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(e,"b8(frag / sz) - 0.5;\n float lv = max(").concat(e,"levels, 1.0);\n ").concat(t.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(e,"ink, ").concat(e,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(e,"amount, 0.0, 1.0));\n }")},uniforms:function(e,t){return{levels:["1f",null!=e.levels?e.levels:6],size:["1f",(null!=e.size?e.size:1)*t],amount:["1f",null!=e.amount?e.amount:1],ink:["3fv",i(e.ink||"#0B1B2B")],paper:["3fv",i(e.paper||"#FFFFFF")],radius:["1f",(e.radius||220)*t]}}},aberration:{movesCoords:!1,doc:{summary:"Chromatic aberration: the three colour channels are sampled at slightly different offsets, like a cheap lens.",params:{amount:{default:6,unit:"px",summary:"channel separation"},radius:{default:240,unit:"px",summary:"falloff around the focus when `by` names a driver"}}},structural:["by"],stage:"displace",chroma:!0,decl:function(e){return"\n uniform float ".concat(e,"amount;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n vec2 ctr = ".concat(t.by?"".concat(e,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(t.by?"float amt = ".concat(e,"amount * ").concat(e,"damt *\n (1.0 - smoothstep(0.0, ").concat(e,"radius, dl));"):"float amt = ".concat(e,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(e,t){return{amount:["1f",(null!=e.amount?e.amount:6)*t],radius:["1f",(e.radius||240)*t]}}},mask:{doc:{summary:'Writes a scalar FIELD for later ops to read — draws nothing itself. Give a downstream op `masked: "name"` and it applies only where this field is high. This is how any op becomes local without knowing anything about masking.',params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written. Consumers name it in `masked:`."},from:{default:"radial",unit:"name",structural:!0,summary:"field shape — compiled in, so changing it rebuilds"},at:{default:[.5,.5],unit:"point",structural:!0,summary:"centre as a fraction of the element box; survives resizes"},radius:{default:260,unit:"px",summary:"field radius"},invert:{default:!1,unit:"bool",summary:"swap inside and outside"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as","from","at"],stage:"field",producesField:!0,defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"at;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"invert;")},code:function(e,t){var n=t.from||"radial",a=t.at?"(".concat(e,"at * u_res)"):"".concat(e,"dpos"),r="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(a,"))");return"\n {\n float m = ".concat(r,";\n m = clamp((m - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(e,"invert);\n ").concat(f(t.as||"mask")," *= m * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:260)*t],at:["2fv",e.at||[.5,.5]],remap:["2fv",e.remap||[0,1]],invert:["1f",e.invert?1:0]}}},noise:{doc:{summary:"Writes an animated noise FIELD. Same contract as `mask` — it draws nothing; downstream ops read it via `masked:`. Use it to make any other op flicker, breathe or crawl.",params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written"},scale:{default:3,unit:"ratio",summary:"noise frequency across the element"},speed:{default:.3,unit:"seconds",summary:"how fast it evolves; 0 freezes it"},amount:{default:1,unit:"ratio",summary:"blend between flat 1.0 and full noise"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as"],stage:"field",producesField:!0,decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"speed;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"amp;\n float ").concat(e,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(e,t){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(e,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(e,"n(np + u_time * ").concat(e,"speed) * 0.65 +\n ").concat(e,"n(np * 2.7 - u_time * ").concat(e,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(f(t.as||"mask")," *= mix(1.0, n, ").concat(e,"amp);\n }")},uniforms:function(e){return{scale:["1f",null!=e.scale?e.scale:3],speed:["1f",null!=e.speed?e.speed:.3],remap:["2fv",e.remap||[0,1]],amp:["1f",null!=e.amount?e.amount:1]}}},copy:{multiSample:!0,doc:{summary:"Stamps extra copies of the element over itself. Copies sample the ORIGINAL texture, not the result of earlier colour ops, so a copy of a halftoned element is a copy of the unhalftoned source.",params:{count:{default:5,unit:"count",structural:!0,summary:"stamps arranged in a ring around the focus. The loop is unrolled at compile time, so this rebuilds — not something to animate."},points:{default:null,unit:"point",structural:!0,summary:"explicit [[x,y], ...] in fractions of the element box, instead of a ring. Survives resizes. Overrides `count`."},radius:{default:110,unit:"px",summary:"ring radius when using `count`"},scale:{default:.5,unit:"ratio",summary:"size of each copy"},rotate:{default:0,unit:"deg",summary:"rotation applied per copy"},fade:{default:1,unit:"ratio",summary:"opacity falloff across the set"},amount:{default:1,unit:"ratio",summary:"overall blend of the copies over the original"}}},structural:["count","points"],stage:"color",defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform float ").concat(e,"scale;\n uniform float ").concat(e,"rotate;\n uniform float ").concat(e,"fade;\n uniform float ").concat(e,"amount;")},code:function(e,t){for(var n=Array.isArray(t.points)&&t.points.length>0,a=n?t.points.length:Math.max(1,Math.min(24,Math.round(t.count||5))),r="",o=function(o){var c,i=n?"vec2(".concat((+t.points[o][0]).toFixed(5),", ").concat((+t.points[o][1]).toFixed(5),") * u_res"):(c=o/a*Math.PI*2,"".concat(e,"dpos + vec2(").concat(Math.cos(c).toFixed(5),", ")+"".concat(Math.sin(c).toFixed(5),") * ").concat(e,"radius"));r+="\n {\n float ang = ".concat(e,"rotate * ").concat((o+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(i,"));\n vec2 q = d / max(").concat(e,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(e,"amount * ").concat(e,"damt\n * pow(").concat(e,"fade, ").concat(o.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},c=0;c<a;c++)o(c);return r},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:110)*t],scale:["1f",null!=e.scale?e.scale:.5],rotate:["1f",null!=e.rotate?e.rotate:0],fade:["1f",null!=e.fade?e.fade:1],amount:["1f",null!=e.amount?e.amount:1]}}},merge:{doc:{summary:"Runs two sub-chains over the same source and blends the results. The only op that takes other ops as arguments — everything else composes by sequence, this composes in parallel.",params:{a:{default:null,summary:"first branch: an array of nodes",structural:!0},b:{default:null,summary:"second branch: an array of nodes",structural:!0},mode:{default:"over",unit:"name",structural:!0,summary:"how the branches combine: over, add, screen, multiply, difference, lighten. Compiled in, so it rebuilds."},mix:{default:1,unit:"ratio",summary:"how far to blend b into a"}}},structural:["mode","a","b"],stage:"color",decl:function(e){return"uniform float ".concat(e,"mix;")},code:function(){return""},uniforms:function(e){return{mix:["1f",null!=e.mix?e.mix:1]}}},echo:{doc:{summary:"Temporal accumulation — a fading trail of what CHANGED. Typing smears, a ticking counter leaves a comet. The one op that does nothing on the snapshot backend, because a frozen image has no motion to record.",params:{strength:{default:.85,unit:"ratio",summary:"opacity of the trail"},decay:{default:.92,unit:"ratio",summary:"per-second persistence — higher is a longer tail"},tint:{default:"#7FD4FF",unit:"color",summary:"colour pushed into the trail"},tintAmount:{default:.5,unit:"ratio",summary:"how far the trail is tinted"}}},stage:"color",decl:function(e){return"\n uniform sampler2D ".concat(e,"hist;\n uniform float ").concat(e,"strength;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"tintAmt;")},code:function(e){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(e,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(e,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(e,"tint, ").concat(e,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(e){return{strength:["1f",null!=e.strength?e.strength:.85],tint:["3fv",i(e.tint||"#7FD4FF")],tintAmt:["1f",e.tint?null!=e.tintAmount?e.tintAmount:.5:0]}},solver:{resolutions:function(e,t,n){return{frame:[t,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(e,t,n){var a=Math.min(n.dt,1/30),r=Math.pow(null!=t.decay?t.decay:.92,60*a);e.use("accumulate"),e.f2("u_texel",1/e.canvasW,1/e.canvasH),e.f1("u_decay",r),e.smp("u_content",e.content,0),e.smp("u_hist",e.read("history"),1),e.blit(e.write("history")),e.swap("history")}}},stir:{doc:{summary:"Stirred liquid: a real fluid simulation the content is dragged through. STATEFUL — it owns a ping-pong pair of render targets that evolve frame to frame, so it is the most expensive op here.",params:{strength:{default:26,unit:"px",summary:"how far the fluid carries the content"},force:{default:1,unit:"ratio",summary:"how hard the pointer pushes the fluid"},radius:{default:.1,unit:"ratio",summary:"splat size, as a fraction of the sim grid"},curl:{default:2.2,unit:"ratio",summary:"vorticity — how much the fluid curls into eddies"},decay:{default:.985,unit:"ratio",summary:"per-second velocity persistence"},pressure:{default:.8,unit:"ratio",summary:"pressure retained between frames"},pressureIterations:{default:6,unit:"count",summary:"solver iterations; higher is stiffer and slower"},intensity:{default:1.6,unit:"ratio",summary:"brightness of the dye layer"},sheen:{default:.15,unit:"ratio",summary:"specular highlight on the surface"},tint:{default:"#7FD4FF",unit:"color",summary:"dye colour, unless `rainbow`"},rainbow:{default:!1,unit:"bool",summary:"cycle dye hue instead of using `tint`"},dye:{default:.85,unit:"ratio",summary:"how much dye colour reaches the final image"},dyeAmount:{default:.6,unit:"ratio",summary:"how much dye each splat injects"},dyeFade:{default:.97,unit:"ratio",summary:"per-second dye persistence"},resolution:{default:128,unit:"count",summary:"velocity grid size, clamped 32..512"},dyeResolution:{default:512,unit:"count",summary:"dye grid size, clamped 64..1024"}}},stage:["warp","color"],decl:function(e){return"\n uniform sampler2D ".concat(e,"vel;\n uniform sampler2D ").concat(e,"dye;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"dyemix;\n uniform float ").concat(e,"intensity;\n uniform float ").concat(e,"sheen;\n uniform vec3 ").concat(e,"tint;")},code:function(e,t,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(e,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(e,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(e,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(e,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(e,"intensity)) * ").concat(e,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(e,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(e,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(e,"sheen);\n }")},uniforms:function(e,t){return{strength:["1f",(null!=e.strength?e.strength:26)*t],sheen:["1f",null!=e.sheen?e.sheen:.15],tint:["3fv",i(e.tint||"#7FD4FF")],dyemix:["1f",null!=e.dye?e.dye:.85],intensity:["1f",null!=e.intensity?e.intensity:1.6]}},solver:{resolutions:function(e){return{sim:Math.max(32,Math.min(e.resolution||128,512)),dye:Math.max(64,Math.min(e.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(e,t,n){var a=null!=e.dyeAmount?e.dyeAmount:.6;if(!e.rainbow){var r=i(e.tint||"#7FD4FF");return[r[0]*a,r[1]*a,r[2]*a]}var o=Math.atan2(n,t);return[(.5+.5*Math.cos(o))*a,(.5+.5*Math.cos(o+2.0944))*a,(.5+.5*Math.cos(o+4.1888))*a]},step:function(e,t,n){var a=Math.min(n.dt,1/30),r=1/e.res.sim,o=1/e.res.dye,c=function(e,t){return Math.pow(e,60*t)};if(n.moving){var i=null!=t.force?t.force:1;e.use("splat"),e.f1("u_radius",null!=t.radius?t.radius:.1),e.f1("u_aspect",n.aspect),e.f2("u_point",n.px,n.py),e.f2("u_texel",r,r),e.smp("u_src",e.read("velocity"),0),e.f3("u_amount",n.dx*i,n.dy*i,0),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",o,o),e.smp("u_src",e.read("dye"),0),e.f3("u_amount",n.col[0],n.col[1],n.col[2]),e.blit(e.write("dye")),e.swap("dye")}e.use("curl"),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("vorticity")),e.use("confine"),e.f2("u_texel",r,r),e.f1("u_eps",null!=t.curl?t.curl:2.2),e.f1("u_dt",a),e.smp("u_vel",e.read("velocity"),0),e.smp("u_curl",e.single("vorticity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("divergence"),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("divergence")),e.use("decay"),e.f2("u_texel",r,r),e.f1("u_value",c(null!=t.pressure?t.pressure:.8,a)),e.smp("u_tex",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure"),e.use("jacobi"),e.f2("u_texel",r,r),e.smp("u_div",e.single("divergence"),1);for(var s=Math.max(1,Math.min(t.pressureIterations||6,40)),u=0;u<s;u++)e.smp("u_p",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure");e.use("subtract"),e.f2("u_texel",r,r),e.smp("u_p",e.read("pressure"),0),e.smp("u_vel",e.read("velocity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("advect"),e.f1("u_dt",a),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("velocity"),0),e.f1("u_diss",c(null!=t.decay?t.decay:.985,a)),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("dye"),1),e.f1("u_diss",c(null!=t.dyeFade?t.dyeFade:.97,a)),e.blit(e.write("dye")),e.swap("dye")}}},blobs:{doc:{summary:"Liquid-glass blobs that follow the pointer: a chain of metaballs refracting the content behind them, stretching apart on a fast flick and relaxing back to a single circle at rest.",params:{count:{default:1,unit:"count",structural:!0,summary:"independent drifting blobs, on top of the trail chain"},trail:{default:7,unit:"count",structural:!0,summary:"blobs in the follow-the-leader chain. Unrolled at compile time, so it rebuilds."},radius:{default:46,unit:"px",summary:"blob radius at rest"},color:{default:"#EAF4EE",unit:"color",summary:"glass tint"},refract:{default:70,unit:"px",summary:"how far the glass bends what is behind it"},rim:{default:.6,unit:"ratio",summary:"brightness of the rim light"},alpha:{default:1,unit:"ratio",summary:"overall opacity"},iridescence:{default:.8,unit:"ratio",summary:"colour shift across the rim"},dispersion:{default:1,unit:"ratio",summary:"per-channel refraction spread"},frost:{default:.25,unit:"ratio",summary:"blur of what shows through"}}},structural:["count","trail"],stage:"color",overlay:!0,mips:!0,decl:function(e){return"\n uniform vec3 ".concat(e,"blobs[").concat(12,"];\n uniform int ").concat(e,"count;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"refract;\n uniform float ").concat(e,"rim;\n uniform float ").concat(e,"alpha;\n uniform float ").concat(e,"irid;\n uniform float ").concat(e,"disp;\n uniform float ").concat(e,"frost;\n float ").concat(e,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(e,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(e,"hash(f);\n float c100 = ").concat(e,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(e,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(e,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(e,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(e,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(e,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(e,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(e){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(e,"count) break;\n vec2 bd = frag - ").concat(e,"blobs[bi].xy;\n float br = ").concat(e,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(e,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(e,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(e,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(e,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(e,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(e,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(e,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(e,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(e,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(e,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(e,"alpha);\n }\n }")},uniforms:function(e,t){return{tint:["3fv",i(e.color||"#EAF4EE")],refract:["1f",(null!=e.refract?e.refract:70)*t],rim:["1f",null!=e.rim?e.rim:.6],alpha:["1f",null!=e.alpha?e.alpha:1],irid:["1f",null!=e.iridescence?e.iridescence:.8],disp:["1f",null!=e.dispersion?e.dispersion:1],frost:["1f",null!=e.frost?e.frost:.25]}},init:function(e,t,n,a){for(var r=(e.radius||46)*t,o=Math.max(1,Math.min(null!=e.trail?e.trail:7,12)),c=[],i=0,s=0;s<o;s++){var u=Math.pow(.86,s);c.push(u),i+=u*u}for(var l=Math.sqrt(i),f=c.map(function(e){return r*e/l}),d=c.map(function(e,t){return.85*r*Math.pow(.955,t)}),m=function(e,t){return e+Math.random()*(t-e)},h=Math.max(0,Math.min((e.count||1)-1,12-o)),p=[],v=0;v<h;v++){var y=m(0,2*Math.PI),g=m(30,80)*t;p.push({x:m(r,n-r),y:m(r,a-r),r:r*m(.45,.8),vx:Math.cos(y)*g,vy:Math.sin(y)*g,phase:m(0,2*Math.PI)})}for(var x={x:.5*n,y:.55*a},b=[],w=0;w<o;w++)b.push({x:x.x,y:x.y});return{head:x,chain:b,nTrail:o,drifters:p,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*r}},tick:function(e,t){var a=Math.min(t.dt,.05),r=t.w,o=t.h,c=1-Math.exp(9*-a);e.head.x+=(t.mouseX-e.head.x)*c,e.head.y+=(t.mouseY-e.head.y)*c;var i=e.chain;i[0].x=e.head.x,i[0].y=e.head.y;for(var s=1-Math.exp(16*-a),u=1;u<i.length;u++){var l=i[u-1],f=i[u],d=l.x-f.x,m=l.y-f.y,h=Math.hypot(d,m)||1e-4,p=e.seg;h>p&&(f.x+=d*(1-p/h),f.y+=m*(1-p/h)),f.x+=(l.x-f.x)*s,f.y+=(l.y-f.y)*s}var v=i[i.length-1],y=Math.hypot(v.x-e.head.x,v.y-e.head.y),g=Math.max(1,e.seg*(e.nTrail-1)),x=Math.min(1,y/g);e.stretch+=(x-e.stretch)*(1-Math.exp(8*-a));var b,w=function(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=n(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return i=e.done,e},e:function(e){s=!0,c=e},f:function(){try{i||null==a.return||a.return()}finally{if(s)throw c}}}}(e.drifters);try{for(w.s();!(b=w.n()).done;){var _=b.value;_.x+=_.vx*a,_.y+=_.vy*a,_.x<_.r?(_.x=_.r,_.vx=Math.abs(_.vx)):_.x>r-_.r&&(_.x=r-_.r,_.vx=-Math.abs(_.vx)),_.y<_.r?(_.y=_.r,_.vy=Math.abs(_.vy)):_.y>o-_.r&&(_.y=o-_.r,_.vy=-Math.abs(_.vy)),_.phase+=1.6*a}}catch(e){w.e(e)}finally{w.f()}for(var F=new Float32Array(36),D=e.stretch,k=0;k<e.nTrail;k++){var M=i[k];F[3*k]=M.x,F[3*k+1]=M.y,F[3*k+2]=e.trailIdleR[k]+(e.trailMoveR[k]-e.trailIdleR[k])*D}return e.drifters.forEach(function(t,n){var a=e.nTrail+n;F[3*a]=t.x,F[3*a+1]=t.y,F[3*a+2]=t.r*(1+.12*Math.sin(t.phase))}),[{name:"blobs",kind:"3fv",value:F},{name:"count",kind:"1i",value:e.nTrail+e.drifters.length}]}}};function i(e){return[1,3,5].map(function(t){return parseInt(e.slice(t,t+2),16)/255})}Object.keys(c).concat("switch");var s,u={linear:function(e){return e},in:function(e){return e*e*e},out:function(e){return 1-Math.pow(1-e,3)},"in-out":function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},back:function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)}},l=Object.keys(u),f=(["field"].concat(function(e){if(Array.isArray(e))return a(e)}(s=Object.keys({warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||n(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),"what steers the effect: ".concat(o.join(", "),". "),"easing for this node's local progress: ".concat(l.join(", ")),function(e){return"fld_".concat(String(e).replace(/[^A-Za-z0-9_]/g,""))});function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,v(a.key),a)}}function v(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}new Set(["none","rgba(0, 0, 0, 0)","transparent","0px","auto","1","repeat","0% 0%","border-box","0% 0% / auto repeat scroll padding-box border-box"]),new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),new Set;var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.res=null,this.currentItem=""},(t=[{key:"set",value:function(e){var t=this,n=e;this.options=e;var a=document.createElement("input");a.setAttribute("list","dlCities"),a.setAttribute("id","my");var r=e.data,o=0,c=r.length,i=document.createElement("datalist");for(i.id="dlCities",o=0;o<c;o+=1){var s=document.createElement("option");s.value=r[o],i.appendChild(s)}return a.appendChild(i),a.addEventListener("change",function(){var e=document.querySelector("#my").value;t.currentItem=e}),a.setAttribute("placeholder","Type value"),a.style.padding=".4rem .75rem",a.style.fontSize="1rem",this.res=a,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var e=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(e,")")]}},{key:"getValue",value:function(){return this.res.value}},{key:"arrayPadding",value:function(e,t){return e.includes("left")&&(this.res.style.paddingLeft=t),e.includes("right")&&(this.res.style.paddingRight=t),e.includes("top")&&(this.res.style.paddingTop=t),e.includes("bottom")&&(this.res.style.paddingBottom=t),e.includes("all")&&(this.res.style.padding=t),this}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),this}},{key:"margin",value:function(e){return this.res.style.margin=e,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(e){if(!e)return this.res;document.querySelector(e).appendChild(this.res)}}])&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),g=y;y=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n){if(m())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var r=new(e.bind.apply(e,a));return n&&d(r,n.prototype),r}(g,t)},"undefined"!=typeof window&&(window.DataList=y),module.exports=t})();
2
+ (()=>{"use strict";var e={d:(t,n)=>{for(var a in n)e.o(n,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:n[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataList:()=>y});function n(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}!function(){try{var e=localStorage.getItem("nodality.theme.mode");if("light"===e||"dark"===e)return e}catch(e){}"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}();var r={static:function(e){return{x:.5*e.w,y:.5*e.h,amt:1}},mouse:function(e){return{x:e.mouseX,y:e.mouseY,amt:1}},hover:function(e){return{x:e.mouseX,y:e.mouseY,amt:e.hover}},scroll:function(e){return{x:.5*e.w,y:e.h*e.scroll,amt:1}},time:function(e){return{x:e.w*(.5+.34*Math.cos(.6*e.t)),y:e.h*(.5+.34*Math.sin(.8*e.t)),amt:1}}},o=Object.keys(r),c={hexalize:{doc:{summary:"Hexagonal cell grid. Snaps sampling to a hex lattice and draws cell borders; with `lift`, cells near the driver swell toward the viewer and their content magnifies to match.",params:{size:{default:24,unit:"px",summary:"lattice pitch — the width of one cell"},lift:{default:0,unit:"ratio",structural:!0,summary:"how much bigger a cell gets at the focus: 0.3 renders the nearest hexagons at 1.3x. 0 compiles the cheap path entirely away, so crossing zero rebuilds."},radius:{default:200,unit:"px",summary:"falloff distance around the driver focus"}}},structuralOnToggle:["lift"],stage:"cell",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"lift;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return t.lift?"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n vec2 ").concat(e,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(e,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(e,"bestC = ").concat(e,"c0;\n float ").concat(e,"bestF = (1.0 - smoothstep(0.0, ").concat(e,"radius,\n length(").concat(e,"c0 * ").concat(e,"size - ").concat(e,"dpos))) * ").concat(e,"damt;\n float ").concat(e,"bestS = 1.0 + ").concat(e,"lift * ").concat(e,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(t){var a,r,o,c,i=(c=2,function(e){if(Array.isArray(e))return e}(o=t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,c,i=[],s=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);s=!0);}catch(e){u=!0,r=e}finally{try{if(!s&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw r}}return i}}(o,c)||n(o,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return a=i[0],r=i[1],"\n {\n vec2 c = ".concat(e,"c0 + vec2(").concat(a.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(e,"radius,\n length(c * ").concat(e,"size - ").concat(e,"dpos));\n f *= ").concat(e,"damt;\n float s = 1.0 + ").concat(e,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(e,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(e,"bestS) {\n ").concat(e,"bestS = s; ").concat(e,"bestC = c; ").concat(e,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(e,"bestC * ").concat(e,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(e,"bestC) / max(").concat(e,"bestS, 1e-3);\n warped = center + gv * ").concat(e,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(e,"AX), gv.x)) * ").concat(e,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(e,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||24)*t],lift:["1f",null!=e.lift?e.lift:0],radius:["1f",(e.radius||200)*t]}},map:function(e,t){return t.lift?null:e}},offset:{doc:{summary:"Pushes the coordinate space away from the driver focus. Warp stage, so cell grids and borders move WITH the content instead of staying a fixed screen-space lattice.",params:{strength:{default:20,unit:"px",summary:"how far the space is pushed at full amount"},radius:{default:260,unit:"px",summary:"falloff distance around the focus"}}},stage:"warp",defaultDriver:"mouse",decl:function(e){return"uniform float ".concat(e,"strength; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e){return"\n {\n float d = length(warped - ".concat(e,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(e,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(e,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(e,"strength * fall * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{strength:["1f",(e.strength||20)*t],radius:["1f",(e.radius||260)*t]}},map:function(e,t,n){var a,r,o,c=(t.strength||20)*n.dpr,i=(t.radius||260)*n.dpr,s=e[0]-n.dpos[0],u=e[1]-n.dpos[1],l=Math.hypot(s,u),f=1-(a=i,r=l,(o=Math.min(1,Math.max(0,(r-0)/(a-0||1e-6))))*o*(3-2*o));if(!(l>.5))return e;var d=c*f*n.damt/l;return[e[0]-s*d,e[1]-u*d]}},flow:{doc:{summary:"Curl-noise current. The coordinate space drifts along a divergence-free field, so content slides as if carried by water. Divergence-free means the flow never piles up or tears.",params:{strength:{default:18,unit:"px",summary:"how far the current carries the space"},scale:{default:120,unit:"px",summary:"size of one eddy — small is turbulent, large is a slow drift"},speed:{default:.25,unit:"seconds",summary:"how fast the field evolves; 0 freezes it"},seed:{default:0,unit:"count",summary:"picks a different field of the same character"},radius:{default:320,unit:"px",summary:"falloff around the focus. Only used when `by` names a driver; without one the current covers the whole element."}}},structural:["by"],stage:"warp",decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"speed;\n uniform float ").concat(e,"seed;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;\n // Polynomial bit-mixing hash, deliberately NOT the usual\n // fract(sin(dot(...))). Trig-based hashes disagree across GPU\n // vendors — sin's precision at large arguments is not\n // specified — so the same seed would render a different field\n // on different hardware. This one is multiply/fract only, so\n // the field is at least stable per-device. (Determinism rule,\n // MORPH-IMPL-SPEC §2.9.5a.)\n float ").concat(e,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(e,"seed);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }\n // The potential. Two octaves: enough structure to read as a\n // current without the cost of a full fBm.\n float ").concat(e,"psi(vec2 v) {\n return ").concat(e,"n(v) * 0.65 + ").concat(e,"n(v * 2.3 + 11.0) * 0.35;\n }")},code:function(e,t){return"\n {\n float sc = max(".concat(e,"scale, 1.0);\n vec2 drift = vec2(0.0, u_time * ").concat(e,"speed);").concat(t.by?"\n float fall = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(warped - ").concat(e,"dpos));\n float amt = ").concat(e,"strength * fall * ").concat(e,"damt;"):"\n float amt = ".concat(e,"strength;"),"\n // Three fixed Euler steps along curl(psi). Fixed count, not\n // adaptive: the step budget is a compile-time property so the\n // shader cost cannot vary with the content.\n for (int i = 0; i < 3; i++) {\n vec2 q = warped / sc + drift;\n float e = 0.35;\n float dy = ").concat(e,"psi(q + vec2(0.0, e)) - ").concat(e,"psi(q - vec2(0.0, e));\n float dx = ").concat(e,"psi(q + vec2(e, 0.0)) - ").concat(e,"psi(q - vec2(e, 0.0));\n // curl of a 2D scalar potential = (dpsi/dy, -dpsi/dx)\n warped += vec2(dy, -dx) / (2.0 * e) * amt * 0.3333;\n }\n }")},uniforms:function(e,t){return{scale:["1f",(null!=e.scale?e.scale:120)*t],strength:["1f",(null!=e.strength?e.strength:18)*t],speed:["1f",null!=e.speed?e.speed:.25],seed:["1f",null!=e.seed?e.seed:0],radius:["1f",(null!=e.radius?e.radius:320)*t]}}},duotone:{doc:{summary:"Maps luminance onto a two-colour ramp. With `by`, the mapping is confined to a spot around the driver focus and the rest of the element keeps its own colour.",params:{colors:{default:["#104B87","#E8FF00"],unit:"color",summary:"[shadow, highlight] — the two ends of the ramp"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"a; uniform vec3 ").concat(e,"b; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(e,"a, ").concat(e,"b, lum);\n ").concat(t.by?"float mask = (1.0 - smoothstep(".concat(e,"radius * 0.35, ").concat(e,"radius,\n length(center - ").concat(e,"dpos))) * ").concat(e,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(e,t){var n=e.colors||["#104B87","#E8FF00"];return{a:["3fv",i(n[0])],b:["3fv",i(n[1])],radius:["1f",(e.radius||220)*t]}}},edges:{doc:{summary:"Draws the cell borders a cell-stage op produced. On its own it shows nothing — it colours `edge`, which only hexalize (or another cell op) writes.",params:{color:{default:"#FFFFFF",unit:"color",summary:"border colour"},strength:{default:1,unit:"ratio",summary:"border opacity"}}},stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"color; uniform float ").concat(e,"strength;")},code:function(e){return"\n {\n edgeCol = ".concat(e,"color;\n edgeCov = max(edgeCov, edge * ").concat(e,"strength);\n }")},uniforms:function(e){return{color:["3fv",i(e.color||"#FFFFFF")],strength:["1f",null!=e.strength?e.strength:1]}}},halftone:{doc:{summary:"Print halftone: the image is redrawn as a grid of ink dots on paper, dot size following local luminance.",params:{size:{default:6,unit:"px",summary:"dot pitch"},angle:{default:15,unit:"deg",summary:"screen angle of the dot grid"},ink:{default:"#0B1B2B",unit:"color",summary:"dot colour"},paper:{default:"#FFFFFF",unit:"color",summary:"background colour"},softness:{default:.08,unit:"ratio",summary:"dot edge softness — 0 is a hard stencil"},amount:{default:1,unit:"ratio",summary:"blend back toward the un-screened image; 0 is identity. Keyframe it to 0 at both ends of a transition so the shader hands over to the real element without a pop."},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"amount;\n uniform float ").concat(e,"angle;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform float ").concat(e,"soft;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(e,"size;").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(e,"angle), sa = sin(").concat(e,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(e,"soft, length(cell));\n col = mix(col, mix(").concat(e,"paper, ").concat(e,"ink, dm), clamp(").concat(e,"amount, 0.0, 1.0));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||6)*t],amount:["1f",null!=e.amount?e.amount:1],angle:["1f",(null!=e.angle?e.angle:15)*Math.PI/180],ink:["3fv",i(e.ink||"#0B1B2B")],paper:["3fv",i(e.paper||"#FFFFFF")],soft:["1f",null!=e.softness?e.softness:.08],radius:["1f",(e.radius||220)*t]}}},dither:{doc:{summary:"Ordered (Bayer) dithering to a small palette — the look of an 8-bit display, and the one op that gets sharper as the element gets smaller.",params:{size:{default:1,unit:"px",summary:"size of one dither cell; 1 is per-pixel"},levels:{default:6,unit:"count",summary:"quantisation steps per channel"},amount:{default:1,unit:"ratio",summary:"blend back toward the undithered image"},mono:{default:!1,unit:"bool",structural:!0,summary:"quantise luminance to ink/paper instead of per-channel colour. A different shader, so toggling rebuilds."},ink:{default:"#0B1B2B",unit:"color",summary:"dark end, mono only"},paper:{default:"#FFFFFF",unit:"color",summary:"light end, mono only"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by","mono"],stage:"color",decl:function(e){return"\n uniform float ".concat(e,"levels;\n uniform float ").concat(e,"size;\n uniform float ").concat(e,"amount;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(e,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(e,"b4(vec2 a) { return ").concat(e,"b2(0.5 * a) * 0.25 + ").concat(e,"b2(a); }\n float ").concat(e,"b8(vec2 a) { return ").concat(e,"b4(0.5 * a) * 0.25 + ").concat(e,"b2(a); }")},code:function(e,t){return"\n {\n float sz = max(".concat(e,"size, 1e-3);").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(e,"b8(frag / sz) - 0.5;\n float lv = max(").concat(e,"levels, 1.0);\n ").concat(t.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(e,"ink, ").concat(e,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(e,"amount, 0.0, 1.0));\n }")},uniforms:function(e,t){return{levels:["1f",null!=e.levels?e.levels:6],size:["1f",(null!=e.size?e.size:1)*t],amount:["1f",null!=e.amount?e.amount:1],ink:["3fv",i(e.ink||"#0B1B2B")],paper:["3fv",i(e.paper||"#FFFFFF")],radius:["1f",(e.radius||220)*t]}}},aberration:{movesCoords:!1,doc:{summary:"Chromatic aberration: the three colour channels are sampled at slightly different offsets, like a cheap lens.",params:{amount:{default:6,unit:"px",summary:"channel separation"},radius:{default:240,unit:"px",summary:"falloff around the focus when `by` names a driver"}}},structural:["by"],stage:"displace",chroma:!0,decl:function(e){return"\n uniform float ".concat(e,"amount;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n vec2 ctr = ".concat(t.by?"".concat(e,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(t.by?"float amt = ".concat(e,"amount * ").concat(e,"damt *\n (1.0 - smoothstep(0.0, ").concat(e,"radius, dl));"):"float amt = ".concat(e,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(e,t){return{amount:["1f",(null!=e.amount?e.amount:6)*t],radius:["1f",(e.radius||240)*t]}}},mask:{doc:{summary:'Writes a scalar FIELD for later ops to read — draws nothing itself. Give a downstream op `masked: "name"` and it applies only where this field is high. This is how any op becomes local without knowing anything about masking.',params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written. Consumers name it in `masked:`."},from:{default:"radial",unit:"name",structural:!0,summary:"field shape — compiled in, so changing it rebuilds"},at:{default:[.5,.5],unit:"point",structural:!0,summary:"centre as a fraction of the element box; survives resizes"},radius:{default:260,unit:"px",summary:"field radius"},invert:{default:!1,unit:"bool",summary:"swap inside and outside"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as","from","at"],stage:"field",producesField:!0,defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"at;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"invert;")},code:function(e,t){var n=t.from||"radial",a=t.at?"(".concat(e,"at * u_res)"):"".concat(e,"dpos"),r="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(a,"))");return"\n {\n float m = ".concat(r,";\n m = clamp((m - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(e,"invert);\n ").concat(f(t.as||"mask")," *= m * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:260)*t],at:["2fv",e.at||[.5,.5]],remap:["2fv",e.remap||[0,1]],invert:["1f",e.invert?1:0]}}},noise:{doc:{summary:"Writes an animated noise FIELD. Same contract as `mask` — it draws nothing; downstream ops read it via `masked:`. Use it to make any other op flicker, breathe or crawl.",params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written"},scale:{default:3,unit:"ratio",summary:"noise frequency across the element"},speed:{default:.3,unit:"seconds",summary:"how fast it evolves; 0 freezes it"},amount:{default:1,unit:"ratio",summary:"blend between flat 1.0 and full noise"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as"],stage:"field",producesField:!0,decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"speed;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"amp;\n float ").concat(e,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(e,t){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(e,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(e,"n(np + u_time * ").concat(e,"speed) * 0.65 +\n ").concat(e,"n(np * 2.7 - u_time * ").concat(e,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(f(t.as||"mask")," *= mix(1.0, n, ").concat(e,"amp);\n }")},uniforms:function(e){return{scale:["1f",null!=e.scale?e.scale:3],speed:["1f",null!=e.speed?e.speed:.3],remap:["2fv",e.remap||[0,1]],amp:["1f",null!=e.amount?e.amount:1]}}},copy:{multiSample:!0,doc:{summary:"Stamps extra copies of the element over itself. Copies sample the ORIGINAL texture, not the result of earlier colour ops, so a copy of a halftoned element is a copy of the unhalftoned source.",params:{count:{default:5,unit:"count",structural:!0,summary:'stamps arranged in a ring around the focus. The loop is unrolled at compile time, so this rebuilds — not something to animate. This default is the shader\'s; the DOM path that an element of type "copy" takes uses 3 instead.'},points:{default:null,unit:"point",structural:!0,summary:"explicit [[x,y], ...] in fractions of the element box, instead of a ring. Survives resizes. Overrides `count`."},radius:{default:110,unit:"px",summary:"ring radius when using `count`"},scale:{default:.5,unit:"ratio",summary:"size of each copy"},rotate:{default:0,unit:"deg",summary:"rotation applied per copy"},fade:{default:1,unit:"ratio",summary:"opacity falloff across the set"},amount:{default:1,unit:"ratio",summary:"overall blend of the copies over the original"},animation:{default:!1,unit:"bool",readBy:"element-mapper",summary:'DOM path only. An element of type "copy" is built by the mapper rather than by the shader, and this asks that mapper for animated copies; the shader path ignores it. Declared because the mapper has always read it and the docs have always taught it, while the registry did not list it – so the validator reported a documented, working node as an unknown parameter.'}}},structural:["count","points"],stage:"color",defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform float ").concat(e,"scale;\n uniform float ").concat(e,"rotate;\n uniform float ").concat(e,"fade;\n uniform float ").concat(e,"amount;")},code:function(e,t){for(var n=Array.isArray(t.points)&&t.points.length>0,a=n?t.points.length:Math.max(1,Math.min(24,Math.round(t.count||5))),r="",o=function(o){var c,i=n?"vec2(".concat((+t.points[o][0]).toFixed(5),", ").concat((+t.points[o][1]).toFixed(5),") * u_res"):(c=o/a*Math.PI*2,"".concat(e,"dpos + vec2(").concat(Math.cos(c).toFixed(5),", ")+"".concat(Math.sin(c).toFixed(5),") * ").concat(e,"radius"));r+="\n {\n float ang = ".concat(e,"rotate * ").concat((o+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(i,"));\n vec2 q = d / max(").concat(e,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(e,"amount * ").concat(e,"damt\n * pow(").concat(e,"fade, ").concat(o.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},c=0;c<a;c++)o(c);return r},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:110)*t],scale:["1f",null!=e.scale?e.scale:.5],rotate:["1f",null!=e.rotate?e.rotate:0],fade:["1f",null!=e.fade?e.fade:1],amount:["1f",null!=e.amount?e.amount:1]}}},merge:{doc:{summary:"Runs two sub-chains over the same source and blends the results. The only op that takes other ops as arguments — everything else composes by sequence, this composes in parallel.",params:{a:{default:null,summary:"first branch: an array of nodes",structural:!0},b:{default:null,summary:"second branch: an array of nodes",structural:!0},mode:{default:"over",unit:"name",structural:!0,summary:"how the branches combine: over, add, screen, multiply, difference, lighten. Compiled in, so it rebuilds."},mix:{default:1,unit:"ratio",summary:"how far to blend b into a"}}},structural:["mode","a","b"],stage:"color",decl:function(e){return"uniform float ".concat(e,"mix;")},code:function(){return""},uniforms:function(e){return{mix:["1f",null!=e.mix?e.mix:1]}}},echo:{doc:{summary:"Temporal accumulation — a fading trail of what CHANGED. Typing smears, a ticking counter leaves a comet. The one op that does nothing on the snapshot backend, because a frozen image has no motion to record.",params:{strength:{default:.85,unit:"ratio",summary:"opacity of the trail"},decay:{default:.92,unit:"ratio",summary:"per-second persistence — higher is a longer tail"},tint:{default:"#7FD4FF",unit:"color",summary:"colour pushed into the trail"},tintAmount:{default:.5,unit:"ratio",summary:"how far the trail is tinted"}}},stage:"color",decl:function(e){return"\n uniform sampler2D ".concat(e,"hist;\n uniform float ").concat(e,"strength;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"tintAmt;")},code:function(e){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(e,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(e,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(e,"tint, ").concat(e,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(e){return{strength:["1f",null!=e.strength?e.strength:.85],tint:["3fv",i(e.tint||"#7FD4FF")],tintAmt:["1f",e.tint?null!=e.tintAmount?e.tintAmount:.5:0]}},solver:{resolutions:function(e,t,n){return{frame:[t,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(e,t,n){var a=Math.min(n.dt,1/30),r=Math.pow(null!=t.decay?t.decay:.92,60*a);e.use("accumulate"),e.f2("u_texel",1/e.canvasW,1/e.canvasH),e.f1("u_decay",r),e.smp("u_content",e.content,0),e.smp("u_hist",e.read("history"),1),e.blit(e.write("history")),e.swap("history")}}},stir:{doc:{summary:"Stirred liquid: a real fluid simulation the content is dragged through. STATEFUL — it owns a ping-pong pair of render targets that evolve frame to frame, so it is the most expensive op here.",params:{strength:{default:26,unit:"px",summary:"how far the fluid carries the content"},force:{default:1,unit:"ratio",summary:"how hard the pointer pushes the fluid"},radius:{default:.1,unit:"ratio",summary:"splat size, as a fraction of the sim grid"},curl:{default:2.2,unit:"ratio",summary:"vorticity — how much the fluid curls into eddies"},decay:{default:.985,unit:"ratio",summary:"per-second velocity persistence"},pressure:{default:.8,unit:"ratio",summary:"pressure retained between frames"},pressureIterations:{default:6,unit:"count",summary:"solver iterations; higher is stiffer and slower"},intensity:{default:1.6,unit:"ratio",summary:"brightness of the dye layer"},sheen:{default:.15,unit:"ratio",summary:"specular highlight on the surface"},tint:{default:"#7FD4FF",unit:"color",summary:"dye colour, unless `rainbow`"},rainbow:{default:!1,unit:"bool",summary:"cycle dye hue instead of using `tint`"},dye:{default:.85,unit:"ratio",summary:"how much dye colour reaches the final image"},dyeAmount:{default:.6,unit:"ratio",summary:"how much dye each splat injects"},dyeFade:{default:.97,unit:"ratio",summary:"per-second dye persistence"},resolution:{default:128,unit:"count",summary:"velocity grid size, clamped 32..512"},dyeResolution:{default:512,unit:"count",summary:"dye grid size, clamped 64..1024"}}},stage:["warp","color"],decl:function(e){return"\n uniform sampler2D ".concat(e,"vel;\n uniform sampler2D ").concat(e,"dye;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"dyemix;\n uniform float ").concat(e,"intensity;\n uniform float ").concat(e,"sheen;\n uniform vec3 ").concat(e,"tint;")},code:function(e,t,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(e,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(e,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(e,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(e,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(e,"intensity)) * ").concat(e,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(e,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(e,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(e,"sheen);\n }")},uniforms:function(e,t){return{strength:["1f",(null!=e.strength?e.strength:26)*t],sheen:["1f",null!=e.sheen?e.sheen:.15],tint:["3fv",i(e.tint||"#7FD4FF")],dyemix:["1f",null!=e.dye?e.dye:.85],intensity:["1f",null!=e.intensity?e.intensity:1.6]}},solver:{resolutions:function(e){return{sim:Math.max(32,Math.min(e.resolution||128,512)),dye:Math.max(64,Math.min(e.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(e,t,n){var a=null!=e.dyeAmount?e.dyeAmount:.6;if(!e.rainbow){var r=i(e.tint||"#7FD4FF");return[r[0]*a,r[1]*a,r[2]*a]}var o=Math.atan2(n,t);return[(.5+.5*Math.cos(o))*a,(.5+.5*Math.cos(o+2.0944))*a,(.5+.5*Math.cos(o+4.1888))*a]},step:function(e,t,n){var a=Math.min(n.dt,1/30),r=1/e.res.sim,o=1/e.res.dye,c=function(e,t){return Math.pow(e,60*t)};if(n.moving){var i=null!=t.force?t.force:1;e.use("splat"),e.f1("u_radius",null!=t.radius?t.radius:.1),e.f1("u_aspect",n.aspect),e.f2("u_point",n.px,n.py),e.f2("u_texel",r,r),e.smp("u_src",e.read("velocity"),0),e.f3("u_amount",n.dx*i,n.dy*i,0),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",o,o),e.smp("u_src",e.read("dye"),0),e.f3("u_amount",n.col[0],n.col[1],n.col[2]),e.blit(e.write("dye")),e.swap("dye")}e.use("curl"),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("vorticity")),e.use("confine"),e.f2("u_texel",r,r),e.f1("u_eps",null!=t.curl?t.curl:2.2),e.f1("u_dt",a),e.smp("u_vel",e.read("velocity"),0),e.smp("u_curl",e.single("vorticity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("divergence"),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("divergence")),e.use("decay"),e.f2("u_texel",r,r),e.f1("u_value",c(null!=t.pressure?t.pressure:.8,a)),e.smp("u_tex",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure"),e.use("jacobi"),e.f2("u_texel",r,r),e.smp("u_div",e.single("divergence"),1);for(var s=Math.max(1,Math.min(t.pressureIterations||6,40)),u=0;u<s;u++)e.smp("u_p",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure");e.use("subtract"),e.f2("u_texel",r,r),e.smp("u_p",e.read("pressure"),0),e.smp("u_vel",e.read("velocity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("advect"),e.f1("u_dt",a),e.f2("u_texel",r,r),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("velocity"),0),e.f1("u_diss",c(null!=t.decay?t.decay:.985,a)),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("dye"),1),e.f1("u_diss",c(null!=t.dyeFade?t.dyeFade:.97,a)),e.blit(e.write("dye")),e.swap("dye")}}},blobs:{doc:{summary:"Liquid-glass blobs that follow the pointer: a chain of metaballs refracting the content behind them, stretching apart on a fast flick and relaxing back to a single circle at rest.",params:{count:{default:1,unit:"count",structural:!0,summary:"independent drifting blobs, on top of the trail chain"},trail:{default:7,unit:"count",structural:!0,summary:"blobs in the follow-the-leader chain. Unrolled at compile time, so it rebuilds."},radius:{default:46,unit:"px",summary:"blob radius at rest"},color:{default:"#EAF4EE",unit:"color",summary:"glass tint"},refract:{default:70,unit:"px",summary:"how far the glass bends what is behind it"},rim:{default:.6,unit:"ratio",summary:"brightness of the rim light"},alpha:{default:1,unit:"ratio",summary:"overall opacity"},iridescence:{default:.8,unit:"ratio",summary:"colour shift across the rim"},dispersion:{default:1,unit:"ratio",summary:"per-channel refraction spread"},frost:{default:.25,unit:"ratio",summary:"blur of what shows through"}}},structural:["count","trail"],stage:"color",overlay:!0,mips:!0,decl:function(e){return"\n uniform vec3 ".concat(e,"blobs[").concat(12,"];\n uniform int ").concat(e,"count;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"refract;\n uniform float ").concat(e,"rim;\n uniform float ").concat(e,"alpha;\n uniform float ").concat(e,"irid;\n uniform float ").concat(e,"disp;\n uniform float ").concat(e,"frost;\n float ").concat(e,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(e,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(e,"hash(f);\n float c100 = ").concat(e,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(e,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(e,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(e,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(e,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(e,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(e,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(e){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(e,"count) break;\n vec2 bd = frag - ").concat(e,"blobs[bi].xy;\n float br = ").concat(e,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(e,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(e,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(e,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(e,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(e,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(e,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(e,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(e,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(e,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(e,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(e,"alpha);\n }\n }")},uniforms:function(e,t){return{tint:["3fv",i(e.color||"#EAF4EE")],refract:["1f",(null!=e.refract?e.refract:70)*t],rim:["1f",null!=e.rim?e.rim:.6],alpha:["1f",null!=e.alpha?e.alpha:1],irid:["1f",null!=e.iridescence?e.iridescence:.8],disp:["1f",null!=e.dispersion?e.dispersion:1],frost:["1f",null!=e.frost?e.frost:.25]}},init:function(e,t,n,a){for(var r=(e.radius||46)*t,o=Math.max(1,Math.min(null!=e.trail?e.trail:7,12)),c=[],i=0,s=0;s<o;s++){var u=Math.pow(.86,s);c.push(u),i+=u*u}for(var l=Math.sqrt(i),f=c.map(function(e){return r*e/l}),d=c.map(function(e,t){return.85*r*Math.pow(.955,t)}),m=function(e,t){return e+Math.random()*(t-e)},h=Math.max(0,Math.min((e.count||1)-1,12-o)),p=[],v=0;v<h;v++){var y=m(0,2*Math.PI),g=m(30,80)*t;p.push({x:m(r,n-r),y:m(r,a-r),r:r*m(.45,.8),vx:Math.cos(y)*g,vy:Math.sin(y)*g,phase:m(0,2*Math.PI)})}for(var x={x:.5*n,y:.55*a},b=[],w=0;w<o;w++)b.push({x:x.x,y:x.y});return{head:x,chain:b,nTrail:o,drifters:p,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*r}},tick:function(e,t){var a=Math.min(t.dt,.05),r=t.w,o=t.h,c=1-Math.exp(9*-a);e.head.x+=(t.mouseX-e.head.x)*c,e.head.y+=(t.mouseY-e.head.y)*c;var i=e.chain;i[0].x=e.head.x,i[0].y=e.head.y;for(var s=1-Math.exp(16*-a),u=1;u<i.length;u++){var l=i[u-1],f=i[u],d=l.x-f.x,m=l.y-f.y,h=Math.hypot(d,m)||1e-4,p=e.seg;h>p&&(f.x+=d*(1-p/h),f.y+=m*(1-p/h)),f.x+=(l.x-f.x)*s,f.y+=(l.y-f.y)*s}var v=i[i.length-1],y=Math.hypot(v.x-e.head.x,v.y-e.head.y),g=Math.max(1,e.seg*(e.nTrail-1)),x=Math.min(1,y/g);e.stretch+=(x-e.stretch)*(1-Math.exp(8*-a));var b,w=function(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=n(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,i=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return i=e.done,e},e:function(e){s=!0,c=e},f:function(){try{i||null==a.return||a.return()}finally{if(s)throw c}}}}(e.drifters);try{for(w.s();!(b=w.n()).done;){var _=b.value;_.x+=_.vx*a,_.y+=_.vy*a,_.x<_.r?(_.x=_.r,_.vx=Math.abs(_.vx)):_.x>r-_.r&&(_.x=r-_.r,_.vx=-Math.abs(_.vx)),_.y<_.r?(_.y=_.r,_.vy=Math.abs(_.vy)):_.y>o-_.r&&(_.y=o-_.r,_.vy=-Math.abs(_.vy)),_.phase+=1.6*a}}catch(e){w.e(e)}finally{w.f()}for(var F=new Float32Array(36),D=e.stretch,k=0;k<e.nTrail;k++){var M=i[k];F[3*k]=M.x,F[3*k+1]=M.y,F[3*k+2]=e.trailIdleR[k]+(e.trailMoveR[k]-e.trailIdleR[k])*D}return e.drifters.forEach(function(t,n){var a=e.nTrail+n;F[3*a]=t.x,F[3*a+1]=t.y,F[3*a+2]=t.r*(1+.12*Math.sin(t.phase))}),[{name:"blobs",kind:"3fv",value:F},{name:"count",kind:"1i",value:e.nTrail+e.drifters.length}]}}};function i(e){return[1,3,5].map(function(t){return parseInt(e.slice(t,t+2),16)/255})}Object.keys(c).concat("switch");var s,u={linear:function(e){return e},in:function(e){return e*e*e},out:function(e){return 1-Math.pow(1-e,3)},"in-out":function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},back:function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)}},l=Object.keys(u),f=(["field"].concat(function(e){if(Array.isArray(e))return a(e)}(s=Object.keys({warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||n(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),"what steers the effect: ".concat(o.join(", "),". "),"easing for this node's local progress: ".concat(l.join(", ")),function(e){return"fld_".concat(String(e).replace(/[^A-Za-z0-9_]/g,""))});function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function p(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,v(a.key),a)}}function v(e){var t=function(e){if("object"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}new Set(["none","rgba(0, 0, 0, 0)","transparent","0px","auto","1","repeat","0% 0%","border-box","0% 0% / auto repeat scroll padding-box border-box"]),new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),new Set;var y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.res=null,this.currentItem=""},(t=[{key:"set",value:function(e){var t=this,n=e;this.options=e;var a=document.createElement("input");a.setAttribute("list","dlCities"),a.setAttribute("id","my");var r=e.data,o=0,c=r.length,i=document.createElement("datalist");for(i.id="dlCities",o=0;o<c;o+=1){var s=document.createElement("option");s.value=r[o],i.appendChild(s)}return a.appendChild(i),a.addEventListener("change",function(){var e=document.querySelector("#my").value;t.currentItem=e}),a.setAttribute("placeholder","Type value"),a.style.padding=".4rem .75rem",a.style.fontSize="1rem",this.res=a,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var e=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(e,")")]}},{key:"getValue",value:function(){return this.res.value}},{key:"arrayPadding",value:function(e,t){return e.includes("left")&&(this.res.style.paddingLeft=t),e.includes("right")&&(this.res.style.paddingRight=t),e.includes("top")&&(this.res.style.paddingTop=t),e.includes("bottom")&&(this.res.style.paddingBottom=t),e.includes("all")&&(this.res.style.padding=t),this}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),this}},{key:"margin",value:function(e){return this.res.style.margin=e,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(e){if(!e)return this.res;document.querySelector(e).appendChild(this.res)}}])&&p(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),g=y;y=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n){if(m())return Reflect.construct.apply(null,arguments);var a=[null];a.push.apply(a,t);var r=new(e.bind.apply(e,a));return n&&d(r,n.prototype),r}(g,t)},"undefined"!=typeof window&&(window.DataList=y),module.exports=t})();
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * nodality v1.2.6
2
+ * nodality v1.2.7
3
3
  * (c) 2026 Filip Vabrousek
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * nodality v1.2.6
2
+ * nodality v1.2.7
3
3
  * (c) 2026 Filip Vabrousek
4
4
  * License: MIT
5
5
  */