@mkbabb/glass-ui 3.12.0 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/{CardAction-DuArVky-.js → CardAction-Cj2eycQ2.js} +2 -2
  2. package/dist/{CommandShortcut-CefCj5mt.js → CommandShortcut-RowNEO6i.js} +4 -4
  3. package/dist/{ContextMenuSubContent-Bhg4f5jX.js → ContextMenuSubContent-BQmxTAdw.js} +4 -4
  4. package/dist/{DataTable-CUHMukiQ.js → DataTable-BCddn3T3.js} +3 -3
  5. package/dist/{DialogContent-BRkT1cjP.js → DialogContent-Dl9WkAoS.js} +3 -3
  6. package/dist/{DialogFooter-Gprw8H_A.js → DialogFooter-Blu4t7tJ.js} +2 -2
  7. package/dist/{HoverPopover-2LOIW34a.js → HoverPopover-CISOJQuZ.js} +1 -1
  8. package/dist/{IconTooltip-Cus0fvK0.js → IconTooltip-DPzE09X9.js} +1 -1
  9. package/dist/MetricBadge-C9QMz1KT.js +79 -0
  10. package/dist/{Notification-DLMhblXR.js → Notification-DdwNxIrI.js} +2 -2
  11. package/dist/{NumberFieldContent-BbLOh8RU.js → NumberFieldContent-CqaN-SvN.js} +3 -3
  12. package/dist/{PopoverContent-BId6ggf_.js → PopoverContent-BYwt2-4x.js} +1 -1
  13. package/dist/{ScrollingText-BPP84wKo.js → ScrollingText-DfFrwSph.js} +1 -1
  14. package/dist/{SelectScrollDownButton-T32cVFeM.js → SelectScrollDownButton-CiDUxfEj.js} +6 -6
  15. package/dist/{Switch-Ch-k3Rv-.js → Switch-CsIuYP_e.js} +1 -1
  16. package/dist/{TabsList-B8CVOQPC.js → TabsList-Dttss653.js} +9 -5
  17. package/dist/{Toaster-1rYWrmAm.js → Toaster-D6q4HtXu.js} +50 -47
  18. package/dist/{ToggleGroupItem-COu_4IW4.js → ToggleGroupItem-D_AHlRw9.js} +18 -22
  19. package/dist/animated-digit.js +2 -2
  20. package/dist/api/index.d.ts +5 -2
  21. package/dist/api.js +2 -2
  22. package/dist/aurora.js +69 -69
  23. package/dist/{badge-CaoFJzRb.js → badge-UILT_3pZ.js} +1 -1
  24. package/dist/badge.js +1 -1
  25. package/dist/{button-DN39cGqL.js → button-ChXMfsud.js} +12 -12
  26. package/dist/button.js +1 -1
  27. package/dist/card.js +1 -1
  28. package/dist/carousel.js +8 -8
  29. package/dist/{check-BBKKKSTf.js → check-njhk-vfu.js} +1 -1
  30. package/dist/{chevron-down-BSkTP2aL.js → chevron-down-DKkxb4VV.js} +1 -1
  31. package/dist/{chevron-right-sDM0Yvrf.js → chevron-right-CPXbqQQz.js} +1 -1
  32. package/dist/{chevron-up-CCOD_FTz.js → chevron-up-n_24SqI-.js} +1 -1
  33. package/dist/coalesceMetric-5qIeZnTx.js +13 -0
  34. package/dist/{color-C5ls_QF7.js → color-CUYeFbgd.js} +9 -7
  35. package/dist/color.js +1 -1
  36. package/dist/command.js +1 -1
  37. package/dist/components/custom/animated-digit/AnimatedDigit.vue.d.ts +8 -0
  38. package/dist/components/custom/aurora/constants/presets.d.ts +5 -62
  39. package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +1 -1
  40. package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +1 -0
  41. package/dist/components/custom/aurora/index.d.ts +1 -1
  42. package/dist/components/custom/configurator/ConfiguratorRow.vue.d.ts +16 -0
  43. package/dist/components/custom/constellation/Constellation.vue.d.ts +74 -6
  44. package/dist/components/custom/constellation/composables/createConstellationField.d.ts +41 -0
  45. package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +35 -0
  46. package/dist/components/custom/constellation/constants.d.ts +61 -0
  47. package/dist/components/custom/constellation/constellationDraw.d.ts +30 -0
  48. package/dist/components/custom/constellation/constellationField.d.ts +116 -149
  49. package/dist/components/custom/constellation/constellationInteraction.d.ts +132 -0
  50. package/dist/components/custom/constellation/index.d.ts +5 -2
  51. package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +11 -0
  52. package/dist/components/custom/dock/DockRail.vue.d.ts +88 -0
  53. package/dist/components/custom/dock/DockTabButton.vue.d.ts +3 -4
  54. package/dist/components/custom/dock/GlassDock.vue.d.ts +5 -118
  55. package/dist/components/custom/dock/composables/dockMorphContext.d.ts +36 -0
  56. package/dist/components/custom/dock/composables/index.d.ts +1 -0
  57. package/dist/components/custom/dock/composables/useDockClickIntegrity.d.ts +23 -0
  58. package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +15 -0
  59. package/dist/components/custom/dock/composables/useDockOrientationMorph.d.ts +44 -0
  60. package/dist/components/custom/dock/composables/useDockShellProps.d.ts +165 -0
  61. package/dist/components/custom/dock/composables/useLayerTransition.d.ts +44 -0
  62. package/dist/components/custom/dock/constants.d.ts +48 -0
  63. package/dist/components/custom/dock/index.d.ts +3 -0
  64. package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +5 -37
  65. package/dist/components/custom/fourier-field/index.d.ts +1 -1
  66. package/dist/components/custom/fourier-field/math.d.ts +17 -0
  67. package/dist/components/custom/fourier-field/presets.d.ts +54 -0
  68. package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +18 -0
  69. package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +41 -0
  70. package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +4 -3
  71. package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +11 -8
  72. package/dist/components/custom/goo-blob/constants.d.ts +52 -0
  73. package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +1 -0
  74. package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
  75. package/dist/components/custom/labeled-field/LabeledField.vue.d.ts +37 -0
  76. package/dist/components/custom/labeled-field/LabeledSelect.vue.d.ts +6 -0
  77. package/dist/components/custom/labeled-field/LabeledSlider.vue.d.ts +6 -0
  78. package/dist/components/custom/labeled-field/LabeledSwitch.vue.d.ts +6 -0
  79. package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +11 -18
  80. package/dist/components/custom/metric-badge/index.d.ts +1 -0
  81. package/dist/components/custom/metric-cell/MetricCell.vue.d.ts +15 -4
  82. package/dist/components/custom/metric-stack/MetricRow.vue.d.ts +6 -4
  83. package/dist/components/custom/tabs/constants.d.ts +12 -0
  84. package/dist/components/custom/underline/GlassUnderline.vue.d.ts +84 -0
  85. package/dist/components/custom/underline/index.d.ts +2 -0
  86. package/dist/components/custom/underline/types.d.ts +56 -0
  87. package/dist/components/ui/card/Card.vue.d.ts +15 -3
  88. package/dist/components/ui/drawer/Drawer.vue.d.ts +1 -0
  89. package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
  90. package/dist/components/ui/metric-pill/MetricPill.vue.d.ts +6 -3
  91. package/dist/components/ui/slider/index.d.ts +22 -19
  92. package/dist/components/ui/tabs/TabsIndicator.vue.d.ts +4 -1
  93. package/dist/components/ui/toast/use-toast.d.ts +2 -2
  94. package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
  95. package/dist/components/ui/toggle/index.d.ts +1 -1
  96. package/dist/components/ui/toggle-group/ToggleGroup.vue.d.ts +1 -7
  97. package/dist/components/ui/toggle-group/ToggleGroupItem.vue.d.ts +1 -3
  98. package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +0 -13
  99. package/dist/composables/color/index.d.ts +12 -0
  100. package/dist/composables/dark/index.d.ts +1 -1
  101. package/dist/composables/dark/useGlobalDark.d.ts +1 -21
  102. package/dist/composables/glass/index.d.ts +0 -1
  103. package/dist/composables/glass/useGlassBackdropLuminance.d.ts +59 -0
  104. package/dist/composables/glass/useSpecularTracking.d.ts +12 -3
  105. package/dist/composables/motion/core/index.d.ts +1 -1
  106. package/dist/composables/motion/curves.d.ts +48 -0
  107. package/dist/composables/motion/index.d.ts +2 -0
  108. package/dist/composables/motion/springPresets.d.ts +33 -0
  109. package/dist/composables/motion/suite.d.ts +2 -0
  110. package/dist/composables/motion/useLiquidFlex.d.ts +85 -0
  111. package/dist/composables/motion/useSpringMount.d.ts +1 -1
  112. package/dist/configurator.js +1 -1
  113. package/dist/confirm-dialog.js +2 -2
  114. package/dist/constellation.js +336 -222
  115. package/dist/context-menu.js +2 -2
  116. package/dist/controls.js +48 -20
  117. package/dist/dark.d.ts +1 -1
  118. package/dist/dark.js +1 -1
  119. package/dist/data-table.js +1 -1
  120. package/dist/dialog.js +2 -2
  121. package/dist/dock.js +705 -365
  122. package/dist/dockContext-BegmJVmx.js +17 -0
  123. package/dist/dom.js +5 -5
  124. package/dist/{dropdown-menu-D77jX6Df.js → dropdown-menu-DzkkyBwX.js} +11 -8
  125. package/dist/dropdown-menu.js +1 -1
  126. package/dist/expandable-container.js +39 -80
  127. package/dist/forms.js +5 -5
  128. package/dist/fourier-field.js +134 -99
  129. package/dist/fourier-math.js +2 -2
  130. package/dist/glass-panel.js +86 -20
  131. package/dist/glass-ui.css +1 -1
  132. package/dist/glass-ui.js +222 -212
  133. package/dist/goo-blob.js +243 -212
  134. package/dist/hover-card.js +1 -1
  135. package/dist/hover-popover.js +1 -1
  136. package/dist/icon-tooltip.js +1 -1
  137. package/dist/index.d.ts +1 -3
  138. package/dist/instrument-chassis.js +1 -1
  139. package/dist/keyboard.js +1 -1
  140. package/dist/label.js +1 -1
  141. package/dist/labeled-field.js +28 -18
  142. package/dist/{math-DTpRVC0e.js → math-U6-RrLmV.js} +18 -2
  143. package/dist/metric-badge.js +1 -1
  144. package/dist/metric-cell.js +25 -21
  145. package/dist/metric-stack.js +35 -34
  146. package/dist/{minimize-2-lcXOuc6V.js → minimize-2-BV31Ob_h.js} +1 -1
  147. package/dist/motion-core.js +32 -137
  148. package/dist/motion-curves.d.ts +1 -0
  149. package/dist/motion-curves.js +130 -0
  150. package/dist/motion.js +38 -37
  151. package/dist/notification.js +1 -1
  152. package/dist/number-field.js +1 -1
  153. package/dist/paper-backdrop.js +1 -1
  154. package/dist/popover.js +1 -1
  155. package/dist/{presets-BP_ALM0m.js → presets-BKVyQfbt.js} +1 -14
  156. package/dist/progress.js +1 -1
  157. package/dist/reactive.js +2 -2
  158. package/dist/scrolling-text.js +1 -1
  159. package/dist/{search-nbkvr2dC.js → search-BSGrf2Sk.js} +1 -1
  160. package/dist/search.js +9 -9
  161. package/dist/select.js +3 -3
  162. package/dist/separator.js +1 -1
  163. package/dist/{sheet-VZEtNFvO.js → sheet-1fChZjtw.js} +3 -3
  164. package/dist/sheet.js +1 -1
  165. package/dist/{slider-ClgpP7EB.js → slider-B-JP2JlI.js} +4 -4
  166. package/dist/slider.js +1 -1
  167. package/dist/sortable-list.js +2 -2
  168. package/dist/springPresets--YdWTHtm.js +40 -0
  169. package/dist/stacked-icons.js +6 -6
  170. package/dist/styles/animations.css +29 -114
  171. package/dist/styles/cards.css +55 -0
  172. package/dist/styles/components.css +4 -1
  173. package/dist/styles/configurator.css +42 -0
  174. package/dist/styles/dock/layer-group.css +83 -25
  175. package/dist/styles/dock/layers.css +23 -1
  176. package/dist/styles/dock/morph-bridge.css +123 -0
  177. package/dist/styles/dock/morph.css +175 -45
  178. package/dist/styles/dock/overflow.css +51 -1
  179. package/dist/styles/dock/rail-extend.css +300 -0
  180. package/dist/styles/dock/shell.css +63 -105
  181. package/dist/styles/dock-controls/dark-mode-toggle.css +109 -0
  182. package/dist/styles/dock-controls/icon-button.css +133 -0
  183. package/dist/styles/dock-controls/tab-button.css +202 -0
  184. package/dist/styles/dock-controls/touch-floor.css +94 -0
  185. package/dist/styles/dock-controls/triggers.css +128 -0
  186. package/dist/styles/dock-controls.css +30 -595
  187. package/dist/styles/dock.css +2 -0
  188. package/dist/styles/drawer.css +2 -0
  189. package/dist/styles/floating-panel.css +17 -0
  190. package/dist/styles/glass/a11y-fallback.css +245 -0
  191. package/dist/styles/glass/ladder.css +337 -0
  192. package/dist/styles/glass/material.css +238 -0
  193. package/dist/styles/glass/progress-rail.css +78 -0
  194. package/dist/styles/glass/squircle.css +66 -0
  195. package/dist/styles/glass/surfaces.css +306 -0
  196. package/dist/styles/glass-refract.css +2 -0
  197. package/dist/styles/glass.css +31 -1188
  198. package/dist/styles/hover-popover.css +2 -0
  199. package/dist/styles/index.css +28 -14
  200. package/dist/styles/instrument-chassis.css +4 -0
  201. package/dist/styles/paper.css +2 -68
  202. package/dist/styles/segmented-tabs.css +275 -0
  203. package/dist/styles/theme/bridges.css +337 -0
  204. package/dist/styles/theme/dark.css +7 -0
  205. package/dist/styles/theme/literals.css +94 -0
  206. package/dist/styles/theme/radius.css +95 -0
  207. package/dist/styles/theme.css +26 -529
  208. package/dist/styles/tokens/color-radius.css +260 -0
  209. package/dist/styles/tokens/dark-arm.css +200 -0
  210. package/dist/styles/tokens/glass.css +440 -0
  211. package/dist/styles/tokens/light-dark.css +158 -0
  212. package/dist/styles/tokens/offsets-sizing.css +500 -0
  213. package/dist/styles/tokens/property-regs.css +169 -0
  214. package/dist/styles/tokens/scale-paper.css +366 -0
  215. package/dist/styles/tokens/scheme-motion.css +334 -0
  216. package/dist/styles/tokens/shadow.css +166 -0
  217. package/dist/styles/tokens.css +22 -2360
  218. package/dist/styles/typography.css +75 -21
  219. package/dist/styles/utilities/a11y-overrides.css +140 -0
  220. package/dist/styles/utilities/animate.css +26 -0
  221. package/dist/styles/utilities/base.css +365 -0
  222. package/dist/styles/utilities/btn.css +401 -0
  223. package/dist/styles/utilities/components.css +317 -0
  224. package/dist/styles/utilities.css +19 -1318
  225. package/dist/styles/view-transition.css +0 -51
  226. package/dist/switch.js +1 -1
  227. package/dist/tabs.js +91 -82
  228. package/dist/timeline.js +1 -1
  229. package/dist/toast.js +1 -1
  230. package/dist/toggle-group.js +1 -1
  231. package/dist/tooltip.js +1 -1
  232. package/dist/underline.d.ts +1 -0
  233. package/dist/underline.js +85 -0
  234. package/dist/{useAnimatedNumber-Bcpy5Etf.js → useAnimatedNumber-C5I3wWd8.js} +1 -1
  235. package/dist/{useConfiguratorState-DxAqksK6.js → useConfiguratorState-DAoeHVue.js} +8 -8
  236. package/dist/{useGlobalDark-CAhOXNLO.js → useGlobalDark-yhL4Wp-s.js} +3 -22
  237. package/dist/useLiquidFlex-BL0lLLN2.js +30 -0
  238. package/dist/useRAFLoop-Bxv0o6L5.js +109 -0
  239. package/dist/{useScrollProgress-CffFGLa5.js → useScrollProgress-Dlvx-L3v.js} +1 -1
  240. package/dist/useSpecularTracking-Bo5su68i.js +32 -0
  241. package/dist/useSpringMount-CI2jOstM.js +108 -0
  242. package/dist/{useTouchGate-WFyJYsth.js → useTouchGate-Dg7MQI1G.js} +1 -1
  243. package/dist/utils/coalesceMetric.d.ts +29 -0
  244. package/dist/utils/index.d.ts +1 -0
  245. package/dist/vReveal-CqaCz_mC.js +44 -0
  246. package/dist/watercolor-dot.js +11 -9
  247. package/dist/{x-Dfsegz9Y.js → x-BUwTKe50.js} +1 -1
  248. package/package.json +78 -58
  249. package/src/styles/animations.css +29 -114
  250. package/src/styles/cards.css +53 -0
  251. package/src/styles/configurator.css +42 -0
  252. package/src/styles/dock/layer-group.css +83 -25
  253. package/src/styles/dock/layers.css +23 -1
  254. package/src/styles/dock/morph-bridge.css +123 -0
  255. package/src/styles/dock/morph.css +175 -45
  256. package/src/styles/dock/overflow.css +51 -1
  257. package/src/styles/dock/rail-extend.css +300 -0
  258. package/src/styles/dock/shell.css +63 -105
  259. package/src/styles/dock-controls/dark-mode-toggle.css +109 -0
  260. package/src/styles/dock-controls/icon-button.css +133 -0
  261. package/src/styles/dock-controls/tab-button.css +202 -0
  262. package/src/styles/dock-controls/touch-floor.css +94 -0
  263. package/src/styles/dock-controls/triggers.css +128 -0
  264. package/src/styles/dock-controls.css +30 -595
  265. package/src/styles/dock.css +2 -0
  266. package/src/styles/floating-panel.css +15 -0
  267. package/src/styles/glass/a11y-fallback.css +245 -0
  268. package/src/styles/glass/ladder.css +337 -0
  269. package/src/styles/glass/material.css +238 -0
  270. package/src/styles/glass/progress-rail.css +78 -0
  271. package/src/styles/glass/squircle.css +66 -0
  272. package/src/styles/glass/surfaces.css +306 -0
  273. package/src/styles/glass.css +31 -1188
  274. package/src/styles/index.css +28 -14
  275. package/src/styles/paper.css +2 -68
  276. package/src/styles/segmented-tabs.css +271 -0
  277. package/src/styles/theme/bridges.css +337 -0
  278. package/src/styles/theme/dark.css +7 -0
  279. package/src/styles/theme/literals.css +94 -0
  280. package/src/styles/theme/radius.css +95 -0
  281. package/src/styles/theme.css +26 -529
  282. package/src/styles/tokens/color-radius.css +260 -0
  283. package/src/styles/tokens/dark-arm.css +200 -0
  284. package/src/styles/tokens/glass.css +440 -0
  285. package/src/styles/tokens/light-dark.css +158 -0
  286. package/src/styles/tokens/offsets-sizing.css +500 -0
  287. package/src/styles/tokens/property-regs.css +169 -0
  288. package/src/styles/tokens/scale-paper.css +366 -0
  289. package/src/styles/tokens/scheme-motion.css +334 -0
  290. package/src/styles/tokens/shadow.css +166 -0
  291. package/src/styles/tokens.css +22 -2360
  292. package/src/styles/typography.css +75 -21
  293. package/src/styles/utilities/a11y-overrides.css +140 -0
  294. package/src/styles/utilities/animate.css +26 -0
  295. package/src/styles/utilities/base.css +365 -0
  296. package/src/styles/utilities/btn.css +401 -0
  297. package/src/styles/utilities/components.css +317 -0
  298. package/src/styles/utilities.css +19 -1318
  299. package/src/styles/view-transition.css +0 -51
  300. package/dist/DeckProgress-Dmk4_AKN.js +0 -23
  301. package/dist/InstrumentRail-CUJ05YVG.js +0 -44
  302. package/dist/MetricBadge-BZVWIxNy.js +0 -80
  303. package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +0 -27
  304. package/dist/components/custom/deck-progress/index.d.ts +0 -2
  305. package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +0 -57
  306. package/dist/components/custom/dialog-native/index.d.ts +0 -1
  307. package/dist/components/custom/handmark/HandMark.vue.d.ts +0 -29
  308. package/dist/components/custom/handmark/brush.d.ts +0 -242
  309. package/dist/components/custom/handmark/freehand.d.ts +0 -69
  310. package/dist/components/custom/handmark/geometry.d.ts +0 -50
  311. package/dist/components/custom/handmark/index.d.ts +0 -21
  312. package/dist/components/custom/handmark/ink.d.ts +0 -11
  313. package/dist/components/custom/handmark/texture.d.ts +0 -39
  314. package/dist/components/custom/handmark/types.d.ts +0 -53
  315. package/dist/components/custom/handmark/useHandMark.d.ts +0 -87
  316. package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +0 -91
  317. package/dist/components/custom/instrument-rail/index.d.ts +0 -2
  318. package/dist/composables/motion/useRouteTransition.d.ts +0 -42
  319. package/dist/deck-progress.d.ts +0 -1
  320. package/dist/deck-progress.js +0 -2
  321. package/dist/dockContext-BKeIMmNk.js +0 -9
  322. package/dist/handmark.d.ts +0 -1
  323. package/dist/handmark.js +0 -663
  324. package/dist/instrument-rail.d.ts +0 -1
  325. package/dist/instrument-rail.js +0 -2
  326. package/dist/styles/instrument-rail.css +0 -127
  327. package/dist/useGlassRenderer-D7YGOYiM.js +0 -69
  328. package/dist/useSpecularTracking-BVRZsRHA.js +0 -26
  329. package/dist/useSpringMount-BJSHcLl3.js +0 -113
  330. package/dist/useViewTransition-DaN5Zrox.js +0 -21
  331. package/dist/vReveal-zUIQk-rJ.js +0 -53
  332. package/src/styles/instrument-rail.css +0 -127
  333. /package/dist/{ContextMenuContent-DDa0v27s.js → ContextMenuContent-CT3AS1WX.js} +0 -0
  334. /package/dist/{HoverCardContent-B6CcQ8He.js → HoverCardContent-Csywg3YF.js} +0 -0
  335. /package/dist/{Input-xuDwALQR.js → Input-DWQQIOC4.js} +0 -0
  336. /package/dist/{InstrumentChassis-C2f6cBaQ.js → InstrumentChassis-UUJX0-mW.js} +0 -0
  337. /package/dist/{Label-zRfbQdCn.js → Label-r3WzWrsj.js} +0 -0
  338. /package/dist/{ModalOverlay-B1GkAjNb.js → ModalOverlay-DVLI2VRr.js} +0 -0
  339. /package/dist/{PaperBackdrop-CqwjnfLv.js → PaperBackdrop-DIXTtVq6.js} +0 -0
  340. /package/dist/{Progress-iEuD9pxG.js → Progress-DwlUKGbr.js} +0 -0
  341. /package/dist/{SelectGroup-BFiod7X2.js → SelectGroup-aumMgWLs.js} +0 -0
  342. /package/dist/{SelectSeparator-C4Ql0gzV.js → SelectSeparator-BQ_1Fcbp.js} +0 -0
  343. /package/dist/{Separator-D7sD7RKj.js → Separator-0JE6LtNu.js} +0 -0
  344. /package/dist/{TooltipProvider-CmZzCuaG.js → TooltipProvider-B3MkB_8P.js} +0 -0
  345. /package/dist/{compile-BOXjLUxu.js → compile-B7NGOBcP.js} +0 -0
  346. /package/dist/{constants-yKeKnE84.js → constants-CS75AWHG.js} +0 -0
  347. /package/dist/{createContext-B44Sah_H.js → createContext-BM46COQ-.js} +0 -0
  348. /package/dist/{createLucideIcon-B6uNAU9G.js → createLucideIcon-DydS2qgk.js} +0 -0
  349. /package/dist/{menuItemVariants-CCoBNkU5.js → menuItemVariants-DPiEarb0.js} +0 -0
  350. /package/dist/{supportsCssTimeline-C5oe0lnD.js → supportsCssTimeline-BWenxvHU.js} +0 -0
  351. /package/dist/{useIntersectionPause-Cck5Uxk8.js → useIntersectionPause-Cc-H9ees.js} +0 -0
  352. /package/dist/{useInterval-Dsmqwi03.js → useInterval-iHludrxk.js} +0 -0
  353. /package/dist/{useKeyboardShortcuts-CyIYrndH.js → useKeyboardShortcuts-Be3w_Rwk.js} +0 -0
  354. /package/dist/{useResizeObserver-CWCbk5Px.js → useResizeObserver-BhgdhOIj.js} +0 -0
  355. /package/dist/{useResolveTokenColor-r9pnNjqK.js → useResolveTokenColor-Dvn2RZJW.js} +0 -0
  356. /package/dist/{useSortable-C8ReQ50P.js → useSortable-muI29agz.js} +0 -0
  357. /package/dist/{useTextHighlight-CWEi25hf.js → useTextHighlight-DmRYkOBx.js} +0 -0
  358. /package/dist/{useTimer-3xqf_54b.js → useTimer-Dzarvzuk.js} +0 -0
  359. /package/dist/{useUserInvalidAria-DoJKMZ3s.js → useUserInvalidAria-B2h6jAM_.js} +0 -0
  360. /package/dist/{useViewportReady-RIr5Wgkh.js → useViewportReady-B40FK4Pa.js} +0 -0
package/dist/goo-blob.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-ok8pgSl5.js";
2
- import { t } from "./useResolveTokenColor-r9pnNjqK.js";
3
- import { a as n, c as r, n as i, o as a, r as o, s, t as c } from "./compile-BOXjLUxu.js";
4
- import { s as l, t as u } from "./color-C5ls_QF7.js";
5
- import { t as d } from "./useIntersectionPause-Cck5Uxk8.js";
2
+ import { t } from "./useResolveTokenColor-Dvn2RZJW.js";
3
+ import { a as n, c as r, n as i, o as a, r as o, s, t as c } from "./compile-B7NGOBcP.js";
4
+ import { s as l, t as u } from "./color-CUYeFbgd.js";
5
+ import { t as d } from "./useIntersectionPause-Cc-H9ees.js";
6
6
  import { n as f, t as p } from "./prng-D27-B3tK.js";
7
7
  import { computed as m, createElementBlock as h, createElementVNode as g, defineComponent as _, inject as v, normalizeStyle as y, onScopeDispose as b, onUnmounted as x, openBlock as S, readonly as C, ref as w, useTemplateRef as T, watch as E } from "vue";
8
8
  import { SpringProgress as D } from "@mkbabb/keyframes.js";
@@ -24,7 +24,7 @@ var O = {
24
24
  },
25
25
  membrane: {
26
26
  smoothK: .05,
27
- merge: "quadratic",
27
+ merge: "circular",
28
28
  noiseAmp: .038,
29
29
  noiseFreq: 3.5,
30
30
  noiseSpeed: .08,
@@ -71,21 +71,7 @@ var O = {
71
71
  },
72
72
  quality: "full",
73
73
  tempo: 1
74
- }, k = Symbol("blobConfig");
75
- //#endregion
76
- //#region src/components/custom/goo-blob/composables/easing.ts
77
- function A(e) {
78
- return e < .5 ? 2 * e * e : 1 - 2 * (1 - e) * (1 - e);
79
- }
80
- function j(e) {
81
- return e * e;
82
- }
83
- function M(e) {
84
- return 1 - (1 - e) * (1 - e);
85
- }
86
- //#endregion
87
- //#region src/components/custom/goo-blob/composables/useBlobMood.ts
88
- var N = {
74
+ }, k = Symbol("blobConfig"), A = 1 / 1.6, j = {
89
75
  idle: {
90
76
  valence: 0,
91
77
  arousal: .35
@@ -106,37 +92,50 @@ var N = {
106
92
  valence: .7,
107
93
  arousal: 1
108
94
  }
109
- }, P = (e, t, n) => e + (t - e) * n;
110
- function F({ valence: e, arousal: t }) {
95
+ }, M = (e, t, n) => e + (t - e) * n;
96
+ function N({ valence: e, arousal: t }) {
111
97
  return {
112
- orbitSpeedScale: P(.4, 2.2, t),
113
- wobbleScale: P(.5, 2, t),
114
- pulseFreq: P(.15, 1.5, t),
115
- pulseAmp: P(.008, .05, t),
116
- noiseAmp: P(.015, .045, t),
117
- hueRange: P(3, 25, t * .6 + (e * .5 + .5) * .4),
118
- satShift: P(-.05, .1, e * .5 + .5),
119
- brightnessShift: P(-.03, .08, e * .5 + .5),
120
- smoothK: P(.85, 1.35, t),
121
- pointerAttraction: P(-.2, .6, e * .5 + .5) * (.7 + .15 * t),
122
- mergeRate: P(2, .3, t),
123
- iridScale: P(.55, 1.35, t)
98
+ orbitSpeedScale: M(.4, 2.2, t),
99
+ wobbleScale: M(.5, 2, t),
100
+ pulseFreq: M(.15, 1.5, t),
101
+ pulseAmp: M(.008, .05, t),
102
+ noiseAmp: M(.015, .045, t),
103
+ hueRange: M(3, 25, t * .6 + (e * .5 + .5) * .4),
104
+ satShift: M(-.05, .1, e * .5 + .5),
105
+ brightnessShift: M(-.03, .08, e * .5 + .5),
106
+ smoothK: M(.85, 1.35, t),
107
+ pointerAttraction: M(-.2, .6, e * .5 + .5) * (.7 + .15 * t),
108
+ mergeRate: M(2, .3, t),
109
+ iridScale: M(.55, 1.35, t)
124
110
  };
125
111
  }
126
- var I = {
127
- idle: F(N.idle),
128
- happy: F(N.happy),
129
- curious: F(N.curious),
130
- sleepy: F(N.sleepy),
131
- excited: F(N.excited)
132
- }, L = {
112
+ var P = {
113
+ idle: N(j.idle),
114
+ happy: N(j.happy),
115
+ curious: N(j.curious),
116
+ sleepy: N(j.sleepy),
117
+ excited: N(j.excited)
118
+ }, F = {
133
119
  idle: 1500,
134
120
  happy: 1200,
135
121
  curious: 800,
136
122
  sleepy: 2500,
137
123
  excited: 600
138
- };
139
- function R(e, t, n) {
124
+ }, I = 6e3, L = .35, R = .75, z = 2e3, B = /* @__PURE__ */ "uResolution.uTime.uBaseColor.uPointer.uPointerActive.uPointerAttraction.uPointerStrength.uBodyRadius.uPulsePhase.uPulseAmp.uNoiseAmp.uNoiseFreq.uNoiseSpeed.uWarpAmp.uSmoothK.uMerge.uMaxReach.uLit.uRimColor.uLightDir.uSpecStrength.uSpecShininess.uRimPower.uRimStrength.uIridescence.uIridHue.uIridSpeed.uSssScale.uSssPower.uCoreGlow.uHueRange.uSatShift.uBrightnessShift.uColorNoiseFreq.uColorNoiseSpeed.uStopCount.uSatCount.uTrailCount.uVelocity.uStretch".split(".");
125
+ //#endregion
126
+ //#region src/components/custom/goo-blob/composables/easing.ts
127
+ function ee(e) {
128
+ return e < .5 ? 2 * e * e : 1 - 2 * (1 - e) * (1 - e);
129
+ }
130
+ function te(e) {
131
+ return e * e;
132
+ }
133
+ function ne(e) {
134
+ return 1 - (1 - e) * (1 - e);
135
+ }
136
+ //#endregion
137
+ //#region src/components/custom/goo-blob/composables/useBlobMood.ts
138
+ function re(e, t, n) {
140
139
  let r = (e, t) => e + (t - e) * n;
141
140
  return {
142
141
  orbitSpeedScale: r(e.orbitSpeedScale, t.orbitSpeedScale),
@@ -153,11 +152,10 @@ function R(e, t, n) {
153
152
  iridScale: r(e.iridScale, t.iridScale)
154
153
  };
155
154
  }
156
- var z = 6e3;
157
- function B() {
158
- let e = w("idle"), t = w({ ...I.idle }), n = { ...I.idle }, r = { ...I.idle }, i = 0, a = 0, o = !1, s = 0, c = !1, l = !1, u = 0;
155
+ function V() {
156
+ let e = w("idle"), t = w({ ...P.idle }), n = { ...P.idle }, r = { ...P.idle }, i = 0, a = 0, o = !1, s = 0, c = !1, l = !1, u = 0;
159
157
  function d(s, l = {}) {
160
- (l.source ?? "manual") === "manual" && (c = !0), !(s === e.value && !o) && (e.value = s, n = { ...t.value }, r = I[s], a = L[s], i = 0, o = !0);
158
+ (l.source ?? "manual") === "manual" && (c = !0), !(s === e.value && !o) && (e.value = s, n = { ...t.value }, r = P[s], a = F[s], i = 0, o = !0);
161
159
  }
162
160
  function f(e) {
163
161
  u = e.idleMs;
@@ -167,20 +165,20 @@ function B() {
167
165
  s = 900, d("excited", { source: "auto" });
168
166
  return;
169
167
  }
170
- s > 0 || (e.pointerActive ? d("curious", { source: "auto" }) : e.idleMs > z ? d("sleepy", { source: "auto" }) : d("idle", { source: "auto" }));
168
+ s > 0 || (e.pointerActive ? d("curious", { source: "auto" }) : e.idleMs > 6e3 ? d("sleepy", { source: "auto" }) : d("idle", { source: "auto" }));
171
169
  }
172
170
  }
173
171
  function p() {
174
- return o || s > 0 || c && e.value !== "idle" ? !1 : !(!c && e.value !== "sleepy" && u < z);
172
+ return o || s > 0 || c && e.value !== "idle" ? !1 : !(!c && e.value !== "sleepy" && u < 6e3);
175
173
  }
176
174
  function m() {
177
- return o || s > 0 || c || e.value === "sleepy" ? Infinity : Math.max(0, z - u);
175
+ return o || s > 0 || c || e.value === "sleepy" ? Infinity : Math.max(0, I - u);
178
176
  }
179
177
  function h(e) {
180
178
  if (s > 0 && (s = Math.max(0, s - e)), !o) return;
181
179
  i += e;
182
- let c = Math.min(i / a, 1), l = A(c);
183
- t.value = R(n, r, l), c >= 1 && (o = !1);
180
+ let c = Math.min(i / a, 1), l = ee(c);
181
+ t.value = re(n, r, l), c >= 1 && (o = !1);
184
182
  }
185
183
  return {
186
184
  currentMood: C(e),
@@ -192,7 +190,9 @@ function B() {
192
190
  nextAutoMoodMs: m
193
191
  };
194
192
  }
195
- function V(e) {
193
+ //#endregion
194
+ //#region src/components/custom/goo-blob/composables/useBlobPointer.ts
195
+ function H(e) {
196
196
  let t = w({
197
197
  x: 0,
198
198
  y: 0
@@ -223,22 +223,22 @@ function V(e) {
223
223
  });
224
224
  }, { immediate: !0 }), x(() => _?.());
225
225
  function v(e = 16) {
226
- let s = Math.min(e, 50) / 1e3;
226
+ let s = Math.min(e, 50), h = s / 1e3;
227
227
  r.value ? O = 0 : O += Math.min(e, 50);
228
- let h = r.value ? a : 0, g = r.value ? o : 0;
229
- if (c.target = h, l.target = g, c.tick(s), l.tick(s), t.value = {
228
+ let g = r.value ? a : 0, _ = r.value ? o : 0;
229
+ if (c.target = g, l.target = _, c.tickDt(s), l.tickDt(s), t.value = {
230
230
  x: c.value,
231
231
  y: l.value
232
232
  }, n.value = {
233
233
  x: c.velocity,
234
234
  y: l.velocity
235
235
  }, p !== 0 || m !== 0) {
236
- let e = -324 * p - 2 * .35 * 18 * m;
237
- m += e * s, p += m * s, p < -.9 && (p = -.9), Math.abs(p) < 1e-4 && Math.abs(m) < 1e-4 && (p = 0, m = 0);
236
+ let e = -324 * p - 2 * L * 18 * m;
237
+ m += e * h, p += m * h, p < -.9 && (p = -.9), Math.abs(p) < 1e-4 && Math.abs(m) < 1e-4 && (p = 0, m = 0);
238
238
  }
239
239
  i.value = p;
240
- let _ = Math.hypot(c.velocity, l.velocity);
241
- r.value || _ > .05 ? (d = (d + 1) % 15, u[d].x = c.value, u[d].y = l.value, f = Math.min(f + 1, 15)) : f > 0 && (f = Math.max(0, f - 1));
240
+ let v = Math.hypot(c.velocity, l.velocity);
241
+ r.value || v > .05 ? (d = (d + 1) % 15, u[d].x = c.value, u[d].y = l.value, f = Math.min(f + 1, 15)) : f > 0 && (f = Math.max(0, f - 1));
242
242
  }
243
243
  function y(e) {
244
244
  let t = [];
@@ -273,9 +273,8 @@ function V(e) {
273
273
  y: 0
274
274
  }, p = 0, m = 0, i.value = 0, f = 0;
275
275
  }
276
- let A = .001;
277
- function j() {
278
- return !(r.value || Math.hypot(c.velocity, l.velocity) > A || Math.abs(c.value) > A || Math.abs(l.value) > A || f > 0 || p !== 0 || m !== 0);
276
+ function A() {
277
+ return !(r.value || Math.hypot(c.velocity, l.velocity) > .001 || Math.abs(c.value) > .001 || Math.abs(l.value) > .001 || f > 0 || p !== 0 || m !== 0);
279
278
  }
280
279
  return {
281
280
  pointer: C(t),
@@ -288,21 +287,21 @@ function V(e) {
288
287
  click: S,
289
288
  consumeClick: T,
290
289
  rest: k,
291
- isAtRest: j
290
+ isAtRest: A
292
291
  };
293
292
  }
294
293
  //#endregion
295
294
  //#region src/components/custom/goo-blob/composables/useBlobSatellites.ts
296
- function H(e, t, n) {
295
+ function U(e, t, n) {
297
296
  return t + e() * (n - t);
298
297
  }
299
- function U(e) {
298
+ function W(e) {
300
299
  return e < 0 ? 0 : e > 1 ? 1 : e;
301
300
  }
302
- function W(e, t, n) {
301
+ function G(e, t, n) {
303
302
  return e + (t - e) * n;
304
303
  }
305
- function G(e, t, n, r, i) {
304
+ function ie(e, t, n, r, i) {
306
305
  let a = t / 4 * Math.PI * 2 + (e() - .5) * Math.PI, o = n * (.8 + e() * .4), s = r * (.3 + e() * .7);
307
306
  return {
308
307
  phase: "orbiting",
@@ -339,13 +338,12 @@ function q(e, t, n, r) {
339
338
  y: (e.baseRadiusY + o) * Math.sin(a) + e.pertYAmp * Math.cos(e.pertYFreq * i + e.pertYPhase)
340
339
  };
341
340
  }
342
- function ee(e, t, n, r, i) {
341
+ function ae(e, t, n, r, i) {
343
342
  e.timeOrigin = i, e.angularSpeed = .08 + t() * .16, e.phaseOffset = t() * Math.PI * 2;
344
343
  let a = n * (.8 + t() * .4), o = r * (.3 + t() * .7);
345
344
  e.baseRadiusX = a * (1 - o), e.baseRadiusY = a * (1 + o), e.wobbleAmp1 = .02 + t() * .06, e.wobbleFreq1 = .08 + t() * .22, e.wobbleAmp2 = .015 + t() * .04, e.wobbleFreq2 = .18 + t() * .32, e.pertXAmp = .03 + t() * .05, e.pertXFreq = .06 + t() * .18, e.pertXPhase = t() * Math.PI * 2, e.pertYAmp = .03 + t() * .05, e.pertYFreq = .07 + t() * .17, e.pertYPhase = t() * Math.PI * 2;
346
345
  }
347
- var J = .75, Y = 2e3;
348
- function te(e, t) {
346
+ function J(e, t) {
349
347
  let n = f(p(t + "goo")), r = [], i = [], a = [], o = -Infinity, s = e.geometry.orbitRadius;
350
348
  function c() {
351
349
  let t = e.geometry.orbitRadius;
@@ -357,7 +355,7 @@ function te(e, t) {
357
355
  }
358
356
  function l(t) {
359
357
  let o = e.geometry.satelliteCount;
360
- for (; r.length < o;) r.push(G(n, r.length, e.geometry.orbitRadius, e.geometry.eccentricity, t)), i.push({
358
+ for (; r.length < o;) r.push(ie(n, r.length, e.geometry.orbitRadius, e.geometry.eccentricity, t)), i.push({
361
359
  x: 0,
362
360
  y: 0,
363
361
  radius: e.geometry.satelliteRadius,
@@ -373,10 +371,10 @@ function te(e, t) {
373
371
  l(t), c();
374
372
  let u = r.length, d = s.mergeRate, f = e.geometry.satelliteRadius, p = e.satellites.mergeDuration, m = e.satellites.emergeDuration, h = e.satellites.orbitDuration, g = e.satellites.absorbedDuration;
375
373
  for (let c = 0; c < u; c++) {
376
- let l = r[c], u = t - l.phaseStart, _ = U(l.phaseDuration > 0 ? u / l.phaseDuration : 1);
374
+ let l = r[c], u = t - l.phaseStart, _ = W(l.phaseDuration > 0 ? u / l.phaseDuration : 1);
377
375
  switch (l.phase) {
378
376
  case "orbiting":
379
- if (_ >= 1) if (t - o < 3e3 * d) l.phaseStart = t, l.phaseDuration = H(n, h[0], h[1]);
377
+ if (_ >= 1) if (t - o < 3e3 * d) l.phaseStart = t, l.phaseDuration = U(n, h[0], h[1]);
380
378
  else {
381
379
  let e = q(l, t, s.orbitSpeedScale, s.wobbleScale);
382
380
  l.startX = e.x, l.startY = e.y;
@@ -385,11 +383,11 @@ function te(e, t) {
385
383
  }
386
384
  break;
387
385
  case "merging":
388
- _ >= 1 && K(l, "absorbed", t, H(n, g[0], g[1]));
386
+ _ >= 1 && K(l, "absorbed", t, U(n, g[0], g[1]));
389
387
  break;
390
388
  case "absorbed":
391
389
  if (_ >= 1) {
392
- ee(l, n, e.geometry.orbitRadius, e.geometry.eccentricity, t);
390
+ ae(l, n, e.geometry.orbitRadius, e.geometry.eccentricity, t);
393
391
  let r = q(l, t + 3e3, s.orbitSpeedScale, s.wobbleScale);
394
392
  l.endX = r.x, l.endY = r.y;
395
393
  let i = Math.hypot(r.x, r.y), a = i > .01 ? .08 / i : 0;
@@ -399,7 +397,7 @@ function te(e, t) {
399
397
  case "emerging":
400
398
  if (_ >= 1) {
401
399
  let e = a[c];
402
- e.x = l.endX, e.y = l.endY, e.start = t, l.timeOrigin = t, l.phaseOffset = Math.atan2(l.endY, l.endX), K(l, "orbiting", t, H(n, h[0], h[1]));
400
+ e.x = l.endX, e.y = l.endY, e.start = t, l.timeOrigin = t, l.phaseOffset = Math.atan2(l.endY, l.endX), K(l, "orbiting", t, U(n, h[0], h[1]));
403
401
  }
404
402
  break;
405
403
  }
@@ -407,28 +405,28 @@ function te(e, t) {
407
405
  switch (l.phase) {
408
406
  case "orbiting": {
409
407
  let e = q(l, t, s.orbitSpeedScale, s.wobbleScale), n = a[c], r = t - n.start;
410
- if (n.start > 0 && r < Y) {
411
- let t = U(r / Y), i = t * t * (3 - 2 * t);
412
- v = W(n.x, e.x, i), y = W(n.y, e.y, i);
408
+ if (n.start > 0 && r < 2e3) {
409
+ let t = W(r / z), i = t * t * (3 - 2 * t);
410
+ v = G(n.x, e.x, i), y = G(n.y, e.y, i);
413
411
  } else v = e.x, y = e.y;
414
- b = J, x = 1;
412
+ b = R, x = 1;
415
413
  break;
416
414
  }
417
415
  case "merging": {
418
- let e = j(U((t - l.phaseStart) / l.phaseDuration));
419
- v = W(l.startX, l.endX, e), y = W(l.startY, l.endY, e);
420
- let n = U((t - l.phaseStart) / l.phaseDuration);
421
- b = n > .85 ? W(J, 0, (n - .85) / .15) : J, x = W(1, .65, e);
416
+ let e = te(W((t - l.phaseStart) / l.phaseDuration));
417
+ v = G(l.startX, l.endX, e), y = G(l.startY, l.endY, e);
418
+ let n = W((t - l.phaseStart) / l.phaseDuration);
419
+ b = n > .85 ? G(R, 0, (n - .85) / .15) : R, x = G(1, .65, e);
422
420
  break;
423
421
  }
424
422
  case "absorbed":
425
423
  v = 0, y = 0, b = 0, x = .5;
426
424
  break;
427
425
  case "emerging": {
428
- let e = M(U((t - l.phaseStart) / l.phaseDuration));
429
- v = W(l.startX, l.endX, e), y = W(l.startY, l.endY, e);
430
- let n = U((t - l.phaseStart) / l.phaseDuration);
431
- b = n < .1 ? W(0, J, n / .1) : J, x = W(.65, 1, e);
426
+ let e = ne(W((t - l.phaseStart) / l.phaseDuration));
427
+ v = G(l.startX, l.endX, e), y = G(l.startY, l.endY, e);
428
+ let n = W((t - l.phaseStart) / l.phaseDuration);
429
+ b = n < .1 ? G(0, R, n / .1) : R, x = G(.65, 1, e);
432
430
  break;
433
431
  }
434
432
  }
@@ -465,7 +463,7 @@ function te(e, t) {
465
463
  }
466
464
  //#endregion
467
465
  //#region src/components/custom/goo-blob/shaders/metaball.vert.ts
468
- var ne = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\n vUv = 0.5 * (aPosition + 1.0);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", re = "// --- SDF ---\n\nfloat sdCircle(vec2 p, vec2 center, float radius) {\n return length(p - center) - radius;\n}\n\n// AX.W15 — the VALUE+GRADIENT circle: returns vec3(d, dd/dx, dd/dy). The circle\n// gradient is the UNIT radial direction (p - center)/length(p - center) (the\n// eikonal property holds EXACTLY for a circle), guarded at the degenerate centre.\n// This is the keystone of the analytic-gradient smin: carrying the gradient\n// through the scene field DELETES the per-pixel 4-tap normal (4 full sceneDist\n// evals, each running 3-octave FBM + the sat/trail loops).\nvec3 sdgCircle(vec2 p, vec2 center, float radius) {\n vec2 d = p - center;\n float len = length(d);\n vec2 grad = len > 1e-6 ? d / len : vec2(0.0, 1.0);\n return vec3(len - radius, grad);\n}\n\n// IQ 2024 quadratic-polynomial smin, NORMALIZED so k is a blend band in distance\n// units. The k *= 4.0 pre-scale makes the h*h*k*0.25 poly's effective blend width\n// equal to k (the un-normalized form's width was 0.25*k).\nfloat sminQuadratic(float a, float b, float k) {\n k *= 4.0;\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - h * h * k * 0.25;\n}\n\n// IQ circular smin — a quarter-circle fillet at the seam (rounder than the\n// quadratic). The k *= 1.0/(1.0-sqrt(0.5)) factor normalizes k to the same\n// blend-band units so the merge axis swaps shape without re-tuning uSmoothK.\nfloat sminCircular(float a, float b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n}\n\n// Config-gated merge dispatch — uMerge 0 = quadratic, 1 = circular.\nfloat smin(float a, float b, float k) {\n if (uMerge > 0.5) return sminCircular(a, b, k);\n return sminQuadratic(a, b, k);\n}\n\n// AX.W15 — the VALUE+GRADIENT smin. a/b are vec3(dist, grad.xy); the blended\n// gradient is mix(a.yz, b.yz, w) with the interpolation weight w the distance\n// blend uses (IQ's vec2-smin insight). This propagates the analytic gradient\n// through the merge so the surface normal reads the field gradient DIRECTLY — no\n// finite-difference tap. The blend weight matches each variant.\nvec3 sminQuadraticG(vec3 a, vec3 b, float k) {\n k *= 4.0;\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = h * h * k * 0.25;\n // h-weight that selects which surface dominates (0 → a, 1 → b).\n float w = (a.x < b.x) ? 0.5 * h * h : 1.0 - 0.5 * h * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminCircularG(vec3 a, vec3 b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n float w = (a.x < b.x) ? 0.5 * h : 1.0 - 0.5 * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminG(vec3 a, vec3 b, float k) {\n if (uMerge > 0.5) return sminCircularG(a, b, k);\n return sminQuadraticG(a, b, k);\n}", ie = "// --- Noise ---\n\nfloat hash21(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// IQ analytic-derivative gradient noise — value in .x, ANALYTIC gradient\n// (d/dx, d/dy) in .yz, from one eval. The quintic fade has a continuous 2nd\n// derivative so the gradient is smooth (a cubic smoothstep fade would crease it).\n// (Inigo Quilez, https://iquilezles.org/articles/gradientnoise/.)\nvec3 noised(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n\n // Quintic fade + its derivative.\n vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n vec2 du = 30.0 * f * f * (f * (f - 2.0) + 1.0);\n\n // Per-corner gradient vectors from the hash (centred to [-1, 1]).\n vec2 ga = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 0.0)), hash21(i + vec2(7.3, 0.0)));\n vec2 gb = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 0.0)), hash21(i + vec2(8.3, 0.0)));\n vec2 gc = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(7.3, 1.0)));\n vec2 gd = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 1.0)), hash21(i + vec2(8.3, 1.0)));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n // Value, remapped to [0,1] so it drops in for the prior valueNoise.\n float n = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n float value = 0.5 + 0.5 * n;\n\n // Analytic gradient (chain rule through the bilinear blend + the fade).\n vec2 grad =\n ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd) +\n du * (vec2(u.y, u.x) * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(value, 0.5 * grad);\n}\n\n// Rotated-octave FBM over the analytic gradient noise: a fixed ~0.5 rad 2x2\n// rotation between octaves breaks the axis-aligned banding. The rotation CONSTANT\n// is spliced from the shared chunk (AV.W2 — the one FBM_ROT); the loops below\n// stay blob-local (param octaves + the LIQUID lacunarity/persistence, per §3a).", ae = 1.8, oe = .42, se = `float fbm(vec2 p, int octaves) {
466
+ var oe = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\n vUv = 0.5 * (aPosition + 1.0);\n gl_Position = vec4(aPosition, 0.0, 1.0);\n}", se = "// --- SDF ---\n\nfloat sdCircle(vec2 p, vec2 center, float radius) {\n return length(p - center) - radius;\n}\n\n// AX.W15 — the VALUE+GRADIENT circle: returns vec3(d, dd/dx, dd/dy). The circle\n// gradient is the UNIT radial direction (p - center)/length(p - center) (the\n// eikonal property holds EXACTLY for a circle), guarded at the degenerate centre.\n// This is the keystone of the analytic-gradient smin: carrying the gradient\n// through the scene field DELETES the per-pixel 4-tap normal (4 full sceneDist\n// evals, each running 3-octave FBM + the sat/trail loops).\nvec3 sdgCircle(vec2 p, vec2 center, float radius) {\n vec2 d = p - center;\n float len = length(d);\n vec2 grad = len > 1e-6 ? d / len : vec2(0.0, 1.0);\n return vec3(len - radius, grad);\n}\n\n// IQ 2024 quadratic-polynomial smin, NORMALIZED so k is a blend band in distance\n// units. The k *= 4.0 pre-scale makes the h*h*k*0.25 poly's effective blend width\n// equal to k (the un-normalized form's width was 0.25*k).\nfloat sminQuadratic(float a, float b, float k) {\n k *= 4.0;\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - h * h * k * 0.25;\n}\n\n// IQ circular smin — a quarter-circle fillet at the seam (rounder than the\n// quadratic). The k *= 1.0/(1.0-sqrt(0.5)) factor normalizes k to the same\n// blend-band units so the merge axis swaps shape without re-tuning uSmoothK.\nfloat sminCircular(float a, float b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a - b), 0.0) / k;\n return min(a, b) - k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n}\n\n// Config-gated merge dispatch — uMerge 0 = quadratic, 1 = circular.\nfloat smin(float a, float b, float k) {\n if (uMerge > 0.5) return sminCircular(a, b, k);\n return sminQuadratic(a, b, k);\n}\n\n// AX.W15 — the VALUE+GRADIENT smin. a/b are vec3(dist, grad.xy); the blended\n// gradient is mix(a.yz, b.yz, w) with the interpolation weight w the distance\n// blend uses (IQ's vec2-smin insight). This propagates the analytic gradient\n// through the merge so the surface normal reads the field gradient DIRECTLY — no\n// finite-difference tap. The blend weight matches each variant.\nvec3 sminQuadraticG(vec3 a, vec3 b, float k) {\n k *= 4.0;\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = h * h * k * 0.25;\n // h-weight that selects which surface dominates (0 → a, 1 → b).\n float w = (a.x < b.x) ? 0.5 * h * h : 1.0 - 0.5 * h * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminCircularG(vec3 a, vec3 b, float k) {\n k *= 1.0 / (1.0 - sqrt(0.5));\n float h = max(k - abs(a.x - b.x), 0.0) / k;\n float m = k * 0.5 * (1.0 + h - sqrt(1.0 - h * (h - 2.0)));\n float w = (a.x < b.x) ? 0.5 * h : 1.0 - 0.5 * h;\n float dist = min(a.x, b.x) - m;\n vec2 grad = mix(a.yz, b.yz, w);\n return vec3(dist, grad);\n}\n\nvec3 sminG(vec3 a, vec3 b, float k) {\n if (uMerge > 0.5) return sminCircularG(a, b, k);\n return sminQuadraticG(a, b, k);\n}", ce = "// --- Noise ---\n\nfloat hash21(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * 0.1031);\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.x + p3.y) * p3.z);\n}\n\n// IQ analytic-derivative gradient noise — value in .x, ANALYTIC gradient\n// (d/dx, d/dy) in .yz, from one eval. The quintic fade has a continuous 2nd\n// derivative so the gradient is smooth (a cubic smoothstep fade would crease it).\n// (Inigo Quilez, https://iquilezles.org/articles/gradientnoise/.)\nvec3 noised(vec2 p) {\n vec2 i = floor(p);\n vec2 f = fract(p);\n\n // Quintic fade + its derivative.\n vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n vec2 du = 30.0 * f * f * (f * (f - 2.0) + 1.0);\n\n // Per-corner gradient vectors from the hash (centred to [-1, 1]).\n vec2 ga = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 0.0)), hash21(i + vec2(7.3, 0.0)));\n vec2 gb = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 0.0)), hash21(i + vec2(8.3, 0.0)));\n vec2 gc = -1.0 + 2.0 * vec2(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(7.3, 1.0)));\n vec2 gd = -1.0 + 2.0 * vec2(hash21(i + vec2(1.0, 1.0)), hash21(i + vec2(8.3, 1.0)));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n // Value, remapped to [0,1] so it drops in for the prior valueNoise.\n float n = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n float value = 0.5 + 0.5 * n;\n\n // Analytic gradient (chain rule through the bilinear blend + the fade).\n vec2 grad =\n ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd) +\n du * (vec2(u.y, u.x) * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(value, 0.5 * grad);\n}\n\n// Rotated-octave FBM over the analytic gradient noise: a fixed ~0.5 rad 2x2\n// rotation between octaves breaks the axis-aligned banding. The rotation CONSTANT\n// is spliced from the shared chunk (AV.W2 — the one FBM_ROT); the loops below\n// stay blob-local (param octaves + the LIQUID lacunarity/persistence, per §3a).", Y = 1.8, X = .42, le = `float fbm(vec2 p, int octaves) {
469
467
  float value = 0.0;
470
468
  float amp = 0.5;
471
469
  float freq = 1.0;
@@ -473,8 +471,8 @@ var ne = "#version 300 es\n\nin vec2 aPosition;\nout vec2 vUv;\n\nvoid main() {\
473
471
  if (i >= octaves) break;
474
472
  value += amp * noised(p * freq).x;
475
473
  p = FBM_ROT * p;
476
- freq *= ${ae.toFixed(1)};
477
- amp *= ${oe.toFixed(2)};
474
+ freq *= ${Y.toFixed(1)};
475
+ amp *= ${X.toFixed(2)};
478
476
  }
479
477
  return value;
480
478
  }
@@ -501,8 +499,8 @@ vec3 fbmG(vec2 p, int octaves) {
501
499
  // d(value)/dp = amp · freq · (R^i)^T · noised.yz (the rotated chain rule).
502
500
  grad += amp * freq * (transpose(rotAccum) * n.yz);
503
501
  pp = FBM_ROT * pp;
504
- freq *= ${ae.toFixed(1)};
505
- amp *= ${oe.toFixed(2)};
502
+ freq *= ${Y.toFixed(1)};
503
+ amp *= ${X.toFixed(2)};
506
504
  rotAccum = FBM_ROT * rotAccum;
507
505
  }
508
506
  return vec3(value, grad);
@@ -517,9 +515,9 @@ vec3 fbmWarpedG(vec2 p, int octaves, float warpAmp) {
517
515
  vec2 q = vec2(fbm(p + vec2(0.0, 0.0), octaves), fbm(p + vec2(5.2, 1.3), octaves));
518
516
  return fbmG(p + warpAmp * (q - 0.5), octaves);
519
517
  }
520
- `, ce = "// Edit #4's gamut step — hue-preserving inward chroma clamp. If the linear result\n// is out of [0,1], bisect chroma toward 0 (L + h fixed) until in gamut. Preserves\n// hue exactly (only C shrinks). 16 steps resolve C to < 2^-16 of its span.\nbool inGamut(vec3 lin) {\n return all(greaterThanEqual(lin, vec3(0.0))) && all(lessThanEqual(lin, vec3(1.0)));\n}\nvec3 gamutClampOklch(vec3 lch) {\n vec3 lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) return lch;\n float lo = 0.0;\n float hi = lch.y;\n for (int i = 0; i < 16; i++) {\n float mid = 0.5 * (lo + hi);\n vec3 test = vec3(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return vec3(lch.x, lo, lch.z);\n}", X = "\n", le = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) — 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// AX.W16 (arm 5) — the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane — domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) — gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// Iridescence + fake subsurface (W11.a) — translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform — OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) — a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n\n" + ie + X + `${a}
518
+ `, ue = "// Edit #4's gamut step — hue-preserving inward chroma clamp. If the linear result\n// is out of [0,1], bisect chroma toward 0 (L + h fixed) until in gamut. Preserves\n// hue exactly (only C shrinks). 16 steps resolve C to < 2^-16 of its span.\nbool inGamut(vec3 lin) {\n return all(greaterThanEqual(lin, vec3(0.0))) && all(lessThanEqual(lin, vec3(1.0)));\n}\nvec3 gamutClampOklch(vec3 lch) {\n vec3 lin = oklabToLinearSrgb(oklchToOklab(lch));\n if (inGamut(lin)) return lch;\n float lo = 0.0;\n float hi = lch.y;\n for (int i = 0; i < 16; i++) {\n float mid = 0.5 * (lo + hi);\n vec3 test = vec3(lch.x, mid, lch.z);\n if (inGamut(oklabToLinearSrgb(oklchToOklab(test)))) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return vec3(lch.x, lo, lch.z);\n}", de = "#version 300 es\nprecision highp float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform vec2 uResolution;\nuniform float uTime;\nuniform vec3 uBaseColor;\n\n// Multi-stop palette (W11.b) — 2-4 in-family OKLCh stops (uploaded GAMMA sRGB, like\n// uBaseColor). uStopCount <= 1 falls back to uBaseColor (the single-color default,\n// zero regression). MAX_BLOB_STOPS is a compile-time #define.\n#define MAX_BLOB_STOPS 4\nuniform int uStopCount;\nuniform vec3 uPalette[MAX_BLOB_STOPS];\n\n// Pointer\nuniform vec2 uPointer;\nuniform float uPointerActive;\nuniform float uPointerAttraction;\nuniform float uPointerStrength;\n\n// Main body\nuniform float uBodyRadius;\n\n// Pulsation\nuniform float uPulsePhase;\nuniform float uPulseAmp;\n\n// Surface noise\nuniform float uNoiseAmp;\nuniform float uNoiseFreq;\nuniform float uNoiseSpeed;\n\n// Gooey\nuniform float uSmoothK;\nuniform float uMerge; // 0 = quadratic smin, 1 = circular smin (rounder menisci)\n\n// AX.W16 (arm 5) — the PRE-FBM bounding-discard radius (UV space). main() early-outs\n// to a transparent write for any fragment OUTSIDE this radius BEFORE the two 3-octave\n// FBM calls + the OKLCh round-trip. The renderer uploads it PADDED by every\n// outward-expanding term (body + eccentric orbit + sat radius + smin band + FBM edge\n// amplitude + click-pulse + a lean/squash safety pad) so it NEVER clips the wet\n// meniscus (IQ: inflate the bound to match any outward op).\nuniform float uMaxReach;\n\n// Membrane — domain-warp strength on the FBM edge displacement (0 = plain fbm).\nuniform float uWarpAmp;\n\n// Lit glass surface (W9.b) — gated behind uLit so the flat fill stays default.\nuniform float uLit; // 0 = flat fill (default), 1 = lit droplet\nuniform vec3 uRimColor; // Fresnel rim tint (GAMMA sRGB, via the /color leaf)\nuniform vec3 uLightDir; // normalized light direction (x, y, z)\nuniform float uSpecStrength; // Blinn-Phong specular weight\nuniform float uSpecShininess; // specular exponent (16-64, tight glint)\nuniform float uRimPower; // Fresnel/Schlick exponent (~2-3)\nuniform float uRimStrength; // Fresnel rim weight\n\n// Iridescence + fake subsurface (W11.a) — translucent-gel read.\nuniform float uIridescence; // warm-pearl rim sheen weight (0 = off)\nuniform float uIridHue; // base hue (radians) the cosine palette biases toward (warm)\nuniform float uIridSpeed; // animated-thickness scroll for the iridescent t\nuniform float uSssScale; // fast-SSS back-light weight\nuniform float uSssPower; // fast-SSS exponent\nuniform float uCoreGlow; // thickness-driven inner-luminosity lift\n\n// Color perturbation (perceptually uniform — OKLCh L/C/h)\nuniform float uHueRange; // degrees of hue swing (converted to radians)\nuniform float uSatShift; // OKLCh chroma swing\nuniform float uBrightnessShift; // OKLCh lightness bias\nuniform float uColorNoiseFreq;\nuniform float uColorNoiseSpeed;\n\n// Satellites (max 4)\n#define MAX_SATS 4\nuniform int uSatCount;\nuniform vec2 uSatPos[MAX_SATS];\nuniform float uSatRadius[MAX_SATS];\nuniform float uSatOpacity[MAX_SATS];\n\n// Pointer trail (W10) — a decaying-radius pseudopod toward the cursor. uTrail is a\n// COMPILE-TIME-SIZED array (GLSL ES 3.00 forbids a uniform-sized array) with a\n// DYNAMIC break on uTrailCount, mirroring the satellite loop. Later samples paint\n// smaller metaballs (r *= 1 - i/N) so the trail tapers into a tail.\n#define TRAIL_N 15\nuniform int uTrailCount;\nuniform vec2 uTrailPos[TRAIL_N];\nuniform float uTrailRadius[TRAIL_N];\n\n// Velocity-driven volume-preserving squash-and-stretch (W10).\nuniform vec2 uVelocity; // smoothed pointer velocity (motion direction + speed)\nuniform float uStretch; // squash-stretch magnitude (0 = off)\n\nconst float PI = 3.141592653589793;\n", Z = "\n", fe = de + Z + ce + Z + `${a}
521
519
 
522
- ` + se + X + re + X + `
520
+ ` + le + Z + se + Z + `
523
521
  // --- Color (Ottosson OKLab/OKLCh — value.js EXACT constants, transposed) ---
524
522
  //
525
523
  // The OETF (srgbToLinear/linearToSrgb) + the four Ottosson matrices + their space
@@ -531,35 +529,126 @@ vec3 fbmWarpedG(vec2 p, int octaves, float warpAmp) {
531
529
  ${s}
532
530
  ${r}
533
531
 
534
- ` + ce + X + "\n// AX.W15 — de-synced breath. The body throb was a single sin(uPulsePhase) — a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// AX.W15 — the composite SDF field WITH its ANALYTIC GRADIENT, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (W10 volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven VOLUME-PRESERVING squash-and-stretch (W10), SATURATED (AX.W46\n // D5). sa is the stretch along motion, EXACTLY 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The W10 form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// AX.W15 — the analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// W11.b — sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // AX.W16 (arm 5) — PRE-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction (W10): a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // AY.W-BLOB-CONFIG D2 — the SIGN was INVERTED in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // AX.W46 D5 — the falloff radius NARROWS 0.65 → 0.5 (the calm-lean reconciliation).\n // The W15 REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field WITH its analytic gradient (AX.W15).\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample (W11.b) — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // Surface normal — from the ANALYTIC field gradient (AX.W15: the 4-tap is\n // deleted). Computed ONCE here and reused by the iridescence (W11.a), the\n // fake-SSS (W11.a), and the lit glass block (W9.b).\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── W11.a iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── W11.a fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the W9 normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity (AX.W15): a SATURATING 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core (AX.W15 — only the thin rim warms).\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── W9.b lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // ENERGY-CONSERVING Blinn-Phong (AX.W15 [9]): the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). FOREGROUND-AWARE MIN-CONTRAST GUARD (AX.W15 [10]):\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // AX.W46 D4 — CLAMP the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // IGN dither (AX.W15 [2][9]) — the low-chroma warm-cream dome BANDS on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}", ue = 4, de = 15, Z = 4, Q = "[GooBlob]", $ = 1 / 1.6, fe = /* @__PURE__ */ "uResolution.uTime.uBaseColor.uPointer.uPointerActive.uPointerAttraction.uPointerStrength.uBodyRadius.uPulsePhase.uPulseAmp.uNoiseAmp.uNoiseFreq.uNoiseSpeed.uWarpAmp.uSmoothK.uMerge.uMaxReach.uLit.uRimColor.uLightDir.uSpecStrength.uSpecShininess.uRimPower.uRimStrength.uIridescence.uIridHue.uIridSpeed.uSssScale.uSssPower.uCoreGlow.uHueRange.uSatShift.uBrightnessShift.uColorNoiseFreq.uColorNoiseSpeed.uStopCount.uSatCount.uTrailCount.uVelocity.uStretch".split(".");
535
- function pe(e) {
536
- let { canvasRef: t, color: r, rimColor: a, paletteStops: s, mood: f, pointer: p, satellites: m, config: h } = e, g = 0, _ = 0, v = /* @__PURE__ */ new Map();
537
- function y(e) {
538
- let t = v.get(e);
532
+ ` + ue + Z + "\n// AX.W15 — de-synced breath. The body throb was a single sin(uPulsePhase) — a\n// mechanical pulse that re-syncs every cycle. Three DETUNED sines at IRRATIONAL\n// frequency ratios (1, 0.13/0.09 ≈ 1.444, 0.31) never re-phase, so the membrane\n// breathes like a living creature (an asymmetric slower-exhale calm band) rather\n// than a metronome. Normalized so the composite stays in ~[-1, 1].\nfloat breath(float phase) {\n return (sin(phase)\n + 0.5 * sin(phase * 1.4444 + 1.7)\n + 0.28 * sin(phase * 0.31 + 4.1)) / 1.78;\n}\n\n// AX.W15 — the composite SDF field WITH its ANALYTIC GRADIENT, returned as\n// vec3(dist, ∂d/∂x, ∂d/∂y). The domain-warped body membrane smin-merged with the\n// satellites + trail; the gradient propagates through sminG's mix(a.yz, b.yz, h)\n// so the surface normal reads the field gradient DIRECTLY (the 4-tap finite\n// difference is DELETED — its 4 full evals per lit pixel are gone).\n//\n// The ANISOTROPIC SQUASH (W10 volume-preserving stretch) is a linear map\n// bodyUv = D·R·uv (R rotates world→(motion-axis, perp); D = diag(1/sa, sa)). The\n// body field's gradient is computed in bodyUv space, so it MUST be transformed back\n// to uv space by M^T = R^T·D (the inverse-transpose handling the SOTA-deepening [2]\n// warns the 4-tap did implicitly by sampling in screen space).\nvec3 sceneDistG(vec2 uv) {\n // De-synced pulsing body radius.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Velocity-driven VOLUME-PRESERVING squash-and-stretch (W10), SATURATED (AX.W46\n // D5). sa is the stretch along motion, EXACTLY 1/sa perpendicular (area-preserving).\n // The basis (ax, perp) is captured so the gradient can be transformed back below.\n //\n // The W10 form sa = 1 + speed*uStretch rode an UNBOUNDED critically-damped spring\n // velocity (O(5-8)/s on a fast flick) -> sa ~ 1.78-2.25x elongation, a violent\n // taffy-pull. A tanh saturation sa = 1 + tanh(speed*k)*uStretch caps the elongation\n // at 1 + uStretch (~1.5x at the default stretch 0.5) no matter how fast the flick —\n // the fastest flick reads as a lively bounce, never a rubber-band snap (the standard\n // volume-preserving squash-and-stretch restraint). k = 1.6 keeps the tanh in its\n // near-linear regime for a slow drag (the gentle squash still reads) and saturates\n // only the fast flick.\n vec2 bodyUv = uv;\n vec2 ax = vec2(1.0, 0.0);\n vec2 perp = vec2(0.0, 1.0);\n float sa = 1.0;\n float speed = length(uVelocity);\n bool squashed = uStretch > 0.0 && speed > 1e-4;\n if (squashed) {\n ax = uVelocity / speed;\n perp = vec2(-ax.y, ax.x);\n sa = 1.0 + tanh(speed * 1.6) * uStretch;\n bodyUv = vec2(dot(uv, ax) / sa, dot(uv, perp) * sa);\n }\n\n // Domain-warped FBM displacement WITH its analytic gradient (the warp-Jacobian\n // approximation per [2]). disp = (noiseVal - 0.5) · uNoiseAmp; its gradient in\n // bodyUv space is uNoiseAmp · uNoiseFreq · fbmGrad (the uNoiseFreq chain factor\n // from the bodyUv·uNoiseFreq argument).\n vec3 fbmv = fbmWarpedG(bodyUv * uNoiseFreq + uTime * uNoiseSpeed, 3, uWarpAmp);\n float bodyDisplacement = (fbmv.x - 0.5) * uNoiseAmp;\n vec2 dispGradBody = uNoiseAmp * uNoiseFreq * fbmv.yz;\n\n // Body circle WITH gradient (in bodyUv space). The displaced radius subtracts\n // the displacement, so the body gradient is circleGrad - dispGrad (sign per\n // [2]: d = circleDist - displacement ⇒ grad = circleGrad - dispGrad).\n vec3 bodyG = sdgCircle(bodyUv, vec2(0.0), bodyR + bodyDisplacement);\n vec2 bodyGradBody = bodyG.yz - dispGradBody;\n\n // Transform the body gradient back to uv space: g_uv = R^T · D · g_body, i.e.\n // scale by D = diag(1/sa, sa) in the (ax, perp) frame then reconstruct in world.\n vec2 bodyGradUv;\n if (squashed) {\n vec2 scaled = vec2(bodyGradBody.x / sa, bodyGradBody.y * sa);\n bodyGradUv = scaled.x * ax + scaled.y * perp;\n } else {\n bodyGradUv = bodyGradBody;\n }\n vec3 d = vec3(bodyG.x, bodyGradUv);\n\n // Satellites — smin-merged into the body (uMerge selects quadratic/circular).\n for (int i = 0; i < MAX_SATS; i++) {\n if (i >= uSatCount) break;\n vec3 satG = sdgCircle(uv, uSatPos[i], uSatRadius[i]);\n satG.x += (1.0 - uSatOpacity[i]) * 0.3;\n d = sminG(d, satG, uSmoothK);\n }\n\n // Pointer trail — a decaying-radius pseudopod reaching toward the cursor,\n // smin-merged so it stretches an elastic limb and snaps back.\n for (int i = 0; i < TRAIL_N; i++) {\n if (i >= uTrailCount) break;\n vec3 trailG = sdgCircle(uv, uTrailPos[i], uTrailRadius[i]);\n d = sminG(d, trailG, uSmoothK);\n }\n return d;\n}\n\n// AX.W15 — the analytic surface normal. The field gradient grad2d arrives\n// DIRECTLY from sceneDistG (no 4-tap). The smin field is sub-unit (the CD family\n// |grad| ≤ 1) so the gradient is NOT unit-length — normalize() before the dome\n// lift (the unit contract is on the FINAL lifted normal N, not the raw field\n// gradient). The Z dome: 'interior' is the normalized depth inward from the rim\n// (-d/bodyR); z = sqrt(1 - (1 - interior)^2) is the unit half-sphere profile (flat\n// centre, steep rim). N tilts outward along the field gradient near the rim and\n// points at the viewer deep inside.\nvec3 surfaceNormalFromGrad(vec2 grad2d, float d, float bodyR) {\n vec2 g = normalize(grad2d + vec2(1e-6));\n float interior = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0);\n float z = sqrt(max(0.0, 1.0 - (1.0 - interior) * (1.0 - interior)));\n return normalize(vec3(g * (1.0 - z), z) + vec3(0.0, 0.0, 1e-6));\n}\n\n// W11.b — sample the multi-stop palette at t in [0,1], interpolating adjacent\n// stops in OKLab with a MIDPOINT CHROMA-BUMP (a linear OKLab mix of a vivid pair\n// dips chroma through grey; the bump lifts it back). Falls back to uBaseColor when\n// uStopCount <= 1. Returns an OKLCh stop [L, C, h(rad)].\nvec3 samplePaletteOklch(float t) {\n if (uStopCount <= 1) return oklabToOklch(srgbToOklab(uBaseColor));\n float n = float(uStopCount);\n float ft = clamp(t, 0.0, 1.0) * (n - 1.0);\n int i0 = int(floor(ft));\n int i1 = min(i0 + 1, uStopCount - 1);\n float f = ft - float(i0);\n // Fetch adjacent stops (uPalette is gamma sRGB) → OKLab.\n vec3 labA = srgbToOklab(uPalette[i0]);\n vec3 labB = srgbToOklab(uPalette[i1]);\n vec3 lab = mix(labA, labB, f);\n vec3 lch = oklabToOklch(lab);\n // Midpoint chroma-bump: a bell (peaks at f=0.5) lifts C off the grey midpoint.\n lch.y += 0.03 * sin(PI * f);\n return lch;\n}\n\nvoid main() {\n vec2 uv = vUv - 0.5;\n\n // AX.W16 (arm 5) — PRE-FBM bounding early-out. The oversized canvas (1.6x the\n // wrapper) runs the full fragment ALU — two 3-octave FBM evals + the OKLCh\n // round-trip + the lit/iridescence/SSS block — on a large transparent border\n // otherwise (~60% of the canvas is outside the droplet reach). Any fragment beyond\n // uMaxReach (the PADDED worst-case painted reach, uploaded so it never clips the\n // wet meniscus) writes transparent and returns BEFORE any of that work. This is a\n // transparent WRITE, NOT a GLSL discard: the pass is a pure premultiplied blend\n // with no depth, and discard disables the tiled-renderer fast path on mobile GPUs.\n // No fwidth is computed before the return, so there is no\n // derivative-in-non-uniform-control-flow hazard (the kept pixels compute their own\n // fwidth normally below). The pad covers the pointer-lean uv shift, so testing the\n // pre-deform uv is safe.\n if (dot(uv, uv) > uMaxReach * uMaxReach) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Pointer deformation — honor the SIGN of uPointerAttraction (W10): a positive\n // attraction leans the body IN toward the cursor, a negative shies it AWAY. The\n // signed influence flows straight into the UV shift (no hardcoded repulsion).\n //\n // AY.W-BLOB-CONFIG D2 — the SIGN was INVERTED in the rendered result. The\n // sample-shift sign here was uv -= dir*influence; the live readback (an attraction\n // sweep over a HELD pointer) measured the body shifting MORE toward the cursor as\n // attraction went MORE NEGATIVE (a=-1 -> +0.081, a=0 -> +0.063, a=+1 -> +0.042) —\n // exactly inverted: a shy-away -1 LUNGED at the cursor, a lean-in +1 pulled back.\n // pointerDir = uPointer - uv is the toward-pointer direction in SAMPLE space; to\n // MOVE the rendered body TOWARD the pointer the sample must shift ALONG pointerDir\n // (sample the field from where the pointer is), so the sign is uv += dir*influence.\n // A positive attraction now shifts the body toward the cursor (leans in), a negative\n // shifts it away (shies) — the sign the comment + the demo slider always promised,\n // now true in the render.\n //\n // AX.W46 D5 — the falloff radius NARROWS 0.65 → 0.5 (the calm-lean reconciliation).\n // The W15 REDRESS widened it to 0.65 to clear a synthetic floor; the live π-lane\n // read the result as a LUNGE. The drama lives in the STRENGTH (pointerStrength,\n // dropped to 0.18 in types.ts), NOT the falloff — the falloff's job is purely to keep\n // the lean COHERENT across the creature so the body, satellites and trail all tilt\n // toward the cursor as ONE. At 0.5 the body (sitting ≈0.2 uv from the cursor on a\n // hover-flick) is still well inside the cutoff, so the whole creature tilts as one —\n // a gentle, coherent \"it notices you\" lean rather than the body lunging a body-width.\n if (uPointerActive > 0.5) {\n vec2 pointerDir = uPointer - uv;\n float pointerDist = length(pointerDir);\n float influence = smoothstep(0.5, 0.0, pointerDist) * uPointerAttraction * uPointerStrength;\n uv += normalize(pointerDir + 1e-6) * influence;\n }\n\n // The de-synced pulsing body radius — also reused below for the inner-glow scale.\n float bodyR = uBodyRadius + breath(uPulsePhase) * uPulseAmp;\n\n // Composite domain-warped membrane field WITH its analytic gradient (AX.W15).\n vec3 scene = sceneDistG(uv);\n float d = scene.x;\n vec2 fieldGrad = scene.yz;\n\n // Edit #1 — fwidth-based anti-aliased edge: derive the smoothstep half-width\n // from the SDF screen-space gradient so the edge stays ~1px regardless of zoom.\n float aa = max(fwidth(d), 1e-6);\n float alpha = 1.0 - smoothstep(-aa, aa, d);\n\n if (alpha < 0.001) {\n fragColor = vec4(0.0);\n return;\n }\n\n // Edit #4 — perceptually-uniform OKLCh variation. Gamma base → linear → OKLab\n // → OKLCh; perturb L/C/h; OKLCh → OKLab → linear; hue-preserving gamut clamp.\n // The base is the multi-stop palette sample (W11.b) — distributed across the\n // body/satellites by the color noise field — or uBaseColor when single-stop.\n float colorNoise = fbm(uv * uColorNoiseFreq + uTime * uColorNoiseSpeed, 3);\n vec3 oklch = samplePaletteOklch(colorNoise);\n\n oklch.z += (colorNoise - 0.5) * uHueRange * (PI / 180.0); // hue swing, radians\n oklch.y = max(oklch.y + (colorNoise - 0.5) * uSatShift, 0.0); // chroma swing\n oklch.x = clamp(oklch.x + uBrightnessShift, 0.0, 1.0); // lightness bias\n\n // Surface normal — from the ANALYTIC field gradient (AX.W15: the 4-tap is\n // deleted). Computed ONCE here and reused by the iridescence (W11.a), the\n // fake-SSS (W11.a), and the lit glass block (W9.b).\n vec3 N = surfaceNormalFromGrad(fieldGrad, d, bodyR);\n vec3 V = vec3(0.0, 0.0, 1.0);\n float thickness = clamp(-d / max(bodyR, 1e-4), 0.0, 1.0); // 0 at rim, ~1 deep in\n float fres = pow(1.0 - max(dot(N, V), 0.0), 2.5); // rim-weighted angle\n\n // ── W11.a iridescence — warm-biased IQ cosine palette driving OKLCh HUE ──\n //\n // A thin-film-like sheen on the RIM (fres-weighted), NOT the cold-blue default:\n // an IQ cosine palette (a + b*cos(2pi(c*t + d))) maps the Fresnel/edge angle +\n // the FBM color field + an animated thickness onto a HUE OFFSET biased to the\n // warm arc (uIridHue), with the chroma clamped to a warm-pearl band so the rim\n // reads cream/gold (congruent with the warm-cream-glass identity). Mixed into\n // OKLCh BEFORE the gamut clamp. Default LOW.\n if (uIridescence > 0.0) {\n float t = fres + 0.3 * colorNoise + uTime * uIridSpeed;\n // Cosine palette in HUE space, centred on the warm uIridHue (~0.18 turn of\n // warm sweep so the sheen shimmers gold→peach, never swinging to cold blue).\n float iridHue = uIridHue + 0.18 * PI * cos(2.0 * PI * t);\n float w = fres * uIridescence; // rim-weighted blend\n oklch.z = mix(oklch.z, iridHue, w);\n // Warm-pearl chroma cap: lift chroma toward a pale-pearl band, clamped.\n oklch.y = min(oklch.y + 0.04 * w, oklch.y + 0.08);\n oklch.x = min(oklch.x + 0.05 * w, 1.0); // a touch brighter at the sheen\n }\n\n // ── W11.a fake subsurface translucency — thickness inner-glow + back-light ──\n //\n // A bright translucent CORE fading to a light-leaking EDGE (the -d ramp) plus\n // the fast-SSS back-light (light wrapping through the thin rim). Both lift OKLCh\n // L and warm the hue, consuming the W9 normal. In OKLCh before the gamut clamp.\n if (uCoreGlow > 0.0 || uSssScale > 0.0) {\n // Beer-Lambert inner luminosity (AX.W15): a SATURATING 1 - exp(-k·thickness)\n // curve — a flat thick core with a fast warm rim falloff — NOT the linear\n // coreGlow·thickness ramp (which over-brightens deep interiors). k ≈ 3 reads\n // as glass depth.\n oklch.x = min(oklch.x + uCoreGlow * (1.0 - exp(-3.0 * thickness)), 1.0);\n // Fast-SSS back-light: light wrapping through the thin (low-thickness) rim.\n vec3 L = normalize(uLightDir + vec3(1e-6));\n float back = pow(clamp(dot(V, -(L + N * thickness)), 0.0, 1.0), uSssPower);\n float sss = back * uSssScale * (1.0 - thickness);\n oklch.x = min(oklch.x + sss, 1.0);\n // Warm the THIN leaking rim only (scale by 1 - thickness): the SSS hue-warm\n // shift rides the rim, not the core (AX.W15 — only the thin rim warms).\n oklch.z += sss * 0.1 * (1.0 - thickness);\n }\n\n oklch = gamutClampOklch(oklch);\n\n vec3 lin = oklabToLinearSrgb(oklchToOklab(oklch));\n\n // ── W9.b lit glass surface — Blinn-Phong glint + Fresnel rim, in LINEAR ──\n //\n // The lit terms enter lin in LINEAR space BEFORE the OETF (linearToSrgb)\n // and BEFORE the * alpha premultiply — a post-OETF apply double-gammas the\n // highlight and fringes the premultiplied edge (the named A5/A2 trap). The\n // prior flat inner-glow lift is SUBSUMED by the Fresnel rim (the curvature\n // read now comes from the surface normal, not a flat smoothstep). Gated behind\n // uLit so the flat fill stays the default (zero regression).\n if (uLit > 0.5) {\n // N, V, thickness are already computed in main() (reused by iridescence/SSS).\n vec3 L = normalize(uLightDir + vec3(1e-6)); // light direction\n vec3 H = normalize(L + V); // Blinn-Phong half-vector\n\n // Warm-cream specular glint — a near-white OKLCh TINT (L~0.97, C~0.03,\n // hue~85°) routed through the SAME spliced OKLCh matrices, NOT hardcoded\n // sRGB white (pure white reads cheap-CG). Linearized for the linear add.\n vec3 warmCream = oklabToLinearSrgb(oklchToOklab(vec3(0.97, 0.03, radians(85.0))));\n\n // ENERGY-CONSERVING Blinn-Phong (AX.W15 [9]): the (shininess+2)/8 factor\n // DECOUPLES shininess from strength (without it, raising shininess dims the\n // glint, so the two knobs fight). SPECULAR ANTIALIASING: the FBM membrane\n // makes the normal vary fast, so a tight glint (16-64) STROBES on small\n // dock-grid blobs. Widen the effective lobe where the normal varies\n // (Toksvig-style fwidth clamp) — drop shininess, NOT raise it. nVar reads\n // the screen-space normal derivative; a high-variance pixel softens the\n // exponent so the glint stays stable.\n float nVar = length(fwidth(N));\n float shininess = uSpecShininess / (1.0 + 24.0 * nVar);\n float energyNorm = (shininess + 2.0) / 8.0;\n float spec = pow(max(dot(N, H), 0.0), shininess) * uSpecStrength * energyNorm;\n\n // Fresnel/Schlick rim — fed uRimColor (the --foreground warm rim via the\n // /color leaf). FOREGROUND-AWARE MIN-CONTRAST GUARD (AX.W15 [10]):\n // a var(--primary) blob in dark mode resolves a rim near the BODY color, so\n // the rim washes out (no contrast). When the rim's luminance sits too close\n // to the body's, the guard CHROMA-REDUCES and L-LIFTS the rim stop (a\n // perceptual move, NOT a re-tint) so the curved rim always reads. Computed in\n // OKLCh so the lift is perceptual.\n vec3 rimOkl = oklabToOklch(srgbToOklab(uRimColor));\n float bodyL = oklch.x; // the post-perturb body lightness\n float dL = abs(rimOkl.x - bodyL);\n // If the rim is within 0.22 L of the body, push it AWAY (lift if the body is\n // dark, the dark-mode primary case; the chroma-reduce keeps it neutral-warm).\n float lack = clamp((0.22 - dL) / 0.22, 0.0, 1.0);\n rimOkl.x = clamp(mix(rimOkl.x, (bodyL < 0.5 ? 0.92 : 0.18), lack), 0.0, 1.0);\n rimOkl.y *= mix(1.0, 0.5, lack); // chroma-reduce toward a pale pearl\n vec3 rimLin = oklabToLinearSrgb(oklchToOklab(rimOkl));\n\n float rimFres = pow(1.0 - max(dot(N, V), 0.0), uRimPower);\n float rim = rimFres * uRimStrength * (1.0 - 0.6 * thickness);\n\n // Combine the two warm highlights and add in LINEAR. max(spec, rim*scale)\n // keeps the glint from stacking on the rim into a blown hotspot.\n //\n // AX.W46 D4 — CLAMP the linear highlight below unity before the add (the\n // belt-and-braces guard the re-derived specStrength makes rarely-binding but\n // never lets a worst-case normal blow to a hard white spot). The energy-\n // conserving Blinn-Phong CAN still spike on a grazing normal where the Toksvig\n // widen has not kicked in; capping the highlight magnitude at 0.85 (a contained\n // warm gleam, sub-unity) means the OETF clamp below can never crush a\n // pure-white pixel over the dome. The cap is on the highlight ALONE (not the\n // composited lin), so the body color underneath is untouched — it caps only\n // the additive catch-light's energy.\n vec3 highlight = max(warmCream * spec, rimLin * rim);\n highlight = min(highlight, vec3(0.85));\n lin += highlight;\n }\n\n vec3 rgb = clamp(linearToSrgb(lin), 0.0, 1.0); // MANDATORY OETF — closes the seam\n\n // IGN dither (AX.W15 [2][9]) — the low-chroma warm-cream dome BANDS on 8-bit\n // panels (visible Mach steps in the smooth L roll). Interleaved-gradient noise at\n // 1/255, applied AFTER linearToSrgb and BEFORE the *alpha premultiply (aurora\n // ships the same splice). A triangular ±0.5 LSB dither decorrelates the steps.\n float ign = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));\n rgb = clamp(rgb + (ign - 0.5) / 255.0, 0.0, 1.0);\n\n // Edit #8 — premultiply AFTER the OETF: straight-alpha gamma → premultiplied.\n fragColor = vec4(rgb * alpha, alpha);\n}";
533
+ //#endregion
534
+ //#region src/components/custom/goo-blob/composables/uploadBlobUniforms.ts
535
+ function pe(e, t, n, r, i, a, o, s, c) {
536
+ let { U: l, satPosLocs: u, satRadLocs: d, satOpLocs: f, trailPosLocs: p, trailRadLocs: m, paletteLocs: h } = r, { params: g, rgb: _, simTimeMs: v, timeSec: y, resolveColor: b, rimColor: x, paletteStops: S } = c, { geometry: C, membrane: w, color: T, surface: E, interaction: D } = a;
537
+ e.useProgram(t), e.bindVertexArray(n), e.uniform2f(l.uResolution, i.width, i.height), e.uniform1f(l.uTime, v / 1e3), e.uniform3f(l.uBaseColor, _[0], _[1], _[2]);
538
+ let O = S, k = Math.min(O.length, 4);
539
+ e.uniform1i(l.uStopCount, k);
540
+ for (let t = 0; t < 4; t++) {
541
+ let n = h[t] ?? null, r = O[t];
542
+ if (r) {
543
+ let t = b(r);
544
+ e.uniform3f(n, t[0], t[1], t[2]);
545
+ } else e.uniform3f(n, _[0], _[1], _[2]);
546
+ }
547
+ let j = o.pointer.value, M = D.pointerAttraction + g.pointerAttraction;
548
+ e.uniform2f(l.uPointer, j.x * .5 * A, j.y * .5 * A), e.uniform1f(l.uPointerActive, +!!o.active.value), e.uniform1f(l.uPointerAttraction, M), e.uniform1f(l.uPointerStrength, D.pointerStrength * A);
549
+ let N = Math.max(0, Math.min(1, M)), P = o.velocity.value;
550
+ e.uniform2f(l.uVelocity, P.x * .5 * A, P.y * .5 * A), e.uniform1f(l.uStretch, D.stretch);
551
+ let F = o.trailSources(C.satelliteRadius * .7 * N);
552
+ e.uniform1i(l.uTrailCount, F.count);
553
+ for (let t = 0; t < 15; t++) {
554
+ let n = p[t] ?? null, r = m[t] ?? null, i = F.sources[t];
555
+ i ? (e.uniform2f(n, i.x * .5 * A, i.y * .5 * A), e.uniform1f(r, i.radius * A)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0));
556
+ }
557
+ e.uniform1f(l.uBodyRadius, C.bodyRadius * A), e.uniform1f(l.uPulsePhase, y * w.pulseFreq * g.pulseFreq * Math.PI * 2);
558
+ let I = o.pulse.value * D.clickImpulse;
559
+ e.uniform1f(l.uPulseAmp, (w.pulseAmp * g.pulseAmp / .015 + I) * A), e.uniform1f(l.uNoiseAmp, w.noiseAmp * g.noiseAmp / .025 * A), e.uniform1f(l.uNoiseFreq, w.noiseFreq), e.uniform1f(l.uNoiseSpeed, w.noiseSpeed), e.uniform1f(l.uWarpAmp, w.warpAmp), e.uniform1f(l.uSmoothK, w.smoothK * g.smoothK * A), e.uniform1f(l.uMerge, +(w.merge === "circular"));
560
+ let L = C.orbitRadius * 1.2 * (1 + C.eccentricity) + C.satelliteRadius, R = (Math.max(C.bodyRadius, L) + w.smoothK * g.smoothK + w.noiseAmp * g.noiseAmp / .025 + Math.abs(o.pulse.value) * D.clickImpulse) * A + .1;
561
+ e.uniform1f(l.uMaxReach, R), e.uniform1f(l.uHueRange, T.hueRange + g.hueRange), e.uniform1f(l.uSatShift, T.satShift + g.satShift), e.uniform1f(l.uBrightnessShift, T.brightnessShift + g.brightnessShift), e.uniform1f(l.uColorNoiseFreq, T.colorNoiseFreq), e.uniform1f(l.uColorNoiseSpeed, T.colorNoiseSpeed), e.uniform1f(l.uLit, +!!E.lit);
562
+ let z = b(x);
563
+ e.uniform3f(l.uRimColor, z[0], z[1], z[2]), e.uniform3f(l.uLightDir, E.lightDir[0], E.lightDir[1], E.lightDir[2]), e.uniform1f(l.uSpecStrength, E.specStrength), e.uniform1f(l.uSpecShininess, E.specShininess), e.uniform1f(l.uRimPower, E.rimPower), e.uniform1f(l.uRimStrength, E.rimStrength), e.uniform1f(l.uIridescence, E.iridescence * g.iridScale), e.uniform1f(l.uIridHue, E.iridHue * (Math.PI / 180)), e.uniform1f(l.uIridSpeed, E.iridSpeed), e.uniform1f(l.uSssScale, E.sssScale * g.iridScale), e.uniform1f(l.uSssPower, E.sssPower), e.uniform1f(l.uCoreGlow, E.coreGlow);
564
+ let B = s.sources;
565
+ e.uniform1i(l.uSatCount, B.length);
566
+ for (let t = 0; t < 4; t++) {
567
+ let n = u[t] ?? null, r = d[t] ?? null, i = f[t] ?? null, a = B[t];
568
+ a ? (e.uniform2f(n, a.x * A, a.y * A), e.uniform1f(r, a.radius * A), e.uniform1f(i, a.opacity)) : (e.uniform2f(n, 0, 0), e.uniform1f(r, 0), e.uniform1f(i, 0));
569
+ }
570
+ e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.drawArrays(e.TRIANGLES, 0, 6), e.bindVertexArray(null);
571
+ }
572
+ //#endregion
573
+ //#region src/components/custom/goo-blob/composables/buildMetaballProgram.ts
574
+ var Q = "[GooBlob]";
575
+ function me(e) {
576
+ let t = c(e, e.VERTEX_SHADER, oe, Q), n = c(e, e.FRAGMENT_SHADER, fe, Q), r = i(e, t, n, Q);
577
+ e.useProgram(r);
578
+ let a = e.createVertexArray();
579
+ e.bindVertexArray(a);
580
+ let o = e.createBuffer();
581
+ e.bindBuffer(e.ARRAY_BUFFER, o), e.bufferData(e.ARRAY_BUFFER, new Float32Array([
582
+ -1,
583
+ -1,
584
+ 1,
585
+ -1,
586
+ -1,
587
+ 1,
588
+ -1,
589
+ 1,
590
+ 1,
591
+ -1,
592
+ 1,
593
+ 1
594
+ ]), e.STATIC_DRAW);
595
+ let s = e.getAttribLocation(r, "aPosition");
596
+ e.enableVertexAttribArray(s), e.vertexAttribPointer(s, 2, e.FLOAT, !1, 0, 0);
597
+ let l = {};
598
+ for (let t of B) l[t] = e.getUniformLocation(r, t);
599
+ let u = [], d = [], f = [];
600
+ for (let t = 0; t < 4; t++) u.push(e.getUniformLocation(r, `uSatPos[${t}]`)), d.push(e.getUniformLocation(r, `uSatRadius[${t}]`)), f.push(e.getUniformLocation(r, `uSatOpacity[${t}]`));
601
+ let p = [], m = [];
602
+ for (let t = 0; t < 15; t++) p.push(e.getUniformLocation(r, `uTrailPos[${t}]`)), m.push(e.getUniformLocation(r, `uTrailRadius[${t}]`));
603
+ let h = [];
604
+ for (let t = 0; t < 4; t++) h.push(e.getUniformLocation(r, `uPalette[${t}]`));
605
+ return e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), {
606
+ prog: r,
607
+ vs: t,
608
+ fs: n,
609
+ vao: a,
610
+ buf: o,
611
+ locs: {
612
+ U: l,
613
+ satPosLocs: u,
614
+ satRadLocs: d,
615
+ satOpLocs: f,
616
+ trailPosLocs: p,
617
+ trailRadLocs: m,
618
+ paletteLocs: h
619
+ }
620
+ };
621
+ }
622
+ //#endregion
623
+ //#region src/components/custom/goo-blob/composables/useMetaballRenderer.ts
624
+ function $(e) {
625
+ let { canvasRef: t, color: r, rimColor: i, paletteStops: a, mood: s, pointer: c, satellites: f, config: p } = e, m = 0, h = 0, g = /* @__PURE__ */ new Map();
626
+ function _(e) {
627
+ let t = g.get(e);
539
628
  if (t) return t;
540
629
  let n = l(u(e));
541
- return v.size > 256 && v.clear(), v.set(e, n), n;
630
+ return g.size > 256 && g.clear(), g.set(e, n), n;
542
631
  }
543
- let b = null, S = !1, C = null;
544
- function w() {
545
- C !== null && (clearTimeout(C), C = null);
632
+ let v = null, y = !1, b = null;
633
+ function S() {
634
+ b !== null && (clearTimeout(b), b = null);
546
635
  }
547
- function T(e) {
548
- if (w(), typeof setTimeout > "u") return;
549
- let t = Math.min(Math.max(e - _, 16), 3e4);
550
- C = setTimeout(() => {
551
- C = null, b?.wake();
636
+ function C(e) {
637
+ if (S(), typeof setTimeout > "u") return;
638
+ let t = Math.min(Math.max(e - h, 16), 3e4);
639
+ b = setTimeout(() => {
640
+ b = null, v?.wake();
552
641
  }, t);
553
642
  }
554
643
  d(t, {
555
- pause: () => b?.suspend("off-screen-io"),
556
- resume: () => b?.resume("off-screen-io")
644
+ pause: () => v?.suspend("off-screen-io"),
645
+ resume: () => v?.resume("off-screen-io")
557
646
  }, {
558
647
  rootMargin: "200px",
559
648
  pauseWhenHidden: !1
560
649
  });
561
- function D(e) {
562
- b = o(e, {
650
+ function w(e) {
651
+ v = o(e, {
563
652
  contextAttrs: {
564
653
  alpha: !0,
565
654
  premultipliedAlpha: !0,
@@ -567,120 +656,62 @@ function pe(e) {
567
656
  preserveDrawingBuffer: !1
568
657
  },
569
658
  setup: (t) => {
570
- let o = c(t, t.VERTEX_SHADER, ne, Q), l = c(t, t.FRAGMENT_SHADER, le, Q), u = i(t, o, l, Q);
571
- t.useProgram(u);
572
- let d = t.createVertexArray();
573
- t.bindVertexArray(d);
574
- let v = t.createBuffer();
575
- t.bindBuffer(t.ARRAY_BUFFER, v), t.bufferData(t.ARRAY_BUFFER, new Float32Array([
576
- -1,
577
- -1,
578
- 1,
579
- -1,
580
- -1,
581
- 1,
582
- -1,
583
- 1,
584
- 1,
585
- -1,
586
- 1,
587
- 1
588
- ]), t.STATIC_DRAW);
589
- let x = t.getAttribLocation(u, "aPosition");
590
- t.enableVertexAttribArray(x), t.vertexAttribPointer(x, 2, t.FLOAT, !1, 0, 0);
591
- let C = {};
592
- for (let e of fe) C[e] = t.getUniformLocation(u, e);
593
- let E = [], D = [], O = [];
594
- for (let e = 0; e < ue; e++) E.push(t.getUniformLocation(u, `uSatPos[${e}]`)), D.push(t.getUniformLocation(u, `uSatRadius[${e}]`)), O.push(t.getUniformLocation(u, `uSatOpacity[${e}]`));
595
- let k = [], A = [];
596
- for (let e = 0; e < de; e++) k.push(t.getUniformLocation(u, `uTrailPos[${e}]`)), A.push(t.getUniformLocation(u, `uTrailRadius[${e}]`));
597
- let j = [];
598
- for (let e = 0; e < Z; e++) j.push(t.getUniformLocation(u, `uPalette[${e}]`));
599
- t.enable(t.BLEND), t.blendFunc(t.ONE, t.ONE_MINUS_SRC_ALPHA);
600
- function M() {
601
- let r = n(), i = h.quality === "half" ? .5 : 1, a = e.clientWidth || h.geometry.canvasSize, o = e.clientHeight || h.geometry.canvasSize, s = Math.max(1, Math.round(a * r * i)), c = Math.max(1, Math.round(o * r * i));
659
+ let { prog: o, vs: l, fs: u, vao: d, buf: g, locs: b } = me(t);
660
+ function x() {
661
+ let r = n(), i = p.quality === "half" ? .5 : 1, a = e.clientWidth || p.geometry.canvasSize, o = e.clientHeight || p.geometry.canvasSize, s = Math.max(1, Math.round(a * r * i)), c = Math.max(1, Math.round(o * r * i));
602
662
  (e.width !== s || e.height !== c) && (e.width = s, e.height = c), t.viewport(0, 0, s, c);
603
663
  }
604
- function N(n) {
605
- let i = g ? (n - g) * 1e3 : 16;
606
- g = n;
607
- let o = Math.max(0, Math.min(i, 50));
608
- i < 0 && console.warn(`[DIAG-NEGDT] rawDtMs=${i.toFixed(0)} timeSec=${n.toFixed(2)}`);
609
- let c = b?.reducedMotion ?? !1, l = (c || S ? 0 : h.tempo) * o;
610
- _ += l, c || f.update({
611
- pointerActive: p.active.value,
612
- clicked: p.consumeClick(),
613
- idleMs: p.idleMs()
614
- }), f.tick(l), c ? p.rest() : p.tick(l), m.tick(_, f.params.value);
615
- let v = f.params.value, x = y(r.value), { geometry: w, membrane: T, color: M, surface: N, interaction: P } = h;
616
- t.useProgram(u), t.bindVertexArray(d), t.uniform2f(C.uResolution, e.width, e.height), t.uniform1f(C.uTime, _ / 1e3), t.uniform3f(C.uBaseColor, x[0], x[1], x[2]);
617
- let F = s.value, I = Math.min(F.length, Z);
618
- t.uniform1i(C.uStopCount, I);
619
- for (let e = 0; e < Z; e++) {
620
- let n = j[e] ?? null, r = F[e];
621
- if (r) {
622
- let e = y(r);
623
- t.uniform3f(n, e[0], e[1], e[2]);
624
- } else t.uniform3f(n, x[0], x[1], x[2]);
625
- }
626
- let L = p.pointer.value, R = P.pointerAttraction + v.pointerAttraction;
627
- t.uniform2f(C.uPointer, L.x * .5 * $, L.y * .5 * $), t.uniform1f(C.uPointerActive, +!!p.active.value), t.uniform1f(C.uPointerAttraction, R), t.uniform1f(C.uPointerStrength, P.pointerStrength * $);
628
- let z = Math.max(0, Math.min(1, R)), B = p.velocity.value;
629
- t.uniform2f(C.uVelocity, B.x * .5 * $, B.y * .5 * $), t.uniform1f(C.uStretch, P.stretch);
630
- let V = p.trailSources(w.satelliteRadius * .7 * z);
631
- t.uniform1i(C.uTrailCount, V.count);
632
- for (let e = 0; e < de; e++) {
633
- let n = k[e] ?? null, r = A[e] ?? null, i = V.sources[e];
634
- i ? (t.uniform2f(n, i.x * .5 * $, i.y * .5 * $), t.uniform1f(r, i.radius * $)) : (t.uniform2f(n, 0, 0), t.uniform1f(r, 0));
635
- }
636
- t.uniform1f(C.uBodyRadius, w.bodyRadius * $), t.uniform1f(C.uPulsePhase, n * T.pulseFreq * v.pulseFreq * Math.PI * 2);
637
- let H = p.pulse.value * P.clickImpulse;
638
- t.uniform1f(C.uPulseAmp, (T.pulseAmp * v.pulseAmp / .015 + H) * $), t.uniform1f(C.uNoiseAmp, T.noiseAmp * v.noiseAmp / .025 * $), t.uniform1f(C.uNoiseFreq, T.noiseFreq), t.uniform1f(C.uNoiseSpeed, T.noiseSpeed), t.uniform1f(C.uWarpAmp, T.warpAmp), t.uniform1f(C.uSmoothK, T.smoothK * v.smoothK * $), t.uniform1f(C.uMerge, +(T.merge === "circular"));
639
- let U = w.orbitRadius * 1.2 * (1 + w.eccentricity) + w.satelliteRadius, W = (Math.max(w.bodyRadius, U) + T.smoothK * v.smoothK + T.noiseAmp * v.noiseAmp / .025 + Math.abs(p.pulse.value) * P.clickImpulse) * $ + .1;
640
- t.uniform1f(C.uMaxReach, W), t.uniform1f(C.uHueRange, M.hueRange + v.hueRange), t.uniform1f(C.uSatShift, M.satShift + v.satShift), t.uniform1f(C.uBrightnessShift, M.brightnessShift + v.brightnessShift), t.uniform1f(C.uColorNoiseFreq, M.colorNoiseFreq), t.uniform1f(C.uColorNoiseSpeed, M.colorNoiseSpeed), t.uniform1f(C.uLit, +!!N.lit);
641
- let G = y(a.value);
642
- t.uniform3f(C.uRimColor, G[0], G[1], G[2]), t.uniform3f(C.uLightDir, N.lightDir[0], N.lightDir[1], N.lightDir[2]), t.uniform1f(C.uSpecStrength, N.specStrength), t.uniform1f(C.uSpecShininess, N.specShininess), t.uniform1f(C.uRimPower, N.rimPower), t.uniform1f(C.uRimStrength, N.rimStrength), t.uniform1f(C.uIridescence, N.iridescence * v.iridScale), t.uniform1f(C.uIridHue, N.iridHue * (Math.PI / 180)), t.uniform1f(C.uIridSpeed, N.iridSpeed), t.uniform1f(C.uSssScale, N.sssScale * v.iridScale), t.uniform1f(C.uSssPower, N.sssPower), t.uniform1f(C.uCoreGlow, N.coreGlow);
643
- let K = m.sources;
644
- t.uniform1i(C.uSatCount, K.length);
645
- for (let e = 0; e < ue; e++) {
646
- let n = E[e] ?? null, r = D[e] ?? null, i = O[e] ?? null, a = K[e];
647
- a ? (t.uniform2f(n, a.x * $, a.y * $), t.uniform1f(r, a.radius * $), t.uniform1f(i, a.opacity)) : (t.uniform2f(n, 0, 0), t.uniform1f(r, 0), t.uniform1f(i, 0));
648
- }
649
- t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 6), t.bindVertexArray(null);
664
+ function w(n) {
665
+ let l = m ? (n - m) * 1e3 : 16;
666
+ m = n;
667
+ let u = Math.max(0, Math.min(l, 50)), g = v?.reducedMotion ?? !1, x = (g || y ? 0 : p.tempo) * u;
668
+ h += x, g || s.update({
669
+ pointerActive: c.active.value,
670
+ clicked: c.consumeClick(),
671
+ idleMs: c.idleMs()
672
+ }), s.tick(x), g ? c.rest() : c.tick(x), f.tick(h, s.params.value), pe(t, o, d, b, e, p, c, f, {
673
+ params: s.params.value,
674
+ rgb: _(r.value),
675
+ simTimeMs: h,
676
+ timeSec: n,
677
+ resolveColor: _,
678
+ rimColor: i.value,
679
+ paletteStops: a.value
680
+ });
650
681
  }
651
- function P() {
652
- if (S) return !1;
653
- if (!f.isSettled() || !p.isAtRest() || !m.isQuiescent()) return w(), !0;
654
- let e = m.nextEventMs(_), t = f.nextAutoMoodMs(), n = Number.isFinite(t) ? _ + t : Infinity;
655
- return T(Math.min(e, n)), !1;
682
+ function T() {
683
+ if (y) return !1;
684
+ if (!s.isSettled() || !c.isAtRest() || !f.isQuiescent()) return S(), !0;
685
+ let e = f.nextEventMs(h), t = s.nextAutoMoodMs(), n = Number.isFinite(t) ? h + t : Infinity;
686
+ return C(Math.min(e, n)), !1;
656
687
  }
657
688
  return {
658
- frame: N,
659
- shouldContinue: P,
660
- resize: M,
689
+ frame: w,
690
+ shouldContinue: T,
691
+ resize: x,
661
692
  teardown: () => {
662
- t.deleteProgram(u), t.deleteShader(o), t.deleteShader(l), t.deleteBuffer(v), t.deleteVertexArray(d);
693
+ t.deleteProgram(o), t.deleteShader(l), t.deleteShader(u), t.deleteBuffer(g), t.deleteVertexArray(d);
663
694
  }
664
695
  };
665
696
  }
666
- }), b.arm();
697
+ }), v.arm();
667
698
  }
668
699
  return E(t, (e) => {
669
- e && !b && D(e);
670
- }, { immediate: !0 }), E(r, () => b?.wake()), E(s, () => b?.wake(), { deep: !0 }), x(() => {
671
- w(), b?.dispose(), b = null;
700
+ e && !v && w(e);
701
+ }, { immediate: !0 }), E(r, () => v?.wake()), E(a, () => v?.wake(), { deep: !0 }), x(() => {
702
+ S(), v?.dispose(), v = null;
672
703
  }), {
673
704
  pause: () => {
674
- S = !0, b?.suspend("manual");
705
+ y = !0, v?.suspend("manual");
675
706
  },
676
707
  resume: () => {
677
- S = !1, b?.resume("manual");
708
+ y = !1, v?.resume("manual");
678
709
  }
679
710
  };
680
711
  }
681
712
  //#endregion
682
713
  //#region src/components/custom/goo-blob/GooBlob.vue
683
- var me = /* @__PURE__ */ e(/* @__PURE__ */ _({
714
+ var he = /* @__PURE__ */ e(/* @__PURE__ */ _({
684
715
  __name: "GooBlob",
685
716
  props: {
686
717
  color: {},
@@ -695,12 +726,12 @@ var me = /* @__PURE__ */ e(/* @__PURE__ */ _({
695
726
  setup(e, { expose: n, emit: r }) {
696
727
  let i = r, a = v(k, null), o = e.config ?? a;
697
728
  if (!o) throw Error("[glass-ui] GooBlob: no blob config. Pass an explicit `config` prop (e.g. BLOB_CONFIG_DEFAULTS) or provide(BLOB_CONFIG_KEY, cfg) from an ancestor. There is no silent defaults synthesis.");
698
- let s = () => e.config ?? a ?? o, c = T("canvasRef"), l = T("wrapperRef"), u = B(), d = V(l), f = te(o, e.color + e.seed), p = t(), _ = w(e.color), x = w(o.surface.rimColor), C = w([...o.color.paletteStops]);
729
+ let s = () => e.config ?? a ?? o, c = T("canvasRef"), l = T("wrapperRef"), u = V(), d = H(l), f = J(o, e.color + e.seed), p = t(), _ = w(e.color), x = w(o.surface.rimColor), C = w([...o.color.paletteStops]);
699
730
  function D() {
700
731
  let t = l.value, n = s();
701
732
  p.invalidate(), _.value = p.resolve(e.color, t), x.value = p.resolve(n.surface.rimColor, t), C.value = n.color.paletteStops.map((e) => p.resolve(e, t));
702
733
  }
703
- let O = pe({
734
+ let O = $({
704
735
  canvasRef: c,
705
736
  color: _,
706
737
  rimColor: x,
@@ -756,6 +787,6 @@ var me = /* @__PURE__ */ e(/* @__PURE__ */ _({
756
787
  "data-testid": "goo-blob-canvas"
757
788
  }, null, 512)], 4));
758
789
  }
759
- }), [["__scopeId", "data-v-d2abf215"]]);
790
+ }), [["__scopeId", "data-v-0da7ca14"]]);
760
791
  //#endregion
761
- export { O as BLOB_CONFIG_DEFAULTS, k as BLOB_CONFIG_KEY, me as GooBlob, B as useBlobMood, V as useBlobPointer, te as useBlobSatellites, pe as useMetaballRenderer };
792
+ export { O as BLOB_CONFIG_DEFAULTS, k as BLOB_CONFIG_KEY, he as GooBlob, V as useBlobMood, H as useBlobPointer, J as useBlobSatellites, $ as useMetaballRenderer };