// Ported verbatim from `@base-ui/react`'s // `slider/thumb/prehydrationScript.min.ts`. Inlined inert JS string that runs // BEFORE Solid hydration to set each thumb's `--position` CSS var (and the // indicator's `--start-position` / `--end-position` / `--relative-size`) from // the SSR'd `value`/`min`/`max` + measured geometry — avoiding a flash at the // wrong position before the client measurement effects run. // // Emitted only server-side, gated on `inset && isHydrating && // renderBeforeHydration && isLastThumb` (see `slider-thumb.tsx`). The script // reads `document.currentScript.parentElement` (the last thumb) so it must be // rendered as a child of that thumb's element. // // Keep this byte-for-byte in sync with the React source; regenerate there via // `pnpm inline-scripts` and re-copy if the React template changes. // The `${...}` sequences are real backtick-template interpolations INSIDE the // inlined script body (kept verbatim from React's minified output), not stray // placeholders in this outer single-quoted string — suppress the false positive. export const sliderPrehydrationScript = // biome-ignore lint/suspicious/noTemplateCurlyInString: verbatim minified script body '!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-quoin-slider-control]");if(!e)return;const r=e.querySelector("[data-quoin-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t