{"version":3,"file":"chunk-animation.mjs","names":[],"sources":["../../src/util/animation.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useSyncExternalStore } from 'react';\n\nconst REDUCED_MOTION_QUERY = '(prefers-reduced-motion: reduce)';\n\nconst matchReducedMotion = (): MediaQueryList | undefined =>\n  typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n    ? window.matchMedia(REDUCED_MOTION_QUERY)\n    : undefined;\n\nconst subscribeReducedMotion = (onChange: () => void): (() => void) => {\n  const query = matchReducedMotion();\n  query?.addEventListener('change', onChange);\n  return () => query?.removeEventListener('change', onChange);\n};\n\nconst getReducedMotionSnapshot = (): boolean => matchReducedMotion()?.matches ?? false;\n\n/** Tracks the reader's `prefers-reduced-motion` setting, re-rendering when they change it. */\nexport const useReducedMotion = (): boolean =>\n  useSyncExternalStore(subscribeReducedMotion, getReducedMotionSnapshot, () => false);\n\n/**\n * `VITE_DX_DISABLE_ANIMATIONS=true` turns off animation that runs without a user gesture —\n * carousel auto-advance and the like.\n *\n * Agent-driven recordings (`autocue`) are culled by dropping runs of identical frames, and\n * an unattended animation makes every frame differ, so the whole session survives the cull.\n */\nexport const animationsDisabled = (): boolean => {\n  // `import.meta.env` is absent outside a Vite graph (plain node, a tsc-built consumer).\n  const value = (import.meta as { env?: Record<string, string | undefined> }).env?.VITE_DX_DISABLE_ANIMATIONS;\n  return value === 'true' || value === '1';\n};\n"],"mappings":";;AAMA,IAAM,uBAAuB;AAE7B,IAAM,2BACJ,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,aAC1D,OAAO,WAAW,oBAAoB,IACtC,KAAA;AAEN,IAAM,0BAA0B,aAAuC;CACrE,MAAM,QAAQ,mBAAmB;CACjC,OAAO,iBAAiB,UAAU,QAAQ;CAC1C,aAAa,OAAO,oBAAoB,UAAU,QAAQ;AAC5D;AAEA,IAAM,iCAA0C,mBAAmB,CAAC,EAAE,WAAW;;AAGjF,IAAa,yBACX,qBAAqB,wBAAwB,gCAAgC,KAAK;;;;;;;;AASpF,IAAa,2BAAoC;CAG/C,OAA2B;AAC7B"}