sparkecoder 0.1.9 → 0.1.10

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 (146) hide show
  1. package/dist/agent/index.d.ts +3 -3
  2. package/dist/agent/index.js +26 -7
  3. package/dist/agent/index.js.map +1 -1
  4. package/dist/{bash-CGAqW7HR.d.ts → bash-C43A-o5X.d.ts} +4 -4
  5. package/dist/cli.js +21 -9
  6. package/dist/cli.js.map +1 -1
  7. package/dist/db/index.d.ts +1 -1
  8. package/dist/{index-BeKylVnB.d.ts → index-DuWb8kNN.d.ts} +6 -6
  9. package/dist/index.d.ts +7 -7
  10. package/dist/index.js +17 -9
  11. package/dist/index.js.map +1 -1
  12. package/dist/{schema-CkrIadxa.d.ts → schema-J6qYlHtl.d.ts} +3 -3
  13. package/dist/server/index.js +17 -9
  14. package/dist/server/index.js.map +1 -1
  15. package/dist/tools/index.d.ts +3 -3
  16. package/dist/tools/index.js +152 -118
  17. package/dist/tools/index.js.map +1 -1
  18. package/package.json +1 -1
  19. package/web/.next/BUILD_ID +1 -1
  20. package/web/.next/build-manifest.json +2 -2
  21. package/web/.next/cache/.previewinfo +1 -1
  22. package/web/.next/cache/.rscinfo +1 -1
  23. package/web/.next/cache/.tsbuildinfo +1 -1
  24. package/web/.next/cache/config.json +3 -3
  25. package/web/.next/dev/cache/.rscinfo +1 -1
  26. package/web/.next/dev/cache/config.json +3 -3
  27. package/web/.next/dev/cache/turbopack/731ace46/00000001.sst +0 -0
  28. package/web/.next/dev/cache/turbopack/731ace46/00000002.sst +0 -0
  29. package/web/.next/dev/cache/turbopack/731ace46/00000004.sst +0 -0
  30. package/web/.next/dev/cache/turbopack/731ace46/00000005.sst +0 -0
  31. package/web/.next/dev/cache/turbopack/731ace46/00000007.meta +0 -0
  32. package/web/.next/dev/cache/turbopack/731ace46/00000008.meta +0 -0
  33. package/web/.next/dev/cache/turbopack/731ace46/00000010.meta +0 -0
  34. package/web/.next/dev/cache/turbopack/731ace46/00000011.sst +0 -0
  35. package/web/.next/dev/cache/turbopack/731ace46/00000012.sst +0 -0
  36. package/web/.next/dev/cache/turbopack/731ace46/00000014.sst +0 -0
  37. package/web/.next/dev/cache/turbopack/731ace46/00000015.sst +0 -0
  38. package/web/.next/dev/cache/turbopack/731ace46/00000017.meta +0 -0
  39. package/web/.next/dev/cache/turbopack/731ace46/00000018.meta +0 -0
  40. package/web/.next/dev/cache/turbopack/731ace46/00000019.meta +0 -0
  41. package/web/.next/dev/cache/turbopack/731ace46/00000020.meta +0 -0
  42. package/web/.next/dev/cache/turbopack/731ace46/00000021.sst +0 -0
  43. package/web/.next/dev/cache/turbopack/731ace46/00000022.sst +0 -0
  44. package/web/.next/dev/cache/turbopack/731ace46/00000023.sst +0 -0
  45. package/web/.next/dev/cache/turbopack/731ace46/{00000040.meta → 00000025.meta} +0 -0
  46. package/web/.next/dev/cache/turbopack/731ace46/00000026.meta +0 -0
  47. package/web/.next/dev/cache/turbopack/731ace46/00000027.sst +0 -0
  48. package/web/.next/dev/cache/turbopack/731ace46/00000028.sst +0 -0
  49. package/web/.next/dev/cache/turbopack/731ace46/00000029.sst +0 -0
  50. package/web/.next/dev/cache/turbopack/731ace46/00000030.meta +0 -0
  51. package/web/.next/dev/cache/turbopack/731ace46/{00000045.meta → 00000031.meta} +0 -0
  52. package/web/.next/dev/cache/turbopack/731ace46/{00000029.meta → 00000032.meta} +0 -0
  53. package/web/.next/dev/cache/turbopack/731ace46/00000033.sst +0 -0
  54. package/web/.next/dev/cache/turbopack/731ace46/00000034.sst +0 -0
  55. package/web/.next/dev/cache/turbopack/731ace46/00000035.sst +0 -0
  56. package/web/.next/dev/cache/turbopack/731ace46/00000036.meta +0 -0
  57. package/web/.next/dev/cache/turbopack/731ace46/00000037.meta +0 -0
  58. package/web/.next/dev/cache/turbopack/731ace46/00000038.meta +0 -0
  59. package/web/.next/dev/cache/turbopack/731ace46/00000039.sst +0 -0
  60. package/web/.next/dev/cache/turbopack/731ace46/00000040.sst +0 -0
  61. package/web/.next/dev/cache/turbopack/731ace46/00000041.sst +0 -0
  62. package/web/.next/dev/cache/turbopack/731ace46/00000042.meta +0 -0
  63. package/web/.next/dev/cache/turbopack/731ace46/{00000039.meta → 00000043.meta} +0 -0
  64. package/web/.next/dev/cache/turbopack/731ace46/00000044.meta +0 -0
  65. package/web/.next/dev/cache/turbopack/731ace46/00000045.sst +0 -0
  66. package/web/.next/dev/cache/turbopack/731ace46/{00000042.sst → 00000046.sst} +0 -0
  67. package/web/.next/dev/cache/turbopack/731ace46/00000047.sst +0 -0
  68. package/web/.next/dev/cache/turbopack/731ace46/00000048.meta +0 -0
  69. package/web/.next/dev/cache/turbopack/731ace46/00000049.meta +0 -0
  70. package/web/.next/dev/cache/turbopack/731ace46/00000050.meta +0 -0
  71. package/web/.next/dev/cache/turbopack/731ace46/00000051.sst +0 -0
  72. package/web/.next/dev/cache/turbopack/731ace46/00000052.sst +0 -0
  73. package/web/.next/dev/cache/turbopack/731ace46/00000053.sst +0 -0
  74. package/web/.next/dev/cache/turbopack/731ace46/00000054.meta +0 -0
  75. package/web/.next/dev/cache/turbopack/731ace46/00000055.meta +0 -0
  76. package/web/.next/dev/cache/turbopack/731ace46/00000056.meta +0 -0
  77. package/web/.next/dev/cache/turbopack/731ace46/CURRENT +0 -0
  78. package/web/.next/dev/cache/turbopack/731ace46/LOG +44 -30
  79. package/web/.next/dev/prerender-manifest.json +3 -3
  80. package/web/.next/dev/server/server-reference-manifest.js +1 -1
  81. package/web/.next/dev/server/server-reference-manifest.json +1 -1
  82. package/web/.next/dev/trace +1 -1
  83. package/web/.next/fallback-build-manifest.json +2 -2
  84. package/web/.next/prerender-manifest.json +3 -3
  85. package/web/.next/server/app/(main)/session/[id]/page.js.nft.json +1 -1
  86. package/web/.next/server/app/(main)/session/[id]/page_client-reference-manifest.js +1 -1
  87. package/web/.next/server/app/_global-error.html +2 -2
  88. package/web/.next/server/app/_global-error.rsc +1 -1
  89. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  90. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  91. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  92. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  93. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  94. package/web/.next/server/app/_not-found.html +1 -1
  95. package/web/.next/server/app/_not-found.rsc +1 -1
  96. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  97. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  98. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  99. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  100. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  101. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  102. package/web/.next/server/app/index.html +1 -1
  103. package/web/.next/server/app/index.rsc +1 -1
  104. package/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  105. package/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  106. package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  107. package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  108. package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  109. package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  110. package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js → 2374f__pnpm_2c066fc4._.js} +1 -1
  111. package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js → 2374f__pnpm_6c21de20._.js} +1 -1
  112. package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js → 2374f__pnpm_7261fee6._.js} +1 -1
  113. package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js → 2374f__pnpm_86153ae0._.js} +1 -1
  114. package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js → 2374f__pnpm_b316ce7b._.js} +2 -2
  115. package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js → 2374f__pnpm_e9578f61._.js} +1 -1
  116. package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js → 2374f__pnpm_ef13102d._.js} +1 -1
  117. package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js → 2374f__pnpm_f79c2825._.js} +1 -1
  118. package/web/.next/server/chunks/ssr/{[root-of-the-server]__2dfcd951._.js → [root-of-the-server]__02cdbf0f._.js} +2 -2
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__02cdbf0f._.js.map +1 -0
  120. package/web/.next/server/pages/404.html +1 -1
  121. package/web/.next/server/pages/500.html +2 -2
  122. package/web/.next/server/server-reference-manifest.js +1 -1
  123. package/web/.next/server/server-reference-manifest.json +1 -1
  124. package/web/.next/static/chunks/{bf853305cd7a9765.js → cffe148e9b82e836.js} +3 -3
  125. package/web/.next/trace +1 -1
  126. package/web/.next/trace-build +1 -1
  127. package/web/.next/dev/cache/turbopack/731ace46/00000024.sst +0 -0
  128. package/web/.next/dev/cache/turbopack/731ace46/00000025.sst +0 -0
  129. package/web/.next/dev/cache/turbopack/731ace46/00000028.meta +0 -0
  130. package/web/.next/dev/cache/turbopack/731ace46/00000031.sst +0 -0
  131. package/web/.next/dev/cache/turbopack/731ace46/00000032.sst +0 -0
  132. package/web/.next/dev/cache/turbopack/731ace46/00000043.sst +0 -0
  133. package/web/.next/dev/cache/turbopack/731ace46/00000046.meta +0 -0
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__2dfcd951._.js.map +0 -1
  135. /package/web/.next/dev/cache/turbopack/731ace46/{00000027.meta → 00000024.meta} +0 -0
  136. /package/web/.next/server/chunks/ssr/{2374f__pnpm_d7f11ceb._.js.map → 2374f__pnpm_2c066fc4._.js.map} +0 -0
  137. /package/web/.next/server/chunks/ssr/{2374f__pnpm_e04ff5e3._.js.map → 2374f__pnpm_6c21de20._.js.map} +0 -0
  138. /package/web/.next/server/chunks/ssr/{2374f__pnpm_f4abb025._.js.map → 2374f__pnpm_7261fee6._.js.map} +0 -0
  139. /package/web/.next/server/chunks/ssr/{2374f__pnpm_c03e1359._.js.map → 2374f__pnpm_86153ae0._.js.map} +0 -0
  140. /package/web/.next/server/chunks/ssr/{2374f__pnpm_eb87394d._.js.map → 2374f__pnpm_b316ce7b._.js.map} +0 -0
  141. /package/web/.next/server/chunks/ssr/{2374f__pnpm_aa2ce93b._.js.map → 2374f__pnpm_e9578f61._.js.map} +0 -0
  142. /package/web/.next/server/chunks/ssr/{2374f__pnpm_c7feb274._.js.map → 2374f__pnpm_ef13102d._.js.map} +0 -0
  143. /package/web/.next/server/chunks/ssr/{2374f__pnpm_2f0d7c45._.js.map → 2374f__pnpm_f79c2825._.js.map} +0 -0
  144. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_buildManifest.js +0 -0
  145. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_clientMiddlewareManifest.json +0 -0
  146. /package/web/.next/static/{O9K30qQQXDEvnesMUBQxo → YnBzwu6wdLNKy3zBf7w5K}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../web/src/components/ui/badge.tsx","../../../../../web/src/components/ai-elements/conversation.tsx","../../../../../web/node_modules/.pnpm/use-stick-to-bottom%401.1.2_react%4019.2.3/node_modules/use-stick-to-bottom/dist/useStickToBottom.js","../../../../../web/node_modules/.pnpm/use-stick-to-bottom%401.1.2_react%4019.2.3/node_modules/use-stick-to-bottom/dist/StickToBottom.js","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/arrow-down.ts","../../../../../web/src/components/ui/button-group.tsx","../../../../../web/node_modules/.pnpm/micromark-util-symbol%402.0.1/node_modules/micromark-util-symbol/lib/codes.js","../../../../../web/node_modules/.pnpm/micromark-extension-cjk-friendly%401.2.3_micromark-util-types%402.0.2_micromark%404.0.2/node_modules/micromark-extension-cjk-friendly/dist/index.js","../../../../../web/node_modules/.pnpm/micromark-util-symbol%402.0.1/node_modules/micromark-util-symbol/lib/constants.js","../../../../../web/node_modules/.pnpm/micromark-extension-cjk-friendly-util%402.1.1_micromark-util-types%402.0.2/node_modules/micromark-extension-cjk-friendly-util/dist/index.js","../../../../../web/node_modules/.pnpm/get-east-asian-width%401.4.0/node_modules/get-east-asian-width/lookup.js","../../../../../web/node_modules/.pnpm/get-east-asian-width%401.4.0/node_modules/get-east-asian-width/index.js","../../../../../web/node_modules/.pnpm/micromark-util-symbol%402.0.1/node_modules/micromark-util-symbol/lib/types.js","../../../../../web/node_modules/.pnpm/remark-cjk-friendly%401.2.3_%40types%2Bmdast%404.0.4_micromark-util-types%402.0.2_micromark%404.0.2_unified%4011.0.5/node_modules/remark-cjk-friendly/dist/index.js","../../../../../web/node_modules/.pnpm/micromark-extension-cjk-friendly-gfm-strikethrough%401.2.3_micromark-util-types%402.0.2_micromark%404.0.2/node_modules/micromark-extension-cjk-friendly-gfm-strikethrough/dist/index.js","../../../../../web/node_modules/.pnpm/remark-cjk-friendly-gfm-strikethrough%401.2.3_%40types%2Bmdast%404.0.4_micromark-util-types%402.0.2_micromark%404.0.2_unified%4011.0.5/node_modules/remark-cjk-friendly-gfm-strikethrough/dist/index.js","../../../../../web/node_modules/.pnpm/%40streamdown%2Bcjk%401.0.1_%40types%2Bmdast%404.0.4_micromark-util-types%402.0.2_micromark%404.0.2_react%4019.2.3_unified%4011.0.5/node_modules/%40streamdown/cjk/dist/index.js","../../../../../web/node_modules/.pnpm/%40streamdown%2Bcode%401.0.1_react%4019.2.3/node_modules/%40streamdown/code/dist/index.js","../../../../../web/node_modules/.pnpm/hast-util-from-html%402.0.3/node_modules/hast-util-from-html/lib/index.js","../../../../../web/node_modules/.pnpm/hast-util-from-html%402.0.3/node_modules/hast-util-from-html/lib/errors.js","../../../../../web/node_modules/.pnpm/unist-util-remove-position%405.0.0/node_modules/unist-util-remove-position/lib/index.js","../../../../../web/node_modules/.pnpm/hast-util-from-html-isomorphic%402.0.0/node_modules/hast-util-from-html-isomorphic/lib/index.js","../../../../../web/node_modules/.pnpm/unist-util-find-after%405.0.0/node_modules/unist-util-find-after/lib/index.js","../../../../../web/node_modules/.pnpm/hast-util-is-element%403.0.0/node_modules/hast-util-is-element/lib/index.js","../../../../../web/node_modules/.pnpm/hast-util-to-text%404.0.2/node_modules/hast-util-to-text/lib/index.js","../../../../../web/node_modules/.pnpm/rehype-katex%407.0.1/node_modules/rehype-katex/lib/index.js","../../../../../web/node_modules/.pnpm/mdast-util-math%403.0.0/node_modules/mdast-util-math/lib/index.js","../../../../../web/node_modules/.pnpm/micromark-extension-math%403.1.0/node_modules/micromark-extension-math/lib/math-flow.js","../../../../../web/node_modules/.pnpm/micromark-extension-math%403.1.0/node_modules/micromark-extension-math/lib/math-text.js","../../../../../web/node_modules/.pnpm/micromark-extension-math%403.1.0/node_modules/micromark-extension-math/lib/syntax.js","../../../../../web/node_modules/.pnpm/remark-math%406.0.0/node_modules/remark-math/lib/index.js","../../../../../web/node_modules/.pnpm/%40streamdown%2Bmath%401.0.1_react%4019.2.3/node_modules/%40streamdown/math/dist/index.js","../../../../../web/node_modules/.pnpm/mermaid%4011.12.2/node_modules/mermaid/dist/mermaid.core.mjs","../../../../../web/node_modules/.pnpm/stylis%404.3.6/node_modules/stylis/src/Enum.js","../../../../../web/node_modules/.pnpm/stylis%404.3.6/node_modules/stylis/src/Utility.js","../../../../../web/node_modules/.pnpm/stylis%404.3.6/node_modules/stylis/src/Tokenizer.js","../../../../../web/node_modules/.pnpm/stylis%404.3.6/node_modules/stylis/src/Parser.js","../../../../../web/node_modules/.pnpm/stylis%404.3.6/node_modules/stylis/src/Serializer.js","../../../../../web/node_modules/.pnpm/%40streamdown%2Bmermaid%401.0.1_react%4019.2.3/node_modules/%40streamdown/mermaid/dist/index.js","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/chevron-left.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/chevron-right.ts","../../../../../web/node_modules/.pnpm/streamdown%402.1.0_react%4019.2.3/node_modules/streamdown/dist/index.js","../../../../../web/src/components/ai-elements/message.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-collapsible%401.1.12_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%40_j6oritwyrspsjarocqpoi74cai/node_modules/%40radix-ui/react-collapsible/dist/index.mjs","../../../../../web/src/components/ui/collapsible.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle-check-big.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/clock.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/wrench.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle-x.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/copy.ts","../../../../../web/src/components/ai-elements/code-block.tsx","../../../../../web/src/components/ai-elements/tool.tsx","../../../../../web/src/components/ai-elements/artifact.tsx","../../../../../web/src/components/ui/alert.tsx","../../../../../web/src/components/ai-elements/confirmation.tsx","../../../../../web/src/components/ai-elements/loader.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/brain.ts","../../../../../web/src/components/ai-elements/shimmer.tsx","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/clamp.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/frameloop/order.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/drag/state/is-active.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/utils/color-regex.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/utils/float-regex.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/press/utils/state.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/mix/immediate.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/get-final-keyframe.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/resolve-elements.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/dom/parse-transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/styles/transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/is-svg-tag.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/calc-child-stagger.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/events/add-dom-event.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/easing/cubic-bezier.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/is-css-variable.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/utils/is-bezier-definition.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/noop.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/reduced-motion/state.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/is-object.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/utils/is-easing-array.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/dom/utils/camel-to-dash.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/utils/is-generator.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/keyframes/get-final.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/format-error-message.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/styles/scale-border-radius.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/frameloop/render-step.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/utils/setup.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/modifiers/reverse.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/anticipate.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/utils/get-context-window.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/supports/scroll-timeline.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/modifiers/mirror.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/numbers/units.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/is-numerical-string.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/press.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/render/components/create-proxy.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/interpolate.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/inertia.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/optimized-appear/data-id.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/html/utils/scrape-motion-values.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/frameloop/frame.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/hover.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/scrape-motion-values.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/drivers/frame.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/is-variant-label.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/is-forced-motion-value.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/node/DocumentProjectionNode.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/interfaces/visual-element.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/start-waapi-animation.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/resolve-dynamic-variants.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/events/add-pointer-event.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/spring/find.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/complex/index.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/layout.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/is-transition-defined.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/animate/single-value.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/keyframes/utils/unit-conversion.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/supports/memo.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/utils/velocity.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/interfaces/visual-element-variant.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/gestures.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/render/components/motion/feature-bundle.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/focus.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/mix/visibility.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/shallow-compare.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/context/MotionContext/utils.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/animation/mix-values.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/utils/measure.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/keyframes.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/complex/filter.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/utils/linear.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/color/rgba.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/utils/create-generator-easing.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/html/utils/build-styles.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/render.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/motion-values.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/velocity-per-second.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/color/hsla.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/render/dom/utils/filter-props.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/setters.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/dimensions.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/generators/spring/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/utils/apply-generator.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/easing/supported.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/is-controlling-variants.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/reduced-motion/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/keys-position.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/numbers/index.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/pan/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/replace-transition-type.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/utils/flat-tree.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/interfaces/motion-value.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/node/state.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/keyframes/utils/make-none-animatable.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/keyframes/DOMKeyframesResolver.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/keyframes/KeyframesResolver.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/errors.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/is-animatable.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/styles/scale-box-shadow.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/pan/PanSession.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/events/event-info.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/delta-calc.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/utils.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/conversion.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/will-change/add-will-change.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/animation/exit.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/models.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/mix/complex.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/utils/has-transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/utils/mix/color.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/get-variant-context.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/utils/unsupported-easing.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/supports/waapi.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/press/utils/keyboard.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/progress.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/definitions.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/press/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/animation-state.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/drag/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/color/hsla-to-rgba.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/interfaces/visual-element-target.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/resolve-variants.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/node/HTMLProjectionNode.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/array.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/frameloop/batcher.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/animation/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/build-attrs.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/viewport/observers.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/frameloop/sync-time.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/shared/stack.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/features/viewport/index.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/color/utils.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/html/utils/build-transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/dom/DOMVisualElement.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/delta-remove.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/path.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/maps/transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/waapi/easing/map-easing.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/css-variables-conversion.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/cubic-bezier.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/SVGVisualElement.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/gestures/drag/state/set-active.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/subscription-manager.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/hover.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/AsyncMotionValueAnimation.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/delta-apply.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/NativeAnimation.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/geometry/copy.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/utils/keys-transform.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/svg/utils/camel-case-attrs.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/can-animate.ts","../../../../../web/node_modules/.pnpm/motion-utils%4012.27.2/node_modules/motion-utils/src/easing/utils/map.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/maps/number.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/html/HTMLVisualElement.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/drag/utils/constraints.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/utils/default-transitions.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/value/types/color/hex.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/projection/node/create-projection-node.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/NativeAnimationExtended.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/gestures/drag/VisualElementDragControls.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/animation/JSAnimation.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/utils/valid-prop.ts","../../../../../web/node_modules/.pnpm/motion-dom%4012.29.0/node_modules/motion-dom/src/render/VisualElement.ts","../../../../../web/node_modules/.pnpm/framer-motion%4012.29.0_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/framer-motion/src/motion/index.tsx","../../../../../web/src/components/ai-elements/reasoning.tsx","../../../../../web/src/components/ai-elements/prompt-input.tsx","../../../../../web/node_modules/.pnpm/cmdk%401.1.1_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%4019.2.9_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/cmdk/dist/index.mjs","../../../../../web/src/components/ui/command.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-roving-focus%401.1.11_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact_wj32kjz3sqrxs5a56mjrydvzx4/node_modules/%40radix-ui/react-roving-focus/dist/index.mjs","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-menu%402.1.16_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%4019.2.9__qrhuwzdkoytvfvivh2req5winm/node_modules/%40radix-ui/react-menu/dist/index.mjs","../../../../../web/node_modules/.pnpm/cmdk%401.1.1_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%4019.2.9_react-dom%4019.2.3_react%4019.2.3__react%4019.2.3/node_modules/cmdk/dist/chunk-NZJY6EH4.mjs","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-dropdown-menu%402.1.16_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breac_z3bfbqn2j232xg4arldqj2mlyy/node_modules/%40radix-ui/react-dropdown-menu/dist/index.mjs","../../../../../web/src/components/ui/dropdown-menu.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-hover-card%401.1.15_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%401_xdn6fegfsbm6pd2jpvhr7chzzi/node_modules/%40radix-ui/react-hover-card/dist/index.mjs","../../../../../web/src/components/ui/hover-card.tsx","../../../../../web/src/components/ui/input-group.tsx","../../../../../web/node_modules/.pnpm/nanoid%405.1.6/node_modules/nanoid/index.js","../../../../../web/node_modules/.pnpm/nanoid%405.1.6/node_modules/nanoid/url-alphabet/index.js","../../../../../web/src/components/ui/textarea.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/square.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/image.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/search.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/corner-down-left.ts","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-dropdown-menu%402.1.16_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breac_z3bfbqn2j232xg4arldqj2mlyy/node_modules/%40radix-ui/react-dropdown-menu/src/dropdown-menu.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-hover-card%401.1.15_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%401_xdn6fegfsbm6pd2jpvhr7chzzi/node_modules/%40radix-ui/react-hover-card/src/hover-card.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-menu%402.1.16_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%4019.2.9__qrhuwzdkoytvfvivh2req5winm/node_modules/%40radix-ui/react-menu/src/menu.tsx","../../../../../web/node_modules/.pnpm/%40radix-ui%2Breact-scroll-area%401.2.10_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.9__%40types%2Breact%40_sum7p3ulik7p7vjqumvswzc3qy/node_modules/%40radix-ui/react-scroll-area/dist/index.mjs","../../../../../web/src/components/ui/scroll-area.tsx","../../../../../web/src/components/ai-elements/suggestion.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/list-todo.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle-dot.ts","../../../../../web/src/components/ai-elements/todo-panel.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle-check.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/triangle-alert.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/file-code.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/pencil.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/rotate-ccw.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/file.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/file-plus.ts","../../../../../web/src/components/ai-elements/write-file-tool.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/file-text.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/scissors.ts","../../../../../web/src/components/ai-elements/read-file-tool.tsx","../../../../../web/src/components/ai-elements/bash-tool.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/circle-stop.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/radio.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/terminal.ts","../../../../../web/src/components/ai-elements/todo-tool.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/trash.ts","../../../../../web/src/components/ai-elements/load-skill-tool.tsx","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/sparkles.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/list.ts","../../../../../web/node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.3/node_modules/lucide-react/src/icons/book-open.ts","../../../../../web/src/components/chat-interface.tsx","../../../../../web/src/app/%28main%29/session/%5Bid%5D/page.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-full border border-transparent px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1.5 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-all duration-200 overflow-hidden\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n ghost: \"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 [a&]:hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n data-variant={variant}\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n","\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport { ArrowDownIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { useCallback } from \"react\";\nimport { StickToBottom, useStickToBottomContext } from \"use-stick-to-bottom\";\n\nexport type ConversationProps = ComponentProps<typeof StickToBottom>;\n\nexport const Conversation = ({ className, ...props }: ConversationProps) => (\n <StickToBottom\n className={cn(\"relative flex-1 overflow-y-hidden\", className)}\n initial=\"smooth\"\n resize=\"smooth\"\n role=\"log\"\n {...props}\n />\n);\n\nexport type ConversationContentProps = ComponentProps<\n typeof StickToBottom.Content\n>;\n\nexport const ConversationContent = ({\n className,\n ...props\n}: ConversationContentProps) => (\n <StickToBottom.Content\n className={cn(\"flex flex-col gap-8 p-4\", className)}\n {...props}\n />\n);\n\nexport type ConversationEmptyStateProps = ComponentProps<\"div\"> & {\n title?: string;\n description?: string;\n icon?: React.ReactNode;\n};\n\nexport const ConversationEmptyState = ({\n className,\n title = \"No messages yet\",\n description = \"Start a conversation to see messages here\",\n icon,\n children,\n ...props\n}: ConversationEmptyStateProps) => (\n <div\n className={cn(\n \"flex size-full flex-col items-center justify-center gap-4 p-8 text-center\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon && (\n <div className=\"text-muted-foreground/50 p-4 rounded-2xl bg-muted/30\">\n {icon}\n </div>\n )}\n <div className=\"space-y-2\">\n <h3 className=\"font-semibold text-base text-foreground\">{title}</h3>\n {description && (\n <p className=\"text-muted-foreground text-sm max-w-xs\">{description}</p>\n )}\n </div>\n </>\n )}\n </div>\n);\n\nexport type ConversationScrollButtonProps = ComponentProps<typeof Button>;\n\nexport const ConversationScrollButton = ({\n className,\n ...props\n}: ConversationScrollButtonProps) => {\n const { isAtBottom, scrollToBottom } = useStickToBottomContext();\n\n const handleScrollToBottom = useCallback(() => {\n scrollToBottom();\n }, [scrollToBottom]);\n\n return (\n !isAtBottom && (\n <Button\n className={cn(\n \"absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted\",\n className\n )}\n onClick={handleScrollToBottom}\n size=\"icon\"\n type=\"button\"\n variant=\"outline\"\n {...props}\n >\n <ArrowDownIcon className=\"size-4\" />\n </Button>\n )\n );\n};\n","/*!---------------------------------------------------------------------------------------------\n * Copyright (c) StackBlitz. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { useCallback, useMemo, useRef, useState, } from \"react\";\nconst DEFAULT_SPRING_ANIMATION = {\n /**\n * A value from 0 to 1, on how much to damp the animation.\n * 0 means no damping, 1 means full damping.\n *\n * @default 0.7\n */\n damping: 0.7,\n /**\n * The stiffness of how fast/slow the animation gets up to speed.\n *\n * @default 0.05\n */\n stiffness: 0.05,\n /**\n * The inertial mass associated with the animation.\n * Higher numbers make the animation slower.\n *\n * @default 1.25\n */\n mass: 1.25,\n};\nconst STICK_TO_BOTTOM_OFFSET_PX = 70;\nconst SIXTY_FPS_INTERVAL_MS = 1000 / 60;\nconst RETAIN_ANIMATION_DURATION_MS = 350;\nlet mouseDown = false;\nglobalThis.document?.addEventListener(\"mousedown\", () => {\n mouseDown = true;\n});\nglobalThis.document?.addEventListener(\"mouseup\", () => {\n mouseDown = false;\n});\nglobalThis.document?.addEventListener(\"click\", () => {\n mouseDown = false;\n});\nexport const useStickToBottom = (options = {}) => {\n const [escapedFromLock, updateEscapedFromLock] = useState(false);\n const [isAtBottom, updateIsAtBottom] = useState(options.initial !== false);\n const [isNearBottom, setIsNearBottom] = useState(false);\n const optionsRef = useRef(null);\n optionsRef.current = options;\n const isSelecting = useCallback(() => {\n if (!mouseDown) {\n return false;\n }\n const selection = window.getSelection();\n if (!selection || !selection.rangeCount) {\n return false;\n }\n const range = selection.getRangeAt(0);\n return (range.commonAncestorContainer.contains(scrollRef.current) ||\n scrollRef.current?.contains(range.commonAncestorContainer));\n }, []);\n const setIsAtBottom = useCallback((isAtBottom) => {\n state.isAtBottom = isAtBottom;\n updateIsAtBottom(isAtBottom);\n }, []);\n const setEscapedFromLock = useCallback((escapedFromLock) => {\n state.escapedFromLock = escapedFromLock;\n updateEscapedFromLock(escapedFromLock);\n }, []);\n // biome-ignore lint/correctness/useExhaustiveDependencies: not needed\n const state = useMemo(() => {\n let lastCalculation;\n return {\n escapedFromLock,\n isAtBottom,\n resizeDifference: 0,\n accumulated: 0,\n velocity: 0,\n listeners: new Set(),\n get scrollTop() {\n return scrollRef.current?.scrollTop ?? 0;\n },\n set scrollTop(scrollTop) {\n if (scrollRef.current) {\n scrollRef.current.scrollTop = scrollTop;\n state.ignoreScrollToTop = scrollRef.current.scrollTop;\n }\n },\n get targetScrollTop() {\n if (!scrollRef.current || !contentRef.current) {\n return 0;\n }\n return (scrollRef.current.scrollHeight - 1 - scrollRef.current.clientHeight);\n },\n get calculatedTargetScrollTop() {\n if (!scrollRef.current || !contentRef.current) {\n return 0;\n }\n const { targetScrollTop } = this;\n if (!options.targetScrollTop) {\n return targetScrollTop;\n }\n if (lastCalculation?.targetScrollTop === targetScrollTop) {\n return lastCalculation.calculatedScrollTop;\n }\n const calculatedScrollTop = Math.max(Math.min(options.targetScrollTop(targetScrollTop, {\n scrollElement: scrollRef.current,\n contentElement: contentRef.current,\n }), targetScrollTop), 0);\n lastCalculation = { targetScrollTop, calculatedScrollTop };\n requestAnimationFrame(() => {\n lastCalculation = undefined;\n });\n return calculatedScrollTop;\n },\n get scrollDifference() {\n return this.calculatedTargetScrollTop - this.scrollTop;\n },\n get isNearBottom() {\n return this.scrollDifference <= STICK_TO_BOTTOM_OFFSET_PX;\n },\n };\n }, []);\n const scrollToBottom = useCallback((scrollOptions = {}) => {\n if (typeof scrollOptions === \"string\") {\n scrollOptions = { animation: scrollOptions };\n }\n if (!scrollOptions.preserveScrollPosition) {\n setIsAtBottom(true);\n }\n const waitElapsed = Date.now() + (Number(scrollOptions.wait) || 0);\n const behavior = mergeAnimations(optionsRef.current, scrollOptions.animation);\n const { ignoreEscapes = false } = scrollOptions;\n let durationElapsed;\n let startTarget = state.calculatedTargetScrollTop;\n if (scrollOptions.duration instanceof Promise) {\n scrollOptions.duration.finally(() => {\n durationElapsed = Date.now();\n });\n }\n else {\n durationElapsed = waitElapsed + (scrollOptions.duration ?? 0);\n }\n const next = async () => {\n const promise = new Promise(requestAnimationFrame).then(() => {\n if (!state.isAtBottom) {\n state.animation = undefined;\n return false;\n }\n const { scrollTop } = state;\n const tick = performance.now();\n const tickDelta = (tick - (state.lastTick ?? tick)) / SIXTY_FPS_INTERVAL_MS;\n state.animation || (state.animation = { behavior, promise, ignoreEscapes });\n if (state.animation.behavior === behavior) {\n state.lastTick = tick;\n }\n if (isSelecting()) {\n return next();\n }\n if (waitElapsed > Date.now()) {\n return next();\n }\n if (scrollTop < Math.min(startTarget, state.calculatedTargetScrollTop)) {\n if (state.animation?.behavior === behavior) {\n if (behavior === \"instant\") {\n state.scrollTop = state.calculatedTargetScrollTop;\n return next();\n }\n state.velocity =\n (behavior.damping * state.velocity +\n behavior.stiffness * state.scrollDifference) /\n behavior.mass;\n state.accumulated += state.velocity * tickDelta;\n state.scrollTop += state.accumulated;\n if (state.scrollTop !== scrollTop) {\n state.accumulated = 0;\n }\n }\n return next();\n }\n if (durationElapsed > Date.now()) {\n startTarget = state.calculatedTargetScrollTop;\n return next();\n }\n state.animation = undefined;\n /**\n * If we're still below the target, then queue\n * up another scroll to the bottom with the last\n * requested animatino.\n */\n if (state.scrollTop < state.calculatedTargetScrollTop) {\n return scrollToBottom({\n animation: mergeAnimations(optionsRef.current, optionsRef.current.resize),\n ignoreEscapes,\n duration: Math.max(0, durationElapsed - Date.now()) || undefined,\n });\n }\n return state.isAtBottom;\n });\n return promise.then((isAtBottom) => {\n requestAnimationFrame(() => {\n if (!state.animation) {\n state.lastTick = undefined;\n state.velocity = 0;\n }\n });\n return isAtBottom;\n });\n };\n if (scrollOptions.wait !== true) {\n state.animation = undefined;\n }\n if (state.animation?.behavior === behavior) {\n return state.animation.promise;\n }\n return next();\n }, [setIsAtBottom, isSelecting, state]);\n const stopScroll = useCallback(() => {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }, [setEscapedFromLock, setIsAtBottom]);\n const handleScroll = useCallback(({ target }) => {\n if (target !== scrollRef.current) {\n return;\n }\n const { scrollTop, ignoreScrollToTop } = state;\n let { lastScrollTop = scrollTop } = state;\n state.lastScrollTop = scrollTop;\n state.ignoreScrollToTop = undefined;\n if (ignoreScrollToTop && ignoreScrollToTop > scrollTop) {\n /**\n * When the user scrolls up while the animation plays, the `scrollTop` may\n * not come in separate events; if this happens, to make sure `isScrollingUp`\n * is correct, set the lastScrollTop to the ignored event.\n */\n lastScrollTop = ignoreScrollToTop;\n }\n setIsNearBottom(state.isNearBottom);\n /**\n * Scroll events may come before a ResizeObserver event,\n * so in order to ignore resize events correctly we use a\n * timeout.\n *\n * @see https://github.com/WICG/resize-observer/issues/25#issuecomment-248757228\n */\n setTimeout(() => {\n /**\n * When theres a resize difference ignore the resize event.\n */\n if (state.resizeDifference || scrollTop === ignoreScrollToTop) {\n return;\n }\n if (isSelecting()) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n return;\n }\n const isScrollingDown = scrollTop > lastScrollTop;\n const isScrollingUp = scrollTop < lastScrollTop;\n if (state.animation?.ignoreEscapes) {\n state.scrollTop = lastScrollTop;\n return;\n }\n if (isScrollingUp) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }\n if (isScrollingDown) {\n setEscapedFromLock(false);\n }\n if (!state.escapedFromLock && state.isNearBottom) {\n setIsAtBottom(true);\n }\n }, 1);\n }, [setEscapedFromLock, setIsAtBottom, isSelecting, state]);\n const handleWheel = useCallback(({ target, deltaY }) => {\n let element = target;\n while (![\"scroll\", \"auto\"].includes(getComputedStyle(element).overflow)) {\n if (!element.parentElement) {\n return;\n }\n element = element.parentElement;\n }\n /**\n * The browser may cancel the scrolling from the mouse wheel\n * if we update it from the animation in meantime.\n * To prevent this, always escape when the wheel is scrolled up.\n */\n if (element === scrollRef.current &&\n deltaY < 0 &&\n scrollRef.current.scrollHeight > scrollRef.current.clientHeight &&\n !state.animation?.ignoreEscapes) {\n setEscapedFromLock(true);\n setIsAtBottom(false);\n }\n }, [setEscapedFromLock, setIsAtBottom, state]);\n const scrollRef = useRefCallback((scroll) => {\n scrollRef.current?.removeEventListener(\"scroll\", handleScroll);\n scrollRef.current?.removeEventListener(\"wheel\", handleWheel);\n scroll?.addEventListener(\"scroll\", handleScroll, { passive: true });\n scroll?.addEventListener(\"wheel\", handleWheel, { passive: true });\n }, []);\n const contentRef = useRefCallback((content) => {\n state.resizeObserver?.disconnect();\n if (!content) {\n return;\n }\n let previousHeight;\n state.resizeObserver = new ResizeObserver(([entry]) => {\n const { height } = entry.contentRect;\n const difference = height - (previousHeight ?? height);\n state.resizeDifference = difference;\n /**\n * Sometimes the browser can overscroll past the target,\n * so check for this and adjust appropriately.\n */\n if (state.scrollTop > state.targetScrollTop) {\n state.scrollTop = state.targetScrollTop;\n }\n setIsNearBottom(state.isNearBottom);\n if (difference >= 0) {\n /**\n * If it's a positive resize, scroll to the bottom when\n * we're already at the bottom.\n */\n const animation = mergeAnimations(optionsRef.current, previousHeight\n ? optionsRef.current.resize\n : optionsRef.current.initial);\n scrollToBottom({\n animation,\n wait: true,\n preserveScrollPosition: true,\n duration: animation === \"instant\" ? undefined : RETAIN_ANIMATION_DURATION_MS,\n });\n }\n else {\n /**\n * Else if it's a negative resize, check if we're near the bottom\n * if we are want to un-escape from the lock, because the resize\n * could have caused the container to be at the bottom.\n */\n if (state.isNearBottom) {\n setEscapedFromLock(false);\n setIsAtBottom(true);\n }\n }\n previousHeight = height;\n /**\n * Reset the resize difference after the scroll event\n * has fired. Requires a rAF to wait for the scroll event,\n * and a setTimeout to wait for the other timeout we have in\n * resizeObserver in case the scroll event happens after the\n * resize event.\n */\n requestAnimationFrame(() => {\n setTimeout(() => {\n if (state.resizeDifference === difference) {\n state.resizeDifference = 0;\n }\n }, 1);\n });\n });\n state.resizeObserver?.observe(content);\n }, []);\n return {\n contentRef,\n scrollRef,\n scrollToBottom,\n stopScroll,\n isAtBottom: isAtBottom || isNearBottom,\n isNearBottom,\n escapedFromLock,\n state,\n };\n};\nfunction useRefCallback(callback, deps) {\n // biome-ignore lint/correctness/useExhaustiveDependencies: not needed\n const result = useCallback((ref) => {\n result.current = ref;\n return callback(ref);\n }, deps);\n return result;\n}\nconst animationCache = new Map();\nfunction mergeAnimations(...animations) {\n const result = { ...DEFAULT_SPRING_ANIMATION };\n let instant = false;\n for (const animation of animations) {\n if (animation === \"instant\") {\n instant = true;\n continue;\n }\n if (typeof animation !== \"object\") {\n continue;\n }\n instant = false;\n result.damping = animation.damping ?? result.damping;\n result.stiffness = animation.stiffness ?? result.stiffness;\n result.mass = animation.mass ?? result.mass;\n }\n const key = JSON.stringify(result);\n if (!animationCache.has(key)) {\n animationCache.set(key, Object.freeze(result));\n }\n return instant ? \"instant\" : animationCache.get(key);\n}\n","/*!---------------------------------------------------------------------------------------------\n * Copyright (c) StackBlitz. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport { createContext, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, } from \"react\";\nimport { useStickToBottom, } from \"./useStickToBottom.js\";\nconst StickToBottomContext = createContext(null);\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nexport function StickToBottom({ instance, children, resize, initial, mass, damping, stiffness, targetScrollTop: currentTargetScrollTop, contextRef, ...props }) {\n const customTargetScrollTop = useRef(null);\n const targetScrollTop = React.useCallback((target, elements) => {\n const get = context?.targetScrollTop ?? currentTargetScrollTop;\n return get?.(target, elements) ?? target;\n }, [currentTargetScrollTop]);\n const defaultInstance = useStickToBottom({\n mass,\n damping,\n stiffness,\n resize,\n initial,\n targetScrollTop,\n });\n const { scrollRef, contentRef, scrollToBottom, stopScroll, isAtBottom, escapedFromLock, state, } = instance ?? defaultInstance;\n const context = useMemo(() => ({\n scrollToBottom,\n stopScroll,\n scrollRef,\n isAtBottom,\n escapedFromLock,\n contentRef,\n state,\n get targetScrollTop() {\n return customTargetScrollTop.current;\n },\n set targetScrollTop(targetScrollTop) {\n customTargetScrollTop.current = targetScrollTop;\n },\n }), [\n scrollToBottom,\n isAtBottom,\n contentRef,\n scrollRef,\n stopScroll,\n escapedFromLock,\n state,\n ]);\n useImperativeHandle(contextRef, () => context, [context]);\n useIsomorphicLayoutEffect(() => {\n if (!scrollRef.current) {\n return;\n }\n if (getComputedStyle(scrollRef.current).overflow === \"visible\") {\n scrollRef.current.style.overflow = \"auto\";\n }\n }, []);\n return (React.createElement(StickToBottomContext.Provider, { value: context },\n React.createElement(\"div\", { ...props }, typeof children === \"function\" ? children(context) : children)));\n}\n(function (StickToBottom) {\n function Content({ children, scrollClassName, ...props }) {\n const context = useStickToBottomContext();\n return (React.createElement(\"div\", { ref: context.scrollRef, style: {\n height: \"100%\",\n width: \"100%\",\n scrollbarGutter: \"stable both-edges\",\n }, className: scrollClassName },\n React.createElement(\"div\", { ...props, ref: context.contentRef }, typeof children === \"function\" ? children(context) : children)));\n }\n StickToBottom.Content = Content;\n})(StickToBottom || (StickToBottom = {}));\n/**\n * Use this hook inside a <StickToBottom> component to gain access to whether the component is at the bottom of the scrollable area.\n */\nexport function useStickToBottomContext() {\n const context = useContext(StickToBottomContext);\n if (!context) {\n throw new Error(\"use-stick-to-bottom component context must be used within a StickToBottom component\");\n }\n return context;\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 5v14', key: 's699le' }],\n ['path', { d: 'm19 12-7 7-7-7', key: '1idqje' }],\n];\n\n/**\n * @component @name ArrowDown\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgNXYxNCIgLz4KICA8cGF0aCBkPSJtMTkgMTItNyA3LTctNyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-down\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowDown = createLucideIcon('arrow-down', __iconNode);\n\nexport default ArrowDown;\n","import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Separator } from \"@/components/ui/separator\"\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\n {\n variants: {\n orientation: {\n horizontal:\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\n vertical:\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n },\n }\n)\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean\n}) {\n const Comp = asChild ? Slot : \"div\"\n\n return (\n <Comp\n className={cn(\n \"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n \"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n}\n","/**\n * Character codes.\n *\n * This module is compiled away!\n *\n * micromark works based on character codes.\n * This module contains constants for the ASCII block and the replacement\n * character.\n * A couple of them are handled in a special way, such as the line endings\n * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal\n * tab) and its expansion based on what column it’s at (virtual space),\n * and the end-of-file (eof) character.\n * As values are preprocessed before handling them, the actual characters LF,\n * CR, HT, and NUL (which is present as the replacement character), are\n * guaranteed to not exist.\n *\n * Unicode basic latin block.\n */\nexport const codes = /** @type {const} */ ({\n carriageReturn: -5,\n lineFeed: -4,\n carriageReturnLineFeed: -3,\n horizontalTab: -2,\n virtualSpace: -1,\n eof: null,\n nul: 0,\n soh: 1,\n stx: 2,\n etx: 3,\n eot: 4,\n enq: 5,\n ack: 6,\n bel: 7,\n bs: 8,\n ht: 9, // `\\t`\n lf: 10, // `\\n`\n vt: 11, // `\\v`\n ff: 12, // `\\f`\n cr: 13, // `\\r`\n so: 14,\n si: 15,\n dle: 16,\n dc1: 17,\n dc2: 18,\n dc3: 19,\n dc4: 20,\n nak: 21,\n syn: 22,\n etb: 23,\n can: 24,\n em: 25,\n sub: 26,\n esc: 27,\n fs: 28,\n gs: 29,\n rs: 30,\n us: 31,\n space: 32,\n exclamationMark: 33, // `!`\n quotationMark: 34, // `\"`\n numberSign: 35, // `#`\n dollarSign: 36, // `$`\n percentSign: 37, // `%`\n ampersand: 38, // `&`\n apostrophe: 39, // `'`\n leftParenthesis: 40, // `(`\n rightParenthesis: 41, // `)`\n asterisk: 42, // `*`\n plusSign: 43, // `+`\n comma: 44, // `,`\n dash: 45, // `-`\n dot: 46, // `.`\n slash: 47, // `/`\n digit0: 48, // `0`\n digit1: 49, // `1`\n digit2: 50, // `2`\n digit3: 51, // `3`\n digit4: 52, // `4`\n digit5: 53, // `5`\n digit6: 54, // `6`\n digit7: 55, // `7`\n digit8: 56, // `8`\n digit9: 57, // `9`\n colon: 58, // `:`\n semicolon: 59, // `;`\n lessThan: 60, // `<`\n equalsTo: 61, // `=`\n greaterThan: 62, // `>`\n questionMark: 63, // `?`\n atSign: 64, // `@`\n uppercaseA: 65, // `A`\n uppercaseB: 66, // `B`\n uppercaseC: 67, // `C`\n uppercaseD: 68, // `D`\n uppercaseE: 69, // `E`\n uppercaseF: 70, // `F`\n uppercaseG: 71, // `G`\n uppercaseH: 72, // `H`\n uppercaseI: 73, // `I`\n uppercaseJ: 74, // `J`\n uppercaseK: 75, // `K`\n uppercaseL: 76, // `L`\n uppercaseM: 77, // `M`\n uppercaseN: 78, // `N`\n uppercaseO: 79, // `O`\n uppercaseP: 80, // `P`\n uppercaseQ: 81, // `Q`\n uppercaseR: 82, // `R`\n uppercaseS: 83, // `S`\n uppercaseT: 84, // `T`\n uppercaseU: 85, // `U`\n uppercaseV: 86, // `V`\n uppercaseW: 87, // `W`\n uppercaseX: 88, // `X`\n uppercaseY: 89, // `Y`\n uppercaseZ: 90, // `Z`\n leftSquareBracket: 91, // `[`\n backslash: 92, // `\\`\n rightSquareBracket: 93, // `]`\n caret: 94, // `^`\n underscore: 95, // `_`\n graveAccent: 96, // `` ` ``\n lowercaseA: 97, // `a`\n lowercaseB: 98, // `b`\n lowercaseC: 99, // `c`\n lowercaseD: 100, // `d`\n lowercaseE: 101, // `e`\n lowercaseF: 102, // `f`\n lowercaseG: 103, // `g`\n lowercaseH: 104, // `h`\n lowercaseI: 105, // `i`\n lowercaseJ: 106, // `j`\n lowercaseK: 107, // `k`\n lowercaseL: 108, // `l`\n lowercaseM: 109, // `m`\n lowercaseN: 110, // `n`\n lowercaseO: 111, // `o`\n lowercaseP: 112, // `p`\n lowercaseQ: 113, // `q`\n lowercaseR: 114, // `r`\n lowercaseS: 115, // `s`\n lowercaseT: 116, // `t`\n lowercaseU: 117, // `u`\n lowercaseV: 118, // `v`\n lowercaseW: 119, // `w`\n lowercaseX: 120, // `x`\n lowercaseY: 121, // `y`\n lowercaseZ: 122, // `z`\n leftCurlyBrace: 123, // `{`\n verticalBar: 124, // `|`\n rightCurlyBrace: 125, // `}`\n tilde: 126, // `~`\n del: 127,\n // Unicode Specials block.\n byteOrderMarker: 65_279,\n // Unicode Specials block.\n replacementCharacter: 65_533 // `�`\n})\n","// src/index.ts\nimport { codes as codes2 } from \"micromark-util-symbol\";\n\n// src/ext/attention.ts\nimport { ok as assert } from \"devlop\";\nimport {\n classifyCharacter,\n classifyPrecedingCharacter,\n isCjk,\n isCjkOrIvs,\n isCodeHighSurrogate,\n isCodeLowSurrogate,\n isNonCjkPunctuation,\n isSpaceOrPunctuation,\n isUnicodeWhitespace,\n TwoPreviousCode,\n tryGetGenuineNextCode,\n tryGetGenuinePreviousCode\n} from \"micromark-extension-cjk-friendly-util\";\nimport { push, splice } from \"micromark-util-chunked\";\nimport { resolveAll } from \"micromark-util-resolve-all\";\nimport { codes, types } from \"micromark-util-symbol\";\nvar attention = {\n name: \"attention\",\n resolveAll: resolveAllAttention,\n tokenize: tokenizeAttention\n};\nfunction resolveAllAttention(events, context) {\n let index = -1;\n let open;\n let group;\n let text;\n let openingSequence;\n let closingSequence;\n let use;\n let nextEvents;\n let offset;\n while (++index < events.length) {\n if (events[index][0] === \"enter\" && events[index][1].type === \"attentionSequence\" && events[index][1]._close) {\n open = index;\n while (open--) {\n if (events[open][0] === \"exit\" && events[open][1].type === \"attentionSequence\" && events[open][1]._open && // If the markers are the same:\n context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0)) {\n if ((events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !((events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3)) {\n continue;\n }\n use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1;\n const start = { ...events[open][1].end };\n const end = { ...events[index][1].start };\n movePoint(start, -use);\n movePoint(end, use);\n openingSequence = {\n type: use > 1 ? types.strongSequence : types.emphasisSequence,\n start,\n end: { ...events[open][1].end }\n };\n closingSequence = {\n type: use > 1 ? types.strongSequence : types.emphasisSequence,\n start: { ...events[index][1].start },\n end\n };\n text = {\n type: use > 1 ? types.strongText : types.emphasisText,\n start: { ...events[open][1].end },\n end: { ...events[index][1].start }\n };\n group = {\n type: use > 1 ? types.strong : types.emphasis,\n start: { ...openingSequence.start },\n end: { ...closingSequence.end }\n };\n events[open][1].end = { ...openingSequence.start };\n events[index][1].start = { ...closingSequence.end };\n nextEvents = [];\n if (events[open][1].end.offset - events[open][1].start.offset) {\n nextEvents = push(nextEvents, [\n [\"enter\", events[open][1], context],\n [\"exit\", events[open][1], context]\n ]);\n }\n nextEvents = push(nextEvents, [\n [\"enter\", group, context],\n [\"enter\", openingSequence, context],\n [\"exit\", openingSequence, context],\n [\"enter\", text, context]\n ]);\n assert(\n context.parser.constructs.insideSpan.null,\n \"expected `insideSpan` to be populated\"\n );\n nextEvents = push(\n nextEvents,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + 1, index),\n context\n )\n );\n nextEvents = push(nextEvents, [\n [\"exit\", text, context],\n [\"enter\", closingSequence, context],\n [\"exit\", closingSequence, context],\n [\"exit\", group, context]\n ]);\n if (events[index][1].end.offset - events[index][1].start.offset) {\n offset = 2;\n nextEvents = push(nextEvents, [\n [\"enter\", events[index][1], context],\n [\"exit\", events[index][1], context]\n ]);\n } else {\n offset = 0;\n }\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - offset - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === \"attentionSequence\") {\n events[index][1].type = \"data\";\n }\n }\n return events;\n}\nfunction tokenizeAttention(effects, ok) {\n const attentionMarkers = this.parser.constructs.attentionMarkers.null;\n const { now, sliceSerialize, previous: tentativePrevious } = this;\n const previous = isCodeLowSurrogate(tentativePrevious) ? (\n // second (lower) surrogate likely to be preceded by first (higher) surrogate\n tryGetGenuinePreviousCode(tentativePrevious, now(), sliceSerialize)\n ) : tentativePrevious;\n const before = classifyCharacter(previous);\n const twoPrevious = new TwoPreviousCode(previous, now(), sliceSerialize);\n const beforePrimary = classifyPrecedingCharacter(\n before,\n twoPrevious.value.bind(twoPrevious),\n previous\n );\n let marker;\n return start;\n function start(code) {\n assert(\n code === codes.asterisk || code === codes.underscore,\n \"expected asterisk or underscore\"\n );\n marker = code;\n effects.enter(\"attentionSequence\");\n return inside(code);\n }\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n const token = effects.exit(\"attentionSequence\");\n const next = isCodeHighSurrogate(code) ? tryGetGenuineNextCode(code, now(), sliceSerialize) : code;\n const after = classifyCharacter(next);\n assert(attentionMarkers, \"expected `attentionMarkers` to be populated\");\n const beforeNonCjkPunctuation = isNonCjkPunctuation(beforePrimary);\n const beforeSpaceOrNonCjkPunctuation = beforeNonCjkPunctuation || isUnicodeWhitespace(beforePrimary);\n const afterNonCjkPunctuation = isNonCjkPunctuation(after);\n const afterSpaceOrNonCjkPunctuation = afterNonCjkPunctuation || isUnicodeWhitespace(after);\n const beforeCjkOrIvs = isCjkOrIvs(beforePrimary);\n const open = !afterSpaceOrNonCjkPunctuation || afterNonCjkPunctuation && (beforeSpaceOrNonCjkPunctuation || beforeCjkOrIvs) || attentionMarkers.includes(code);\n const close = !beforeSpaceOrNonCjkPunctuation || beforeNonCjkPunctuation && (afterSpaceOrNonCjkPunctuation || isCjk(after)) || attentionMarkers.includes(previous);\n token._open = Boolean(\n marker === codes.asterisk ? open : open && (isSpaceOrPunctuation(beforePrimary) || !close)\n );\n token._close = Boolean(\n marker === codes.asterisk ? close : close && (isSpaceOrPunctuation(after) || !open)\n );\n return ok(code);\n }\n}\nfunction movePoint(point, offset) {\n point.column += offset;\n point.offset += offset;\n point._bufferIndex += offset;\n}\n\n// src/index.ts\nfunction cjkFriendlyExtension() {\n return {\n text: {\n [codes2.asterisk]: attention,\n [codes2.underscore]: attention\n },\n insideSpan: { null: [attention] }\n };\n}\nexport {\n cjkFriendlyExtension\n};\n","/**\n * This module is compiled away!\n *\n * Parsing markdown comes with a couple of constants, such as minimum or maximum\n * sizes of certain sequences.\n * Additionally, there are a couple symbols used inside micromark.\n * These are all defined here, but compiled away by scripts.\n */\nexport const constants = /** @type {const} */ ({\n attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*`\n attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a`\n atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t.\n autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many.\n autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many.\n cdataOpeningString: 'CDATA[', // And preceded by `<![`.\n characterGroupPunctuation: 2, // Symbol used to indicate a character is punctuation\n characterGroupWhitespace: 1, // Symbol used to indicate a character is whitespace\n characterReferenceDecimalSizeMax: 7, // `&#9999999;`.\n characterReferenceHexadecimalSizeMax: 6, // `&#xff9999;`.\n characterReferenceNamedSizeMax: 31, // `&CounterClockwiseContourIntegral;`.\n codeFencedSequenceSizeMin: 3, // At least 3 ticks or tildes are needed.\n contentTypeContent: 'content',\n contentTypeDocument: 'document',\n contentTypeFlow: 'flow',\n contentTypeString: 'string',\n contentTypeText: 'text',\n hardBreakPrefixSizeMin: 2, // At least 2 trailing spaces are needed.\n htmlBasic: 6, // Symbol for `<div`\n htmlCdata: 5, // Symbol for `<![CDATA[]]>`\n htmlComment: 2, // Symbol for `<!---->`\n htmlComplete: 7, // Symbol for `<x>`\n htmlDeclaration: 4, // Symbol for `<!doctype>`\n htmlInstruction: 3, // Symbol for `<?php?>`\n htmlRawSizeMax: 8, // Length of `textarea`.\n htmlRaw: 1, // Symbol for `<script>`\n linkResourceDestinationBalanceMax: 32, // See: <https://spec.commonmark.org/0.30/#link-destination>, <https://github.com/remarkjs/react-markdown/issues/658#issuecomment-984345577>\n linkReferenceSizeMax: 999, // See: <https://spec.commonmark.org/0.30/#link-label>\n listItemValueSizeMax: 10, // See: <https://spec.commonmark.org/0.30/#ordered-list-marker>\n numericBaseDecimal: 10,\n numericBaseHexadecimal: 0x10,\n tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark.\n thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed.\n v8MaxSafeChunkSize: 10_000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks.\n})\n","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/categoryUtil.ts\nimport { constants as constants2 } from \"micromark-util-symbol\";\n\n// src/classifyCharacter.ts\nimport { markdownLineEndingOrSpace } from \"micromark-util-character\";\nimport { codes, constants } from \"micromark-util-symbol\";\n\n// src/characterWithNonBmp.ts\nimport { eastAsianWidthType } from \"get-east-asian-width\";\nfunction isEmoji(uc) {\n return /^\\p{Emoji_Presentation}/u.test(String.fromCodePoint(uc));\n}\nfunction cjkOrIvs(uc) {\n if (!uc || uc < 4352) {\n return false;\n }\n const eaw = eastAsianWidthType(uc);\n switch (eaw) {\n case \"fullwidth\":\n case \"halfwidth\":\n return true;\n // never be emoji\n case \"wide\":\n return !isEmoji(uc);\n case \"narrow\":\n return false;\n case \"ambiguous\":\n return 917760 <= uc && uc <= 917999 ? null : false;\n case \"neutral\":\n return /^\\p{sc=Hangul}/u.test(String.fromCodePoint(uc));\n }\n}\nfunction isCjkAmbiguousPunctuation(main, vs) {\n if (vs !== 65025 || !main || main < 8216) return false;\n return main === 8216 || main === 8217 || main === 8220 || main === 8221;\n}\nfunction nonEmojiGeneralUseVS(code) {\n return code !== null && code >= 65024 && code <= 65038;\n}\nvar unicodePunctuation = regexCheck(/\\p{P}|\\p{S}/u);\nvar unicodeWhitespace = regexCheck(/\\s/);\nfunction regexCheck(regex) {\n return check;\n function check(code) {\n return code !== null && code > -1 && regex.test(String.fromCodePoint(code));\n }\n}\n\n// src/classifyCharacter.ts\nvar constantsEx;\n((constantsEx2) => {\n constantsEx2.spaceOrPunctuation = 3;\n constantsEx2.cjk = 4096;\n constantsEx2.cjkPunctuation = 4098;\n constantsEx2.ivs = 8192;\n constantsEx2.cjkOrIvs = 12288;\n constantsEx2.nonEmojiGeneralUseVS = 16384;\n constantsEx2.variationSelector = 24576;\n constantsEx2.ivsToCjkRightShift = 1;\n})(constantsEx || (constantsEx = {}));\nfunction classifyCharacter(code) {\n if (code === codes.eof || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return constants.characterGroupWhitespace;\n }\n let value = 0;\n if (code >= 4352) {\n if (nonEmojiGeneralUseVS(code)) {\n return constantsEx.nonEmojiGeneralUseVS;\n }\n switch (cjkOrIvs(code)) {\n case null:\n return constantsEx.ivs;\n case true:\n value |= constantsEx.cjk;\n break;\n }\n }\n if (unicodePunctuation(code)) {\n value |= constants.characterGroupPunctuation;\n }\n return value;\n}\nfunction classifyPrecedingCharacter(before, get2Previous, previous) {\n if (!isNonEmojiGeneralUseVS(before)) {\n return before;\n }\n const twoPrevious = get2Previous();\n const twoBefore = classifyCharacter(twoPrevious);\n return !twoPrevious || isUnicodeWhitespace(twoBefore) ? before : isCjkAmbiguousPunctuation(twoPrevious, previous) ? constantsEx.cjkPunctuation : stripIvs(twoBefore);\n}\nfunction stripIvs(twoBefore) {\n return twoBefore & ~constantsEx.ivs;\n}\n\n// src/categoryUtil.ts\nfunction isUnicodeWhitespace(category) {\n return Boolean(category & constants2.characterGroupWhitespace);\n}\nfunction isNonCjkPunctuation(category) {\n return (category & constantsEx.cjkPunctuation) === constants2.characterGroupPunctuation;\n}\nfunction isCjk(category) {\n return Boolean(category & constantsEx.cjk);\n}\nfunction isIvs(category) {\n return category === constantsEx.ivs;\n}\nfunction isCjkOrIvs(category) {\n return Boolean(category & constantsEx.cjkOrIvs);\n}\nfunction isNonEmojiGeneralUseVS(category) {\n return category === constantsEx.nonEmojiGeneralUseVS;\n}\nfunction isSpaceOrPunctuation(category) {\n return Boolean(category & constantsEx.spaceOrPunctuation);\n}\n\n// src/codeUtil.ts\nfunction isCodeHighSurrogate(code) {\n return Boolean(code && code >= 55296 && code <= 56319);\n}\nfunction isCodeLowSurrogate(code) {\n return Boolean(code && code >= 56320 && code <= 57343);\n}\nfunction tryGetGenuinePreviousCode(code, nowPoint, sliceSerialize) {\n if (nowPoint._bufferIndex < 2) {\n return code;\n }\n const previousBuffer = sliceSerialize({\n // take 2 characters (code units)\n start: { ...nowPoint, _bufferIndex: nowPoint._bufferIndex - 2 },\n end: nowPoint\n });\n const previousCandidate = previousBuffer.codePointAt(0);\n return previousCandidate && previousCandidate >= 65536 ? previousCandidate : code;\n}\nfunction tryGetCodeTwoBefore(previousCode, nowPoint, sliceSerialize) {\n const previousWidth = previousCode >= 65536 ? 2 : 1;\n if (nowPoint._bufferIndex < 1 + previousWidth) {\n return null;\n }\n const idealStart = nowPoint._bufferIndex - previousWidth - 2;\n const twoPreviousBuffer = sliceSerialize({\n // take 1--2 character\n start: {\n ...nowPoint,\n _bufferIndex: idealStart >= 0 ? idealStart : 0\n },\n end: {\n ...nowPoint,\n _bufferIndex: nowPoint._bufferIndex - previousWidth\n }\n });\n const twoPreviousLast = twoPreviousBuffer.charCodeAt(\n twoPreviousBuffer.length - 1\n );\n if (Number.isNaN(twoPreviousLast)) {\n return null;\n }\n if (twoPreviousBuffer.length < 2 || twoPreviousLast < 56320 || 57343 < twoPreviousLast) {\n return twoPreviousLast;\n }\n const twoPreviousCandidate = twoPreviousBuffer.codePointAt(0);\n if (twoPreviousCandidate && twoPreviousCandidate >= 65536) {\n return twoPreviousCandidate;\n }\n return twoPreviousLast;\n}\nvar TwoPreviousCode = class {\n /**\n * @see {@link tryGetCodeTwoBefore}\n *\n * @param previousCode a previous code point. Should be greater than 65,535 if it represents a [Supplementary Character](https://www.unicode.org/glossary/#supplementary_character).\n * @param nowPoint `this.now()` (`this` = `TokenizeContext`)\n * @param sliceSerialize `this.sliceSerialize` (`this` = `TokenizeContext`)\n */\n constructor(previousCode, nowPoint, sliceSerialize) {\n this.previousCode = previousCode;\n this.nowPoint = nowPoint;\n this.sliceSerialize = sliceSerialize;\n __publicField(this, \"cachedValue\");\n }\n /**\n * Returns the return value of {@link tryGetCodeTwoBefore}.\n *\n * If the value has not been computed yet, it will be computed and cached.\n *\n * @see {@link tryGetCodeTwoBefore}\n *\n * @returns a value greater than 65,535 if the code point two positions before represents a [Supplementary Character](https://www.unicode.org/glossary/#supplementary_character), a value less than 65,536 for a [BMP Character](https://www.unicode.org/glossary/#bmp_character), or `null` if not found\n */\n value() {\n if (this.cachedValue === void 0) {\n this.cachedValue = tryGetCodeTwoBefore(\n this.previousCode,\n this.nowPoint,\n this.sliceSerialize\n );\n }\n return this.cachedValue;\n }\n};\nfunction tryGetGenuineNextCode(code, nowPoint, sliceSerialize) {\n const nextCandidate = sliceSerialize({\n start: nowPoint,\n end: { ...nowPoint, _bufferIndex: nowPoint._bufferIndex + 2 }\n }).codePointAt(0);\n return nextCandidate && nextCandidate >= 65536 ? nextCandidate : code;\n}\nexport {\n TwoPreviousCode,\n classifyCharacter,\n classifyPrecedingCharacter,\n constantsEx,\n isCjk,\n isCjkOrIvs,\n isCodeHighSurrogate,\n isCodeLowSurrogate,\n isIvs,\n isNonCjkPunctuation,\n isNonEmojiGeneralUseVS,\n isSpaceOrPunctuation,\n isUnicodeWhitespace,\n tryGetCodeTwoBefore,\n tryGetGenuineNextCode,\n tryGetGenuinePreviousCode\n};\n","// Generated code.\n\nfunction isAmbiguous(x) {\n\treturn x === 0xA1\n\t\t|| x === 0xA4\n\t\t|| x === 0xA7\n\t\t|| x === 0xA8\n\t\t|| x === 0xAA\n\t\t|| x === 0xAD\n\t\t|| x === 0xAE\n\t\t|| x >= 0xB0 && x <= 0xB4\n\t\t|| x >= 0xB6 && x <= 0xBA\n\t\t|| x >= 0xBC && x <= 0xBF\n\t\t|| x === 0xC6\n\t\t|| x === 0xD0\n\t\t|| x === 0xD7\n\t\t|| x === 0xD8\n\t\t|| x >= 0xDE && x <= 0xE1\n\t\t|| x === 0xE6\n\t\t|| x >= 0xE8 && x <= 0xEA\n\t\t|| x === 0xEC\n\t\t|| x === 0xED\n\t\t|| x === 0xF0\n\t\t|| x === 0xF2\n\t\t|| x === 0xF3\n\t\t|| x >= 0xF7 && x <= 0xFA\n\t\t|| x === 0xFC\n\t\t|| x === 0xFE\n\t\t|| x === 0x101\n\t\t|| x === 0x111\n\t\t|| x === 0x113\n\t\t|| x === 0x11B\n\t\t|| x === 0x126\n\t\t|| x === 0x127\n\t\t|| x === 0x12B\n\t\t|| x >= 0x131 && x <= 0x133\n\t\t|| x === 0x138\n\t\t|| x >= 0x13F && x <= 0x142\n\t\t|| x === 0x144\n\t\t|| x >= 0x148 && x <= 0x14B\n\t\t|| x === 0x14D\n\t\t|| x === 0x152\n\t\t|| x === 0x153\n\t\t|| x === 0x166\n\t\t|| x === 0x167\n\t\t|| x === 0x16B\n\t\t|| x === 0x1CE\n\t\t|| x === 0x1D0\n\t\t|| x === 0x1D2\n\t\t|| x === 0x1D4\n\t\t|| x === 0x1D6\n\t\t|| x === 0x1D8\n\t\t|| x === 0x1DA\n\t\t|| x === 0x1DC\n\t\t|| x === 0x251\n\t\t|| x === 0x261\n\t\t|| x === 0x2C4\n\t\t|| x === 0x2C7\n\t\t|| x >= 0x2C9 && x <= 0x2CB\n\t\t|| x === 0x2CD\n\t\t|| x === 0x2D0\n\t\t|| x >= 0x2D8 && x <= 0x2DB\n\t\t|| x === 0x2DD\n\t\t|| x === 0x2DF\n\t\t|| x >= 0x300 && x <= 0x36F\n\t\t|| x >= 0x391 && x <= 0x3A1\n\t\t|| x >= 0x3A3 && x <= 0x3A9\n\t\t|| x >= 0x3B1 && x <= 0x3C1\n\t\t|| x >= 0x3C3 && x <= 0x3C9\n\t\t|| x === 0x401\n\t\t|| x >= 0x410 && x <= 0x44F\n\t\t|| x === 0x451\n\t\t|| x === 0x2010\n\t\t|| x >= 0x2013 && x <= 0x2016\n\t\t|| x === 0x2018\n\t\t|| x === 0x2019\n\t\t|| x === 0x201C\n\t\t|| x === 0x201D\n\t\t|| x >= 0x2020 && x <= 0x2022\n\t\t|| x >= 0x2024 && x <= 0x2027\n\t\t|| x === 0x2030\n\t\t|| x === 0x2032\n\t\t|| x === 0x2033\n\t\t|| x === 0x2035\n\t\t|| x === 0x203B\n\t\t|| x === 0x203E\n\t\t|| x === 0x2074\n\t\t|| x === 0x207F\n\t\t|| x >= 0x2081 && x <= 0x2084\n\t\t|| x === 0x20AC\n\t\t|| x === 0x2103\n\t\t|| x === 0x2105\n\t\t|| x === 0x2109\n\t\t|| x === 0x2113\n\t\t|| x === 0x2116\n\t\t|| x === 0x2121\n\t\t|| x === 0x2122\n\t\t|| x === 0x2126\n\t\t|| x === 0x212B\n\t\t|| x === 0x2153\n\t\t|| x === 0x2154\n\t\t|| x >= 0x215B && x <= 0x215E\n\t\t|| x >= 0x2160 && x <= 0x216B\n\t\t|| x >= 0x2170 && x <= 0x2179\n\t\t|| x === 0x2189\n\t\t|| x >= 0x2190 && x <= 0x2199\n\t\t|| x === 0x21B8\n\t\t|| x === 0x21B9\n\t\t|| x === 0x21D2\n\t\t|| x === 0x21D4\n\t\t|| x === 0x21E7\n\t\t|| x === 0x2200\n\t\t|| x === 0x2202\n\t\t|| x === 0x2203\n\t\t|| x === 0x2207\n\t\t|| x === 0x2208\n\t\t|| x === 0x220B\n\t\t|| x === 0x220F\n\t\t|| x === 0x2211\n\t\t|| x === 0x2215\n\t\t|| x === 0x221A\n\t\t|| x >= 0x221D && x <= 0x2220\n\t\t|| x === 0x2223\n\t\t|| x === 0x2225\n\t\t|| x >= 0x2227 && x <= 0x222C\n\t\t|| x === 0x222E\n\t\t|| x >= 0x2234 && x <= 0x2237\n\t\t|| x === 0x223C\n\t\t|| x === 0x223D\n\t\t|| x === 0x2248\n\t\t|| x === 0x224C\n\t\t|| x === 0x2252\n\t\t|| x === 0x2260\n\t\t|| x === 0x2261\n\t\t|| x >= 0x2264 && x <= 0x2267\n\t\t|| x === 0x226A\n\t\t|| x === 0x226B\n\t\t|| x === 0x226E\n\t\t|| x === 0x226F\n\t\t|| x === 0x2282\n\t\t|| x === 0x2283\n\t\t|| x === 0x2286\n\t\t|| x === 0x2287\n\t\t|| x === 0x2295\n\t\t|| x === 0x2299\n\t\t|| x === 0x22A5\n\t\t|| x === 0x22BF\n\t\t|| x === 0x2312\n\t\t|| x >= 0x2460 && x <= 0x24E9\n\t\t|| x >= 0x24EB && x <= 0x254B\n\t\t|| x >= 0x2550 && x <= 0x2573\n\t\t|| x >= 0x2580 && x <= 0x258F\n\t\t|| x >= 0x2592 && x <= 0x2595\n\t\t|| x === 0x25A0\n\t\t|| x === 0x25A1\n\t\t|| x >= 0x25A3 && x <= 0x25A9\n\t\t|| x === 0x25B2\n\t\t|| x === 0x25B3\n\t\t|| x === 0x25B6\n\t\t|| x === 0x25B7\n\t\t|| x === 0x25BC\n\t\t|| x === 0x25BD\n\t\t|| x === 0x25C0\n\t\t|| x === 0x25C1\n\t\t|| x >= 0x25C6 && x <= 0x25C8\n\t\t|| x === 0x25CB\n\t\t|| x >= 0x25CE && x <= 0x25D1\n\t\t|| x >= 0x25E2 && x <= 0x25E5\n\t\t|| x === 0x25EF\n\t\t|| x === 0x2605\n\t\t|| x === 0x2606\n\t\t|| x === 0x2609\n\t\t|| x === 0x260E\n\t\t|| x === 0x260F\n\t\t|| x === 0x261C\n\t\t|| x === 0x261E\n\t\t|| x === 0x2640\n\t\t|| x === 0x2642\n\t\t|| x === 0x2660\n\t\t|| x === 0x2661\n\t\t|| x >= 0x2663 && x <= 0x2665\n\t\t|| x >= 0x2667 && x <= 0x266A\n\t\t|| x === 0x266C\n\t\t|| x === 0x266D\n\t\t|| x === 0x266F\n\t\t|| x === 0x269E\n\t\t|| x === 0x269F\n\t\t|| x === 0x26BF\n\t\t|| x >= 0x26C6 && x <= 0x26CD\n\t\t|| x >= 0x26CF && x <= 0x26D3\n\t\t|| x >= 0x26D5 && x <= 0x26E1\n\t\t|| x === 0x26E3\n\t\t|| x === 0x26E8\n\t\t|| x === 0x26E9\n\t\t|| x >= 0x26EB && x <= 0x26F1\n\t\t|| x === 0x26F4\n\t\t|| x >= 0x26F6 && x <= 0x26F9\n\t\t|| x === 0x26FB\n\t\t|| x === 0x26FC\n\t\t|| x === 0x26FE\n\t\t|| x === 0x26FF\n\t\t|| x === 0x273D\n\t\t|| x >= 0x2776 && x <= 0x277F\n\t\t|| x >= 0x2B56 && x <= 0x2B59\n\t\t|| x >= 0x3248 && x <= 0x324F\n\t\t|| x >= 0xE000 && x <= 0xF8FF\n\t\t|| x >= 0xFE00 && x <= 0xFE0F\n\t\t|| x === 0xFFFD\n\t\t|| x >= 0x1F100 && x <= 0x1F10A\n\t\t|| x >= 0x1F110 && x <= 0x1F12D\n\t\t|| x >= 0x1F130 && x <= 0x1F169\n\t\t|| x >= 0x1F170 && x <= 0x1F18D\n\t\t|| x === 0x1F18F\n\t\t|| x === 0x1F190\n\t\t|| x >= 0x1F19B && x <= 0x1F1AC\n\t\t|| x >= 0xE0100 && x <= 0xE01EF\n\t\t|| x >= 0xF0000 && x <= 0xFFFFD\n\t\t|| x >= 0x100000 && x <= 0x10FFFD;\n}\n\nfunction isFullWidth(x) {\n\treturn x === 0x3000\n\t\t|| x >= 0xFF01 && x <= 0xFF60\n\t\t|| x >= 0xFFE0 && x <= 0xFFE6;\n}\n\nfunction isWide(x) {\n\treturn x >= 0x1100 && x <= 0x115F\n\t\t|| x === 0x231A\n\t\t|| x === 0x231B\n\t\t|| x === 0x2329\n\t\t|| x === 0x232A\n\t\t|| x >= 0x23E9 && x <= 0x23EC\n\t\t|| x === 0x23F0\n\t\t|| x === 0x23F3\n\t\t|| x === 0x25FD\n\t\t|| x === 0x25FE\n\t\t|| x === 0x2614\n\t\t|| x === 0x2615\n\t\t|| x >= 0x2630 && x <= 0x2637\n\t\t|| x >= 0x2648 && x <= 0x2653\n\t\t|| x === 0x267F\n\t\t|| x >= 0x268A && x <= 0x268F\n\t\t|| x === 0x2693\n\t\t|| x === 0x26A1\n\t\t|| x === 0x26AA\n\t\t|| x === 0x26AB\n\t\t|| x === 0x26BD\n\t\t|| x === 0x26BE\n\t\t|| x === 0x26C4\n\t\t|| x === 0x26C5\n\t\t|| x === 0x26CE\n\t\t|| x === 0x26D4\n\t\t|| x === 0x26EA\n\t\t|| x === 0x26F2\n\t\t|| x === 0x26F3\n\t\t|| x === 0x26F5\n\t\t|| x === 0x26FA\n\t\t|| x === 0x26FD\n\t\t|| x === 0x2705\n\t\t|| x === 0x270A\n\t\t|| x === 0x270B\n\t\t|| x === 0x2728\n\t\t|| x === 0x274C\n\t\t|| x === 0x274E\n\t\t|| x >= 0x2753 && x <= 0x2755\n\t\t|| x === 0x2757\n\t\t|| x >= 0x2795 && x <= 0x2797\n\t\t|| x === 0x27B0\n\t\t|| x === 0x27BF\n\t\t|| x === 0x2B1B\n\t\t|| x === 0x2B1C\n\t\t|| x === 0x2B50\n\t\t|| x === 0x2B55\n\t\t|| x >= 0x2E80 && x <= 0x2E99\n\t\t|| x >= 0x2E9B && x <= 0x2EF3\n\t\t|| x >= 0x2F00 && x <= 0x2FD5\n\t\t|| x >= 0x2FF0 && x <= 0x2FFF\n\t\t|| x >= 0x3001 && x <= 0x303E\n\t\t|| x >= 0x3041 && x <= 0x3096\n\t\t|| x >= 0x3099 && x <= 0x30FF\n\t\t|| x >= 0x3105 && x <= 0x312F\n\t\t|| x >= 0x3131 && x <= 0x318E\n\t\t|| x >= 0x3190 && x <= 0x31E5\n\t\t|| x >= 0x31EF && x <= 0x321E\n\t\t|| x >= 0x3220 && x <= 0x3247\n\t\t|| x >= 0x3250 && x <= 0xA48C\n\t\t|| x >= 0xA490 && x <= 0xA4C6\n\t\t|| x >= 0xA960 && x <= 0xA97C\n\t\t|| x >= 0xAC00 && x <= 0xD7A3\n\t\t|| x >= 0xF900 && x <= 0xFAFF\n\t\t|| x >= 0xFE10 && x <= 0xFE19\n\t\t|| x >= 0xFE30 && x <= 0xFE52\n\t\t|| x >= 0xFE54 && x <= 0xFE66\n\t\t|| x >= 0xFE68 && x <= 0xFE6B\n\t\t|| x >= 0x16FE0 && x <= 0x16FE4\n\t\t|| x >= 0x16FF0 && x <= 0x16FF6\n\t\t|| x >= 0x17000 && x <= 0x18CD5\n\t\t|| x >= 0x18CFF && x <= 0x18D1E\n\t\t|| x >= 0x18D80 && x <= 0x18DF2\n\t\t|| x >= 0x1AFF0 && x <= 0x1AFF3\n\t\t|| x >= 0x1AFF5 && x <= 0x1AFFB\n\t\t|| x === 0x1AFFD\n\t\t|| x === 0x1AFFE\n\t\t|| x >= 0x1B000 && x <= 0x1B122\n\t\t|| x === 0x1B132\n\t\t|| x >= 0x1B150 && x <= 0x1B152\n\t\t|| x === 0x1B155\n\t\t|| x >= 0x1B164 && x <= 0x1B167\n\t\t|| x >= 0x1B170 && x <= 0x1B2FB\n\t\t|| x >= 0x1D300 && x <= 0x1D356\n\t\t|| x >= 0x1D360 && x <= 0x1D376\n\t\t|| x === 0x1F004\n\t\t|| x === 0x1F0CF\n\t\t|| x === 0x1F18E\n\t\t|| x >= 0x1F191 && x <= 0x1F19A\n\t\t|| x >= 0x1F200 && x <= 0x1F202\n\t\t|| x >= 0x1F210 && x <= 0x1F23B\n\t\t|| x >= 0x1F240 && x <= 0x1F248\n\t\t|| x === 0x1F250\n\t\t|| x === 0x1F251\n\t\t|| x >= 0x1F260 && x <= 0x1F265\n\t\t|| x >= 0x1F300 && x <= 0x1F320\n\t\t|| x >= 0x1F32D && x <= 0x1F335\n\t\t|| x >= 0x1F337 && x <= 0x1F37C\n\t\t|| x >= 0x1F37E && x <= 0x1F393\n\t\t|| x >= 0x1F3A0 && x <= 0x1F3CA\n\t\t|| x >= 0x1F3CF && x <= 0x1F3D3\n\t\t|| x >= 0x1F3E0 && x <= 0x1F3F0\n\t\t|| x === 0x1F3F4\n\t\t|| x >= 0x1F3F8 && x <= 0x1F43E\n\t\t|| x === 0x1F440\n\t\t|| x >= 0x1F442 && x <= 0x1F4FC\n\t\t|| x >= 0x1F4FF && x <= 0x1F53D\n\t\t|| x >= 0x1F54B && x <= 0x1F54E\n\t\t|| x >= 0x1F550 && x <= 0x1F567\n\t\t|| x === 0x1F57A\n\t\t|| x === 0x1F595\n\t\t|| x === 0x1F596\n\t\t|| x === 0x1F5A4\n\t\t|| x >= 0x1F5FB && x <= 0x1F64F\n\t\t|| x >= 0x1F680 && x <= 0x1F6C5\n\t\t|| x === 0x1F6CC\n\t\t|| x >= 0x1F6D0 && x <= 0x1F6D2\n\t\t|| x >= 0x1F6D5 && x <= 0x1F6D8\n\t\t|| x >= 0x1F6DC && x <= 0x1F6DF\n\t\t|| x === 0x1F6EB\n\t\t|| x === 0x1F6EC\n\t\t|| x >= 0x1F6F4 && x <= 0x1F6FC\n\t\t|| x >= 0x1F7E0 && x <= 0x1F7EB\n\t\t|| x === 0x1F7F0\n\t\t|| x >= 0x1F90C && x <= 0x1F93A\n\t\t|| x >= 0x1F93C && x <= 0x1F945\n\t\t|| x >= 0x1F947 && x <= 0x1F9FF\n\t\t|| x >= 0x1FA70 && x <= 0x1FA7C\n\t\t|| x >= 0x1FA80 && x <= 0x1FA8A\n\t\t|| x >= 0x1FA8E && x <= 0x1FAC6\n\t\t|| x === 0x1FAC8\n\t\t|| x >= 0x1FACD && x <= 0x1FADC\n\t\t|| x >= 0x1FADF && x <= 0x1FAEA\n\t\t|| x >= 0x1FAEF && x <= 0x1FAF8\n\t\t|| x >= 0x20000 && x <= 0x2FFFD\n\t\t|| x >= 0x30000 && x <= 0x3FFFD;\n}\n\nfunction getCategory(x) {\n\tif (isAmbiguous(x)) return 'ambiguous';\n\n\tif (isFullWidth(x)) return 'fullwidth';\n\n\tif (\n\t\tx === 0x20A9\n\t\t|| x >= 0xFF61 && x <= 0xFFBE\n\t\t|| x >= 0xFFC2 && x <= 0xFFC7\n\t\t|| x >= 0xFFCA && x <= 0xFFCF\n\t\t|| x >= 0xFFD2 && x <= 0xFFD7\n\t\t|| x >= 0xFFDA && x <= 0xFFDC\n\t\t|| x >= 0xFFE8 && x <= 0xFFEE\n\t) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (\n\t\tx >= 0x20 && x <= 0x7E\n\t\t|| x === 0xA2\n\t\t|| x === 0xA3\n\t\t|| x === 0xA5\n\t\t|| x === 0xA6\n\t\t|| x === 0xAC\n\t\t|| x === 0xAF\n\t\t|| x >= 0x27E6 && x <= 0x27ED\n\t\t|| x === 0x2985\n\t\t|| x === 0x2986\n\t) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(x)) return 'wide';\n\n\treturn 'neutral';\n}\n\nexport {isAmbiguous, isFullWidth, isWide, getCategory};\n","import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullWidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {isFullWidth as _isFullWidth, isWide as _isWide} from './lookup.js';\n","/**\n * This module is compiled away!\n *\n * Here is the list of all types of tokens exposed by micromark, with a short\n * explanation of what they include and where they are found.\n * In picking names, generally, the rule is to be as explicit as possible\n * instead of reusing names.\n * For example, there is a `definitionDestination` and a `resourceDestination`,\n * instead of one shared name.\n */\n\n// Note: when changing the next record, you must also change `TokenTypeMap`\n// in `micromark-util-types/index.d.ts`.\nexport const types = /** @type {const} */ ({\n // Generic type for data, such as in a title, a destination, etc.\n data: 'data',\n\n // Generic type for syntactic whitespace (tabs, virtual spaces, spaces).\n // Such as, between a fenced code fence and an info string.\n whitespace: 'whitespace',\n\n // Generic type for line endings (line feed, carriage return, carriage return +\n // line feed).\n lineEnding: 'lineEnding',\n\n // A line ending, but ending a blank line.\n lineEndingBlank: 'lineEndingBlank',\n\n // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a\n // line.\n linePrefix: 'linePrefix',\n\n // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a\n // line.\n lineSuffix: 'lineSuffix',\n\n // Whole ATX heading:\n //\n // ```markdown\n // #\n // ## Alpha\n // ### Bravo ###\n // ```\n //\n // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`.\n atxHeading: 'atxHeading',\n\n // Sequence of number signs in an ATX heading (`###`).\n atxHeadingSequence: 'atxHeadingSequence',\n\n // Content in an ATX heading (`alpha`).\n // Includes text.\n atxHeadingText: 'atxHeadingText',\n\n // Whole autolink (`<https://example.com>` or `<admin@example.com>`)\n // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`.\n autolink: 'autolink',\n\n // Email autolink w/o markers (`admin@example.com`)\n autolinkEmail: 'autolinkEmail',\n\n // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`).\n autolinkMarker: 'autolinkMarker',\n\n // Protocol autolink w/o markers (`https://example.com`)\n autolinkProtocol: 'autolinkProtocol',\n\n // A whole character escape (`\\-`).\n // Includes `escapeMarker` and `characterEscapeValue`.\n characterEscape: 'characterEscape',\n\n // The escaped character (`-`).\n characterEscapeValue: 'characterEscapeValue',\n\n // A whole character reference (`&amp;`, `&#8800;`, or `&#x1D306;`).\n // Includes `characterReferenceMarker`, an optional\n // `characterReferenceMarkerNumeric`, in which case an optional\n // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`.\n characterReference: 'characterReference',\n\n // The start or end marker (`&` or `;`).\n characterReferenceMarker: 'characterReferenceMarker',\n\n // Mark reference as numeric (`#`).\n characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric',\n\n // Mark reference as numeric (`x` or `X`).\n characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal',\n\n // Value of character reference w/o markers (`amp`, `8800`, or `1D306`).\n characterReferenceValue: 'characterReferenceValue',\n\n // Whole fenced code:\n //\n // ````markdown\n // ```js\n // alert(1)\n // ```\n // ````\n codeFenced: 'codeFenced',\n\n // A fenced code fence, including whitespace, sequence, info, and meta\n // (` ```js `).\n codeFencedFence: 'codeFencedFence',\n\n // Sequence of grave accent or tilde characters (` ``` `) in a fence.\n codeFencedFenceSequence: 'codeFencedFenceSequence',\n\n // Info word (`js`) in a fence.\n // Includes string.\n codeFencedFenceInfo: 'codeFencedFenceInfo',\n\n // Meta words (`highlight=\"1\"`) in a fence.\n // Includes string.\n codeFencedFenceMeta: 'codeFencedFenceMeta',\n\n // A line of code.\n codeFlowValue: 'codeFlowValue',\n\n // Whole indented code:\n //\n // ```markdown\n // alert(1)\n // ```\n //\n // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`.\n codeIndented: 'codeIndented',\n\n // A text code (``` `alpha` ```).\n // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include\n // `codeTextPadding`.\n codeText: 'codeText',\n\n codeTextData: 'codeTextData',\n\n // A space or line ending right after or before a tick.\n codeTextPadding: 'codeTextPadding',\n\n // A text code fence (` `` `).\n codeTextSequence: 'codeTextSequence',\n\n // Whole content:\n //\n // ```markdown\n // [a]: b\n // c\n // =\n // d\n // ```\n //\n // Includes `paragraph` and `definition`.\n content: 'content',\n // Whole definition:\n //\n // ```markdown\n // [micromark]: https://github.com/micromark/micromark\n // ```\n //\n // Includes `definitionLabel`, `definitionMarker`, `whitespace`,\n // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`.\n definition: 'definition',\n\n // Destination of a definition (`https://github.com/micromark/micromark` or\n // `<https://github.com/micromark/micromark>`).\n // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`.\n definitionDestination: 'definitionDestination',\n\n // Enclosed destination of a definition\n // (`<https://github.com/micromark/micromark>`).\n // Includes `definitionDestinationLiteralMarker` and optionally\n // `definitionDestinationString`.\n definitionDestinationLiteral: 'definitionDestinationLiteral',\n\n // Markers of an enclosed definition destination (`<` or `>`).\n definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker',\n\n // Unenclosed destination of a definition\n // (`https://github.com/micromark/micromark`).\n // Includes `definitionDestinationString`.\n definitionDestinationRaw: 'definitionDestinationRaw',\n\n // Text in an destination (`https://github.com/micromark/micromark`).\n // Includes string.\n definitionDestinationString: 'definitionDestinationString',\n\n // Label of a definition (`[micromark]`).\n // Includes `definitionLabelMarker` and `definitionLabelString`.\n definitionLabel: 'definitionLabel',\n\n // Markers of a definition label (`[` or `]`).\n definitionLabelMarker: 'definitionLabelMarker',\n\n // Value of a definition label (`micromark`).\n // Includes string.\n definitionLabelString: 'definitionLabelString',\n\n // Marker between a label and a destination (`:`).\n definitionMarker: 'definitionMarker',\n\n // Title of a definition (`\"x\"`, `'y'`, or `(z)`).\n // Includes `definitionTitleMarker` and optionally `definitionTitleString`.\n definitionTitle: 'definitionTitle',\n\n // Marker around a title of a definition (`\"`, `'`, `(`, or `)`).\n definitionTitleMarker: 'definitionTitleMarker',\n\n // Data without markers in a title (`z`).\n // Includes string.\n definitionTitleString: 'definitionTitleString',\n\n // Emphasis (`*alpha*`).\n // Includes `emphasisSequence` and `emphasisText`.\n emphasis: 'emphasis',\n\n // Sequence of emphasis markers (`*` or `_`).\n emphasisSequence: 'emphasisSequence',\n\n // Emphasis text (`alpha`).\n // Includes text.\n emphasisText: 'emphasisText',\n\n // The character escape marker (`\\`).\n escapeMarker: 'escapeMarker',\n\n // A hard break created with a backslash (`\\\\n`).\n // Note: does not include the line ending.\n hardBreakEscape: 'hardBreakEscape',\n\n // A hard break created with trailing spaces (` \\n`).\n // Does not include the line ending.\n hardBreakTrailing: 'hardBreakTrailing',\n\n // Flow HTML:\n //\n // ```markdown\n // <div\n // ```\n //\n // Inlcudes `lineEnding`, `htmlFlowData`.\n htmlFlow: 'htmlFlow',\n\n htmlFlowData: 'htmlFlowData',\n\n // HTML in text (the tag in `a <i> b`).\n // Includes `lineEnding`, `htmlTextData`.\n htmlText: 'htmlText',\n\n htmlTextData: 'htmlTextData',\n\n // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or\n // `![alpha]`).\n // Includes `label` and an optional `resource` or `reference`.\n image: 'image',\n\n // Whole link label (`[*alpha*]`).\n // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`.\n label: 'label',\n\n // Text in an label (`*alpha*`).\n // Includes text.\n labelText: 'labelText',\n\n // Start a link label (`[`).\n // Includes a `labelMarker`.\n labelLink: 'labelLink',\n\n // Start an image label (`![`).\n // Includes `labelImageMarker` and `labelMarker`.\n labelImage: 'labelImage',\n\n // Marker of a label (`[` or `]`).\n labelMarker: 'labelMarker',\n\n // Marker to start an image (`!`).\n labelImageMarker: 'labelImageMarker',\n\n // End a label (`]`).\n // Includes `labelMarker`.\n labelEnd: 'labelEnd',\n\n // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`).\n // Includes `label` and an optional `resource` or `reference`.\n link: 'link',\n\n // Whole paragraph:\n //\n // ```markdown\n // alpha\n // bravo.\n // ```\n //\n // Includes text.\n paragraph: 'paragraph',\n\n // A reference (`[alpha]` or `[]`).\n // Includes `referenceMarker` and an optional `referenceString`.\n reference: 'reference',\n\n // A reference marker (`[` or `]`).\n referenceMarker: 'referenceMarker',\n\n // Reference text (`alpha`).\n // Includes string.\n referenceString: 'referenceString',\n\n // A resource (`(https://example.com \"alpha\")`).\n // Includes `resourceMarker`, an optional `resourceDestination` with an optional\n // `whitespace` and `resourceTitle`.\n resource: 'resource',\n\n // A resource destination (`https://example.com`).\n // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`.\n resourceDestination: 'resourceDestination',\n\n // A literal resource destination (`<https://example.com>`).\n // Includes `resourceDestinationLiteralMarker` and optionally\n // `resourceDestinationString`.\n resourceDestinationLiteral: 'resourceDestinationLiteral',\n\n // A resource destination marker (`<` or `>`).\n resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker',\n\n // A raw resource destination (`https://example.com`).\n // Includes `resourceDestinationString`.\n resourceDestinationRaw: 'resourceDestinationRaw',\n\n // Resource destination text (`https://example.com`).\n // Includes string.\n resourceDestinationString: 'resourceDestinationString',\n\n // A resource marker (`(` or `)`).\n resourceMarker: 'resourceMarker',\n\n // A resource title (`\"alpha\"`, `'alpha'`, or `(alpha)`).\n // Includes `resourceTitleMarker` and optionally `resourceTitleString`.\n resourceTitle: 'resourceTitle',\n\n // A resource title marker (`\"`, `'`, `(`, or `)`).\n resourceTitleMarker: 'resourceTitleMarker',\n\n // Resource destination title (`alpha`).\n // Includes string.\n resourceTitleString: 'resourceTitleString',\n\n // Whole setext heading:\n //\n // ```markdown\n // alpha\n // bravo\n // =====\n // ```\n //\n // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and\n // `setextHeadingLine`.\n setextHeading: 'setextHeading',\n\n // Content in a setext heading (`alpha\\nbravo`).\n // Includes text.\n setextHeadingText: 'setextHeadingText',\n\n // Underline in a setext heading, including whitespace suffix (`==`).\n // Includes `setextHeadingLineSequence`.\n setextHeadingLine: 'setextHeadingLine',\n\n // Sequence of equals or dash characters in underline in a setext heading (`-`).\n setextHeadingLineSequence: 'setextHeadingLineSequence',\n\n // Strong (`**alpha**`).\n // Includes `strongSequence` and `strongText`.\n strong: 'strong',\n\n // Sequence of strong markers (`**` or `__`).\n strongSequence: 'strongSequence',\n\n // Strong text (`alpha`).\n // Includes text.\n strongText: 'strongText',\n\n // Whole thematic break:\n //\n // ```markdown\n // * * *\n // ```\n //\n // Includes `thematicBreakSequence` and `whitespace`.\n thematicBreak: 'thematicBreak',\n\n // A sequence of one or more thematic break markers (`***`).\n thematicBreakSequence: 'thematicBreakSequence',\n\n // Whole block quote:\n //\n // ```markdown\n // > a\n // >\n // > b\n // ```\n //\n // Includes `blockQuotePrefix` and flow.\n blockQuote: 'blockQuote',\n // The `>` or `> ` of a block quote.\n blockQuotePrefix: 'blockQuotePrefix',\n // The `>` of a block quote prefix.\n blockQuoteMarker: 'blockQuoteMarker',\n // The optional ` ` of a block quote prefix.\n blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace',\n\n // Whole ordered list:\n //\n // ```markdown\n // 1. a\n // b\n // ```\n //\n // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further\n // lines.\n listOrdered: 'listOrdered',\n\n // Whole unordered list:\n //\n // ```markdown\n // - a\n // b\n // ```\n //\n // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further\n // lines.\n listUnordered: 'listUnordered',\n\n // The indent of further list item lines.\n listItemIndent: 'listItemIndent',\n\n // A marker, as in, `*`, `+`, `-`, `.`, or `)`.\n listItemMarker: 'listItemMarker',\n\n // The thing that starts a list item, such as `1. `.\n // Includes `listItemValue` if ordered, `listItemMarker`, and\n // `listItemPrefixWhitespace` (unless followed by a line ending).\n listItemPrefix: 'listItemPrefix',\n\n // The whitespace after a marker.\n listItemPrefixWhitespace: 'listItemPrefixWhitespace',\n\n // The numerical value of an ordered item.\n listItemValue: 'listItemValue',\n\n // Internal types used for subtokenizers, compiled away\n chunkDocument: 'chunkDocument',\n chunkContent: 'chunkContent',\n chunkFlow: 'chunkFlow',\n chunkText: 'chunkText',\n chunkString: 'chunkString'\n})\n","// src/index.ts\nimport { cjkFriendlyExtension } from \"micromark-extension-cjk-friendly\";\nfunction remarkCjkFriendly() {\n const data = this.data();\n const micromarkExtensions = (\n // biome-ignore lint/suspicious/noAssignInExpressions: base plugin (remark-gfm) already does this\n data.micromarkExtensions || (data.micromarkExtensions = [])\n );\n micromarkExtensions.push(cjkFriendlyExtension());\n}\nexport {\n remarkCjkFriendly as default\n};\n","// src/strikethrough.ts\nimport { ok as assert } from \"devlop\";\nimport {\n classifyCharacter,\n classifyPrecedingCharacter,\n isCjk,\n isCodeHighSurrogate,\n isCodeLowSurrogate,\n isIvs,\n isNonCjkPunctuation,\n isUnicodeWhitespace,\n TwoPreviousCode,\n tryGetGenuineNextCode,\n tryGetGenuinePreviousCode\n} from \"micromark-extension-cjk-friendly-util\";\nimport { splice } from \"micromark-util-chunked\";\nimport { resolveAll } from \"micromark-util-resolve-all\";\nimport { codes, constants, types } from \"micromark-util-symbol\";\nfunction gfmStrikethroughCjkFriendly(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: \"strikethrough\",\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === void 0) {\n single = true;\n }\n return {\n text: { [codes.tilde]: tokenizer },\n insideSpan: { null: [tokenizer] },\n attentionMarkers: { null: [codes.tilde] }\n };\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n while (++index < events.length) {\n if (events[index][0] === \"enter\" && events[index][1].type === \"strikethroughSequenceTemporary\" && events[index][1]._close) {\n let open = index;\n while (open--) {\n if (events[open][0] === \"exit\" && events[open][1].type === \"strikethroughSequenceTemporary\" && events[open][1]._open && // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = \"strikethroughSequence\";\n events[open][1].type = \"strikethroughSequence\";\n const strikethrough = {\n type: \"strikethrough\",\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n const text = {\n type: \"strikethroughText\",\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n const nextEvents = [\n [\"enter\", strikethrough, context],\n [\"enter\", events[open][1], context],\n [\"exit\", events[open][1], context],\n [\"enter\", text, context]\n ];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n splice(\n nextEvents,\n nextEvents.length,\n 0,\n resolveAll(insideSpan, events.slice(open + 1, index), context)\n );\n }\n splice(nextEvents, nextEvents.length, 0, [\n [\"exit\", text, context],\n [\"enter\", events[index][1], context],\n [\"exit\", events[index][1], context],\n [\"exit\", strikethrough, context]\n ]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === \"strikethroughSequenceTemporary\") {\n events[index][1].type = types.data;\n }\n }\n return events;\n }\n function tokenizeStrikethrough(effects, ok, nok) {\n const { now, sliceSerialize, previous: tentativePrevious } = this;\n const previous = isCodeLowSurrogate(tentativePrevious) ? (\n // second (lower) surrogate likely to be preceded by first (higher) surrogate\n tryGetGenuinePreviousCode(tentativePrevious, now(), sliceSerialize)\n ) : tentativePrevious;\n const before = classifyCharacter(previous);\n const twoPrevious = new TwoPreviousCode(previous, now(), sliceSerialize);\n const beforePrimary = classifyPrecedingCharacter(\n before,\n twoPrevious.value.bind(twoPrevious),\n previous\n );\n const events = this.events;\n let size = 0;\n return start;\n function start(code) {\n assert(code === codes.tilde, \"expected `~`\");\n if (previous === codes.tilde && events[events.length - 1][1].type !== types.characterEscape) {\n return nok(code);\n }\n effects.enter(\"strikethroughSequenceTemporary\");\n return more(code);\n }\n function more(code) {\n const before2 = classifyCharacter(previous);\n if (code === codes.tilde) {\n if (size > 1) return nok(code);\n effects.consume(code);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code);\n const token = effects.exit(\"strikethroughSequenceTemporary\");\n const next = isCodeHighSurrogate(code) ? tryGetGenuineNextCode(code, now(), sliceSerialize) : code;\n const after = classifyCharacter(next);\n const beforeNonCjkPunctuation = isNonCjkPunctuation(beforePrimary);\n const beforeSpaceOrNonCjkPunctuation = beforeNonCjkPunctuation || isUnicodeWhitespace(beforePrimary);\n const afterNonCjkPunctuation = isNonCjkPunctuation(after);\n const afterSpaceOrNonCjkPunctuation = afterNonCjkPunctuation || isUnicodeWhitespace(after);\n const beforeCjkOrIvs = isCjk(beforePrimary) || isIvs(before2);\n token._open = !afterSpaceOrNonCjkPunctuation || after === constants.attentionSideAfter && (beforeSpaceOrNonCjkPunctuation || beforeCjkOrIvs);\n token._close = !beforeSpaceOrNonCjkPunctuation || before2 === constants.attentionSideAfter && (afterSpaceOrNonCjkPunctuation || isCjk(after));\n return ok(code);\n }\n }\n}\nexport {\n gfmStrikethroughCjkFriendly\n};\n","// src/index.ts\nimport {\n gfmStrikethroughCjkFriendly\n} from \"micromark-extension-cjk-friendly-gfm-strikethrough\";\nfunction remarkGfmStrikethroughCjkFriendly(options) {\n const data = this.data();\n const micromarkExtensions = (\n // biome-ignore lint/suspicious/noAssignInExpressions: base plugin (remark-gfm) already does this\n data.micromarkExtensions || (data.micromarkExtensions = [])\n );\n micromarkExtensions.push(gfmStrikethroughCjkFriendly(options));\n}\nexport {\n remarkGfmStrikethroughCjkFriendly as default\n};\n","import c from'remark-cjk-friendly';import a from'remark-cjk-friendly-gfm-strikethrough';import {visit}from'unist-util-visit';var k=new Set([\"\\u3002\",\"\\uFF0E\",\"\\uFF0C\",\"\\u3001\",\"\\uFF1F\",\"\\uFF01\",\"\\uFF1A\",\"\\uFF1B\",\"\\uFF08\",\"\\uFF09\",\"\\u3010\",\"\\u3011\",\"\\u300C\",\"\\u300D\",\"\\u300E\",\"\\u300F\",\"\\u3008\",\"\\u3009\",\"\\u300A\",\"\\u300B\"]),m=/^(https?:\\/\\/|mailto:|www\\.)/i,f=t=>{if(t.children.length!==1)return false;let r=t.children[0];return r.type===\"text\"&&r.value===t.url},P=t=>{let r=0;for(let e of t){if(k.has(e))return r;r+=e.length;}return null},p=(t,r)=>({...r,url:t,children:[{type:\"text\",value:t}]}),d=t=>({type:\"text\",value:t}),y=()=>t=>{visit(t,\"link\",(r,e,i)=>{if(!i||typeof e!=\"number\"||!f(r)||!m.test(r.url))return;let n=P(r.url);if(n===null||n===0)return;let l=r.url.slice(0,n),u=r.url.slice(n),o=p(l,r),s=d(u);return i.children.splice(e,1,o,s),e+1});};function b(){let t=[c],r=[y,a],e=[...t,...r];return {name:\"cjk\",type:\"cjk\",remarkPluginsBefore:t,remarkPluginsAfter:r,remarkPlugins:e}}var A=b();export{A as cjk,b as createCjkPlugin};","import {bundledLanguages,createHighlighter}from'shiki';var p=new Set(Object.keys(bundledLanguages)),a=new Map,h=new Map,l=new Map,H=(e,t)=>`${e}-${t[0]}-${t[1]}`,k=(e,t,n)=>{let g=e.slice(0,100),i=e.length>100?e.slice(-100):\"\";return `${t}:${n[0]}:${n[1]}:${e.length}:${g}:${i}`},b=(e,t)=>{let n=H(e,t);if(a.has(n))return a.get(n);let g=createHighlighter({themes:t,langs:[e]});return a.set(n,g),g};function f(e={}){var n;let t=(n=e.themes)!=null?n:[\"github-light\",\"github-dark\"];return {name:\"shiki\",type:\"code-highlighter\",supportsLanguage(g){return p.has(g)},getSupportedLanguages(){return Array.from(p)},getThemes(){return t},highlight({code:g,language:i,themes:r},d){let s=k(g,i,r);return h.has(s)?h.get(s):(d&&(l.has(s)||l.set(s,new Set),l.get(s).add(d)),b(i,r).then(u=>{let B=u.getLoadedLanguages().includes(i)?i:\"text\",o=u.codeToTokens(g,{lang:B,themes:{light:r[0],dark:r[1]}});h.set(s,o);let c=l.get(s);if(c){for(let L of c)L(o);l.delete(s);}}).catch(u=>{console.error(\"[Streamdown Code] Failed to highlight code:\",u),l.delete(s);}),null)}}}var R=f();export{R as code,f as createCodePlugin};","/**\n * @import {Root} from 'hast'\n * @import {ParserError} from 'parse5'\n * @import {Value} from 'vfile'\n * @import {ErrorCode, Options} from './types.js'\n */\n\nimport {ok as assert} from 'devlop'\nimport {fromParse5} from 'hast-util-from-parse5'\nimport {parse, parseFragment} from 'parse5'\nimport {VFile} from 'vfile'\nimport {VFileMessage} from 'vfile-message'\nimport {errors} from './errors.js'\n\nconst base = 'https://html.spec.whatwg.org/multipage/parsing.html#parse-error-'\n\nconst dashToCamelRe = /-[a-z]/g\nconst formatCRe = /%c(?:([-+])(\\d+))?/g\nconst formatXRe = /%x/g\n\nconst fatalities = {2: true, 1: false, 0: null}\n\n/** @type {Readonly<Options>} */\nconst emptyOptions = {}\n\n/**\n * Turn serialized HTML into a hast tree.\n *\n * @param {VFile | Value} value\n * Serialized HTML to parse.\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {Root}\n * Tree.\n */\nexport function fromHtml(value, options) {\n const settings = options || emptyOptions\n const onerror = settings.onerror\n const file = value instanceof VFile ? value : new VFile(value)\n const parseFunction = settings.fragment ? parseFragment : parse\n const document = String(file)\n const p5Document = parseFunction(document, {\n sourceCodeLocationInfo: true,\n // Note `parse5` types currently do not allow `undefined`.\n onParseError: settings.onerror ? internalOnerror : null,\n scriptingEnabled: false\n })\n\n // `parse5` returns document which are always mapped to roots.\n return /** @type {Root} */ (\n fromParse5(p5Document, {\n file,\n space: settings.space,\n verbose: settings.verbose\n })\n )\n\n /**\n * Handle a parse error.\n *\n * @param {ParserError} error\n * Parse5 error.\n * @returns {undefined}\n * Nothing.\n */\n function internalOnerror(error) {\n const code = error.code\n const name = camelcase(code)\n const setting = settings[name]\n const config = setting === null || setting === undefined ? true : setting\n const level = typeof config === 'number' ? config : config ? 1 : 0\n\n if (level) {\n const info = errors[name]\n assert(info, 'expected known error from `parse5`')\n\n const message = new VFileMessage(format(info.reason), {\n place: {\n start: {\n line: error.startLine,\n column: error.startCol,\n offset: error.startOffset\n },\n end: {\n line: error.endLine,\n column: error.endCol,\n offset: error.endOffset\n }\n },\n ruleId: code,\n source: 'hast-util-from-html'\n })\n\n if (file.path) {\n message.file = file.path\n message.name = file.path + ':' + message.name\n }\n\n message.fatal = fatalities[level]\n message.note = format(info.description)\n message.url = info.url === false ? undefined : base + code\n\n assert(onerror, '`internalOnerror` is not passed if `onerror` is not set')\n onerror(message)\n }\n\n /**\n * Format a human readable string about an error.\n *\n * @param {string} value\n * Value to format.\n * @returns {string}\n * Formatted.\n */\n function format(value) {\n return value.replace(formatCRe, formatC).replace(formatXRe, formatX)\n\n /**\n * Format the character.\n *\n * @param {string} _\n * Match.\n * @param {string} $1\n * Sign (`-` or `+`, optional).\n * @param {string} $2\n * Offset.\n * @returns {string}\n * Formatted.\n */\n function formatC(_, $1, $2) {\n const offset =\n ($2 ? Number.parseInt($2, 10) : 0) * ($1 === '-' ? -1 : 1)\n const char = document.charAt(error.startOffset + offset)\n return visualizeCharacter(char)\n }\n\n /**\n * Format the character code.\n *\n * @returns {string}\n * Formatted.\n */\n function formatX() {\n return visualizeCharacterCode(document.charCodeAt(error.startOffset))\n }\n }\n }\n}\n\n/**\n * @param {string} value\n * Error code in dash case.\n * @returns {ErrorCode}\n * Error code in camelcase.\n */\nfunction camelcase(value) {\n // This should match an error code.\n return /** @type {ErrorCode} */ (value.replace(dashToCamelRe, dashToCamel))\n}\n\n/**\n * @param {string} $0\n * Match.\n * @returns {string}\n * Camelcased.\n */\nfunction dashToCamel($0) {\n return $0.charAt(1).toUpperCase()\n}\n\n/**\n * @param {string} char\n * Character.\n * @returns {string}\n * Formatted.\n */\nfunction visualizeCharacter(char) {\n return char === '`' ? '` ` `' : char\n}\n\n/**\n * @param {number} charCode\n * Character code.\n * @returns {string}\n * Formatted.\n */\nfunction visualizeCharacterCode(charCode) {\n return '0x' + charCode.toString(16).toUpperCase()\n}\n","/**\n * @typedef ErrorInfo\n * Info on a `parse5` error.\n * @property {string} reason\n * Reason of error.\n * @property {string} description\n * More info on error.\n * @property {false} [url]\n * Turn off if this is not documented in the html5 spec (optional).\n */\n\nexport const errors = {\n /** @type {ErrorInfo} */\n abandonedHeadElementChild: {\n reason: 'Unexpected metadata element after head',\n description:\n 'Unexpected element after head. Expected the element before `</head>`',\n url: false\n },\n /** @type {ErrorInfo} */\n abruptClosingOfEmptyComment: {\n reason: 'Unexpected abruptly closed empty comment',\n description: 'Unexpected `>` or `->`. Expected `-->` to close comments'\n },\n /** @type {ErrorInfo} */\n abruptDoctypePublicIdentifier: {\n reason: 'Unexpected abruptly closed public identifier',\n description:\n 'Unexpected `>`. Expected a closing `\"` or `\\'` after the public identifier'\n },\n /** @type {ErrorInfo} */\n abruptDoctypeSystemIdentifier: {\n reason: 'Unexpected abruptly closed system identifier',\n description:\n 'Unexpected `>`. Expected a closing `\"` or `\\'` after the identifier identifier'\n },\n /** @type {ErrorInfo} */\n absenceOfDigitsInNumericCharacterReference: {\n reason: 'Unexpected non-digit at start of numeric character reference',\n description:\n 'Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references'\n },\n /** @type {ErrorInfo} */\n cdataInHtmlContent: {\n reason: 'Unexpected CDATA section in HTML',\n description:\n 'Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead'\n },\n /** @type {ErrorInfo} */\n characterReferenceOutsideUnicodeRange: {\n reason: 'Unexpected too big numeric character reference',\n description:\n 'Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)'\n },\n /** @type {ErrorInfo} */\n closingOfElementWithOpenChildElements: {\n reason: 'Unexpected closing tag with open child elements',\n description:\n 'Unexpectedly closing tag. Expected other tags to be closed first',\n url: false\n },\n /** @type {ErrorInfo} */\n controlCharacterInInputStream: {\n reason: 'Unexpected control character',\n description:\n 'Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace'\n },\n /** @type {ErrorInfo} */\n controlCharacterReference: {\n reason: 'Unexpected control character reference',\n description:\n 'Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace'\n },\n /** @type {ErrorInfo} */\n disallowedContentInNoscriptInHead: {\n reason: 'Disallowed content inside `<noscript>` in `<head>`',\n description:\n 'Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`',\n url: false\n },\n /** @type {ErrorInfo} */\n duplicateAttribute: {\n reason: 'Unexpected duplicate attribute',\n description:\n 'Unexpectedly double attribute. Expected attributes to occur only once'\n },\n /** @type {ErrorInfo} */\n endTagWithAttributes: {\n reason: 'Unexpected attribute on closing tag',\n description: 'Unexpected attribute. Expected `>` instead'\n },\n /** @type {ErrorInfo} */\n endTagWithTrailingSolidus: {\n reason: 'Unexpected slash at end of closing tag',\n description: 'Unexpected `%c-1`. Expected `>` instead'\n },\n /** @type {ErrorInfo} */\n endTagWithoutMatchingOpenElement: {\n reason: 'Unexpected unopened end tag',\n description: 'Unexpected end tag. Expected no end tag or another end tag',\n url: false\n },\n /** @type {ErrorInfo} */\n eofBeforeTagName: {\n reason: 'Unexpected end of file',\n description: 'Unexpected end of file. Expected tag name instead'\n },\n /** @type {ErrorInfo} */\n eofInCdata: {\n reason: 'Unexpected end of file in CDATA',\n description: 'Unexpected end of file. Expected `]]>` to close the CDATA'\n },\n /** @type {ErrorInfo} */\n eofInComment: {\n reason: 'Unexpected end of file in comment',\n description: 'Unexpected end of file. Expected `-->` to close the comment'\n },\n /** @type {ErrorInfo} */\n eofInDoctype: {\n reason: 'Unexpected end of file in doctype',\n description:\n 'Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)'\n },\n /** @type {ErrorInfo} */\n eofInElementThatCanContainOnlyText: {\n reason: 'Unexpected end of file in element that can only contain text',\n description: 'Unexpected end of file. Expected text or a closing tag',\n url: false\n },\n /** @type {ErrorInfo} */\n eofInScriptHtmlCommentLikeText: {\n reason: 'Unexpected end of file in comment inside script',\n description: 'Unexpected end of file. Expected `-->` to close the comment'\n },\n /** @type {ErrorInfo} */\n eofInTag: {\n reason: 'Unexpected end of file in tag',\n description: 'Unexpected end of file. Expected `>` to close the tag'\n },\n /** @type {ErrorInfo} */\n incorrectlyClosedComment: {\n reason: 'Incorrectly closed comment',\n description: 'Unexpected `%c-1`. Expected `-->` to close the comment'\n },\n /** @type {ErrorInfo} */\n incorrectlyOpenedComment: {\n reason: 'Incorrectly opened comment',\n description: 'Unexpected `%c`. Expected `<!--` to open the comment'\n },\n /** @type {ErrorInfo} */\n invalidCharacterSequenceAfterDoctypeName: {\n reason: 'Invalid sequence after doctype name',\n description: 'Unexpected sequence at `%c`. Expected `public` or `system`'\n },\n /** @type {ErrorInfo} */\n invalidFirstCharacterOfTagName: {\n reason: 'Invalid first character in tag name',\n description: 'Unexpected `%c`. Expected an ASCII letter instead'\n },\n /** @type {ErrorInfo} */\n misplacedDoctype: {\n reason: 'Misplaced doctype',\n description: 'Unexpected doctype. Expected doctype before head',\n url: false\n },\n /** @type {ErrorInfo} */\n misplacedStartTagForHeadElement: {\n reason: 'Misplaced `<head>` start tag',\n description:\n 'Unexpected start tag `<head>`. Expected `<head>` directly after doctype',\n url: false\n },\n /** @type {ErrorInfo} */\n missingAttributeValue: {\n reason: 'Missing attribute value',\n description:\n 'Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead'\n },\n /** @type {ErrorInfo} */\n missingDoctype: {\n reason: 'Missing doctype before other content',\n description: 'Expected a `<!doctype html>` before anything else',\n url: false\n },\n /** @type {ErrorInfo} */\n missingDoctypeName: {\n reason: 'Missing doctype name',\n description: 'Unexpected doctype end at `%c`. Expected `html` instead'\n },\n /** @type {ErrorInfo} */\n missingDoctypePublicIdentifier: {\n reason: 'Missing public identifier in doctype',\n description: 'Unexpected `%c`. Expected identifier for `public` instead'\n },\n /** @type {ErrorInfo} */\n missingDoctypeSystemIdentifier: {\n reason: 'Missing system identifier in doctype',\n description:\n 'Unexpected `%c`. Expected identifier for `system` instead (suggested: `\"about:legacy-compat\"`)'\n },\n /** @type {ErrorInfo} */\n missingEndTagName: {\n reason: 'Missing name in end tag',\n description: 'Unexpected `%c`. Expected an ASCII letter instead'\n },\n /** @type {ErrorInfo} */\n missingQuoteBeforeDoctypePublicIdentifier: {\n reason: 'Missing quote before public identifier in doctype',\n description: 'Unexpected `%c`. Expected `\"` or `\\'` instead'\n },\n /** @type {ErrorInfo} */\n missingQuoteBeforeDoctypeSystemIdentifier: {\n reason: 'Missing quote before system identifier in doctype',\n description: 'Unexpected `%c`. Expected `\"` or `\\'` instead'\n },\n /** @type {ErrorInfo} */\n missingSemicolonAfterCharacterReference: {\n reason: 'Missing semicolon after character reference',\n description: 'Unexpected `%c`. Expected `;` instead'\n },\n /** @type {ErrorInfo} */\n missingWhitespaceAfterDoctypePublicKeyword: {\n reason: 'Missing whitespace after public identifier in doctype',\n description: 'Unexpected `%c`. Expected ASCII whitespace instead'\n },\n /** @type {ErrorInfo} */\n missingWhitespaceAfterDoctypeSystemKeyword: {\n reason: 'Missing whitespace after system identifier in doctype',\n description: 'Unexpected `%c`. Expected ASCII whitespace instead'\n },\n /** @type {ErrorInfo} */\n missingWhitespaceBeforeDoctypeName: {\n reason: 'Missing whitespace before doctype name',\n description: 'Unexpected `%c`. Expected ASCII whitespace instead'\n },\n /** @type {ErrorInfo} */\n missingWhitespaceBetweenAttributes: {\n reason: 'Missing whitespace between attributes',\n description: 'Unexpected `%c`. Expected ASCII whitespace instead'\n },\n /** @type {ErrorInfo} */\n missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers: {\n reason:\n 'Missing whitespace between public and system identifiers in doctype',\n description: 'Unexpected `%c`. Expected ASCII whitespace instead'\n },\n /** @type {ErrorInfo} */\n nestedComment: {\n reason: 'Unexpected nested comment',\n description: 'Unexpected `<!--`. Expected `-->`'\n },\n /** @type {ErrorInfo} */\n nestedNoscriptInHead: {\n reason: 'Unexpected nested `<noscript>` in `<head>`',\n description:\n 'Unexpected `<noscript>`. Expected a closing tag or a meta element',\n url: false\n },\n /** @type {ErrorInfo} */\n nonConformingDoctype: {\n reason: 'Unexpected non-conforming doctype declaration',\n description:\n 'Expected `<!doctype html>` or `<!doctype html system \"about:legacy-compat\">`',\n url: false\n },\n /** @type {ErrorInfo} */\n nonVoidHtmlElementStartTagWithTrailingSolidus: {\n reason: 'Unexpected trailing slash on start tag of non-void element',\n description: 'Unexpected `/`. Expected `>` instead'\n },\n /** @type {ErrorInfo} */\n noncharacterCharacterReference: {\n reason:\n 'Unexpected noncharacter code point referenced by character reference',\n description: 'Unexpected code point. Do not use noncharacters in HTML'\n },\n /** @type {ErrorInfo} */\n noncharacterInInputStream: {\n reason: 'Unexpected noncharacter character',\n description: 'Unexpected code point `%x`. Do not use noncharacters in HTML'\n },\n /** @type {ErrorInfo} */\n nullCharacterReference: {\n reason: 'Unexpected NULL character referenced by character reference',\n description: 'Unexpected code point. Do not use NULL characters in HTML'\n },\n /** @type {ErrorInfo} */\n openElementsLeftAfterEof: {\n reason: 'Unexpected end of file',\n description: 'Unexpected end of file. Expected closing tag instead',\n url: false\n },\n /** @type {ErrorInfo} */\n surrogateCharacterReference: {\n reason: 'Unexpected surrogate character referenced by character reference',\n description:\n 'Unexpected code point. Do not use lone surrogate characters in HTML'\n },\n /** @type {ErrorInfo} */\n surrogateInInputStream: {\n reason: 'Unexpected surrogate character',\n description:\n 'Unexpected code point `%x`. Do not use lone surrogate characters in HTML'\n },\n /** @type {ErrorInfo} */\n unexpectedCharacterAfterDoctypeSystemIdentifier: {\n reason: 'Invalid character after system identifier in doctype',\n description: 'Unexpected character at `%c`. Expected `>`'\n },\n /** @type {ErrorInfo} */\n unexpectedCharacterInAttributeName: {\n reason: 'Unexpected character in attribute name',\n description:\n 'Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter'\n },\n /** @type {ErrorInfo} */\n unexpectedCharacterInUnquotedAttributeValue: {\n reason: 'Unexpected character in unquoted attribute value',\n description: 'Unexpected `%c`. Quote the attribute value to include it'\n },\n /** @type {ErrorInfo} */\n unexpectedEqualsSignBeforeAttributeName: {\n reason: 'Unexpected equals sign before attribute name',\n description: 'Unexpected `%c`. Add an attribute name before it'\n },\n /** @type {ErrorInfo} */\n unexpectedNullCharacter: {\n reason: 'Unexpected NULL character',\n description:\n 'Unexpected code point `%x`. Do not use NULL characters in HTML'\n },\n /** @type {ErrorInfo} */\n unexpectedQuestionMarkInsteadOfTagName: {\n reason: 'Unexpected question mark instead of tag name',\n description: 'Unexpected `%c`. Expected an ASCII letter instead'\n },\n /** @type {ErrorInfo} */\n unexpectedSolidusInTag: {\n reason: 'Unexpected slash in tag',\n description:\n 'Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value'\n },\n /** @type {ErrorInfo} */\n unknownNamedCharacterReference: {\n reason: 'Unexpected unknown named character reference',\n description:\n 'Unexpected character reference. Expected known named character references'\n }\n}\n","/**\n * @typedef {import('unist').Node} Node\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [force=false]\n * Whether to use `delete` to remove `position` fields.\n *\n * The default is to set them to `undefined`.\n */\n\nimport {visit} from 'unist-util-visit'\n\n/**\n * Remove the `position` field from a tree.\n *\n * @param {Node} tree\n * Tree to clean.\n * @param {Options | null | undefined} [options={force: false}]\n * Configuration (default: `{force: false}`).\n * @returns {undefined}\n * Nothing.\n */\nexport function removePosition(tree, options) {\n const config = options || {}\n const force = config.force || false\n\n visit(tree, remove)\n\n /**\n * @param {Node} node\n */\n function remove(node) {\n if (force) {\n delete node.position\n } else {\n node.position = undefined\n }\n }\n}\n","/**\n * @typedef {import('hast').Root} Root\n *\n * @typedef {Pick<import('hast-util-from-html').Options, 'fragment'>} Options\n */\n\nimport {fromHtml} from 'hast-util-from-html'\nimport {removePosition} from 'unist-util-remove-position'\n\n/**\n * Turn HTML into a syntax tree, using browser APIs when available, so it has\n * a smaller bundle size there.\n *\n * @param {string} value\n * Serialized HTML to parse.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {Root}\n * Tree.\n */\nexport function fromHtmlIsomorphic(value, options) {\n const tree = fromHtml(value, options)\n removePosition(tree, {force: true})\n delete tree.data\n return tree\n}\n","/**\n * @typedef {import('unist').Node} UnistNode\n * @typedef {import('unist').Parent} UnistParent\n */\n\n/**\n * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test\n * Test from `unist-util-is`.\n *\n * Note: we have remove and add `undefined`, because otherwise when generating\n * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,\n * which doesn’t work when publishing on npm.\n */\n\n/**\n * @typedef {(\n * Fn extends (value: any) => value is infer Thing\n * ? Thing\n * : Fallback\n * )} Predicate\n * Get the value of a type guard `Fn`.\n * @template Fn\n * Value; typically function that is a type guard (such as `(x): x is Y`).\n * @template Fallback\n * Value to yield if `Fn` is not a type guard.\n */\n\n/**\n * @typedef {(\n * Check extends null | undefined // No test.\n * ? Value\n * : Value extends {type: Check} // String (type) test.\n * ? Value\n * : Value extends Check // Partial test.\n * ? Value\n * : Check extends Function // Function test.\n * ? Predicate<Check, Value> extends Value\n * ? Predicate<Check, Value>\n * : never\n * : never // Some other test?\n * )} MatchesOne\n * Check whether a node matches a primitive check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test, but not arrays.\n */\n\n/**\n * @typedef {(\n * Check extends Array<any>\n * ? MatchesOne<Value, Check[keyof Check]>\n * : MatchesOne<Value, Check>\n * )} Matches\n * Check whether a node matches a check in the type system.\n * @template Value\n * Value; typically unist `Node`.\n * @template Check\n * Value; typically `unist-util-is`-compatible test.\n */\n\n/**\n * @typedef {(\n * Kind extends {children: Array<infer Child>}\n * ? Child\n * : never\n * )} Child\n * Collect nodes that can be parents of `Child`.\n * @template {UnistNode} Kind\n * All node types.\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Find the first node in `parent` after another `node` or after an index,\n * that passes `test`.\n *\n * @param parent\n * Parent node.\n * @param index\n * Child node or index.\n * @param [test=undefined]\n * Test for child to look for (optional).\n * @returns\n * A child (matching `test`, if given) or `undefined`.\n */\nexport const findAfter =\n // Note: overloads like this are needed to support optional generics.\n /**\n * @type {(\n * (<Kind extends UnistParent, Check extends Test>(parent: Kind, index: Child<Kind> | number, test: Check) => Matches<Child<Kind>, Check> | undefined) &\n * (<Kind extends UnistParent>(parent: Kind, index: Child<Kind> | number, test?: null | undefined) => Child<Kind> | undefined)\n * )}\n */\n (\n /**\n * @param {UnistParent} parent\n * @param {UnistNode | number} index\n * @param {Test} [test]\n * @returns {UnistNode | undefined}\n */\n function (parent, index, test) {\n const is = convert(test)\n\n if (!parent || !parent.type || !parent.children) {\n throw new Error('Expected parent node')\n }\n\n if (typeof index === 'number') {\n if (index < 0 || index === Number.POSITIVE_INFINITY) {\n throw new Error('Expected positive finite number as index')\n }\n } else {\n index = parent.children.indexOf(index)\n\n if (index < 0) {\n throw new Error('Expected child node or index')\n }\n }\n\n while (++index < parent.children.length) {\n if (is(parent.children[index], index, parent)) {\n return parent.children[index]\n }\n }\n\n return undefined\n }\n )\n","/**\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Parents} Parents\n */\n\n/**\n * @template Fn\n * @template Fallback\n * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate\n */\n\n/**\n * @callback Check\n * Check that an arbitrary value is an element.\n * @param {unknown} this\n * Context object (`this`) to call `test` with\n * @param {unknown} [element]\n * Anything (typically a node).\n * @param {number | null | undefined} [index]\n * Position of `element` in its parent.\n * @param {Parents | null | undefined} [parent]\n * Parent of `element`.\n * @returns {boolean}\n * Whether this is an element and passes a test.\n *\n * @typedef {Array<TestFunction | string> | TestFunction | string | null | undefined} Test\n * Check for an arbitrary element.\n *\n * * when `string`, checks that the element has that tag name\n * * when `function`, see `TestFunction`\n * * when `Array`, checks if one of the subtests pass\n *\n * @callback TestFunction\n * Check if an element passes a test.\n * @param {unknown} this\n * The given context.\n * @param {Element} element\n * An element.\n * @param {number | undefined} [index]\n * Position of `element` in its parent.\n * @param {Parents | undefined} [parent]\n * Parent of `element`.\n * @returns {boolean | undefined | void}\n * Whether this element passes the test.\n *\n * Note: `void` is included until TS sees no return as `undefined`.\n */\n\n/**\n * Check if `element` is an `Element` and whether it passes the given test.\n *\n * @param element\n * Thing to check, typically `element`.\n * @param test\n * Check for a specific element.\n * @param index\n * Position of `element` in its parent.\n * @param parent\n * Parent of `element`.\n * @param context\n * Context object (`this`) to call `test` with.\n * @returns\n * Whether `element` is an `Element` and passes a test.\n * @throws\n * When an incorrect `test`, `index`, or `parent` is given; there is no error\n * thrown when `element` is not a node or not an element.\n */\nexport const isElement =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends TestFunction>(element: unknown, test: Condition, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &\n * (<Condition extends string>(element: unknown, test: Condition, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &\n * ((element?: null | undefined) => false) &\n * ((element: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &\n * ((element: unknown, test?: Test, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => boolean)\n * )}\n */\n (\n /**\n * @param {unknown} [element]\n * @param {Test | undefined} [test]\n * @param {number | null | undefined} [index]\n * @param {Parents | null | undefined} [parent]\n * @param {unknown} [context]\n * @returns {boolean}\n */\n // eslint-disable-next-line max-params\n function (element, test, index, parent, context) {\n const check = convertElement(test)\n\n if (\n index !== null &&\n index !== undefined &&\n (typeof index !== 'number' ||\n index < 0 ||\n index === Number.POSITIVE_INFINITY)\n ) {\n throw new Error('Expected positive finite `index`')\n }\n\n if (\n parent !== null &&\n parent !== undefined &&\n (!parent.type || !parent.children)\n ) {\n throw new Error('Expected valid `parent`')\n }\n\n if (\n (index === null || index === undefined) !==\n (parent === null || parent === undefined)\n ) {\n throw new Error('Expected both `index` and `parent`')\n }\n\n return looksLikeAnElement(element)\n ? check.call(context, element, index, parent)\n : false\n }\n )\n\n/**\n * Generate a check from a test.\n *\n * Useful if you’re going to test many nodes, for example when creating a\n * utility where something else passes a compatible test.\n *\n * The created function is a bit faster because it expects valid input only:\n * an `element`, `index`, and `parent`.\n *\n * @param test\n * A test for a specific element.\n * @returns\n * A check.\n */\nexport const convertElement =\n // Note: overloads in JSDoc can’t yet use different `@template`s.\n /**\n * @type {(\n * (<Condition extends TestFunction>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &\n * (<Condition extends string>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &\n * ((test?: null | undefined) => (element?: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &\n * ((test?: Test) => Check)\n * )}\n */\n (\n /**\n * @param {Test | null | undefined} [test]\n * @returns {Check}\n */\n function (test) {\n if (test === null || test === undefined) {\n return element\n }\n\n if (typeof test === 'string') {\n return tagNameFactory(test)\n }\n\n // Assume array.\n if (typeof test === 'object') {\n return anyFactory(test)\n }\n\n if (typeof test === 'function') {\n return castFactory(test)\n }\n\n throw new Error('Expected function, string, or array as `test`')\n }\n )\n\n/**\n * Handle multiple tests.\n *\n * @param {Array<TestFunction | string>} tests\n * @returns {Check}\n */\nfunction anyFactory(tests) {\n /** @type {Array<Check>} */\n const checks = []\n let index = -1\n\n while (++index < tests.length) {\n checks[index] = convertElement(tests[index])\n }\n\n return castFactory(any)\n\n /**\n * @this {unknown}\n * @type {TestFunction}\n */\n function any(...parameters) {\n let index = -1\n\n while (++index < checks.length) {\n if (checks[index].apply(this, parameters)) return true\n }\n\n return false\n }\n}\n\n/**\n * Turn a string into a test for an element with a certain type.\n *\n * @param {string} check\n * @returns {Check}\n */\nfunction tagNameFactory(check) {\n return castFactory(tagName)\n\n /**\n * @param {Element} element\n * @returns {boolean}\n */\n function tagName(element) {\n return element.tagName === check\n }\n}\n\n/**\n * Turn a custom test into a test for an element that passes that test.\n *\n * @param {TestFunction} testFunction\n * @returns {Check}\n */\nfunction castFactory(testFunction) {\n return check\n\n /**\n * @this {unknown}\n * @type {Check}\n */\n function check(value, index, parent) {\n return Boolean(\n looksLikeAnElement(value) &&\n testFunction.call(\n this,\n value,\n typeof index === 'number' ? index : undefined,\n parent || undefined\n )\n )\n }\n}\n\n/**\n * Make sure something is an element.\n *\n * @param {unknown} element\n * @returns {element is Element}\n */\nfunction element(element) {\n return Boolean(\n element &&\n typeof element === 'object' &&\n 'type' in element &&\n element.type === 'element' &&\n 'tagName' in element &&\n typeof element.tagName === 'string'\n )\n}\n\n/**\n * @param {unknown} value\n * @returns {value is Element}\n */\nfunction looksLikeAnElement(value) {\n return (\n value !== null &&\n typeof value === 'object' &&\n 'type' in value &&\n 'tagName' in value\n )\n}\n","/**\n * @typedef {import('hast').Comment} Comment\n * @typedef {import('hast').Element} Element\n * @typedef {import('hast').Nodes} Nodes\n * @typedef {import('hast').Parents} Parents\n * @typedef {import('hast').Text} Text\n * @typedef {import('hast-util-is-element').TestFunction} TestFunction\n */\n\n/**\n * @typedef {'normal' | 'nowrap' | 'pre' | 'pre-wrap'} Whitespace\n * Valid and useful whitespace values (from CSS).\n *\n * @typedef {0 | 1 | 2} BreakNumber\n * Specific break:\n *\n * * `0` — space\n * * `1` — line ending\n * * `2` — blank line\n *\n * @typedef {'\\n'} BreakForce\n * Forced break.\n *\n * @typedef {boolean} BreakValue\n * Whether there was a break.\n *\n * @typedef {BreakNumber | BreakValue | undefined} BreakBefore\n * Any value for a break before.\n *\n * @typedef {BreakForce | BreakNumber | BreakValue | undefined} BreakAfter\n * Any value for a break after.\n *\n * @typedef CollectionInfo\n * Info on current collection.\n * @property {BreakAfter} breakAfter\n * Whether there was a break after.\n * @property {BreakBefore} breakBefore\n * Whether there was a break before.\n * @property {Whitespace} whitespace\n * Current whitespace setting.\n *\n * @typedef Options\n * Configuration.\n * @property {Whitespace | null | undefined} [whitespace='normal']\n * Initial CSS whitespace setting to use (default: `'normal'`).\n */\n\nimport {findAfter} from 'unist-util-find-after'\nimport {convertElement} from 'hast-util-is-element'\n\nconst searchLineFeeds = /\\n/g\nconst searchTabOrSpaces = /[\\t ]+/g\n\nconst br = convertElement('br')\nconst cell = convertElement(isCell)\nconst p = convertElement('p')\nconst row = convertElement('tr')\n\n// Note that we don’t need to include void elements here as they don’t have text.\n// See: <https://github.com/wooorm/html-void-elements>\nconst notRendered = convertElement([\n // List from: <https://html.spec.whatwg.org/multipage/rendering.html#hidden-elements>\n 'datalist',\n 'head',\n 'noembed',\n 'noframes',\n 'noscript', // Act as if we support scripting.\n 'rp',\n 'script',\n 'style',\n 'template',\n 'title',\n // Hidden attribute.\n hidden,\n // From: <https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3>\n closedDialog\n])\n\n// See: <https://html.spec.whatwg.org/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints>\nconst blockOrCaption = convertElement([\n 'address', // Flow content\n 'article', // Sections and headings\n 'aside', // Sections and headings\n 'blockquote', // Flow content\n 'body', // Page\n 'caption', // `table-caption`\n 'center', // Flow content (legacy)\n 'dd', // Lists\n 'dialog', // Flow content\n 'dir', // Lists (legacy)\n 'dl', // Lists\n 'dt', // Lists\n 'div', // Flow content\n 'figure', // Flow content\n 'figcaption', // Flow content\n 'footer', // Flow content\n 'form,', // Flow content\n 'h1', // Sections and headings\n 'h2', // Sections and headings\n 'h3', // Sections and headings\n 'h4', // Sections and headings\n 'h5', // Sections and headings\n 'h6', // Sections and headings\n 'header', // Flow content\n 'hgroup', // Sections and headings\n 'hr', // Flow content\n 'html', // Page\n 'legend', // Flow content\n 'li', // Lists (as `display: list-item`)\n 'listing', // Flow content (legacy)\n 'main', // Flow content\n 'menu', // Lists\n 'nav', // Sections and headings\n 'ol', // Lists\n 'p', // Flow content\n 'plaintext', // Flow content (legacy)\n 'pre', // Flow content\n 'section', // Sections and headings\n 'ul', // Lists\n 'xmp' // Flow content (legacy)\n])\n\n/**\n * Get the plain-text value of a node.\n *\n * ###### Algorithm\n *\n * * if `tree` is a comment, returns its `value`\n * * if `tree` is a text, applies normal whitespace collapsing to its\n * `value`, as defined by the CSS Text spec\n * * if `tree` is a root or element, applies an algorithm similar to the\n * `innerText` getter as defined by HTML\n *\n * ###### Notes\n *\n * > 👉 **Note**: the algorithm acts as if `tree` is being rendered, and as if\n * > we’re a CSS-supporting user agent, with scripting enabled.\n *\n * * if `tree` is an element that is not displayed (such as a `head`), we’ll\n * still use the `innerText` algorithm instead of switching to `textContent`\n * * if descendants of `tree` are elements that are not displayed, they are\n * ignored\n * * CSS is not considered, except for the default user agent style sheet\n * * a line feed is collapsed instead of ignored in cases where Fullwidth, Wide,\n * or Halfwidth East Asian Width characters are used, the same goes for a case\n * with Chinese, Japanese, or Yi writing systems\n * * replaced elements (such as `audio`) are treated like non-replaced elements\n *\n * @param {Nodes} tree\n * Tree to turn into text.\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Serialized `tree`.\n */\nexport function toText(tree, options) {\n const options_ = options || {}\n const children = 'children' in tree ? tree.children : []\n const block = blockOrCaption(tree)\n const whitespace = inferWhitespace(tree, {\n whitespace: options_.whitespace || 'normal',\n breakBefore: false,\n breakAfter: false\n })\n\n /** @type {Array<BreakNumber | string>} */\n const results = []\n\n // Treat `text` and `comment` as having normal white-space.\n // This deviates from the spec as in the DOM the node’s `.data` has to be\n // returned.\n // If you want that behavior use `hast-util-to-string`.\n // All other nodes are later handled as if they are `element`s (so the\n // algorithm also works on a `root`).\n // Nodes without children are treated as a void element, so `doctype` is thus\n // ignored.\n if (tree.type === 'text' || tree.type === 'comment') {\n results.push(\n ...collectText(tree, {\n whitespace,\n breakBefore: true,\n breakAfter: true\n })\n )\n }\n\n // 1. If this element is not being rendered, or if the user agent is a\n // non-CSS user agent, then return the same value as the textContent IDL\n // attribute on this element.\n //\n // Note: we’re not supporting stylesheets so we’re acting as if the node\n // is rendered.\n //\n // If you want that behavior use `hast-util-to-string`.\n // Important: we’ll have to account for this later though.\n\n // 2. Let results be a new empty list.\n let index = -1\n\n // 3. For each child node node of this element:\n while (++index < children.length) {\n // 3.1. Let current be the list resulting in running the inner text\n // collection steps with node.\n // Each item in results will either be a JavaScript string or a\n // positive integer (a required line break count).\n // 3.2. For each item item in current, append item to results.\n results.push(\n ...renderedTextCollection(\n children[index],\n // @ts-expect-error: `tree` is a parent if we’re here.\n tree,\n {\n whitespace,\n breakBefore: index ? undefined : block,\n breakAfter:\n index < children.length - 1 ? br(children[index + 1]) : block\n }\n )\n )\n }\n\n // 4. Remove any items from results that are the empty string.\n // 5. Remove any runs of consecutive required line break count items at the\n // start or end of results.\n // 6. Replace each remaining run of consecutive required line break count\n // items with a string consisting of as many U+000A LINE FEED (LF)\n // characters as the maximum of the values in the required line break\n // count items.\n /** @type {Array<string>} */\n const result = []\n /** @type {number | undefined} */\n let count\n\n index = -1\n\n while (++index < results.length) {\n const value = results[index]\n\n if (typeof value === 'number') {\n if (count !== undefined && value > count) count = value\n } else if (value) {\n if (count !== undefined && count > -1) {\n result.push('\\n'.repeat(count) || ' ')\n }\n\n count = -1\n result.push(value)\n }\n }\n\n // 7. Return the concatenation of the string items in results.\n return result.join('')\n}\n\n/**\n * <https://html.spec.whatwg.org/multipage/dom.html#rendered-text-collection-steps>\n *\n * @param {Nodes} node\n * @param {Parents} parent\n * @param {CollectionInfo} info\n * @returns {Array<BreakNumber | string>}\n */\nfunction renderedTextCollection(node, parent, info) {\n if (node.type === 'element') {\n return collectElement(node, parent, info)\n }\n\n if (node.type === 'text') {\n return info.whitespace === 'normal'\n ? collectText(node, info)\n : collectPreText(node)\n }\n\n return []\n}\n\n/**\n * Collect an element.\n *\n * @param {Element} node\n * Element node.\n * @param {Parents} parent\n * @param {CollectionInfo} info\n * Info on current collection.\n * @returns {Array<BreakNumber | string>}\n */\nfunction collectElement(node, parent, info) {\n // First we infer the `white-space` property.\n const whitespace = inferWhitespace(node, info)\n const children = node.children || []\n let index = -1\n /** @type {Array<BreakNumber | string>} */\n let items = []\n\n // We’re ignoring point 3, and exiting without any content here, because we\n // deviated from the spec in `toText` at step 3.\n if (notRendered(node)) {\n return items\n }\n\n /** @type {BreakNumber | undefined} */\n let prefix\n /** @type {BreakForce | BreakNumber | undefined} */\n let suffix\n // Note: we first detect if there is going to be a break before or after the\n // contents, as that changes the white-space handling.\n\n // 2. If node’s computed value of `visibility` is not `visible`, then return\n // items.\n //\n // Note: Ignored, as everything is visible by default user agent styles.\n\n // 3. If node is not being rendered, then return items. [...]\n //\n // Note: We already did this above.\n\n // See `collectText` for step 4.\n\n // 5. If node is a `<br>` element, then append a string containing a single\n // U+000A LINE FEED (LF) character to items.\n if (br(node)) {\n suffix = '\\n'\n }\n\n // 7. If node’s computed value of `display` is `table-row`, and node’s CSS\n // box is not the last `table-row` box of the nearest ancestor `table`\n // box, then append a string containing a single U+000A LINE FEED (LF)\n // character to items.\n //\n // See: <https://html.spec.whatwg.org/multipage/rendering.html#tables-2>\n // Note: needs further investigation as this does not account for implicit\n // rows.\n else if (\n row(node) &&\n // @ts-expect-error: something up with types of parents.\n findAfter(parent, node, row)\n ) {\n suffix = '\\n'\n }\n\n // 8. If node is a `<p>` element, then append 2 (a required line break count)\n // at the beginning and end of items.\n else if (p(node)) {\n prefix = 2\n suffix = 2\n }\n\n // 9. If node’s used value of `display` is block-level or `table-caption`,\n // then append 1 (a required line break count) at the beginning and end of\n // items.\n else if (blockOrCaption(node)) {\n prefix = 1\n suffix = 1\n }\n\n // 1. Let items be the result of running the inner text collection steps with\n // each child node of node in tree order, and then concatenating the\n // results to a single list.\n while (++index < children.length) {\n items = items.concat(\n renderedTextCollection(children[index], node, {\n whitespace,\n breakBefore: index ? undefined : prefix,\n breakAfter:\n index < children.length - 1 ? br(children[index + 1]) : suffix\n })\n )\n }\n\n // 6. If node’s computed value of `display` is `table-cell`, and node’s CSS\n // box is not the last `table-cell` box of its enclosing `table-row` box,\n // then append a string containing a single U+0009 CHARACTER TABULATION\n // (tab) character to items.\n //\n // See: <https://html.spec.whatwg.org/multipage/rendering.html#tables-2>\n if (\n cell(node) &&\n // @ts-expect-error: something up with types of parents.\n findAfter(parent, node, cell)\n ) {\n items.push('\\t')\n }\n\n // Add the pre- and suffix.\n if (prefix) items.unshift(prefix)\n if (suffix) items.push(suffix)\n\n return items\n}\n\n/**\n * 4. If node is a Text node, then for each CSS text box produced by node,\n * in content order, compute the text of the box after application of the\n * CSS `white-space` processing rules and `text-transform` rules, set\n * items to the list of the resulting strings, and return items.\n * The CSS `white-space` processing rules are slightly modified:\n * collapsible spaces at the end of lines are always collapsed, but they\n * are only removed if the line is the last line of the block, or it ends\n * with a br element.\n * Soft hyphens should be preserved.\n *\n * Note: See `collectText` and `collectPreText`.\n * Note: we don’t deal with `text-transform`, no element has that by\n * default.\n *\n * See: <https://drafts.csswg.org/css-text/#white-space-phase-1>\n *\n * @param {Comment | Text} node\n * Text node.\n * @param {CollectionInfo} info\n * Info on current collection.\n * @returns {Array<BreakNumber | string>}\n * Result.\n */\nfunction collectText(node, info) {\n const value = String(node.value)\n /** @type {Array<string>} */\n const lines = []\n /** @type {Array<BreakNumber | string>} */\n const result = []\n let start = 0\n\n while (start <= value.length) {\n searchLineFeeds.lastIndex = start\n\n const match = searchLineFeeds.exec(value)\n const end = match && 'index' in match ? match.index : value.length\n\n lines.push(\n // Any sequence of collapsible spaces and tabs immediately preceding or\n // following a segment break is removed.\n trimAndCollapseSpacesAndTabs(\n // […] ignoring bidi formatting characters (characters with the\n // Bidi_Control property [UAX9]: ALM, LTR, RTL, LRE-RLO, LRI-PDI) as if\n // they were not there.\n value\n .slice(start, end)\n .replace(/[\\u061C\\u200E\\u200F\\u202A-\\u202E\\u2066-\\u2069]/g, ''),\n start === 0 ? info.breakBefore : true,\n end === value.length ? info.breakAfter : true\n )\n )\n\n start = end + 1\n }\n\n // Collapsible segment breaks are transformed for rendering according to the\n // segment break transformation rules.\n // So here we jump to 4.1.2 of [CSSTEXT]:\n // Any collapsible segment break immediately following another collapsible\n // segment break is removed\n let index = -1\n /** @type {BreakNumber | undefined} */\n let join\n\n while (++index < lines.length) {\n // * If the character immediately before or immediately after the segment\n // break is the zero-width space character (U+200B), then the break is\n // removed, leaving behind the zero-width space.\n if (\n lines[index].charCodeAt(lines[index].length - 1) === 0x20_0b /* ZWSP */ ||\n (index < lines.length - 1 &&\n lines[index + 1].charCodeAt(0) === 0x20_0b) /* ZWSP */\n ) {\n result.push(lines[index])\n join = undefined\n }\n\n // * Otherwise, if the East Asian Width property [UAX11] of both the\n // character before and after the segment break is Fullwidth, Wide, or\n // Halfwidth (not Ambiguous), and neither side is Hangul, then the\n // segment break is removed.\n //\n // Note: ignored.\n // * Otherwise, if the writing system of the segment break is Chinese,\n // Japanese, or Yi, and the character before or after the segment break\n // is punctuation or a symbol (Unicode general category P* or S*) and\n // has an East Asian Width property of Ambiguous, and the character on\n // the other side of the segment break is Fullwidth, Wide, or Halfwidth,\n // and not Hangul, then the segment break is removed.\n //\n // Note: ignored.\n\n // * Otherwise, the segment break is converted to a space (U+0020).\n else if (lines[index]) {\n if (typeof join === 'number') result.push(join)\n result.push(lines[index])\n join = 0\n } else if (index === 0 || index === lines.length - 1) {\n // If this line is empty, and it’s the first or last, add a space.\n // Note that this function is only called in normal whitespace, so we\n // don’t worry about `pre`.\n result.push(0)\n }\n }\n\n return result\n}\n\n/**\n * Collect a text node as “pre” whitespace.\n *\n * @param {Text} node\n * Text node.\n * @returns {Array<BreakNumber | string>}\n * Result.\n */\nfunction collectPreText(node) {\n return [String(node.value)]\n}\n\n/**\n * 3. Every collapsible tab is converted to a collapsible space (U+0020).\n * 4. Any collapsible space immediately following another collapsible\n * space—even one outside the boundary of the inline containing that\n * space, provided both spaces are within the same inline formatting\n * context—is collapsed to have zero advance width. (It is invisible,\n * but retains its soft wrap opportunity, if any.)\n *\n * @param {string} value\n * Value to collapse.\n * @param {BreakBefore} breakBefore\n * Whether there was a break before.\n * @param {BreakAfter} breakAfter\n * Whether there was a break after.\n * @returns {string}\n * Result.\n */\nfunction trimAndCollapseSpacesAndTabs(value, breakBefore, breakAfter) {\n /** @type {Array<string>} */\n const result = []\n let start = 0\n /** @type {number | undefined} */\n let end\n\n while (start < value.length) {\n searchTabOrSpaces.lastIndex = start\n const match = searchTabOrSpaces.exec(value)\n end = match ? match.index : value.length\n\n // If we’re not directly after a segment break, but there was white space,\n // add an empty value that will be turned into a space.\n if (!start && !end && match && !breakBefore) {\n result.push('')\n }\n\n if (start !== end) {\n result.push(value.slice(start, end))\n }\n\n start = match ? end + match[0].length : end\n }\n\n // If we reached the end, there was trailing white space, and there’s no\n // segment break after this node, add an empty value that will be turned\n // into a space.\n if (start !== end && !breakAfter) {\n result.push('')\n }\n\n return result.join(' ')\n}\n\n/**\n * Figure out the whitespace of a node.\n *\n * We don’t support void elements here (so `nobr wbr` -> `normal` is ignored).\n *\n * @param {Nodes} node\n * Node (typically `Element`).\n * @param {CollectionInfo} info\n * Info on current collection.\n * @returns {Whitespace}\n * Applied whitespace.\n */\nfunction inferWhitespace(node, info) {\n if (node.type === 'element') {\n const properties = node.properties || {}\n switch (node.tagName) {\n case 'listing':\n case 'plaintext':\n case 'xmp': {\n return 'pre'\n }\n\n case 'nobr': {\n return 'nowrap'\n }\n\n case 'pre': {\n return properties.wrap ? 'pre-wrap' : 'pre'\n }\n\n case 'td':\n case 'th': {\n return properties.noWrap ? 'nowrap' : info.whitespace\n }\n\n case 'textarea': {\n return 'pre-wrap'\n }\n\n default:\n }\n }\n\n return info.whitespace\n}\n\n/**\n * @type {TestFunction}\n * @param {Element} node\n * @returns {node is {properties: {hidden: true}}}\n */\nfunction hidden(node) {\n return Boolean((node.properties || {}).hidden)\n}\n\n/**\n * @type {TestFunction}\n * @param {Element} node\n * @returns {node is {tagName: 'td' | 'th'}}\n */\nfunction isCell(node) {\n return node.tagName === 'td' || node.tagName === 'th'\n}\n\n/**\n * @type {TestFunction}\n */\nfunction closedDialog(node) {\n return node.tagName === 'dialog' && !(node.properties || {}).open\n}\n","/**\n * @import {ElementContent, Root} from 'hast'\n * @import {KatexOptions} from 'katex'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit<KatexOptions, 'displayMode' | 'throwOnError'>} Options\n */\n\nimport {fromHtmlIsomorphic} from 'hast-util-from-html-isomorphic'\nimport {toText} from 'hast-util-to-text'\nimport katex from 'katex'\nimport {SKIP, visitParents} from 'unist-util-visit-parents'\n\n/** @type {Readonly<Options>} */\nconst emptyOptions = {}\n/** @type {ReadonlyArray<unknown>} */\nconst emptyClasses = []\n\n/**\n * Render elements with a `language-math` (or `math-display`, `math-inline`)\n * class with KaTeX.\n *\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns\n * Transform.\n */\nexport default function rehypeKatex(options) {\n const settings = options || emptyOptions\n\n /**\n * Transform.\n *\n * @param {Root} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {undefined}\n * Nothing.\n */\n return function (tree, file) {\n visitParents(tree, 'element', function (element, parents) {\n const classes = Array.isArray(element.properties.className)\n ? element.properties.className\n : emptyClasses\n // This class can be generated from markdown with ` ```math `.\n const languageMath = classes.includes('language-math')\n // This class is used by `remark-math` for flow math (block, `$$\\nmath\\n$$`).\n const mathDisplay = classes.includes('math-display')\n // This class is used by `remark-math` for text math (inline, `$math$`).\n const mathInline = classes.includes('math-inline')\n let displayMode = mathDisplay\n\n // Any class is fine.\n if (!languageMath && !mathDisplay && !mathInline) {\n return\n }\n\n let parent = parents[parents.length - 1]\n let scope = element\n\n // If this was generated with ` ```math `, replace the `<pre>` and use\n // display.\n if (\n element.tagName === 'code' &&\n languageMath &&\n parent &&\n parent.type === 'element' &&\n parent.tagName === 'pre'\n ) {\n scope = parent\n parent = parents[parents.length - 2]\n displayMode = true\n }\n\n /* c8 ignore next -- verbose to test. */\n if (!parent) return\n\n const value = toText(scope, {whitespace: 'pre'})\n\n /** @type {Array<ElementContent> | string | undefined} */\n let result\n\n try {\n result = katex.renderToString(value, {\n ...settings,\n displayMode,\n throwOnError: true\n })\n } catch (error) {\n const cause = /** @type {Error} */ (error)\n const ruleId = cause.name.toLowerCase()\n\n file.message('Could not render math with KaTeX', {\n ancestors: [...parents, element],\n cause,\n place: element.position,\n ruleId,\n source: 'rehype-katex'\n })\n\n // KaTeX *should* handle `ParseError` itself, but not others.\n // it doesn’t always:\n // <https://github.com/remarkjs/react-markdown/issues/853>\n try {\n result = katex.renderToString(value, {\n ...settings,\n displayMode,\n strict: 'ignore',\n throwOnError: false\n })\n } catch {\n // Generate similar markup if this is an other error.\n // See: <https://github.com/KaTeX/KaTeX/blob/5dc7af0/docs/error.md>.\n result = [\n {\n type: 'element',\n tagName: 'span',\n properties: {\n className: ['katex-error'],\n style: 'color:' + (settings.errorColor || '#cc0000'),\n title: String(error)\n },\n children: [{type: 'text', value}]\n }\n ]\n }\n }\n\n if (typeof result === 'string') {\n const root = fromHtmlIsomorphic(result, {fragment: true})\n // Cast as we don’t expect `doctypes` in KaTeX result.\n result = /** @type {Array<ElementContent>} */ (root.children)\n }\n\n const index = parent.children.indexOf(scope)\n parent.children.splice(index, 1, ...result)\n return SKIP\n })\n }\n}\n","/**\n * @typedef {import('hast').Element} HastElement\n * @typedef {import('hast').ElementContent} HastElementContent\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('../index.js').InlineMath} InlineMath\n * @typedef {import('../index.js').Math} Math\n *\n * @typedef ToOptions\n * Configuration.\n * @property {boolean | null | undefined} [singleDollarTextMath=true]\n * Whether to support math (text) with a single dollar (default: `true`).\n *\n * Single dollars work in Pandoc and many other places, but often interfere\n * with “normal” dollars in text.\n * If you turn this off, you can still use two or more dollars for text math.\n */\n\nimport {ok as assert} from 'devlop'\nimport {longestStreak} from 'longest-streak'\n\n/**\n * Create an extension for `mdast-util-from-markdown`.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function mathFromMarkdown() {\n return {\n enter: {\n mathFlow: enterMathFlow,\n mathFlowFenceMeta: enterMathFlowMeta,\n mathText: enterMathText\n },\n exit: {\n mathFlow: exitMathFlow,\n mathFlowFence: exitMathFlowFence,\n mathFlowFenceMeta: exitMathFlowMeta,\n mathFlowValue: exitMathData,\n mathText: exitMathText,\n mathTextData: exitMathData\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathFlow(token) {\n /** @type {HastElement} */\n const code = {\n type: 'element',\n tagName: 'code',\n properties: {className: ['language-math', 'math-display']},\n children: []\n }\n this.enter(\n {\n type: 'math',\n meta: null,\n value: '',\n data: {hName: 'pre', hChildren: [code]}\n },\n token\n )\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathFlowMeta() {\n this.buffer()\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlowMeta() {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'math')\n node.meta = data\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlowFence() {\n // Exit if this is the closing fence.\n if (this.data.mathFlowInside) return\n this.buffer()\n this.data.mathFlowInside = true\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathFlow(token) {\n const data = this.resume().replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '')\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'math')\n this.exit(token)\n node.value = data\n // @ts-expect-error: we defined it in `enterMathFlow`.\n const code = /** @type {HastElement} */ (node.data.hChildren[0])\n assert(code.type === 'element')\n assert(code.tagName === 'code')\n code.children.push({type: 'text', value: data})\n this.data.mathFlowInside = undefined\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function enterMathText(token) {\n this.enter(\n {\n type: 'inlineMath',\n value: '',\n data: {\n hName: 'code',\n hProperties: {className: ['language-math', 'math-inline']},\n hChildren: []\n }\n },\n token\n )\n this.buffer()\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathText(token) {\n const data = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineMath')\n this.exit(token)\n node.value = data\n const children = /** @type {Array<HastElementContent>} */ (\n // @ts-expect-error: we defined it in `enterMathFlow`.\n node.data.hChildren\n )\n children.push({type: 'text', value: data})\n }\n\n /**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\n function exitMathData(token) {\n this.config.enter.data.call(this, token)\n this.config.exit.data.call(this, token)\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown`.\n *\n * @param {ToOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function mathToMarkdown(options) {\n let single = (options || {}).singleDollarTextMath\n\n if (single === null || single === undefined) {\n single = true\n }\n\n inlineMath.peek = inlineMathPeek\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'mathFlowMeta'},\n {character: '\\n', inConstruct: 'mathFlowMeta'},\n {\n character: '$',\n after: single ? undefined : '\\\\$',\n inConstruct: 'phrasing'\n },\n {character: '$', inConstruct: 'mathFlowMeta'},\n {atBreak: true, character: '$', after: '\\\\$'}\n ],\n handlers: {math, inlineMath}\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Math} node\n */\n // Note: fixing this code? Please also fix the similar code for code:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/code.js>\n function math(node, _, state, info) {\n const raw = node.value || ''\n const tracker = state.createTracker(info)\n const sequence = '$'.repeat(Math.max(longestStreak(raw, '$') + 1, 2))\n const exit = state.enter('mathFlow')\n let value = tracker.move(sequence)\n\n if (node.meta) {\n const subexit = state.enter('mathFlowMeta')\n value += tracker.move(\n state.safe(node.meta, {\n after: '\\n',\n before: value,\n encode: ['$'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineMath} node\n */\n // Note: fixing this code? Please also fix the similar code for inline code:\n // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/inline-code.js>\n function inlineMath(node, _, state) {\n let value = node.value || ''\n let size = 1\n\n if (!single) size++\n\n // If there is a single dollar sign on its own in the math, use a fence of\n // two.\n // If there are two in a row, use one.\n while (\n new RegExp('(^|[^$])' + '\\\\$'.repeat(size) + '([^$]|$)').test(value)\n ) {\n size++\n }\n\n const sequence = '$'.repeat(size)\n\n // If this is not just spaces or eols (tabs don’t count), and either the\n // first and last character are a space or eol, or the first or last\n // character are dollar signs, then pad with spaces.\n if (\n // Contains non-space.\n /[^ \\r\\n]/.test(value) &&\n // Starts with space and ends with space.\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) ||\n // Starts or ends with dollar.\n /^\\$|\\$$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n let index = -1\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can’t escape characters in `inlineMath`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.codePointAt(position) === 10 /* `\\n` */ &&\n value.codePointAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n }\n\n /**\n * @returns {string}\n */\n function inlineMathPeek() {\n return '$'\n }\n}\n","/**\n * @import {Construct, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const mathFlow = {\n tokenize: tokenizeMathFenced,\n concrete: true,\n name: 'mathFlow'\n};\n\n/** @type {Construct} */\nconst nonLazyContinuation = {\n tokenize: tokenizeNonLazyContinuation,\n partial: true\n};\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeMathFenced(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n const initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let sizeOpen = 0;\n return start;\n\n /**\n * Start of math.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('mathFlow');\n effects.enter('mathFlowFence');\n effects.enter('mathFlowFenceSequence');\n return sequenceOpen(code);\n }\n\n /**\n * In opening fence sequence.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function sequenceOpen(code) {\n if (code === 36) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n if (sizeOpen < 2) {\n return nok(code);\n }\n effects.exit('mathFlowFenceSequence');\n return factorySpace(effects, metaBefore, \"whitespace\")(code);\n }\n\n /**\n * In opening fence, before meta.\n *\n * ```markdown\n * > | $$asciimath\n * ^\n * | x < y\n * | $$\n * ```\n *\n * @type {State}\n */\n\n function metaBefore(code) {\n if (code === null || markdownLineEnding(code)) {\n return metaAfter(code);\n }\n effects.enter('mathFlowFenceMeta');\n effects.enter(\"chunkString\", {\n contentType: \"string\"\n });\n return meta(code);\n }\n\n /**\n * In meta.\n *\n * ```markdown\n * > | $$asciimath\n * ^\n * | x < y\n * | $$\n * ```\n *\n * @type {State}\n */\n function meta(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"chunkString\");\n effects.exit('mathFlowFenceMeta');\n return metaAfter(code);\n }\n if (code === 36) {\n return nok(code);\n }\n effects.consume(code);\n return meta;\n }\n\n /**\n * After meta.\n *\n * ```markdown\n * > | $$\n * ^\n * | \\frac{1}{2}\n * | $$\n * ```\n *\n * @type {State}\n */\n function metaAfter(code) {\n // Guaranteed to be eol/eof.\n effects.exit('mathFlowFence');\n if (self.interrupt) {\n return ok(code);\n }\n return effects.attempt(nonLazyContinuation, beforeNonLazyContinuation, after)(code);\n }\n\n /**\n * After eol/eof in math, at a non-lazy closing fence or content.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeNonLazyContinuation(code) {\n return effects.attempt({\n tokenize: tokenizeClosingFence,\n partial: true\n }, after, contentStart)(code);\n }\n\n /**\n * Before math content, definitely not before a closing fence.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function contentStart(code) {\n return (initialSize ? factorySpace(effects, beforeContentChunk, \"linePrefix\", initialSize + 1) : beforeContentChunk)(code);\n }\n\n /**\n * Before math content, after optional prefix.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function beforeContentChunk(code) {\n if (code === null) {\n return after(code);\n }\n if (markdownLineEnding(code)) {\n return effects.attempt(nonLazyContinuation, beforeNonLazyContinuation, after)(code);\n }\n effects.enter('mathFlowValue');\n return contentChunk(code);\n }\n\n /**\n * In math content.\n *\n * ```markdown\n * | $$\n * > | \\frac{1}{2}\n * ^\n * | $$\n * ```\n *\n * @type {State}\n */\n function contentChunk(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('mathFlowValue');\n return beforeContentChunk(code);\n }\n effects.consume(code);\n return contentChunk;\n }\n\n /**\n * After math (ha!).\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n effects.exit('mathFlow');\n return ok(code);\n }\n\n /** @type {Tokenizer} */\n function tokenizeClosingFence(effects, ok, nok) {\n let size = 0;\n /**\n * Before closing fence, at optional whitespace.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n */\n return factorySpace(effects, beforeSequenceClose, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4);\n\n /**\n * In closing fence, after optional whitespace, at sequence.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function beforeSequenceClose(code) {\n effects.enter('mathFlowFence');\n effects.enter('mathFlowFenceSequence');\n return sequenceClose(code);\n }\n\n /**\n * In closing fence sequence.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function sequenceClose(code) {\n if (code === 36) {\n size++;\n effects.consume(code);\n return sequenceClose;\n }\n if (size < sizeOpen) {\n return nok(code);\n }\n effects.exit('mathFlowFenceSequence');\n return factorySpace(effects, afterSequenceClose, \"whitespace\")(code);\n }\n\n /**\n * After closing fence sequence, after optional whitespace.\n *\n * ```markdown\n * | $$\n * | \\frac{1}{2}\n * > | $$\n * ^\n * ```\n *\n * @type {State}\n */\n function afterSequenceClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit('mathFlowFence');\n return ok(code);\n }\n return nok(code);\n }\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuation(effects, ok, nok) {\n const self = this;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (code === null) {\n return ok(code);\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineStart;\n }\n\n /** @type {State} */\n function lineStart(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}","/**\n * @import {Options} from 'micromark-extension-math'\n * @import {Construct, Previous, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n// To do: next major: clean spaces in HTML compiler.\n// This has to be coordinated together with `mdast-util-math`.\n\nimport { markdownLineEnding } from 'micromark-util-character';\n/**\n * @param {Options | null | undefined} [options={}]\n * Configuration (default: `{}`).\n * @returns {Construct}\n * Construct.\n */\nexport function mathText(options) {\n const options_ = options || {};\n let single = options_.singleDollarTextMath;\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n tokenize: tokenizeMathText,\n resolve: resolveMathText,\n previous,\n name: 'mathText'\n };\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeMathText(effects, ok, nok) {\n const self = this;\n let sizeOpen = 0;\n /** @type {number} */\n let size;\n /** @type {Token} */\n let token;\n return start;\n\n /**\n * Start of math (text).\n *\n * ```markdown\n * > | $a$\n * ^\n * > | \\$a$\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('mathText');\n effects.enter('mathTextSequence');\n return sequenceOpen(code);\n }\n\n /**\n * In opening sequence.\n *\n * ```markdown\n * > | $a$\n * ^\n * ```\n *\n * @type {State}\n */\n\n function sequenceOpen(code) {\n if (code === 36) {\n effects.consume(code);\n sizeOpen++;\n return sequenceOpen;\n }\n\n // Not enough markers in the sequence.\n if (sizeOpen < 2 && !single) {\n return nok(code);\n }\n effects.exit('mathTextSequence');\n return between(code);\n }\n\n /**\n * Between something and something else.\n *\n * ```markdown\n * > | $a$\n * ^^\n * ```\n *\n * @type {State}\n */\n function between(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 36) {\n token = effects.enter('mathTextSequence');\n size = 0;\n return sequenceClose(code);\n }\n\n // Tabs don’t work, and virtual spaces don’t make sense.\n if (code === 32) {\n effects.enter('space');\n effects.consume(code);\n effects.exit('space');\n return between;\n }\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return between;\n }\n\n // Data.\n effects.enter('mathTextData');\n return data(code);\n }\n\n /**\n * In data.\n *\n * ```markdown\n * > | $a$\n * ^\n * ```\n *\n * @type {State}\n */\n function data(code) {\n if (code === null || code === 32 || code === 36 || markdownLineEnding(code)) {\n effects.exit('mathTextData');\n return between(code);\n }\n effects.consume(code);\n return data;\n }\n\n /**\n * In closing sequence.\n *\n * ```markdown\n * > | `a`\n * ^\n * ```\n *\n * @type {State}\n */\n\n function sequenceClose(code) {\n // More.\n if (code === 36) {\n effects.consume(code);\n size++;\n return sequenceClose;\n }\n\n // Done!\n if (size === sizeOpen) {\n effects.exit('mathTextSequence');\n effects.exit('mathText');\n return ok(code);\n }\n\n // More or less accents: mark as data.\n token.type = 'mathTextData';\n return data(code);\n }\n }\n}\n\n/** @type {Resolver} */\nfunction resolveMathText(events) {\n let tailExitIndex = events.length - 4;\n let headEnterIndex = 3;\n /** @type {number} */\n let index;\n /** @type {number | undefined} */\n let enter;\n\n // If we start and end with an EOL or a space.\n if ((events[headEnterIndex][1].type === \"lineEnding\" || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === \"lineEnding\" || events[tailExitIndex][1].type === 'space')) {\n index = headEnterIndex;\n\n // And we have data.\n while (++index < tailExitIndex) {\n if (events[index][1].type === 'mathTextData') {\n // Then we have padding.\n events[tailExitIndex][1].type = 'mathTextPadding';\n events[headEnterIndex][1].type = 'mathTextPadding';\n headEnterIndex += 2;\n tailExitIndex -= 2;\n break;\n }\n }\n }\n\n // Merge adjacent spaces and data.\n index = headEnterIndex - 1;\n tailExitIndex++;\n while (++index <= tailExitIndex) {\n if (enter === undefined) {\n if (index !== tailExitIndex && events[index][1].type !== \"lineEnding\") {\n enter = index;\n }\n } else if (index === tailExitIndex || events[index][1].type === \"lineEnding\") {\n events[enter][1].type = 'mathTextData';\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n tailExitIndex -= index - enter - 2;\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previous(code) {\n // If there is a previous code, there will always be a tail.\n return code !== 36 || this.events[this.events.length - 1][1].type === \"characterEscape\";\n}","/**\n * @import {Options} from 'micromark-extension-math'\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { mathFlow } from './math-flow.js';\nimport { mathText } from './math-text.js';\n\n/**\n * Create an extension for `micromark` to enable math syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration (default: `{}`).\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable math syntax.\n */\nexport function math(options) {\n return {\n flow: {\n [36]: mathFlow\n },\n text: {\n [36]: mathText(options)\n }\n };\n}","/// <reference types=\"mdast-util-math\" />\n/// <reference types=\"remark-parse\" />\n/// <reference types=\"remark-stringify\" />\n\n/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-math').ToOptions} Options\n * @typedef {import('unified').Processor<Root>} Processor\n */\n\nimport {mathFromMarkdown, mathToMarkdown} from 'mdast-util-math'\nimport {math} from 'micromark-extension-math'\n\n/** @type {Readonly<Options>} */\nconst emptyOptions = {}\n\n/**\n * Add support for math.\n *\n * @param {Readonly<Options> | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkMath(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(math(settings))\n fromMarkdownExtensions.push(mathFromMarkdown())\n toMarkdownExtensions.push(mathToMarkdown(settings))\n}\n","import n from'rehype-katex';import o from'remark-math';function g(e={}){var t,r;let a=[o,{singleDollarTextMath:(t=e.singleDollarTextMath)!=null?t:false}],l=[n,{errorColor:(r=e.errorColor)!=null?r:\"var(--color-muted-foreground)\"}];return {name:\"katex\",type:\"math\",remarkPlugin:a,rehypePlugin:l,getStyles(){return \"katex/dist/katex.min.css\"}}}var h=g();export{g as createMathPlugin,h as math};","import {\n package_default\n} from \"./chunks/mermaid.core/chunk-XAJISQIX.mjs\";\nimport {\n selectSvgElement\n} from \"./chunks/mermaid.core/chunk-EXTU4WIE.mjs\";\nimport {\n JSON_SCHEMA,\n load\n} from \"./chunks/mermaid.core/chunk-MI3HLSF2.mjs\";\nimport {\n registerLayoutLoaders\n} from \"./chunks/mermaid.core/chunk-N4CR4FBY.mjs\";\nimport \"./chunks/mermaid.core/chunk-QXUST7PY.mjs\";\nimport \"./chunks/mermaid.core/chunk-HN2XXSSU.mjs\";\nimport \"./chunks/mermaid.core/chunk-JZLCHNYA.mjs\";\nimport \"./chunks/mermaid.core/chunk-CVBHYZKI.mjs\";\nimport \"./chunks/mermaid.core/chunk-ATLVNIR6.mjs\";\nimport {\n registerIconPacks\n} from \"./chunks/mermaid.core/chunk-JA3XYJ7Z.mjs\";\nimport {\n cleanAndMerge,\n decodeEntities,\n encodeEntities,\n isDetailedError,\n removeDirectives,\n utils_default\n} from \"./chunks/mermaid.core/chunk-S3R3BYOJ.mjs\";\nimport {\n UnknownDiagramError,\n addDirective,\n assignWithDepth_default,\n configureSvgSize,\n defaultConfig,\n detectType,\n detectors,\n evaluate,\n frontMatterRegex,\n getConfig,\n getDiagram,\n getDiagramLoader,\n getSiteConfig,\n registerDiagram,\n registerLazyLoadedDiagrams,\n reset,\n saveConfigFromInitialize,\n setConfig,\n setSiteConfig,\n styles_default,\n themes_default,\n updateSiteConfig\n} from \"./chunks/mermaid.core/chunk-ABZYJK2D.mjs\";\nimport {\n __name,\n log,\n setLogLevel\n} from \"./chunks/mermaid.core/chunk-AGHRB4JF.mjs\";\n\n// src/mermaid.ts\nimport { dedent } from \"ts-dedent\";\n\n// src/diagrams/c4/c4Detector.ts\nvar id = \"c4\";\nvar detector = /* @__PURE__ */ __name((txt) => {\n return /^\\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(txt);\n}, \"detector\");\nvar loader = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/c4Diagram-YG6GDRKO.mjs\");\n return { id, diagram: diagram2 };\n}, \"loader\");\nvar plugin = {\n id,\n detector,\n loader\n};\nvar c4Detector_default = plugin;\n\n// src/diagrams/flowchart/flowDetector.ts\nvar id2 = \"flowchart\";\nvar detector2 = /* @__PURE__ */ __name((txt, config) => {\n if (config?.flowchart?.defaultRenderer === \"dagre-wrapper\" || config?.flowchart?.defaultRenderer === \"elk\") {\n return false;\n }\n return /^\\s*graph/.test(txt);\n}, \"detector\");\nvar loader2 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/flowDiagram-NV44I4VS.mjs\");\n return { id: id2, diagram: diagram2 };\n}, \"loader\");\nvar plugin2 = {\n id: id2,\n detector: detector2,\n loader: loader2\n};\nvar flowDetector_default = plugin2;\n\n// src/diagrams/flowchart/flowDetector-v2.ts\nvar id3 = \"flowchart-v2\";\nvar detector3 = /* @__PURE__ */ __name((txt, config) => {\n if (config?.flowchart?.defaultRenderer === \"dagre-d3\") {\n return false;\n }\n if (config?.flowchart?.defaultRenderer === \"elk\") {\n config.layout = \"elk\";\n }\n if (/^\\s*graph/.test(txt) && config?.flowchart?.defaultRenderer === \"dagre-wrapper\") {\n return true;\n }\n return /^\\s*flowchart/.test(txt);\n}, \"detector\");\nvar loader3 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/flowDiagram-NV44I4VS.mjs\");\n return { id: id3, diagram: diagram2 };\n}, \"loader\");\nvar plugin3 = {\n id: id3,\n detector: detector3,\n loader: loader3\n};\nvar flowDetector_v2_default = plugin3;\n\n// src/diagrams/er/erDetector.ts\nvar id4 = \"er\";\nvar detector4 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*erDiagram/.test(txt);\n}, \"detector\");\nvar loader4 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/erDiagram-Q2GNP2WA.mjs\");\n return { id: id4, diagram: diagram2 };\n}, \"loader\");\nvar plugin4 = {\n id: id4,\n detector: detector4,\n loader: loader4\n};\nvar erDetector_default = plugin4;\n\n// src/diagrams/git/gitGraphDetector.ts\nvar id5 = \"gitGraph\";\nvar detector5 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*gitGraph/.test(txt);\n}, \"detector\");\nvar loader5 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/gitGraphDiagram-NY62KEGX.mjs\");\n return { id: id5, diagram: diagram2 };\n}, \"loader\");\nvar plugin5 = {\n id: id5,\n detector: detector5,\n loader: loader5\n};\nvar gitGraphDetector_default = plugin5;\n\n// src/diagrams/gantt/ganttDetector.ts\nvar id6 = \"gantt\";\nvar detector6 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*gantt/.test(txt);\n}, \"detector\");\nvar loader6 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/ganttDiagram-JELNMOA3.mjs\");\n return { id: id6, diagram: diagram2 };\n}, \"loader\");\nvar plugin6 = {\n id: id6,\n detector: detector6,\n loader: loader6\n};\nvar ganttDetector_default = plugin6;\n\n// src/diagrams/info/infoDetector.ts\nvar id7 = \"info\";\nvar detector7 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*info/.test(txt);\n}, \"detector\");\nvar loader7 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/infoDiagram-WHAUD3N6.mjs\");\n return { id: id7, diagram: diagram2 };\n}, \"loader\");\nvar info = {\n id: id7,\n detector: detector7,\n loader: loader7\n};\n\n// src/diagrams/pie/pieDetector.ts\nvar id8 = \"pie\";\nvar detector8 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*pie/.test(txt);\n}, \"detector\");\nvar loader8 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/pieDiagram-ADFJNKIX.mjs\");\n return { id: id8, diagram: diagram2 };\n}, \"loader\");\nvar pie = {\n id: id8,\n detector: detector8,\n loader: loader8\n};\n\n// src/diagrams/quadrant-chart/quadrantDetector.ts\nvar id9 = \"quadrantChart\";\nvar detector9 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*quadrantChart/.test(txt);\n}, \"detector\");\nvar loader9 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/quadrantDiagram-AYHSOK5B.mjs\");\n return { id: id9, diagram: diagram2 };\n}, \"loader\");\nvar plugin7 = {\n id: id9,\n detector: detector9,\n loader: loader9\n};\nvar quadrantDetector_default = plugin7;\n\n// src/diagrams/xychart/xychartDetector.ts\nvar id10 = \"xychart\";\nvar detector10 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*xychart(-beta)?/.test(txt);\n}, \"detector\");\nvar loader10 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/xychartDiagram-PRI3JC2R.mjs\");\n return { id: id10, diagram: diagram2 };\n}, \"loader\");\nvar plugin8 = {\n id: id10,\n detector: detector10,\n loader: loader10\n};\nvar xychartDetector_default = plugin8;\n\n// src/diagrams/requirement/requirementDetector.ts\nvar id11 = \"requirement\";\nvar detector11 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*requirement(Diagram)?/.test(txt);\n}, \"detector\");\nvar loader11 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/requirementDiagram-UZGBJVZJ.mjs\");\n return { id: id11, diagram: diagram2 };\n}, \"loader\");\nvar plugin9 = {\n id: id11,\n detector: detector11,\n loader: loader11\n};\nvar requirementDetector_default = plugin9;\n\n// src/diagrams/sequence/sequenceDetector.ts\nvar id12 = \"sequence\";\nvar detector12 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*sequenceDiagram/.test(txt);\n}, \"detector\");\nvar loader12 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/sequenceDiagram-WL72ISMW.mjs\");\n return { id: id12, diagram: diagram2 };\n}, \"loader\");\nvar plugin10 = {\n id: id12,\n detector: detector12,\n loader: loader12\n};\nvar sequenceDetector_default = plugin10;\n\n// src/diagrams/class/classDetector.ts\nvar id13 = \"class\";\nvar detector13 = /* @__PURE__ */ __name((txt, config) => {\n if (config?.class?.defaultRenderer === \"dagre-wrapper\") {\n return false;\n }\n return /^\\s*classDiagram/.test(txt);\n}, \"detector\");\nvar loader13 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/classDiagram-2ON5EDUG.mjs\");\n return { id: id13, diagram: diagram2 };\n}, \"loader\");\nvar plugin11 = {\n id: id13,\n detector: detector13,\n loader: loader13\n};\nvar classDetector_default = plugin11;\n\n// src/diagrams/class/classDetector-V2.ts\nvar id14 = \"classDiagram\";\nvar detector14 = /* @__PURE__ */ __name((txt, config) => {\n if (/^\\s*classDiagram/.test(txt) && config?.class?.defaultRenderer === \"dagre-wrapper\") {\n return true;\n }\n return /^\\s*classDiagram-v2/.test(txt);\n}, \"detector\");\nvar loader14 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/classDiagram-v2-WZHVMYZB.mjs\");\n return { id: id14, diagram: diagram2 };\n}, \"loader\");\nvar plugin12 = {\n id: id14,\n detector: detector14,\n loader: loader14\n};\nvar classDetector_V2_default = plugin12;\n\n// src/diagrams/state/stateDetector.ts\nvar id15 = \"state\";\nvar detector15 = /* @__PURE__ */ __name((txt, config) => {\n if (config?.state?.defaultRenderer === \"dagre-wrapper\") {\n return false;\n }\n return /^\\s*stateDiagram/.test(txt);\n}, \"detector\");\nvar loader15 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/stateDiagram-FKZM4ZOC.mjs\");\n return { id: id15, diagram: diagram2 };\n}, \"loader\");\nvar plugin13 = {\n id: id15,\n detector: detector15,\n loader: loader15\n};\nvar stateDetector_default = plugin13;\n\n// src/diagrams/state/stateDetector-V2.ts\nvar id16 = \"stateDiagram\";\nvar detector16 = /* @__PURE__ */ __name((txt, config) => {\n if (/^\\s*stateDiagram-v2/.test(txt)) {\n return true;\n }\n if (/^\\s*stateDiagram/.test(txt) && config?.state?.defaultRenderer === \"dagre-wrapper\") {\n return true;\n }\n return false;\n}, \"detector\");\nvar loader16 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/stateDiagram-v2-4FDKWEC3.mjs\");\n return { id: id16, diagram: diagram2 };\n}, \"loader\");\nvar plugin14 = {\n id: id16,\n detector: detector16,\n loader: loader16\n};\nvar stateDetector_V2_default = plugin14;\n\n// src/diagrams/user-journey/journeyDetector.ts\nvar id17 = \"journey\";\nvar detector17 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*journey/.test(txt);\n}, \"detector\");\nvar loader17 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/journeyDiagram-XKPGCS4Q.mjs\");\n return { id: id17, diagram: diagram2 };\n}, \"loader\");\nvar plugin15 = {\n id: id17,\n detector: detector17,\n loader: loader17\n};\nvar journeyDetector_default = plugin15;\n\n// src/diagrams/error/errorRenderer.ts\nvar draw = /* @__PURE__ */ __name((_text, id28, version) => {\n log.debug(\"rendering svg for syntax error\\n\");\n const svg = selectSvgElement(id28);\n const g = svg.append(\"g\");\n svg.attr(\"viewBox\", \"0 0 2412 512\");\n configureSvgSize(svg, 100, 512, true);\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z\"\n );\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z\"\n );\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z\"\n );\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z\"\n );\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z\"\n );\n g.append(\"path\").attr(\"class\", \"error-icon\").attr(\n \"d\",\n \"m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z\"\n );\n g.append(\"text\").attr(\"class\", \"error-text\").attr(\"x\", 1440).attr(\"y\", 250).attr(\"font-size\", \"150px\").style(\"text-anchor\", \"middle\").text(\"Syntax error in text\");\n g.append(\"text\").attr(\"class\", \"error-text\").attr(\"x\", 1250).attr(\"y\", 400).attr(\"font-size\", \"100px\").style(\"text-anchor\", \"middle\").text(`mermaid version ${version}`);\n}, \"draw\");\nvar renderer = { draw };\nvar errorRenderer_default = renderer;\n\n// src/diagrams/error/errorDiagram.ts\nvar diagram = {\n db: {},\n renderer,\n parser: {\n parse: /* @__PURE__ */ __name(() => {\n return;\n }, \"parse\")\n }\n};\nvar errorDiagram_default = diagram;\n\n// src/diagrams/flowchart/elk/detector.ts\nvar id18 = \"flowchart-elk\";\nvar detector18 = /* @__PURE__ */ __name((txt, config = {}) => {\n if (\n // If diagram explicitly states flowchart-elk\n /^\\s*flowchart-elk/.test(txt) || // If a flowchart/graph diagram has their default renderer set to elk\n /^\\s*(flowchart|graph)/.test(txt) && config?.flowchart?.defaultRenderer === \"elk\"\n ) {\n config.layout = \"elk\";\n return true;\n }\n return false;\n}, \"detector\");\nvar loader18 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/flowDiagram-NV44I4VS.mjs\");\n return { id: id18, diagram: diagram2 };\n}, \"loader\");\nvar plugin16 = {\n id: id18,\n detector: detector18,\n loader: loader18\n};\nvar detector_default = plugin16;\n\n// src/diagrams/timeline/detector.ts\nvar id19 = \"timeline\";\nvar detector19 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*timeline/.test(txt);\n}, \"detector\");\nvar loader19 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/timeline-definition-IT6M3QCI.mjs\");\n return { id: id19, diagram: diagram2 };\n}, \"loader\");\nvar plugin17 = {\n id: id19,\n detector: detector19,\n loader: loader19\n};\nvar detector_default2 = plugin17;\n\n// src/diagrams/mindmap/detector.ts\nvar id20 = \"mindmap\";\nvar detector20 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*mindmap/.test(txt);\n}, \"detector\");\nvar loader20 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/mindmap-definition-VGOIOE7T.mjs\");\n return { id: id20, diagram: diagram2 };\n}, \"loader\");\nvar plugin18 = {\n id: id20,\n detector: detector20,\n loader: loader20\n};\nvar detector_default3 = plugin18;\n\n// src/diagrams/kanban/detector.ts\nvar id21 = \"kanban\";\nvar detector21 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*kanban/.test(txt);\n}, \"detector\");\nvar loader21 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/kanban-definition-3W4ZIXB7.mjs\");\n return { id: id21, diagram: diagram2 };\n}, \"loader\");\nvar plugin19 = {\n id: id21,\n detector: detector21,\n loader: loader21\n};\nvar detector_default4 = plugin19;\n\n// src/diagrams/sankey/sankeyDetector.ts\nvar id22 = \"sankey\";\nvar detector22 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*sankey(-beta)?/.test(txt);\n}, \"detector\");\nvar loader22 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/sankeyDiagram-TZEHDZUN.mjs\");\n return { id: id22, diagram: diagram2 };\n}, \"loader\");\nvar plugin20 = {\n id: id22,\n detector: detector22,\n loader: loader22\n};\nvar sankeyDetector_default = plugin20;\n\n// src/diagrams/packet/detector.ts\nvar id23 = \"packet\";\nvar detector23 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*packet(-beta)?/.test(txt);\n}, \"detector\");\nvar loader23 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/diagram-S2PKOQOG.mjs\");\n return { id: id23, diagram: diagram2 };\n}, \"loader\");\nvar packet = {\n id: id23,\n detector: detector23,\n loader: loader23\n};\n\n// src/diagrams/radar/detector.ts\nvar id24 = \"radar\";\nvar detector24 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*radar-beta/.test(txt);\n}, \"detector\");\nvar loader24 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/diagram-QEK2KX5R.mjs\");\n return { id: id24, diagram: diagram2 };\n}, \"loader\");\nvar radar = {\n id: id24,\n detector: detector24,\n loader: loader24\n};\n\n// src/diagrams/block/blockDetector.ts\nvar id25 = \"block\";\nvar detector25 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*block(-beta)?/.test(txt);\n}, \"detector\");\nvar loader25 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/blockDiagram-VD42YOAC.mjs\");\n return { id: id25, diagram: diagram2 };\n}, \"loader\");\nvar plugin21 = {\n id: id25,\n detector: detector25,\n loader: loader25\n};\nvar blockDetector_default = plugin21;\n\n// src/diagrams/architecture/architectureDetector.ts\nvar id26 = \"architecture\";\nvar detector26 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*architecture/.test(txt);\n}, \"detector\");\nvar loader26 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/architectureDiagram-VXUJARFQ.mjs\");\n return { id: id26, diagram: diagram2 };\n}, \"loader\");\nvar architecture = {\n id: id26,\n detector: detector26,\n loader: loader26\n};\nvar architectureDetector_default = architecture;\n\n// src/diagrams/treemap/detector.ts\nvar id27 = \"treemap\";\nvar detector27 = /* @__PURE__ */ __name((txt) => {\n return /^\\s*treemap/.test(txt);\n}, \"detector\");\nvar loader27 = /* @__PURE__ */ __name(async () => {\n const { diagram: diagram2 } = await import(\"./chunks/mermaid.core/diagram-PSM6KHXK.mjs\");\n return { id: id27, diagram: diagram2 };\n}, \"loader\");\nvar treemap = {\n id: id27,\n detector: detector27,\n loader: loader27\n};\n\n// src/diagram-api/diagram-orchestration.ts\nvar hasLoadedDiagrams = false;\nvar addDiagrams = /* @__PURE__ */ __name(() => {\n if (hasLoadedDiagrams) {\n return;\n }\n hasLoadedDiagrams = true;\n registerDiagram(\"error\", errorDiagram_default, (text) => {\n return text.toLowerCase().trim() === \"error\";\n });\n registerDiagram(\n \"---\",\n // --- diagram type may appear if YAML front-matter is not parsed correctly\n {\n db: {\n clear: /* @__PURE__ */ __name(() => {\n }, \"clear\")\n },\n styles: {},\n // should never be used\n renderer: {\n draw: /* @__PURE__ */ __name(() => {\n }, \"draw\")\n },\n parser: {\n parse: /* @__PURE__ */ __name(() => {\n throw new Error(\n \"Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks\"\n );\n }, \"parse\")\n },\n init: /* @__PURE__ */ __name(() => null, \"init\")\n // no op\n },\n (text) => {\n return text.toLowerCase().trimStart().startsWith(\"---\");\n }\n );\n if (true) {\n registerLazyLoadedDiagrams(detector_default, detector_default3, architectureDetector_default);\n }\n registerLazyLoadedDiagrams(\n c4Detector_default,\n detector_default4,\n classDetector_V2_default,\n classDetector_default,\n erDetector_default,\n ganttDetector_default,\n info,\n pie,\n requirementDetector_default,\n sequenceDetector_default,\n flowDetector_v2_default,\n flowDetector_default,\n detector_default2,\n gitGraphDetector_default,\n stateDetector_V2_default,\n stateDetector_default,\n journeyDetector_default,\n quadrantDetector_default,\n sankeyDetector_default,\n packet,\n xychartDetector_default,\n blockDetector_default,\n radar,\n treemap\n );\n}, \"addDiagrams\");\n\n// src/diagram-api/loadDiagram.ts\nvar loadRegisteredDiagrams = /* @__PURE__ */ __name(async () => {\n log.debug(`Loading registered diagrams`);\n const results = await Promise.allSettled(\n Object.entries(detectors).map(async ([key, { detector: detector28, loader: loader28 }]) => {\n if (!loader28) {\n return;\n }\n try {\n getDiagram(key);\n } catch {\n try {\n const { diagram: diagram2, id: id28 } = await loader28();\n registerDiagram(id28, diagram2, detector28);\n } catch (err) {\n log.error(`Failed to load external diagram with key ${key}. Removing from detectors.`);\n delete detectors[key];\n throw err;\n }\n }\n })\n );\n const failed = results.filter((result) => result.status === \"rejected\");\n if (failed.length > 0) {\n log.error(`Failed to load ${failed.length} external diagrams`);\n for (const res of failed) {\n log.error(res);\n }\n throw new Error(`Failed to load ${failed.length} external diagrams`);\n }\n}, \"loadRegisteredDiagrams\");\n\n// src/mermaidAPI.ts\nimport { select } from \"d3\";\nimport { compile, serialize, stringify } from \"stylis\";\nimport DOMPurify from \"dompurify\";\nimport isEmpty from \"lodash-es/isEmpty.js\";\n\n// src/accessibility.ts\nvar SVG_ROLE = \"graphics-document document\";\nfunction setA11yDiagramInfo(svg, diagramType) {\n svg.attr(\"role\", SVG_ROLE);\n if (diagramType !== \"\") {\n svg.attr(\"aria-roledescription\", diagramType);\n }\n}\n__name(setA11yDiagramInfo, \"setA11yDiagramInfo\");\nfunction addSVGa11yTitleDescription(svg, a11yTitle, a11yDesc, baseId) {\n if (svg.insert === void 0) {\n return;\n }\n if (a11yDesc) {\n const descId = `chart-desc-${baseId}`;\n svg.attr(\"aria-describedby\", descId);\n svg.insert(\"desc\", \":first-child\").attr(\"id\", descId).text(a11yDesc);\n }\n if (a11yTitle) {\n const titleId = `chart-title-${baseId}`;\n svg.attr(\"aria-labelledby\", titleId);\n svg.insert(\"title\", \":first-child\").attr(\"id\", titleId).text(a11yTitle);\n }\n}\n__name(addSVGa11yTitleDescription, \"addSVGa11yTitleDescription\");\n\n// src/Diagram.ts\nvar Diagram = class _Diagram {\n constructor(type, text, db, parser, renderer2) {\n this.type = type;\n this.text = text;\n this.db = db;\n this.parser = parser;\n this.renderer = renderer2;\n }\n static {\n __name(this, \"Diagram\");\n }\n static async fromText(text, metadata = {}) {\n const config = getConfig();\n const type = detectType(text, config);\n text = encodeEntities(text) + \"\\n\";\n try {\n getDiagram(type);\n } catch {\n const loader28 = getDiagramLoader(type);\n if (!loader28) {\n throw new UnknownDiagramError(`Diagram ${type} not found.`);\n }\n const { id: id28, diagram: diagram2 } = await loader28();\n registerDiagram(id28, diagram2);\n }\n const { db, parser, renderer: renderer2, init: init2 } = getDiagram(type);\n if (parser.parser) {\n parser.parser.yy = db;\n }\n db.clear?.();\n init2?.(config);\n if (metadata.title) {\n db.setDiagramTitle?.(metadata.title);\n }\n await parser.parse(text);\n return new _Diagram(type, text, db, parser, renderer2);\n }\n async render(id28, version) {\n await this.renderer.draw(this.text, id28, version, this);\n }\n getParser() {\n return this.parser;\n }\n getType() {\n return this.type;\n }\n};\n\n// src/interactionDb.ts\nvar interactionFunctions = [];\nvar attachFunctions = /* @__PURE__ */ __name(() => {\n interactionFunctions.forEach((f) => {\n f();\n });\n interactionFunctions = [];\n}, \"attachFunctions\");\n\n// src/diagram-api/comments.ts\nvar cleanupComments = /* @__PURE__ */ __name((text) => {\n return text.replace(/^\\s*%%(?!{)[^\\n]+\\n?/gm, \"\").trimStart();\n}, \"cleanupComments\");\n\n// src/diagram-api/frontmatter.ts\nfunction extractFrontMatter(text) {\n const matches = text.match(frontMatterRegex);\n if (!matches) {\n return {\n text,\n metadata: {}\n };\n }\n let parsed = load(matches[1], {\n // To support config, we need JSON schema.\n // https://www.yaml.org/spec/1.2/spec.html#id2803231\n schema: JSON_SCHEMA\n }) ?? {};\n parsed = typeof parsed === \"object\" && !Array.isArray(parsed) ? parsed : {};\n const metadata = {};\n if (parsed.displayMode) {\n metadata.displayMode = parsed.displayMode.toString();\n }\n if (parsed.title) {\n metadata.title = parsed.title.toString();\n }\n if (parsed.config) {\n metadata.config = parsed.config;\n }\n return {\n text: text.slice(matches[0].length),\n metadata\n };\n}\n__name(extractFrontMatter, \"extractFrontMatter\");\n\n// src/preprocess.ts\nvar cleanupText = /* @__PURE__ */ __name((code) => {\n return code.replace(/\\r\\n?/g, \"\\n\").replace(\n /<(\\w+)([^>]*)>/g,\n (match, tag, attributes) => \"<\" + tag + attributes.replace(/=\"([^\"]*)\"/g, \"='$1'\") + \">\"\n );\n}, \"cleanupText\");\nvar processFrontmatter = /* @__PURE__ */ __name((code) => {\n const { text, metadata } = extractFrontMatter(code);\n const { displayMode, title, config = {} } = metadata;\n if (displayMode) {\n if (!config.gantt) {\n config.gantt = {};\n }\n config.gantt.displayMode = displayMode;\n }\n return { title, config, text };\n}, \"processFrontmatter\");\nvar processDirectives = /* @__PURE__ */ __name((code) => {\n const initDirective = utils_default.detectInit(code) ?? {};\n const wrapDirectives = utils_default.detectDirective(code, \"wrap\");\n if (Array.isArray(wrapDirectives)) {\n initDirective.wrap = wrapDirectives.some(({ type }) => type === \"wrap\");\n } else if (wrapDirectives?.type === \"wrap\") {\n initDirective.wrap = true;\n }\n return {\n text: removeDirectives(code),\n directive: initDirective\n };\n}, \"processDirectives\");\nfunction preprocessDiagram(code) {\n const cleanedCode = cleanupText(code);\n const frontMatterResult = processFrontmatter(cleanedCode);\n const directiveResult = processDirectives(frontMatterResult.text);\n const config = cleanAndMerge(frontMatterResult.config, directiveResult.directive);\n code = cleanupComments(directiveResult.text);\n return {\n code,\n title: frontMatterResult.title,\n config\n };\n}\n__name(preprocessDiagram, \"preprocessDiagram\");\n\n// src/utils/base64.ts\nfunction toBase64(str) {\n const utf8Bytes = new TextEncoder().encode(str);\n const utf8Str = Array.from(utf8Bytes, (byte) => String.fromCodePoint(byte)).join(\"\");\n return btoa(utf8Str);\n}\n__name(toBase64, \"toBase64\");\n\n// src/mermaidAPI.ts\nvar MAX_TEXTLENGTH = 5e4;\nvar MAX_TEXTLENGTH_EXCEEDED_MSG = \"graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa\";\nvar SECURITY_LVL_SANDBOX = \"sandbox\";\nvar SECURITY_LVL_LOOSE = \"loose\";\nvar XMLNS_SVG_STD = \"http://www.w3.org/2000/svg\";\nvar XMLNS_XLINK_STD = \"http://www.w3.org/1999/xlink\";\nvar XMLNS_XHTML_STD = \"http://www.w3.org/1999/xhtml\";\nvar IFRAME_WIDTH = \"100%\";\nvar IFRAME_HEIGHT = \"100%\";\nvar IFRAME_STYLES = \"border:0;margin:0;\";\nvar IFRAME_BODY_STYLE = \"margin:0\";\nvar IFRAME_SANDBOX_OPTS = \"allow-top-navigation-by-user-activation allow-popups\";\nvar IFRAME_NOT_SUPPORTED_MSG = 'The \"iframe\" tag is not supported by your browser.';\nvar DOMPURIFY_TAGS = [\"foreignobject\"];\nvar DOMPURIFY_ATTR = [\"dominant-baseline\"];\nfunction processAndSetConfigs(text) {\n const processed = preprocessDiagram(text);\n reset();\n addDirective(processed.config ?? {});\n return processed;\n}\n__name(processAndSetConfigs, \"processAndSetConfigs\");\nasync function parse(text, parseOptions) {\n addDiagrams();\n try {\n const { code, config } = processAndSetConfigs(text);\n const diagram2 = await getDiagramFromText(code);\n return { diagramType: diagram2.type, config };\n } catch (error) {\n if (parseOptions?.suppressErrors) {\n return false;\n }\n throw error;\n }\n}\n__name(parse, \"parse\");\nvar cssImportantStyles = /* @__PURE__ */ __name((cssClass, element, cssClasses = []) => {\n return `\n.${cssClass} ${element} { ${cssClasses.join(\" !important; \")} !important; }`;\n}, \"cssImportantStyles\");\nvar createCssStyles = /* @__PURE__ */ __name((config, classDefs = /* @__PURE__ */ new Map()) => {\n let cssStyles = \"\";\n if (config.themeCSS !== void 0) {\n cssStyles += `\n${config.themeCSS}`;\n }\n if (config.fontFamily !== void 0) {\n cssStyles += `\n:root { --mermaid-font-family: ${config.fontFamily}}`;\n }\n if (config.altFontFamily !== void 0) {\n cssStyles += `\n:root { --mermaid-alt-font-family: ${config.altFontFamily}}`;\n }\n if (classDefs instanceof Map) {\n const htmlLabels = config.htmlLabels ?? config.flowchart?.htmlLabels;\n const cssHtmlElements = [\"> *\", \"span\"];\n const cssShapeElements = [\"rect\", \"polygon\", \"ellipse\", \"circle\", \"path\"];\n const cssElements = htmlLabels ? cssHtmlElements : cssShapeElements;\n classDefs.forEach((styleClassDef) => {\n if (!isEmpty(styleClassDef.styles)) {\n cssElements.forEach((cssElement) => {\n cssStyles += cssImportantStyles(styleClassDef.id, cssElement, styleClassDef.styles);\n });\n }\n if (!isEmpty(styleClassDef.textStyles)) {\n cssStyles += cssImportantStyles(\n styleClassDef.id,\n \"tspan\",\n (styleClassDef?.textStyles || []).map((s) => s.replace(\"color\", \"fill\"))\n );\n }\n });\n }\n return cssStyles;\n}, \"createCssStyles\");\nvar createUserStyles = /* @__PURE__ */ __name((config, graphType, classDefs, svgId) => {\n const userCSSstyles = createCssStyles(config, classDefs);\n const allStyles = styles_default(graphType, userCSSstyles, config.themeVariables);\n return serialize(compile(`${svgId}{${allStyles}}`), stringify);\n}, \"createUserStyles\");\nvar cleanUpSvgCode = /* @__PURE__ */ __name((svgCode = \"\", inSandboxMode, useArrowMarkerUrls) => {\n let cleanedUpSvg = svgCode;\n if (!useArrowMarkerUrls && !inSandboxMode) {\n cleanedUpSvg = cleanedUpSvg.replace(\n /marker-end=\"url\\([\\d+./:=?A-Za-z-]*?#/g,\n 'marker-end=\"url(#'\n );\n }\n cleanedUpSvg = decodeEntities(cleanedUpSvg);\n cleanedUpSvg = cleanedUpSvg.replace(/<br>/g, \"<br/>\");\n return cleanedUpSvg;\n}, \"cleanUpSvgCode\");\nvar putIntoIFrame = /* @__PURE__ */ __name((svgCode = \"\", svgElement) => {\n const height = svgElement?.viewBox?.baseVal?.height ? svgElement.viewBox.baseVal.height + \"px\" : IFRAME_HEIGHT;\n const base64encodedSrc = toBase64(`<body style=\"${IFRAME_BODY_STYLE}\">${svgCode}</body>`);\n return `<iframe style=\"width:${IFRAME_WIDTH};height:${height};${IFRAME_STYLES}\" src=\"data:text/html;charset=UTF-8;base64,${base64encodedSrc}\" sandbox=\"${IFRAME_SANDBOX_OPTS}\">\n ${IFRAME_NOT_SUPPORTED_MSG}\n</iframe>`;\n}, \"putIntoIFrame\");\nvar appendDivSvgG = /* @__PURE__ */ __name((parentRoot, id28, enclosingDivId, divStyle, svgXlink) => {\n const enclosingDiv = parentRoot.append(\"div\");\n enclosingDiv.attr(\"id\", enclosingDivId);\n if (divStyle) {\n enclosingDiv.attr(\"style\", divStyle);\n }\n const svgNode = enclosingDiv.append(\"svg\").attr(\"id\", id28).attr(\"width\", \"100%\").attr(\"xmlns\", XMLNS_SVG_STD);\n if (svgXlink) {\n svgNode.attr(\"xmlns:xlink\", svgXlink);\n }\n svgNode.append(\"g\");\n return parentRoot;\n}, \"appendDivSvgG\");\nfunction sandboxedIframe(parentNode, iFrameId) {\n return parentNode.append(\"iframe\").attr(\"id\", iFrameId).attr(\"style\", \"width: 100%; height: 100%;\").attr(\"sandbox\", \"\");\n}\n__name(sandboxedIframe, \"sandboxedIframe\");\nvar removeExistingElements = /* @__PURE__ */ __name((doc, id28, divId, iFrameId) => {\n doc.getElementById(id28)?.remove();\n doc.getElementById(divId)?.remove();\n doc.getElementById(iFrameId)?.remove();\n}, \"removeExistingElements\");\nvar render = /* @__PURE__ */ __name(async function(id28, text, svgContainingElement) {\n addDiagrams();\n const processed = processAndSetConfigs(text);\n text = processed.code;\n const config = getConfig();\n log.debug(config);\n if (text.length > (config?.maxTextSize ?? MAX_TEXTLENGTH)) {\n text = MAX_TEXTLENGTH_EXCEEDED_MSG;\n }\n const idSelector = \"#\" + id28;\n const iFrameID = \"i\" + id28;\n const iFrameID_selector = \"#\" + iFrameID;\n const enclosingDivID = \"d\" + id28;\n const enclosingDivID_selector = \"#\" + enclosingDivID;\n const removeTempElements = /* @__PURE__ */ __name(() => {\n const tmpElementSelector = isSandboxed ? iFrameID_selector : enclosingDivID_selector;\n const node = select(tmpElementSelector).node();\n if (node && \"remove\" in node) {\n node.remove();\n }\n }, \"removeTempElements\");\n let root = select(\"body\");\n const isSandboxed = config.securityLevel === SECURITY_LVL_SANDBOX;\n const isLooseSecurityLevel = config.securityLevel === SECURITY_LVL_LOOSE;\n const fontFamily = config.fontFamily;\n if (svgContainingElement !== void 0) {\n if (svgContainingElement) {\n svgContainingElement.innerHTML = \"\";\n }\n if (isSandboxed) {\n const iframe = sandboxedIframe(select(svgContainingElement), iFrameID);\n root = select(iframe.nodes()[0].contentDocument.body);\n root.node().style.margin = 0;\n } else {\n root = select(svgContainingElement);\n }\n appendDivSvgG(root, id28, enclosingDivID, `font-family: ${fontFamily}`, XMLNS_XLINK_STD);\n } else {\n removeExistingElements(document, id28, enclosingDivID, iFrameID);\n if (isSandboxed) {\n const iframe = sandboxedIframe(select(\"body\"), iFrameID);\n root = select(iframe.nodes()[0].contentDocument.body);\n root.node().style.margin = 0;\n } else {\n root = select(\"body\");\n }\n appendDivSvgG(root, id28, enclosingDivID);\n }\n let diag;\n let parseEncounteredException;\n try {\n diag = await Diagram.fromText(text, { title: processed.title });\n } catch (error) {\n if (config.suppressErrorRendering) {\n removeTempElements();\n throw error;\n }\n diag = await Diagram.fromText(\"error\");\n parseEncounteredException = error;\n }\n const element = root.select(enclosingDivID_selector).node();\n const diagramType = diag.type;\n const svg = element.firstChild;\n const firstChild = svg.firstChild;\n const diagramClassDefs = diag.renderer.getClasses?.(text, diag);\n const rules = createUserStyles(config, diagramType, diagramClassDefs, idSelector);\n const style1 = document.createElement(\"style\");\n style1.innerHTML = rules;\n svg.insertBefore(style1, firstChild);\n try {\n await diag.renderer.draw(text, id28, package_default.version, diag);\n } catch (e) {\n if (config.suppressErrorRendering) {\n removeTempElements();\n } else {\n errorRenderer_default.draw(text, id28, package_default.version);\n }\n throw e;\n }\n const svgNode = root.select(`${enclosingDivID_selector} svg`);\n const a11yTitle = diag.db.getAccTitle?.();\n const a11yDescr = diag.db.getAccDescription?.();\n addA11yInfo(diagramType, svgNode, a11yTitle, a11yDescr);\n root.select(`[id=\"${id28}\"]`).selectAll(\"foreignobject > *\").attr(\"xmlns\", XMLNS_XHTML_STD);\n let svgCode = root.select(enclosingDivID_selector).node().innerHTML;\n log.debug(\"config.arrowMarkerAbsolute\", config.arrowMarkerAbsolute);\n svgCode = cleanUpSvgCode(svgCode, isSandboxed, evaluate(config.arrowMarkerAbsolute));\n if (isSandboxed) {\n const svgEl = root.select(enclosingDivID_selector + \" svg\").node();\n svgCode = putIntoIFrame(svgCode, svgEl);\n } else if (!isLooseSecurityLevel) {\n svgCode = DOMPurify.sanitize(svgCode, {\n ADD_TAGS: DOMPURIFY_TAGS,\n ADD_ATTR: DOMPURIFY_ATTR,\n HTML_INTEGRATION_POINTS: { foreignobject: true }\n });\n }\n attachFunctions();\n if (parseEncounteredException) {\n throw parseEncounteredException;\n }\n removeTempElements();\n return {\n diagramType,\n svg: svgCode,\n bindFunctions: diag.db.bindFunctions\n };\n}, \"render\");\nfunction initialize(userOptions = {}) {\n const options = assignWithDepth_default({}, userOptions);\n if (options?.fontFamily && !options.themeVariables?.fontFamily) {\n if (!options.themeVariables) {\n options.themeVariables = {};\n }\n options.themeVariables.fontFamily = options.fontFamily;\n }\n saveConfigFromInitialize(options);\n if (options?.theme && options.theme in themes_default) {\n options.themeVariables = themes_default[options.theme].getThemeVariables(\n options.themeVariables\n );\n } else if (options) {\n options.themeVariables = themes_default.default.getThemeVariables(options.themeVariables);\n }\n const config = typeof options === \"object\" ? setSiteConfig(options) : getSiteConfig();\n setLogLevel(config.logLevel);\n addDiagrams();\n}\n__name(initialize, \"initialize\");\nvar getDiagramFromText = /* @__PURE__ */ __name((text, metadata = {}) => {\n const { code } = preprocessDiagram(text);\n return Diagram.fromText(code, metadata);\n}, \"getDiagramFromText\");\nfunction addA11yInfo(diagramType, svgNode, a11yTitle, a11yDescr) {\n setA11yDiagramInfo(svgNode, diagramType);\n addSVGa11yTitleDescription(svgNode, a11yTitle, a11yDescr, svgNode.attr(\"id\"));\n}\n__name(addA11yInfo, \"addA11yInfo\");\nvar mermaidAPI = Object.freeze({\n render,\n parse,\n getDiagramFromText,\n initialize,\n getConfig,\n setConfig,\n getSiteConfig,\n updateSiteConfig,\n reset: /* @__PURE__ */ __name(() => {\n reset();\n }, \"reset\"),\n globalReset: /* @__PURE__ */ __name(() => {\n reset(defaultConfig);\n }, \"globalReset\"),\n defaultConfig\n});\nsetLogLevel(getConfig().logLevel);\nreset(getConfig());\n\n// src/mermaid.ts\nvar handleError = /* @__PURE__ */ __name((error, errors, parseError) => {\n log.warn(error);\n if (isDetailedError(error)) {\n if (parseError) {\n parseError(error.str, error.hash);\n }\n errors.push({ ...error, message: error.str, error });\n } else {\n if (parseError) {\n parseError(error);\n }\n if (error instanceof Error) {\n errors.push({\n str: error.message,\n message: error.message,\n hash: error.name,\n error\n });\n }\n }\n}, \"handleError\");\nvar run = /* @__PURE__ */ __name(async function(options = {\n querySelector: \".mermaid\"\n}) {\n try {\n await runThrowsErrors(options);\n } catch (e) {\n if (isDetailedError(e)) {\n log.error(e.str);\n }\n if (mermaid.parseError) {\n mermaid.parseError(e);\n }\n if (!options.suppressErrors) {\n log.error(\"Use the suppressErrors option to suppress these errors\");\n throw e;\n }\n }\n}, \"run\");\nvar runThrowsErrors = /* @__PURE__ */ __name(async function({ postRenderCallback, querySelector, nodes } = {\n querySelector: \".mermaid\"\n}) {\n const conf = mermaidAPI.getConfig();\n log.debug(`${!postRenderCallback ? \"No \" : \"\"}Callback function found`);\n let nodesToProcess;\n if (nodes) {\n nodesToProcess = nodes;\n } else if (querySelector) {\n nodesToProcess = document.querySelectorAll(querySelector);\n } else {\n throw new Error(\"Nodes and querySelector are both undefined\");\n }\n log.debug(`Found ${nodesToProcess.length} diagrams`);\n if (conf?.startOnLoad !== void 0) {\n log.debug(\"Start On Load: \" + conf?.startOnLoad);\n mermaidAPI.updateSiteConfig({ startOnLoad: conf?.startOnLoad });\n }\n const idGenerator = new utils_default.InitIDGenerator(conf.deterministicIds, conf.deterministicIDSeed);\n let txt;\n const errors = [];\n for (const element of Array.from(nodesToProcess)) {\n log.info(\"Rendering diagram: \" + element.id);\n if (element.getAttribute(\"data-processed\")) {\n continue;\n }\n element.setAttribute(\"data-processed\", \"true\");\n const id28 = `mermaid-${idGenerator.next()}`;\n txt = element.innerHTML;\n txt = dedent(utils_default.entityDecode(txt)).trim().replace(/<br\\s*\\/?>/gi, \"<br/>\");\n const init2 = utils_default.detectInit(txt);\n if (init2) {\n log.debug(\"Detected early reinit: \", init2);\n }\n try {\n const { svg, bindFunctions } = await render2(id28, txt, element);\n element.innerHTML = svg;\n if (postRenderCallback) {\n await postRenderCallback(id28);\n }\n if (bindFunctions) {\n bindFunctions(element);\n }\n } catch (error) {\n handleError(error, errors, mermaid.parseError);\n }\n }\n if (errors.length > 0) {\n throw errors[0];\n }\n}, \"runThrowsErrors\");\nvar initialize2 = /* @__PURE__ */ __name(function(config) {\n mermaidAPI.initialize(config);\n}, \"initialize\");\nvar init = /* @__PURE__ */ __name(async function(config, nodes, callback) {\n log.warn(\"mermaid.init is deprecated. Please use run instead.\");\n if (config) {\n initialize2(config);\n }\n const runOptions = { postRenderCallback: callback, querySelector: \".mermaid\" };\n if (typeof nodes === \"string\") {\n runOptions.querySelector = nodes;\n } else if (nodes) {\n if (nodes instanceof HTMLElement) {\n runOptions.nodes = [nodes];\n } else {\n runOptions.nodes = nodes;\n }\n }\n await run(runOptions);\n}, \"init\");\nvar registerExternalDiagrams = /* @__PURE__ */ __name(async (diagrams, {\n lazyLoad = true\n} = {}) => {\n addDiagrams();\n registerLazyLoadedDiagrams(...diagrams);\n if (lazyLoad === false) {\n await loadRegisteredDiagrams();\n }\n}, \"registerExternalDiagrams\");\nvar contentLoaded = /* @__PURE__ */ __name(function() {\n if (mermaid.startOnLoad) {\n const { startOnLoad } = mermaidAPI.getConfig();\n if (startOnLoad) {\n mermaid.run().catch((err) => log.error(\"Mermaid failed to initialize\", err));\n }\n }\n}, \"contentLoaded\");\nif (typeof document !== \"undefined\") {\n window.addEventListener(\"load\", contentLoaded, false);\n}\nvar setParseErrorHandler = /* @__PURE__ */ __name(function(parseErrorHandler) {\n mermaid.parseError = parseErrorHandler;\n}, \"setParseErrorHandler\");\nvar executionQueue = [];\nvar executionQueueRunning = false;\nvar executeQueue = /* @__PURE__ */ __name(async () => {\n if (executionQueueRunning) {\n return;\n }\n executionQueueRunning = true;\n while (executionQueue.length > 0) {\n const f = executionQueue.shift();\n if (f) {\n try {\n await f();\n } catch (e) {\n log.error(\"Error executing queue\", e);\n }\n }\n }\n executionQueueRunning = false;\n}, \"executeQueue\");\nvar parse2 = /* @__PURE__ */ __name(async (text, parseOptions) => {\n return new Promise((resolve, reject) => {\n const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => {\n mermaidAPI.parse(text, parseOptions).then(\n (r) => {\n res(r);\n resolve(r);\n },\n (e) => {\n log.error(\"Error parsing\", e);\n mermaid.parseError?.(e);\n rej(e);\n reject(e);\n }\n );\n }), \"performCall\");\n executionQueue.push(performCall);\n executeQueue().catch(reject);\n });\n}, \"parse\");\nvar render2 = /* @__PURE__ */ __name((id28, text, container) => {\n return new Promise((resolve, reject) => {\n const performCall = /* @__PURE__ */ __name(() => new Promise((res, rej) => {\n mermaidAPI.render(id28, text, container).then(\n (r) => {\n res(r);\n resolve(r);\n },\n (e) => {\n log.error(\"Error parsing\", e);\n mermaid.parseError?.(e);\n rej(e);\n reject(e);\n }\n );\n }), \"performCall\");\n executionQueue.push(performCall);\n executeQueue().catch(reject);\n });\n}, \"render\");\nvar getRegisteredDiagramsMetadata = /* @__PURE__ */ __name(() => {\n return Object.keys(detectors).map((id28) => ({\n id: id28\n }));\n}, \"getRegisteredDiagramsMetadata\");\nvar mermaid = {\n startOnLoad: true,\n mermaidAPI,\n parse: parse2,\n render: render2,\n init,\n run,\n registerExternalDiagrams,\n registerLayoutLoaders,\n initialize: initialize2,\n parseError: void 0,\n contentLoaded,\n setParseErrorHandler,\n detectType,\n registerIconPacks,\n getRegisteredDiagramsMetadata\n};\nvar mermaid_default = mermaid;\nexport {\n mermaid_default as default\n};\n/*! Check if previously processed */\n/*!\n * Wait for document loaded before starting the execution\n */\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\nexport var SCOPE = '@scope'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @param {number} position\n * @return {number}\n */\nexport function indexof (value, search, position) {\n\treturn value.indexOf(search, position)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n\n/**\n * @param {string[]} array\n * @param {RegExp} pattern\n * @return {string[]}\n */\nexport function filter (array, pattern) {\n\treturn array.filter(function (value) { return !match(value, pattern) })\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {object[]} siblings\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length, siblings) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props)\n}\n\n/**\n * @param {object} root\n */\nexport function lift (root) {\n\twhile (root.root)\n\t\troot = copy(root.root, {children: [root]})\n\n\tappend(root, root.siblings)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, token, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f', abs(index ? points[index - 1] : 0)) != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent, declarations), declarations)\n\t\t\t\t\t\tif ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== ' ') characters += ' '\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length || (variable === 0 && previous === 47)))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tswitch (atrule) {\n\t\t\t\t\t\t\t\t\t// c(ontainer)\n\t\t\t\t\t\t\t\t\tcase 99:\n\t\t\t\t\t\t\t\t\t\tif (charat(characters, 3) === 110) break\n\t\t\t\t\t\t\t\t\t// l(ayer)\n\t\t\t\t\t\t\t\t\tcase 108:\n\t\t\t\t\t\t\t\t\t\tif (charat(characters, 2) === 97) break\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\toffset = 0\n\t\t\t\t\t\t\t\t\t// d(ocument) m(edia) s(upports)\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (offset) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\telse parse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @param {object[]} siblings\n * @return {object}\n */\nexport function comment (value, root, parent, siblings) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function declaration (value, root, parent, length, siblings) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES, NAMESPACE} from './Enum.js'\nimport {strlen} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\n\tfor (var i = 0; i < children.length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: if (!strlen(element.value = element.props.join(','))) return ''\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import n from'mermaid';var m={startOnLoad:false,theme:\"default\",securityLevel:\"strict\",fontFamily:\"monospace\",suppressErrorRendering:true};function o(a={}){let e=false,r={...m,...a.config},t={initialize(i){r={...m,...a.config,...i},n.initialize(r),e=true;},async render(i,g){return e||(n.initialize(r),e=true),await n.render(i,g)}};return {name:\"mermaid\",type:\"diagram\",language:\"mermaid\",getMermaid(i){return i&&t.initialize(i),t}}}var f=o();export{o as createMermaidPlugin,f as mermaid};","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm15 18-6-6 6-6', key: '1wnfg3' }]];\n\n/**\n * @component @name ChevronLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUgMTgtNi02IDYtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chevron-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronLeft = createLucideIcon('chevron-left', __iconNode);\n\nexport default ChevronLeft;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['path', { d: 'm9 18 6-6-6-6', key: 'mthhwq' }]];\n\n/**\n * @component @name ChevronRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOSAxOCA2LTYtNi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/chevron-right\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ChevronRight = createLucideIcon('chevron-right', __iconNode);\n\nexport default ChevronRight;\n","\"use client\";\nexport{i as Block,j as Streamdown,h as StreamdownContext,f as defaultRehypePlugins,g as defaultRemarkPlugins,e as parseMarkdownIntoBlocks}from'./chunk-5FQGJX7Z.js';","\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n ButtonGroup,\n ButtonGroupText,\n} from \"@/components/ui/button-group\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\nimport { cjk } from \"@streamdown/cjk\";\nimport { code } from \"@streamdown/code\";\nimport { math } from \"@streamdown/math\";\nimport { mermaid } from \"@streamdown/mermaid\";\nimport type { UIMessage } from \"ai\";\nimport { ChevronLeftIcon, ChevronRightIcon, ExternalLinkIcon, XIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes, ReactElement } from \"react\";\nimport { createContext, memo, useContext, useEffect, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Streamdown, type LinkSafetyModalProps } from \"streamdown\";\n\nexport type MessageProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage[\"role\"];\n};\n\nexport const Message = ({ className, from, ...props }: MessageProps) => (\n <div\n className={cn(\n \"group flex w-full max-w-[95%] flex-col gap-2 transition-all duration-200\",\n from === \"user\" ? \"is-user ml-auto justify-end\" : \"is-assistant\",\n className\n )}\n {...props}\n />\n);\n\nexport type MessageContentProps = HTMLAttributes<HTMLDivElement>;\n\nexport const MessageContent = ({\n children,\n className,\n ...props\n}: MessageContentProps) => (\n <div\n className={cn(\n \"is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm\",\n \"group-[.is-user]:ml-auto group-[.is-user]:rounded-2xl group-[.is-user]:rounded-br-md group-[.is-user]:bg-primary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-primary-foreground group-[.is-user]:shadow-sm\",\n \"group-[.is-assistant]:text-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nexport type MessageActionsProps = ComponentProps<\"div\">;\n\nexport const MessageActions = ({\n className,\n children,\n ...props\n}: MessageActionsProps) => (\n <div className={cn(\"flex items-center gap-1\", className)} {...props}>\n {children}\n </div>\n);\n\nexport type MessageActionProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n label?: string;\n};\n\nexport const MessageAction = ({\n tooltip,\n children,\n label,\n variant = \"ghost\",\n size = \"icon-sm\",\n ...props\n}: MessageActionProps) => {\n const button = (\n <Button size={size} type=\"button\" variant={variant} {...props}>\n {children}\n <span className=\"sr-only\">{label || tooltip}</span>\n </Button>\n );\n\n if (tooltip) {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>\n <p>{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n }\n\n return button;\n};\n\ninterface MessageBranchContextType {\n currentBranch: number;\n totalBranches: number;\n goToPrevious: () => void;\n goToNext: () => void;\n branches: ReactElement[];\n setBranches: (branches: ReactElement[]) => void;\n}\n\nconst MessageBranchContext = createContext<MessageBranchContextType | null>(\n null\n);\n\nconst useMessageBranch = () => {\n const context = useContext(MessageBranchContext);\n\n if (!context) {\n throw new Error(\n \"MessageBranch components must be used within MessageBranch\"\n );\n }\n\n return context;\n};\n\nexport type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {\n defaultBranch?: number;\n onBranchChange?: (branchIndex: number) => void;\n};\n\nexport const MessageBranch = ({\n defaultBranch = 0,\n onBranchChange,\n className,\n ...props\n}: MessageBranchProps) => {\n const [currentBranch, setCurrentBranch] = useState(defaultBranch);\n const [branches, setBranches] = useState<ReactElement[]>([]);\n\n const handleBranchChange = (newBranch: number) => {\n setCurrentBranch(newBranch);\n onBranchChange?.(newBranch);\n };\n\n const goToPrevious = () => {\n const newBranch =\n currentBranch > 0 ? currentBranch - 1 : branches.length - 1;\n handleBranchChange(newBranch);\n };\n\n const goToNext = () => {\n const newBranch =\n currentBranch < branches.length - 1 ? currentBranch + 1 : 0;\n handleBranchChange(newBranch);\n };\n\n const contextValue: MessageBranchContextType = {\n currentBranch,\n totalBranches: branches.length,\n goToPrevious,\n goToNext,\n branches,\n setBranches,\n };\n\n return (\n <MessageBranchContext.Provider value={contextValue}>\n <div\n className={cn(\"grid w-full gap-2 [&>div]:pb-0\", className)}\n {...props}\n />\n </MessageBranchContext.Provider>\n );\n};\n\nexport type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;\n\nexport const MessageBranchContent = ({\n children,\n ...props\n}: MessageBranchContentProps) => {\n const { currentBranch, setBranches, branches } = useMessageBranch();\n const childrenArray = Array.isArray(children) ? children : [children];\n\n // Use useEffect to update branches when they change\n useEffect(() => {\n if (branches.length !== childrenArray.length) {\n setBranches(childrenArray);\n }\n }, [childrenArray, branches, setBranches]);\n\n return childrenArray.map((branch, index) => (\n <div\n className={cn(\n \"grid gap-2 overflow-hidden [&>div]:pb-0\",\n index === currentBranch ? \"block\" : \"hidden\"\n )}\n key={branch.key}\n {...props}\n >\n {branch}\n </div>\n ));\n};\n\nexport type MessageBranchSelectorProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage[\"role\"];\n};\n\nexport const MessageBranchSelector = ({\n className,\n from,\n ...props\n}: MessageBranchSelectorProps) => {\n const { totalBranches } = useMessageBranch();\n\n // Don't render if there's only one branch\n if (totalBranches <= 1) {\n return null;\n }\n\n return (\n <ButtonGroup\n className=\"[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md\"\n orientation=\"horizontal\"\n {...props}\n />\n );\n};\n\nexport type MessageBranchPreviousProps = ComponentProps<typeof Button>;\n\nexport const MessageBranchPrevious = ({\n children,\n ...props\n}: MessageBranchPreviousProps) => {\n const { goToPrevious, totalBranches } = useMessageBranch();\n\n return (\n <Button\n aria-label=\"Previous branch\"\n disabled={totalBranches <= 1}\n onClick={goToPrevious}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronLeftIcon size={14} />}\n </Button>\n );\n};\n\nexport type MessageBranchNextProps = ComponentProps<typeof Button>;\n\nexport const MessageBranchNext = ({\n children,\n className,\n ...props\n}: MessageBranchNextProps) => {\n const { goToNext, totalBranches } = useMessageBranch();\n\n return (\n <Button\n aria-label=\"Next branch\"\n disabled={totalBranches <= 1}\n onClick={goToNext}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <ChevronRightIcon size={14} />}\n </Button>\n );\n};\n\nexport type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;\n\nexport const MessageBranchPage = ({\n className,\n ...props\n}: MessageBranchPageProps) => {\n const { currentBranch, totalBranches } = useMessageBranch();\n\n return (\n <ButtonGroupText\n className={cn(\n \"border-none bg-transparent text-muted-foreground shadow-none\",\n className\n )}\n {...props}\n >\n {currentBranch + 1} of {totalBranches}\n </ButtonGroupText>\n );\n};\n\nexport type MessageResponseProps = ComponentProps<typeof Streamdown>;\n\n/**\n * Portal-based link safety modal to avoid hydration errors.\n * The default Streamdown modal renders divs inside paragraphs which is invalid HTML.\n * Using a portal renders the modal at the document body level instead.\n */\nexport const LinkSafetyModal = ({\n url,\n isOpen,\n onClose,\n onConfirm,\n}: LinkSafetyModalProps) => {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n if (!mounted || !isOpen) return null;\n\n const hostname = (() => {\n try {\n return new URL(url).hostname;\n } catch {\n return url;\n }\n })();\n\n return createPortal(\n <div\n className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50\"\n onClick={onClose}\n onKeyDown={(e) => e.key === \"Escape\" && onClose()}\n >\n <div\n className=\"relative mx-4 max-w-md rounded-lg bg-background p-6 shadow-lg\"\n onClick={(e) => e.stopPropagation()}\n >\n <button\n className=\"absolute right-3 top-3 rounded-sm p-1 text-muted-foreground hover:bg-muted hover:text-foreground\"\n onClick={onClose}\n type=\"button\"\n >\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </button>\n\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center gap-2 text-lg font-semibold\">\n <ExternalLinkIcon className=\"h-5 w-5\" />\n <span>External Link</span>\n </div>\n\n <p className=\"text-sm text-muted-foreground\">\n You are about to visit an external website:\n </p>\n\n <p className=\"break-all rounded bg-muted px-3 py-2 text-sm font-mono\">\n {hostname}\n </p>\n\n <div className=\"flex justify-end gap-2\">\n <Button variant=\"outline\" onClick={onClose}>\n Cancel\n </Button>\n <Button onClick={onConfirm}>\n Continue\n </Button>\n </div>\n </div>\n </div>\n </div>,\n document.body\n );\n};\n\nexport const MessageResponse = memo(\n ({ className, linkSafety, ...props }: MessageResponseProps) => (\n <Streamdown\n className={cn(\n \"size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0\",\n className\n )}\n plugins={{ code, mermaid, math, cjk }}\n linkSafety={{\n enabled: linkSafety?.enabled ?? true,\n onLinkCheck: linkSafety?.onLinkCheck,\n renderModal: linkSafety?.renderModal ?? LinkSafetyModal,\n }}\n {...props}\n />\n ),\n (prevProps, nextProps) => prevProps.children === nextProps.children\n);\n\nMessageResponse.displayName = \"MessageResponse\";\n\nexport type MessageToolbarProps = ComponentProps<\"div\">;\n\nexport const MessageToolbar = ({\n className,\n children,\n ...props\n}: MessageToolbarProps) => (\n <div\n className={cn(\n \"mt-4 flex w-full items-center justify-between gap-4\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n","\"use client\";\n\n// src/collapsible.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);\nvar [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);\nvar Collapsible = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: COLLAPSIBLE_NAME\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: useId(),\n open,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nCollapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeCollapsible, ...triggerProps } = props;\n const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContent = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nvar CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeCollapsible, present, children, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = React.useState(present);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const heightRef = React.useRef(0);\n const height = heightRef.current;\n const widthRef = React.useRef(0);\n const width = widthRef.current;\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = React.useRef(isOpen);\n const originalStylesRef = React.useRef(void 0);\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n useLayoutEffect(() => {\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n node.style.transitionDuration = \"0s\";\n node.style.animationName = \"none\";\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width;\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration;\n node.style.animationName = originalStylesRef.current.animationName;\n }\n setIsPresent(present);\n }\n }, [context.open, present]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n id: context.contentId,\n hidden: !isOpen,\n ...contentProps,\n ref: composedRefs,\n style: {\n [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,\n [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,\n ...props.style\n },\n children: isOpen && children\n }\n );\n});\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root = Collapsible;\nvar Trigger = CollapsibleTrigger;\nvar Content = CollapsibleContent;\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n Content,\n Root,\n Trigger,\n createCollapsibleScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\"\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\"\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n )\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n )\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M21.801 10A10 10 0 1 1 17 3.335', key: 'yps3ct' }],\n ['path', { d: 'm9 11 3 3L22 4', key: '1pflzl' }],\n];\n\n/**\n * @component @name CircleCheckBig\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEuODAxIDEwQTEwIDEwIDAgMSAxIDE3IDMuMzM1IiAvPgogIDxwYXRoIGQ9Im05IDExIDMgM0wyMiA0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-check-big\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleCheckBig = createLucideIcon('circle-check-big', __iconNode);\n\nexport default CircleCheckBig;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }]];\n\n/**\n * @component @name Circle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Circle = createLucideIcon('circle', __iconNode);\n\nexport default Circle;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 6v6l4 2', key: 'mmk7yg' }],\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n];\n\n/**\n * @component @name Clock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgNnY2bDQgMiIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/clock\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Clock = createLucideIcon('clock', __iconNode);\n\nexport default Clock;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z',\n key: '1ngwbx',\n },\n ],\n];\n\n/**\n * @component @name Wrench\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTQuNyA2LjNhMSAxIDAgMCAwIDAgMS40bDEuNiAxLjZhMSAxIDAgMCAwIDEuNCAwbDMuMTA2LTMuMTA1Yy4zMi0uMzIyLjg2My0uMjIuOTgzLjIxOGE2IDYgMCAwIDEtOC4yNTkgNy4wNTdsLTcuOTEgNy45MWExIDEgMCAwIDEtMi45OTktM2w3LjkxLTcuOTFhNiA2IDAgMCAxIDcuMDU3LTguMjU5Yy40MzguMTIuNTQuNjYyLjIxOS45ODR6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/wrench\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Wrench = createLucideIcon('wrench', __iconNode);\n\nexport default Wrench;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n];\n\n/**\n * @component @name CircleX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJtMTUgOS02IDYiIC8+CiAgPHBhdGggZD0ibTkgOSA2IDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/circle-x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleX = createLucideIcon('circle-x', __iconNode);\n\nexport default CircleX;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2', key: '17jyea' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2', key: 'zix9uf' }],\n];\n\n/**\n * @component @name Copy\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHg9IjgiIHk9IjgiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJNNCAxNmMtMS4xIDAtMi0uOS0yLTJWNGMwLTEuMS45LTIgMi0yaDEwYzEuMSAwIDIgLjkgMiAyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/copy\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Copy = createLucideIcon('copy', __iconNode);\n\nexport default Copy;\n","\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { cn } from \"@/lib/utils\";\nimport { CheckIcon, CopyIcon } from \"lucide-react\";\nimport {\n type ComponentProps,\n type CSSProperties,\n createContext,\n type HTMLAttributes,\n memo,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n type BundledLanguage,\n type BundledTheme,\n createHighlighter,\n type HighlighterGeneric,\n type ThemedToken,\n} from \"shiki\";\n\n// Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline\n// biome-ignore lint/suspicious/noBitwiseOperators: shiki bitflag check\nconst isItalic = (fontStyle: number | undefined) => fontStyle && fontStyle & 1;\n// biome-ignore lint/suspicious/noBitwiseOperators: shiki bitflag check\nconst isBold = (fontStyle: number | undefined) => fontStyle && fontStyle & 2;\nconst isUnderline = (fontStyle: number | undefined) =>\n // biome-ignore lint/suspicious/noBitwiseOperators: shiki bitflag check\n fontStyle && fontStyle & 4;\n\n// Transform tokens to include pre-computed keys to avoid noArrayIndexKey lint\ninterface KeyedToken {\n token: ThemedToken;\n key: string;\n}\ninterface KeyedLine {\n tokens: KeyedToken[];\n key: string;\n}\n\nconst addKeysToTokens = (lines: ThemedToken[][]): KeyedLine[] =>\n lines.map((line, lineIdx) => ({\n key: `line-${lineIdx}`,\n tokens: line.map((token, tokenIdx) => ({\n token,\n key: `line-${lineIdx}-${tokenIdx}`,\n })),\n }));\n\n// Token rendering component\nconst TokenSpan = ({ token }: { token: ThemedToken }) => (\n <span\n className=\"dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]\"\n style={\n {\n color: token.color,\n backgroundColor: token.bgColor,\n ...token.htmlStyle,\n fontStyle: isItalic(token.fontStyle) ? \"italic\" : undefined,\n fontWeight: isBold(token.fontStyle) ? \"bold\" : undefined,\n textDecoration: isUnderline(token.fontStyle) ? \"underline\" : undefined,\n } as CSSProperties\n }\n >\n {token.content}\n </span>\n);\n\n// Line rendering component\nconst LineSpan = ({\n keyedLine,\n showLineNumbers,\n}: {\n keyedLine: KeyedLine;\n showLineNumbers: boolean;\n}) => (\n <span className={showLineNumbers ? LINE_NUMBER_CLASSES : \"block\"}>\n {keyedLine.tokens.length === 0\n ? \"\\n\"\n : keyedLine.tokens.map(({ token, key }) => (\n <TokenSpan key={key} token={token} />\n ))}\n </span>\n);\n\n// Types\ntype CodeBlockProps = HTMLAttributes<HTMLDivElement> & {\n code: string;\n language: BundledLanguage;\n showLineNumbers?: boolean;\n};\n\ninterface TokenizedCode {\n tokens: ThemedToken[][];\n fg: string;\n bg: string;\n}\n\ninterface CodeBlockContextType {\n code: string;\n}\n\n// Context\nconst CodeBlockContext = createContext<CodeBlockContextType>({\n code: \"\",\n});\n\n// Highlighter cache (singleton per language)\nconst highlighterCache = new Map<\n string,\n Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>\n>();\n\n// Token cache\nconst tokensCache = new Map<string, TokenizedCode>();\n\n// Subscribers for async token updates\nconst subscribers = new Map<string, Set<(result: TokenizedCode) => void>>();\n\nconst getTokensCacheKey = (code: string, language: BundledLanguage) => {\n const start = code.slice(0, 100);\n const end = code.length > 100 ? code.slice(-100) : \"\";\n return `${language}:${code.length}:${start}:${end}`;\n};\n\nconst getHighlighter = (\n language: BundledLanguage\n): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> => {\n const cached = highlighterCache.get(language);\n if (cached) {\n return cached;\n }\n\n const highlighterPromise = createHighlighter({\n themes: [\"github-light\", \"github-dark\"],\n langs: [language],\n });\n\n highlighterCache.set(language, highlighterPromise);\n return highlighterPromise;\n};\n\n// Create raw tokens for immediate display while highlighting loads\nconst createRawTokens = (code: string): TokenizedCode => ({\n tokens: code.split(\"\\n\").map((line) =>\n line === \"\"\n ? []\n : [\n {\n content: line,\n color: \"inherit\",\n } as ThemedToken,\n ]\n ),\n fg: \"inherit\",\n bg: \"transparent\",\n});\n\n// Synchronous highlight with callback for async results\nexport function highlightCode(\n code: string,\n language: BundledLanguage,\n callback?: (result: TokenizedCode) => void\n): TokenizedCode | null {\n const tokensCacheKey = getTokensCacheKey(code, language);\n\n // Return cached result if available\n const cached = tokensCache.get(tokensCacheKey);\n if (cached) {\n return cached;\n }\n\n // Subscribe callback if provided\n if (callback) {\n if (!subscribers.has(tokensCacheKey)) {\n subscribers.set(tokensCacheKey, new Set());\n }\n subscribers.get(tokensCacheKey)?.add(callback);\n }\n\n // Start highlighting in background\n getHighlighter(language)\n .then((highlighter) => {\n const availableLangs = highlighter.getLoadedLanguages();\n const langToUse = availableLangs.includes(language) ? language : \"text\";\n\n const result = highlighter.codeToTokens(code, {\n lang: langToUse,\n themes: {\n light: \"github-light\",\n dark: \"github-dark\",\n },\n });\n\n const tokenized: TokenizedCode = {\n tokens: result.tokens,\n fg: result.fg ?? \"\",\n bg: result.bg ?? \"\",\n };\n\n // Cache the result\n tokensCache.set(tokensCacheKey, tokenized);\n\n // Notify all subscribers\n const subs = subscribers.get(tokensCacheKey);\n if (subs) {\n for (const sub of subs) {\n sub(tokenized);\n }\n subscribers.delete(tokensCacheKey);\n }\n })\n .catch((error) => {\n console.error(\"Failed to highlight code:\", error);\n subscribers.delete(tokensCacheKey);\n });\n\n return null;\n}\n\n// Line number styles using CSS counters\nconst LINE_NUMBER_CLASSES = cn(\n \"block\",\n \"before:content-[counter(line)]\",\n \"before:inline-block\",\n \"before:[counter-increment:line]\",\n \"before:w-8\",\n \"before:mr-4\",\n \"before:text-right\",\n \"before:text-muted-foreground/50\",\n \"before:font-mono\",\n \"before:select-none\"\n);\n\nconst CodeBlockBody = memo(\n ({\n tokenized,\n showLineNumbers,\n className,\n }: {\n tokenized: TokenizedCode;\n showLineNumbers: boolean;\n className?: string;\n }) => {\n const preStyle = useMemo(\n () => ({\n backgroundColor: tokenized.bg,\n color: tokenized.fg,\n }),\n [tokenized.bg, tokenized.fg]\n );\n\n const keyedLines = useMemo(\n () => addKeysToTokens(tokenized.tokens),\n [tokenized.tokens]\n );\n\n return (\n <pre\n className={cn(\n \"dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm\",\n className\n )}\n style={preStyle}\n >\n <code\n className={cn(\n \"font-mono text-sm\",\n showLineNumbers && \"[counter-increment:line_0] [counter-reset:line]\"\n )}\n >\n {keyedLines.map((keyedLine) => (\n <LineSpan\n key={keyedLine.key}\n keyedLine={keyedLine}\n showLineNumbers={showLineNumbers}\n />\n ))}\n </code>\n </pre>\n );\n },\n (prevProps, nextProps) =>\n prevProps.tokenized === nextProps.tokenized &&\n prevProps.showLineNumbers === nextProps.showLineNumbers &&\n prevProps.className === nextProps.className\n);\n\nexport const CodeBlockContainer = ({\n className,\n language,\n style,\n ...props\n}: HTMLAttributes<HTMLDivElement> & { language: string }) => (\n <div\n className={cn(\n \"group relative w-full overflow-hidden rounded-md border bg-background text-foreground\",\n className\n )}\n data-language={language}\n style={{\n contentVisibility: \"auto\",\n containIntrinsicSize: \"auto 200px\",\n ...style,\n }}\n {...props}\n />\n);\n\nexport const CodeBlockHeader = ({\n children,\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex items-center justify-between bg-muted/80 px-3 py-2 text-muted-foreground text-xs\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nexport const CodeBlockTitle = ({\n children,\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex items-center gap-2\", className)} {...props}>\n {children}\n </div>\n);\n\nexport const CodeBlockFilename = ({\n children,\n className,\n ...props\n}: HTMLAttributes<HTMLSpanElement>) => (\n <span className={cn(\"font-mono\", className)} {...props}>\n {children}\n </span>\n);\n\nexport const CodeBlockActions = ({\n children,\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex items-center gap-2\", className)} {...props}>\n {children}\n </div>\n);\n\nexport const CodeBlockContent = ({\n code,\n language,\n showLineNumbers = false,\n}: {\n code: string;\n language: BundledLanguage;\n showLineNumbers?: boolean;\n}) => {\n // Memoized raw tokens for immediate display\n const rawTokens = useMemo(() => createRawTokens(code), [code]);\n\n // Try to get cached result synchronously, otherwise use raw tokens\n const [tokenized, setTokenized] = useState<TokenizedCode>(\n () => highlightCode(code, language) ?? rawTokens\n );\n\n useEffect(() => {\n // Reset to raw tokens when code changes (shows current code, not stale tokens)\n setTokenized(highlightCode(code, language) ?? rawTokens);\n\n // Subscribe to async highlighting result\n highlightCode(code, language, setTokenized);\n }, [code, language, rawTokens]);\n\n return (\n <div className=\"relative overflow-auto\">\n <CodeBlockBody showLineNumbers={showLineNumbers} tokenized={tokenized} />\n </div>\n );\n};\n\nexport const CodeBlock = ({\n code,\n language,\n showLineNumbers = false,\n className,\n children,\n ...props\n}: CodeBlockProps) => (\n <CodeBlockContext.Provider value={{ code }}>\n <CodeBlockContainer className={className} language={language} {...props}>\n {children}\n <CodeBlockContent\n code={code}\n language={language}\n showLineNumbers={showLineNumbers}\n />\n </CodeBlockContainer>\n </CodeBlockContext.Provider>\n);\n\nexport type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {\n onCopy?: () => void;\n onError?: (error: Error) => void;\n timeout?: number;\n};\n\nexport const CodeBlockCopyButton = ({\n onCopy,\n onError,\n timeout = 2000,\n children,\n className,\n ...props\n}: CodeBlockCopyButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n const timeoutRef = useRef<number>(0);\n const { code } = useContext(CodeBlockContext);\n\n const copyToClipboard = async () => {\n if (typeof window === \"undefined\" || !navigator?.clipboard?.writeText) {\n onError?.(new Error(\"Clipboard API not available\"));\n return;\n }\n\n try {\n if (!isCopied) {\n await navigator.clipboard.writeText(code);\n setIsCopied(true);\n onCopy?.();\n timeoutRef.current = window.setTimeout(\n () => setIsCopied(false),\n timeout\n );\n }\n } catch (error) {\n onError?.(error as Error);\n }\n };\n\n useEffect(\n () => () => {\n window.clearTimeout(timeoutRef.current);\n },\n []\n );\n\n const Icon = isCopied ? CheckIcon : CopyIcon;\n\n return (\n <Button\n className={cn(\"shrink-0\", className)}\n onClick={copyToClipboard}\n size=\"icon\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <Icon size={14} />}\n </Button>\n );\n};\n\nexport type CodeBlockLanguageSelectorProps = ComponentProps<typeof Select>;\n\nexport const CodeBlockLanguageSelector = (\n props: CodeBlockLanguageSelectorProps\n) => <Select {...props} />;\n\nexport type CodeBlockLanguageSelectorTriggerProps = ComponentProps<\n typeof SelectTrigger\n>;\n\nexport const CodeBlockLanguageSelectorTrigger = ({\n className,\n ...props\n}: CodeBlockLanguageSelectorTriggerProps) => (\n <SelectTrigger\n className={cn(\n \"h-7 border-none bg-transparent px-2 text-xs shadow-none\",\n className\n )}\n size=\"sm\"\n {...props}\n />\n);\n\nexport type CodeBlockLanguageSelectorValueProps = ComponentProps<\n typeof SelectValue\n>;\n\nexport const CodeBlockLanguageSelectorValue = (\n props: CodeBlockLanguageSelectorValueProps\n) => <SelectValue {...props} />;\n\nexport type CodeBlockLanguageSelectorContentProps = ComponentProps<\n typeof SelectContent\n>;\n\nexport const CodeBlockLanguageSelectorContent = ({\n align = \"end\",\n ...props\n}: CodeBlockLanguageSelectorContentProps) => (\n <SelectContent align={align} {...props} />\n);\n\nexport type CodeBlockLanguageSelectorItemProps = ComponentProps<\n typeof SelectItem\n>;\n\nexport const CodeBlockLanguageSelectorItem = (\n props: CodeBlockLanguageSelectorItemProps\n) => <SelectItem {...props} />;\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\nimport type { DynamicToolUIPart, ToolUIPart } from \"ai\";\nimport {\n CheckCircleIcon,\n ChevronDownIcon,\n CircleIcon,\n ClockIcon,\n WrenchIcon,\n XCircleIcon,\n} from \"lucide-react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { isValidElement } from \"react\";\nimport { CodeBlock } from \"./code-block\";\n\nexport type ToolProps = ComponentProps<typeof Collapsible>;\n\nexport const Tool = ({ className, ...props }: ToolProps) => (\n <Collapsible\n className={cn(\"group not-prose mb-4 w-full max-w-full overflow-hidden rounded-md border\", className)}\n {...props}\n />\n);\n\nexport type ToolPart = ToolUIPart | DynamicToolUIPart;\n\nexport type ToolHeaderProps = {\n title?: string;\n className?: string;\n} & (\n | { type: ToolUIPart[\"type\"]; state: ToolUIPart[\"state\"]; toolName?: never }\n | {\n type: DynamicToolUIPart[\"type\"];\n state: DynamicToolUIPart[\"state\"];\n toolName: string;\n }\n);\n\nexport const getStatusBadge = (status: ToolPart[\"state\"]) => {\n const labels: Record<ToolPart[\"state\"], string> = {\n \"input-streaming\": \"Pending\",\n \"input-available\": \"Running\",\n \"approval-requested\": \"Awaiting Approval\",\n \"approval-responded\": \"Responded\",\n \"output-available\": \"Completed\",\n \"output-error\": \"Error\",\n \"output-denied\": \"Denied\",\n };\n\n const icons: Record<ToolPart[\"state\"], ReactNode> = {\n \"input-streaming\": <CircleIcon className=\"size-4\" />,\n \"input-available\": <ClockIcon className=\"size-4 animate-pulse\" />,\n \"approval-requested\": <ClockIcon className=\"size-4 text-yellow-600\" />,\n \"approval-responded\": <CheckCircleIcon className=\"size-4 text-blue-600\" />,\n \"output-available\": <CheckCircleIcon className=\"size-4 text-green-600\" />,\n \"output-error\": <XCircleIcon className=\"size-4 text-red-600\" />,\n \"output-denied\": <XCircleIcon className=\"size-4 text-orange-600\" />,\n };\n\n return (\n <Badge className=\"gap-1.5 rounded-full text-xs\" variant=\"secondary\">\n {icons[status]}\n {labels[status]}\n </Badge>\n );\n};\n\nexport const ToolHeader = ({\n className,\n title,\n type,\n state,\n toolName,\n ...props\n}: ToolHeaderProps) => {\n const derivedName =\n type === \"dynamic-tool\" ? toolName : type.split(\"-\").slice(1).join(\"-\");\n\n return (\n <CollapsibleTrigger\n className={cn(\n \"flex w-full items-center justify-between gap-4 p-3\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <WrenchIcon className=\"size-4 text-muted-foreground\" />\n <span className=\"font-medium text-sm\">{title ?? derivedName}</span>\n {getStatusBadge(state)}\n </div>\n <ChevronDownIcon className=\"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180\" />\n </CollapsibleTrigger>\n );\n};\n\nexport type ToolContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ToolContent = ({ className, ...props }: ToolContentProps) => (\n <CollapsibleContent\n className={cn(\n \"data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in\",\n className\n )}\n {...props}\n />\n);\n\nexport type ToolInputProps = ComponentProps<\"div\"> & {\n input: ToolPart[\"input\"];\n};\n\nexport const ToolInput = ({ className, input, ...props }: ToolInputProps) => (\n <div className={cn(\"space-y-2 overflow-hidden p-4 max-w-full\", className)} {...props}>\n <h4 className=\"font-medium text-muted-foreground text-xs uppercase tracking-wide\">\n Parameters\n </h4>\n <div className=\"rounded-md bg-muted/50 overflow-x-auto max-w-full\">\n <CodeBlock code={JSON.stringify(input, null, 2)} language=\"json\" />\n </div>\n </div>\n);\n\nexport type ToolOutputProps = ComponentProps<\"div\"> & {\n output: ToolPart[\"output\"];\n errorText: ToolPart[\"errorText\"];\n};\n\nexport const ToolOutput = ({\n className,\n output,\n errorText,\n ...props\n}: ToolOutputProps) => {\n if (!(output || errorText)) {\n return null;\n }\n\n let Output = <div>{output as ReactNode}</div>;\n\n if (typeof output === \"object\" && !isValidElement(output)) {\n Output = (\n <CodeBlock code={JSON.stringify(output, null, 2)} language=\"json\" />\n );\n } else if (typeof output === \"string\") {\n Output = <CodeBlock code={output} language=\"json\" />;\n }\n\n return (\n <div className={cn(\"space-y-2 p-4 max-w-full overflow-hidden\", className)} {...props}>\n <h4 className=\"font-medium text-muted-foreground text-xs uppercase tracking-wide\">\n {errorText ? \"Error\" : \"Result\"}\n </h4>\n <div\n className={cn(\n \"overflow-x-auto rounded-md text-xs max-w-full [&_table]:w-full\",\n errorText\n ? \"bg-destructive/10 text-destructive\"\n : \"bg-muted/50 text-foreground\"\n )}\n >\n {errorText && <div>{errorText}</div>}\n {Output}\n </div>\n </div>\n );\n};\n","\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/lib/utils\";\nimport { type LucideIcon, XIcon } from \"lucide-react\";\nimport type { ComponentProps, HTMLAttributes } from \"react\";\n\nexport type ArtifactProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Artifact = ({ className, ...props }: ArtifactProps) => (\n <div\n className={cn(\n \"flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm\",\n className\n )}\n {...props}\n />\n);\n\nexport type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactHeader = ({\n className,\n ...props\n}: ArtifactHeaderProps) => (\n <div\n className={cn(\n \"flex items-center justify-between border-b bg-muted/50 px-4 py-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ArtifactCloseProps = ComponentProps<typeof Button>;\n\nexport const ArtifactClose = ({\n className,\n children,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactCloseProps) => (\n <Button\n className={cn(\n \"size-8 p-0 text-muted-foreground hover:text-foreground\",\n className\n )}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children ?? <XIcon className=\"size-4\" />}\n <span className=\"sr-only\">Close</span>\n </Button>\n);\n\nexport type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;\n\nexport const ArtifactTitle = ({ className, ...props }: ArtifactTitleProps) => (\n <p\n className={cn(\"font-medium text-foreground text-sm\", className)}\n {...props}\n />\n);\n\nexport type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;\n\nexport const ArtifactDescription = ({\n className,\n ...props\n}: ArtifactDescriptionProps) => (\n <p className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n);\n\nexport type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactActions = ({\n className,\n ...props\n}: ArtifactActionsProps) => (\n <div className={cn(\"flex items-center gap-1\", className)} {...props} />\n);\n\nexport type ArtifactActionProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n label?: string;\n icon?: LucideIcon;\n};\n\nexport const ArtifactAction = ({\n tooltip,\n label,\n icon: Icon,\n children,\n className,\n size = \"sm\",\n variant = \"ghost\",\n ...props\n}: ArtifactActionProps) => {\n const button = (\n <Button\n className={cn(\n \"size-8 p-0 text-muted-foreground hover:text-foreground\",\n className\n )}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {Icon ? <Icon className=\"size-4\" /> : children}\n <span className=\"sr-only\">{label || tooltip}</span>\n </Button>\n );\n\n if (tooltip) {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>\n <p>{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n }\n\n return button;\n};\n\nexport type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;\n\nexport const ArtifactContent = ({\n className,\n ...props\n}: ArtifactContentProps) => (\n <div className={cn(\"flex-1 overflow-auto p-4\", className)} {...props} />\n);\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive:\n \"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n \"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n \"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Alert, AlertTitle, AlertDescription }\n","\"use client\";\n\nimport { Alert, AlertDescription } from \"@/components/ui/alert\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport type { ToolUIPart } from \"ai\";\nimport {\n type ComponentProps,\n createContext,\n type ReactNode,\n useContext,\n} from \"react\";\n\ntype ToolUIPartApproval =\n | {\n id: string;\n approved?: never;\n reason?: never;\n }\n | {\n id: string;\n approved: boolean;\n reason?: string;\n }\n | {\n id: string;\n approved: true;\n reason?: string;\n }\n | {\n id: string;\n approved: true;\n reason?: string;\n }\n | {\n id: string;\n approved: false;\n reason?: string;\n }\n | undefined;\n\ninterface ConfirmationContextValue {\n approval: ToolUIPartApproval;\n state: ToolUIPart[\"state\"];\n}\n\nconst ConfirmationContext = createContext<ConfirmationContextValue | null>(\n null\n);\n\nconst useConfirmation = () => {\n const context = useContext(ConfirmationContext);\n\n if (!context) {\n throw new Error(\"Confirmation components must be used within Confirmation\");\n }\n\n return context;\n};\n\nexport type ConfirmationProps = ComponentProps<typeof Alert> & {\n approval?: ToolUIPartApproval;\n state: ToolUIPart[\"state\"];\n};\n\nexport const Confirmation = ({\n className,\n approval,\n state,\n ...props\n}: ConfirmationProps) => {\n if (!approval || state === \"input-streaming\" || state === \"input-available\") {\n return null;\n }\n\n return (\n <ConfirmationContext.Provider value={{ approval, state }}>\n <Alert className={cn(\"flex flex-col gap-2\", className)} {...props} />\n </ConfirmationContext.Provider>\n );\n};\n\nexport type ConfirmationTitleProps = ComponentProps<typeof AlertDescription>;\n\nexport const ConfirmationTitle = ({\n className,\n ...props\n}: ConfirmationTitleProps) => (\n <AlertDescription className={cn(\"inline\", className)} {...props} />\n);\n\nexport interface ConfirmationRequestProps {\n children?: ReactNode;\n}\n\nexport const ConfirmationRequest = ({ children }: ConfirmationRequestProps) => {\n const { state } = useConfirmation();\n\n // Only show when approval is requested\n if (state !== \"approval-requested\") {\n return null;\n }\n\n return children;\n};\n\nexport interface ConfirmationAcceptedProps {\n children?: ReactNode;\n}\n\nexport const ConfirmationAccepted = ({\n children,\n}: ConfirmationAcceptedProps) => {\n const { approval, state } = useConfirmation();\n\n // Only show when approved and in response states\n if (\n !approval?.approved ||\n (state !== \"approval-responded\" &&\n state !== \"output-denied\" &&\n state !== \"output-available\")\n ) {\n return null;\n }\n\n return children;\n};\n\nexport interface ConfirmationRejectedProps {\n children?: ReactNode;\n}\n\nexport const ConfirmationRejected = ({\n children,\n}: ConfirmationRejectedProps) => {\n const { approval, state } = useConfirmation();\n\n // Only show when rejected and in response states\n if (\n approval?.approved !== false ||\n (state !== \"approval-responded\" &&\n state !== \"output-denied\" &&\n state !== \"output-available\")\n ) {\n return null;\n }\n\n return children;\n};\n\nexport type ConfirmationActionsProps = ComponentProps<\"div\">;\n\nexport const ConfirmationActions = ({\n className,\n ...props\n}: ConfirmationActionsProps) => {\n const { state } = useConfirmation();\n\n // Only show when approval is requested\n if (state !== \"approval-requested\") {\n return null;\n }\n\n return (\n <div\n className={cn(\"flex items-center justify-end gap-2 self-end\", className)}\n {...props}\n />\n );\n};\n\nexport type ConfirmationActionProps = ComponentProps<typeof Button>;\n\nexport const ConfirmationAction = (props: ConfirmationActionProps) => (\n <Button className=\"h-8 px-3 text-sm\" type=\"button\" {...props} />\n);\n","import { cn } from \"@/lib/utils\";\nimport type { HTMLAttributes } from \"react\";\n\ninterface LoaderIconProps {\n size?: number;\n}\n\nconst LoaderIcon = ({ size = 16 }: LoaderIconProps) => (\n <svg\n height={size}\n strokeLinejoin=\"round\"\n style={{ color: \"currentcolor\" }}\n viewBox=\"0 0 16 16\"\n width={size}\n >\n <title>Loader</title>\n <g clipPath=\"url(#clip0_2393_1490)\">\n <path d=\"M8 0V4\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path\n d=\"M8 16V12\"\n opacity=\"0.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M3.29773 1.52783L5.64887 4.7639\"\n opacity=\"0.9\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M12.7023 1.52783L10.3511 4.7639\"\n opacity=\"0.1\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M12.7023 14.472L10.3511 11.236\"\n opacity=\"0.4\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M3.29773 14.472L5.64887 11.236\"\n opacity=\"0.6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M15.6085 5.52783L11.8043 6.7639\"\n opacity=\"0.2\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M0.391602 10.472L4.19583 9.23598\"\n opacity=\"0.7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M15.6085 10.4722L11.8043 9.2361\"\n opacity=\"0.3\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n <path\n d=\"M0.391602 5.52783L4.19583 6.7639\"\n opacity=\"0.8\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_2393_1490\">\n <rect fill=\"white\" height=\"16\" width=\"16\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport type LoaderProps = HTMLAttributes<HTMLDivElement> & {\n size?: number;\n};\n\nexport const Loader = ({ className, size = 16, ...props }: LoaderProps) => (\n <div\n className={cn(\n \"inline-flex animate-spin items-center justify-center\",\n className\n )}\n {...props}\n >\n <LoaderIcon size={size} />\n </div>\n);\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 18V5', key: 'adv99a' }],\n ['path', { d: 'M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4', key: '1e3is1' }],\n ['path', { d: 'M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5', key: '1gqd8o' }],\n ['path', { d: 'M17.997 5.125a4 4 0 0 1 2.526 5.77', key: 'iwvgf7' }],\n ['path', { d: 'M18 18a4 4 0 0 0 2-7.464', key: 'efp6ie' }],\n ['path', { d: 'M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517', key: '1gq6am' }],\n ['path', { d: 'M6 18a4 4 0 0 1-2-7.464', key: 'k1g0md' }],\n ['path', { d: 'M6.003 5.125a4 4 0 0 0-2.526 5.77', key: 'q97ue3' }],\n];\n\n/**\n * @component @name Brain\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMThWNSIgLz4KICA8cGF0aCBkPSJNMTUgMTNhNC4xNyA0LjE3IDAgMCAxLTMtNCA0LjE3IDQuMTcgMCAwIDEtMyA0IiAvPgogIDxwYXRoIGQ9Ik0xNy41OTggNi41QTMgMyAwIDEgMCAxMiA1YTMgMyAwIDEgMC01LjU5OCAxLjUiIC8+CiAgPHBhdGggZD0iTTE3Ljk5NyA1LjEyNWE0IDQgMCAwIDEgMi41MjYgNS43NyIgLz4KICA8cGF0aCBkPSJNMTggMThhNCA0IDAgMCAwIDItNy40NjQiIC8+CiAgPHBhdGggZD0iTTE5Ljk2NyAxNy40ODNBNCA0IDAgMSAxIDEyIDE4YTQgNCAwIDEgMS03Ljk2Ny0uNTE3IiAvPgogIDxwYXRoIGQ9Ik02IDE4YTQgNCAwIDAgMS0yLTcuNDY0IiAvPgogIDxwYXRoIGQ9Ik02LjAwMyA1LjEyNWE0IDQgMCAwIDAtMi41MjYgNS43NyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/brain\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Brain = createLucideIcon('brain', __iconNode);\n\nexport default Brain;\n","\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { motion } from \"motion/react\";\nimport {\n type CSSProperties,\n type ElementType,\n type JSX,\n memo,\n useMemo,\n} from \"react\";\n\nexport interface TextShimmerProps {\n children: string;\n as?: ElementType;\n className?: string;\n duration?: number;\n spread?: number;\n}\n\nconst ShimmerComponent = ({\n children,\n as: Component = \"p\",\n className,\n duration = 2,\n spread = 2,\n}: TextShimmerProps) => {\n const MotionComponent = motion.create(\n Component as keyof JSX.IntrinsicElements\n );\n\n const dynamicSpread = useMemo(\n () => (children?.length ?? 0) * spread,\n [children, spread]\n );\n\n return (\n <MotionComponent\n animate={{ backgroundPosition: \"0% center\" }}\n className={cn(\n \"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent\",\n \"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]\",\n className\n )}\n initial={{ backgroundPosition: \"100% center\" }}\n style={\n {\n \"--spread\": `${dynamicSpread}px`,\n backgroundImage:\n \"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))\",\n } as CSSProperties\n }\n transition={{\n repeat: Number.POSITIVE_INFINITY,\n duration,\n ease: \"linear\",\n }}\n >\n {children}\n </MotionComponent>\n );\n};\n\nexport const Shimmer = memo(ShimmerComponent);\n","export const clamp = (min: number, max: number, v: number) => {\n if (v > max) return max\n if (v < min) return min\n return v\n}\n","import { StepId } from \"./types\"\n\nexport const stepsOrder: StepId[] = [\n \"setup\", // Compute\n \"read\", // Read\n \"resolveKeyframes\", // Write/Read/Write/Read\n \"preUpdate\", // Compute\n \"update\", // Compute\n \"preRender\", // Compute\n \"render\", // Write\n \"postRender\", // Compute\n] as const\n\nexport type StepNames = (typeof stepsOrder)[number]\n","export const isDragging = {\n x: false,\n y: false,\n}\n\nexport function isDragActive() {\n return isDragging.x || isDragging.y\n}\n","export const colorRegex =\n /(?:#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\))/giu\n","export const floatRegex = /-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/gu\n","export const isPressing = new WeakSet<EventTarget>()\n","export function mixImmediate<T>(a: T, b: T) {\n return (p: number) => (p > 0 ? b : a)\n}\n","import type { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe<T>(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const index =\n repeat && repeatType !== \"loop\" && repeat % 2 === 1\n ? 0\n : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","export type ElementOrSelector =\n | Element\n | Element[]\n | NodeListOf<Element>\n | string\n | null\n | undefined\n\nexport interface WithQuerySelectorAll {\n querySelectorAll: Element[\"querySelectorAll\"]\n}\n\nexport interface AnimationScope<T = any> {\n readonly current: T\n animations: any[] // TODO: Refactor to types package AnimationPlaybackControls[]\n}\n\nexport interface SelectorCache {\n [key: string]: NodeListOf<Element>\n}\n\nexport function resolveElements(\n elementOrSelector: ElementOrSelector,\n scope?: AnimationScope,\n selectorCache?: SelectorCache\n): Element[] {\n if (elementOrSelector == null) {\n return []\n }\n\n if (elementOrSelector instanceof EventTarget) {\n return [elementOrSelector]\n } else if (typeof elementOrSelector === \"string\") {\n let root: WithQuerySelectorAll = document\n\n if (scope) {\n root = scope.current\n }\n\n const elements =\n selectorCache?.[elementOrSelector] ??\n root.querySelectorAll(elementOrSelector)\n\n return elements ? Array.from(elements) : []\n }\n\n return Array.from(elementOrSelector).filter(\n (element): element is Element => element != null\n )\n}\n","import { transformPropOrder } from \"../utils/keys-transform\"\n\nconst radToDeg = (rad: number) => (rad * 180) / Math.PI\n\ntype MatrixParser = (values: number[]) => number\n\ntype MatrixParsers = Record<\n (typeof transformPropOrder)[number],\n number | MatrixParser\n>\n\nconst rotate = (v: number[]) => {\n const angle = radToDeg(Math.atan2(v[1], v[0]))\n return rebaseAngle(angle)\n}\n\nconst matrix2dParsers: MatrixParsers = {\n x: 4,\n y: 5,\n translateX: 4,\n translateY: 5,\n scaleX: 0,\n scaleY: 3,\n scale: (v) => (Math.abs(v[0]) + Math.abs(v[3])) / 2,\n rotate,\n rotateZ: rotate,\n skewX: (v) => radToDeg(Math.atan(v[1])),\n skewY: (v) => radToDeg(Math.atan(v[2])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[2])) / 2,\n} as const\n\nconst rebaseAngle = (angle: number) => {\n angle = angle % 360\n if (angle < 0) angle += 360\n return angle\n}\n\nconst rotateZ = rotate\n\nconst scaleX = (v: number[]) => Math.sqrt(v[0] * v[0] + v[1] * v[1])\nconst scaleY = (v: number[]) => Math.sqrt(v[4] * v[4] + v[5] * v[5])\n\nconst matrix3dParsers: MatrixParsers = {\n x: 12,\n y: 13,\n z: 14,\n translateX: 12,\n translateY: 13,\n translateZ: 14,\n scaleX,\n scaleY,\n scale: (v) => (scaleX(v) + scaleY(v)) / 2,\n rotateX: (v) => rebaseAngle(radToDeg(Math.atan2(v[6], v[5]))),\n rotateY: (v) => rebaseAngle(radToDeg(Math.atan2(-v[2], v[0]))),\n rotateZ,\n rotate: rotateZ,\n skewX: (v) => radToDeg(Math.atan(v[4])),\n skewY: (v) => radToDeg(Math.atan(v[1])),\n skew: (v) => (Math.abs(v[1]) + Math.abs(v[4])) / 2,\n} as const\n\nexport function defaultTransformValue(name: string): number {\n return name.includes(\"scale\") ? 1 : 0\n}\n\nexport function parseValueFromTransform(\n transform: string | undefined,\n name: string\n): number {\n if (!transform || transform === \"none\") {\n return defaultTransformValue(name)\n }\n\n const matrix3dMatch = transform.match(/^matrix3d\\(([-\\d.e\\s,]+)\\)$/u)\n\n let parsers: MatrixParsers\n let match: RegExpMatchArray | null\n\n if (matrix3dMatch) {\n parsers = matrix3dParsers\n match = matrix3dMatch\n } else {\n const matrix2dMatch = transform.match(/^matrix\\(([-\\d.e\\s,]+)\\)$/u)\n\n parsers = matrix2dParsers\n match = matrix2dMatch\n }\n\n if (!match) {\n return defaultTransformValue(name)\n }\n\n const valueParser = parsers[name]\n const values = match[1].split(\",\").map(convertTransformToNumber)\n\n return typeof valueParser === \"function\"\n ? valueParser(values)\n : values[valueParser]\n}\n\nexport const readTransformValue = (instance: HTMLElement, name: string) => {\n const { transform = \"none\" } = getComputedStyle(instance)\n return parseValueFromTransform(transform, name)\n}\n\nfunction convertTransformToNumber(value: string): number {\n return parseFloat(value.trim())\n}\n","import type { Delta, Point } from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nexport function buildProjectionTransform(\n delta: Delta,\n treeScale: Point,\n latestTransform?: ResolvedValues\n): string {\n let transform = \"\"\n\n /**\n * The translations we use to calculate are always relative to the viewport coordinate space.\n * But when we apply scales, we also scale the coordinate space of an element and its children.\n * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need\n * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.\n */\n const xTranslate = delta.x.translate / treeScale.x\n const yTranslate = delta.y.translate / treeScale.y\n const zTranslate = latestTransform?.z || 0\n if (xTranslate || yTranslate || zTranslate) {\n transform = `translate3d(${xTranslate}px, ${yTranslate}px, ${zTranslate}px) `\n }\n\n /**\n * Apply scale correction for the tree transform.\n * This will apply scale to the screen-orientated axes.\n */\n if (treeScale.x !== 1 || treeScale.y !== 1) {\n transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `\n }\n\n if (latestTransform) {\n const { transformPerspective, rotate, rotateX, rotateY, skewX, skewY } =\n latestTransform\n if (transformPerspective)\n transform = `perspective(${transformPerspective}px) ${transform}`\n if (rotate) transform += `rotate(${rotate}deg) `\n if (rotateX) transform += `rotateX(${rotateX}deg) `\n if (rotateY) transform += `rotateY(${rotateY}deg) `\n if (skewX) transform += `skewX(${skewX}deg) `\n if (skewY) transform += `skewY(${skewY}deg) `\n }\n\n /**\n * Apply scale to match the size of the element to the size we want it.\n * This will apply scale to the element-orientated axes.\n */\n const elementScaleX = delta.x.scale * treeScale.x\n const elementScaleY = delta.y.scale * treeScale.y\n if (elementScaleX !== 1 || elementScaleY !== 1) {\n transform += `scale(${elementScaleX}, ${elementScaleY})`\n }\n\n return transform || \"none\"\n}\n","export const isSVGTag = (tag: unknown) =>\n typeof tag === \"string\" && tag.toLowerCase() === \"svg\"\n","import type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function calcChildStagger(\n children: Set<VisualElement>,\n child: VisualElement,\n delayChildren?: number | DynamicOption<number>,\n staggerChildren: number = 0,\n staggerDirection: number = 1\n): number {\n const index = Array.from(children)\n .sort((a, b) => a.sortNodePosition(b))\n .indexOf(child)\n const numChildren = children.size\n const maxStaggerDuration = (numChildren - 1) * staggerChildren\n const delayIsFunction = typeof delayChildren === \"function\"\n\n return delayIsFunction\n ? delayChildren(index, numChildren)\n : staggerDirection === 1\n ? index * staggerChildren\n : maxStaggerDuration - index * staggerChildren\n}\n","export function addDomEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListener,\n options: AddEventListenerOptions = { passive: true }\n) {\n target.addEventListener(eventName, handler, options)\n\n return () => target.removeEventListener(eventName, handler)\n}\n","import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n","import { AnyResolvedKeyframe } from \"../types\"\n\nexport type CSSVariableName = `--${string}`\n\nexport type CSSVariableToken = `var(${CSSVariableName})`\n\nconst checkStringStartsWith =\n <T extends string>(token: string) =>\n (key?: AnyResolvedKeyframe | null): key is T =>\n typeof key === \"string\" && key.startsWith(token)\n\nexport const isCSSVariableName =\n /*@__PURE__*/ checkStringStartsWith<CSSVariableName>(\"--\")\n\nconst startsAsVariableToken =\n /*@__PURE__*/ checkStringStartsWith<CSSVariableToken>(\"var(--\")\nexport const isCSSVariableToken = (\n value?: string\n): value is CSSVariableToken => {\n const startsWithToken = startsAsVariableToken(value)\n\n if (!startsWithToken) return false\n\n // Ensure any comments are stripped from the value as this can harm performance of the regex.\n return singleCssVariableRegex.test(value.split(\"/*\")[0].trim())\n}\n\nconst singleCssVariableRegex =\n /var\\(--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)$/iu\n\n/**\n * Check if a value contains a CSS variable anywhere (e.g. inside calc()).\n * Unlike isCSSVariableToken which checks if the value IS a var() token,\n * this checks if the value CONTAINS var() somewhere in the string.\n */\nexport function containsCSSVariable(\n value?: AnyResolvedKeyframe | null\n): boolean {\n if (typeof value !== \"string\") return false\n // Strip comments to avoid false positives\n return value.split(\"/*\")[0].includes(\"var(--\")\n}\n","import { BezierDefinition, Easing } from \"../types\"\n\nexport const isBezierDefinition = (\n easing: Easing | Easing[]\n): easing is BezierDefinition =>\n Array.isArray(easing) && typeof easing[0] === \"number\"\n","/*#__NO_SIDE_EFFECTS__*/\nexport const noop = <T>(any: T): T => any\n","interface ReducedMotionState {\n current: boolean | null\n}\n\n// Does this device prefer reduced motion? Returns `null` server-side.\nexport const prefersReducedMotion: ReducedMotionState = { current: null }\n\nexport const hasReducedMotionListener = { current: false }\n","export function isObject(value: unknown): value is object {\n return typeof value === \"object\" && value !== null\n}\n","import { Easing } from \"../types\"\n\nexport const isEasingArray = (ease: any): ease is Easing[] => {\n return Array.isArray(ease) && typeof ease[0] !== \"number\"\n}\n","export function camelToDash(str: string): string {\n return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`)\n}\n","import { AnimationGeneratorType, GeneratorFactory } from \"../../types\"\n\nexport function isGenerator(\n type?: AnimationGeneratorType\n): type is GeneratorFactory {\n return typeof type === \"function\" && \"applyToOptions\" in type\n}\n","import { AnimationPlaybackOptions } from \"../types\"\n\nconst isNotNull = (value: unknown) => value !== null\n\nexport function getFinalKeyframe<T>(\n keyframes: T[],\n { repeat, repeatType = \"loop\" }: AnimationPlaybackOptions,\n finalKeyframe?: T,\n speed: number = 1\n): T {\n const resolvedKeyframes = keyframes.filter(isNotNull)\n const useFirstKeyframe =\n speed < 0 || (repeat && repeatType !== \"loop\" && repeat % 2 === 1)\n const index = useFirstKeyframe ? 0 : resolvedKeyframes.length - 1\n\n return !index || finalKeyframe === undefined\n ? resolvedKeyframes[index]\n : finalKeyframe\n}\n","export function formatErrorMessage(message: string, errorCode?: string) {\n return errorCode\n ? `${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`\n : message\n}\n","import { px } from \"../../value/types/numbers/units\"\nimport type { Axis } from \"motion-utils\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport function pixelsToPercent(pixels: number, axis: Axis): number {\n if (axis.max === axis.min) return 0\n return (pixels / (axis.max - axis.min)) * 100\n}\n\n/**\n * We always correct borderRadius as a percentage rather than pixels to reduce paints.\n * For example, if you are projecting a box that is 100px wide with a 10px borderRadius\n * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%\n * borderRadius in both states. If we animate between the two in pixels that will trigger\n * a paint each time. If we animate between the two in percentage we'll avoid a paint.\n */\nexport const correctBorderRadius: ScaleCorrectorDefinition = {\n correct: (latest, node) => {\n if (!node.target) return latest\n\n /**\n * If latest is a string, if it's a percentage we can return immediately as it's\n * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.\n */\n if (typeof latest === \"string\") {\n if (px.test(latest)) {\n latest = parseFloat(latest)\n } else {\n return latest\n }\n }\n\n /**\n * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that\n * pixel value as a percentage of each axis\n */\n const x = pixelsToPercent(latest, node.target.x)\n const y = pixelsToPercent(latest, node.target.y)\n\n return `${x}% ${y}%`\n },\n}\n","import { statsBuffer } from \"../stats/buffer\"\nimport { StepNames } from \"./order\"\nimport { FrameData, Process, Step } from \"./types\"\n\nexport function createRenderStep(\n runNextFrame: () => void,\n stepName?: StepNames\n): Step {\n /**\n * We create and reuse two queues, one to queue jobs for the current frame\n * and one for the next. We reuse to avoid triggering GC after x frames.\n */\n let thisFrame = new Set<Process>()\n let nextFrame = new Set<Process>()\n\n /**\n * Track whether we're currently processing jobs in this step. This way\n * we can decide whether to schedule new jobs for this frame or next.\n */\n let isProcessing = false\n\n let flushNextFrame = false\n\n /**\n * A set of processes which were marked keepAlive when scheduled.\n */\n const toKeepAlive = new WeakSet<Process>()\n\n let latestFrameData: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n let numCalls = 0\n\n function triggerCallback(callback: Process) {\n if (toKeepAlive.has(callback)) {\n step.schedule(callback)\n runNextFrame()\n }\n\n numCalls++\n callback(latestFrameData)\n }\n\n const step: Step = {\n /**\n * Schedule a process to run on the next frame.\n */\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing\n const queue = addToCurrentFrame ? thisFrame : nextFrame\n\n if (keepAlive) toKeepAlive.add(callback)\n\n if (!queue.has(callback)) queue.add(callback)\n\n return callback\n },\n\n /**\n * Cancel the provided callback from running on the next frame.\n */\n cancel: (callback) => {\n nextFrame.delete(callback)\n toKeepAlive.delete(callback)\n },\n\n /**\n * Execute all schedule callbacks.\n */\n process: (frameData) => {\n latestFrameData = frameData\n\n /**\n * If we're already processing we've probably been triggered by a flushSync\n * inside an existing process. Instead of executing, mark flushNextFrame\n * as true and ensure we flush the following frame at the end of this one.\n */\n if (isProcessing) {\n flushNextFrame = true\n return\n }\n\n isProcessing = true\n\n // Swap this frame and the next to avoid GC\n ;[thisFrame, nextFrame] = [nextFrame, thisFrame]\n\n // Execute this frame\n thisFrame.forEach(triggerCallback)\n\n /**\n * If we're recording stats then\n */\n if (stepName && statsBuffer.value) {\n statsBuffer.value.frameloop[stepName].push(numCalls)\n }\n numCalls = 0\n\n // Clear the frame so no callbacks remain. This is to avoid\n // memory leaks should this render step not run for a while.\n thisFrame.clear()\n\n isProcessing = false\n\n if (flushNextFrame) {\n flushNextFrame = false\n step.process(frameData)\n }\n },\n }\n\n return step\n}\n","import {\n ElementOrSelector,\n resolveElements,\n} from \"../../utils/resolve-elements\"\nimport { EventOptions } from \"../types\"\n\nexport function setupGesture(\n elementOrSelector: ElementOrSelector,\n options: EventOptions\n): [Element[], AddEventListenerOptions, VoidFunction] {\n const elements = resolveElements(elementOrSelector)\n\n const gestureAbortController = new AbortController()\n\n const eventOptions = {\n passive: true,\n ...options,\n signal: gestureAbortController.signal,\n }\n\n const cancel = () => gestureAbortController.abort()\n\n return [elements, eventOptions, cancel]\n}\n","// Accepts an easing function and returns a new one that outputs reversed values.\n\nimport { EasingModifier } from \"../types\"\n\n// Turns easeIn into easeOut.\nexport const reverseEasing: EasingModifier = (easing) => (p) =>\n 1 - easing(1 - p)\n","import { backIn } from \"./back\"\n\nexport const anticipate = (p: number) =>\n (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)))\n","import type { VisualElement } from \"motion-dom\"\n\n// Fixes https://github.com/motiondivision/motion/issues/2270\nexport const getContextWindow = ({ current }: VisualElement<Element>) => {\n return current ? current.ownerDocument.defaultView : null\n}\n","import { memo } from \"motion-utils\"\nimport { ProgressTimeline } from \"../..\"\n\ndeclare global {\n interface Window {\n ScrollTimeline: ScrollTimeline\n }\n}\n\ndeclare class ScrollTimeline implements ProgressTimeline {\n constructor(options: ScrollOptions)\n\n currentTime: null | { value: number }\n\n cancel?: VoidFunction\n}\n\nexport const supportsScrollTimeline = /* @__PURE__ */ memo(\n () => window.ScrollTimeline !== undefined\n)\n","// Accepts an easing function and returns a new one that outputs mirrored values for\n\nimport { EasingModifier } from \"../types\"\n\n// the second half of the animation. Turns easeIn into easeInOut.\nexport const mirrorEasing: EasingModifier = (easing) => (p) =>\n p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\n\n/*#__NO_SIDE_EFFECTS__*/\nconst createUnitType = (unit: string) => ({\n test: (v: AnyResolvedKeyframe) =>\n typeof v === \"string\" && v.endsWith(unit) && v.split(\" \").length === 1,\n parse: parseFloat,\n transform: (v: number | string) => `${v}${unit}`,\n})\n\nexport const degrees = /*@__PURE__*/ createUnitType(\"deg\")\nexport const percent = /*@__PURE__*/ createUnitType(\"%\")\nexport const px = /*@__PURE__*/ createUnitType(\"px\")\nexport const vh = /*@__PURE__*/ createUnitType(\"vh\")\nexport const vw = /*@__PURE__*/ createUnitType(\"vw\")\n\nexport const progressPercentage = /*@__PURE__*/ (() => ({\n ...percent,\n parse: (v: string) => percent.parse(v) / 100,\n transform: (v: number) => percent.transform(v * 100),\n}))()\n","/**\n * Check if value is a numerical string, ie a string that is purely a number eg \"100\" or \"-100.1\"\n */\nexport const isNumericalString = (v: string) => /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)$/u.test(v)\n","import { Feature, frame, press, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handlePressEvent(\n node: VisualElement<Element>,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\" | \"Cancel\"\n) {\n const { props } = node\n\n if (node.current instanceof HTMLButtonElement && node.current.disabled) {\n return\n }\n\n if (node.animationState && props.whileTap) {\n node.animationState.setActive(\"whileTap\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onTap\" + (lifecycle === \"End\" ? \"\" : lifecycle)) as\n | \"onTapStart\"\n | \"onTap\"\n | \"onTapCancel\"\n\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class PressGesture extends Feature<Element> {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = press(\n current,\n (_element, startEvent) => {\n handlePressEvent(this.node, startEvent, \"Start\")\n\n return (endEvent, { success }) =>\n handlePressEvent(\n this.node,\n endEvent,\n success ? \"End\" : \"Cancel\"\n )\n },\n { useGlobalTarget: this.node.props.globalTapTarget }\n )\n }\n\n unmount() {}\n}\n","import { warnOnce } from \"motion-utils\"\nimport { createMotionComponent, MotionComponentOptions } from \"../../motion\"\nimport { FeaturePackages } from \"../../motion/features/types\"\nimport { MotionProps } from \"../../motion/types\"\nimport { DOMMotionComponents } from \"../dom/types\"\nimport { CreateVisualElement } from \"../types\"\n\n/**\n * I'd rather the return type of `custom` to be implicit but this throws\n * incorrect relative paths in the exported types and API Extractor throws\n * a wobbly.\n */\ntype ComponentProps<Props> = React.PropsWithoutRef<Props & MotionProps> &\n React.RefAttributes<SVGElement | HTMLElement>\nexport type CustomDomComponent<Props> = React.ComponentType<\n ComponentProps<Props>\n>\n\ntype MotionProxy = typeof createMotionComponent &\n DOMMotionComponents & { create: typeof createMotionComponent }\n\nexport function createMotionProxy(\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement<any, any>\n): MotionProxy {\n if (typeof Proxy === \"undefined\") {\n return createMotionComponent as MotionProxy\n }\n\n /**\n * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.\n * Rather than generating them anew every render.\n */\n const componentCache = new Map<string, any>()\n\n const factory = (Component: string, options?: MotionComponentOptions) => {\n return createMotionComponent(\n Component,\n options,\n preloadedFeatures,\n createVisualElement\n )\n }\n\n /**\n * Support for deprecated`motion(Component)` pattern\n */\n const deprecatedFactoryFunction = (\n Component: string,\n options?: MotionComponentOptions\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n \"motion() is deprecated. Use motion.create() instead.\"\n )\n }\n return factory(Component, options)\n }\n\n return new Proxy(deprecatedFactoryFunction, {\n /**\n * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.\n * The prop name is passed through as `key` and we can use that to generate a `motion`\n * DOM component with that name.\n */\n get: (_target, key: string) => {\n if (key === \"create\") return factory\n\n /**\n * If this element doesn't exist in the component cache, create it and cache.\n */\n if (!componentCache.has(key)) {\n componentCache.set(\n key,\n createMotionComponent(\n key,\n undefined,\n preloadedFeatures,\n createVisualElement\n )\n )\n }\n\n return componentCache.get(key)!\n },\n }) as MotionProxy\n}\n","import {\n clamp,\n EasingFunction,\n invariant,\n MotionGlobalConfig,\n noop,\n pipe,\n progress,\n} from \"motion-utils\"\nimport { mix } from \"./mix\"\nimport { Mixer, MixerFactory } from \"./mix/types\"\n\nexport interface InterpolateOptions<T> {\n clamp?: boolean\n ease?: EasingFunction | EasingFunction[]\n mixer?: MixerFactory<T>\n}\n\nfunction createMixers<T>(\n output: T[],\n ease?: EasingFunction | EasingFunction[],\n customMixer?: MixerFactory<T>\n) {\n const mixers: Array<Mixer<T>> = []\n const mixerFactory: MixerFactory<T> =\n customMixer || MotionGlobalConfig.mix || mix\n const numMixers = output.length - 1\n\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1])\n\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease\n mixer = pipe(easingFunction, mixer) as Mixer<T>\n }\n\n mixers.push(mixer)\n }\n\n return mixers\n}\n\n/**\n * Create a function that maps from a numerical input array to a generic output array.\n *\n * Accepts:\n * - Numbers\n * - Colors (hex, hsl, hsla, rgb, rgba)\n * - Complex (combinations of one or more numbers or strings)\n *\n * ```jsx\n * const mixColor = interpolate([0, 1], ['#fff', '#000'])\n *\n * mixColor(0.5) // 'rgba(128, 128, 128, 1)'\n * ```\n *\n * TODO Revisit this approach once we've moved to data models for values,\n * probably not needed to pregenerate mixer functions.\n *\n * @public\n */\nexport function interpolate<T>(\n input: number[],\n output: T[],\n { clamp: isClamp = true, ease, mixer }: InterpolateOptions<T> = {}\n): (v: number) => T {\n const inputLength = input.length\n\n invariant(\n inputLength === output.length,\n \"Both input and output ranges must be the same length\",\n \"range-length\"\n )\n\n /**\n * If we're only provided a single input, we can just make a function\n * that returns the output.\n */\n if (inputLength === 1) return () => output[0]\n if (inputLength === 2 && output[0] === output[1]) return () => output[1]\n\n const isZeroDeltaRange = input[0] === input[1]\n\n // If input runs highest -> lowest, reverse both arrays\n if (input[0] > input[inputLength - 1]) {\n input = [...input].reverse()\n output = [...output].reverse()\n }\n\n const mixers = createMixers(output, ease, mixer)\n const numMixers = mixers.length\n\n const interpolator = (v: number): T => {\n if (isZeroDeltaRange && v < input[0]) return output[0]\n\n let i = 0\n\n if (numMixers > 1) {\n for (; i < input.length - 2; i++) {\n if (v < input[i + 1]) break\n }\n }\n\n const progressInRange = progress(input[i], input[i + 1], v)\n\n return mixers[i](progressInRange)\n }\n\n return isClamp\n ? (v: number) =>\n interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator\n}\n","import {\n AnimationState,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\nimport { spring as createSpring } from \"./spring\"\nimport { calcGeneratorVelocity } from \"./utils/velocity\"\n\nexport function inertia({\n keyframes,\n velocity = 0.0,\n power = 0.8,\n timeConstant = 325,\n bounceDamping = 10,\n bounceStiffness = 500,\n modifyTarget,\n min,\n max,\n restDelta = 0.5,\n restSpeed,\n}: ValueAnimationOptions<number>): KeyframeGenerator<number> {\n const origin = keyframes[0]\n\n const state: AnimationState<number> = {\n done: false,\n value: origin,\n }\n\n const isOutOfBounds = (v: number) =>\n (min !== undefined && v < min) || (max !== undefined && v > max)\n\n const nearestBoundary = (v: number) => {\n if (min === undefined) return max\n if (max === undefined) return min\n\n return Math.abs(min - v) < Math.abs(max - v) ? min : max\n }\n\n let amplitude = power * velocity\n const ideal = origin + amplitude\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal)\n\n /**\n * If the target has changed we need to re-calculate the amplitude, otherwise\n * the animation will start from the wrong position.\n */\n if (target !== ideal) amplitude = target - origin\n\n const calcDelta = (t: number) => -amplitude * Math.exp(-t / timeConstant)\n\n const calcLatest = (t: number) => target + calcDelta(t)\n\n const applyFriction = (t: number) => {\n const delta = calcDelta(t)\n const latest = calcLatest(t)\n state.done = Math.abs(delta) <= restDelta\n state.value = state.done ? target : latest\n }\n\n /**\n * Ideally this would resolve for t in a stateless way, we could\n * do that by always precalculating the animation but as we know\n * this will be done anyway we can assume that spring will\n * be discovered during that.\n */\n let timeReachedBoundary: number | undefined\n let spring: KeyframeGenerator<number> | undefined\n\n const checkCatchBoundary = (t: number) => {\n if (!isOutOfBounds(state.value)) return\n\n timeReachedBoundary = t\n\n spring = createSpring({\n keyframes: [state.value, nearestBoundary(state.value)!],\n velocity: calcGeneratorVelocity(calcLatest, t, state.value), // TODO: This should be passing * 1000\n damping: bounceDamping,\n stiffness: bounceStiffness,\n restDelta,\n restSpeed,\n })\n }\n\n checkCatchBoundary(0)\n\n return {\n calculatedDuration: null,\n next: (t: number) => {\n /**\n * We need to resolve the friction to figure out if we need a\n * spring but we don't want to do this twice per frame. So here\n * we flag if we updated for this frame and later if we did\n * we can skip doing it again.\n */\n let hasUpdatedFrame = false\n if (!spring && timeReachedBoundary === undefined) {\n hasUpdatedFrame = true\n applyFriction(t)\n checkCatchBoundary(t)\n }\n\n /**\n * If we have a spring and the provided t is beyond the moment the friction\n * animation crossed the min/max boundary, use the spring.\n */\n if (timeReachedBoundary !== undefined && t >= timeReachedBoundary) {\n return spring!.next(t - timeReachedBoundary)\n } else {\n !hasUpdatedFrame && applyFriction(t)\n return state\n }\n },\n }\n}\n","import { camelToDash } from \"../../render/dom/utils/camel-to-dash\"\n\nexport const optimizedAppearDataId = \"framerAppearId\"\n\nexport const optimizedAppearDataAttribute =\n \"data-\" + camelToDash(optimizedAppearDataId) as \"data-framer-appear-id\"\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { isForcedMotionValue } from \"../../utils/is-forced-motion-value\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const style = (props as any).style\n const prevStyle = (prevProps as any)?.style\n const newValues: { [key: string]: any } = {}\n\n if (!style) return newValues\n\n for (const key in style) {\n if (\n isMotionValue(style[key]) ||\n (prevStyle && isMotionValue(prevStyle[key])) ||\n isForcedMotionValue(key, props) ||\n visualElement?.getValue(key)?.liveStyle !== undefined\n ) {\n newValues[key] = style[key]\n }\n }\n\n return newValues\n}\n","import { noop } from \"motion-utils\"\nimport { createRenderBatcher } from \"./batcher\"\n\nexport const {\n schedule: frame,\n cancel: cancelFrame,\n state: frameData,\n steps: frameSteps,\n} = /* @__PURE__ */ createRenderBatcher(\n typeof requestAnimationFrame !== \"undefined\" ? requestAnimationFrame : noop,\n true\n)\n","import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n const { target } = enterEvent\n const onHoverEnd = onHoverStart(target as Element, enterEvent)\n\n if (typeof onHoverEnd !== \"function\" || !target) return\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (!isValidHover(leaveEvent)) return\n\n onHoverEnd(leaveEvent)\n target.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n target.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n elements.forEach((element) => {\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n","import { isMotionValue } from \"../../../value/utils/is-motion-value\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { scrapeMotionValuesFromProps as scrapeHTMLMotionValuesFromProps } from \"../../html/utils/scrape-motion-values\"\nimport type { VisualElement } from \"../../VisualElement\"\n\nexport function scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement?: VisualElement\n) {\n const newValues = scrapeHTMLMotionValuesFromProps(\n props,\n prevProps,\n visualElement\n )\n\n for (const key in props) {\n if (\n isMotionValue(props[key as keyof typeof props]) ||\n isMotionValue(prevProps[key as keyof typeof prevProps])\n ) {\n const targetKey =\n transformPropOrder.indexOf(key) !== -1\n ? \"attr\" + key.charAt(0).toUpperCase() + key.substring(1)\n : key\n\n newValues[targetKey] = props[key as keyof typeof props]\n }\n }\n\n return newValues\n}\n","import { cancelFrame, frame, frameData } from \"../../frameloop\"\nimport { time } from \"../../frameloop/sync-time\"\nimport { FrameData } from \"../../frameloop/types\"\nimport { Driver } from \"./types\"\n\nexport const frameloopDriver: Driver = (update) => {\n const passTimestamp = ({ timestamp }: FrameData) => update(timestamp)\n\n return {\n start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),\n stop: () => cancelFrame(passTimestamp),\n /**\n * If we're processing this frame we can use the\n * framelocked timestamp to keep things in sync.\n */\n now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),\n }\n}\n","/**\n * Decides if the supplied variable is variant label\n */\nexport function isVariantLabel(v: unknown): v is string | string[] {\n return typeof v === \"string\" || Array.isArray(v)\n}\n","import { transformProps } from \"./keys-transform\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport {\n scaleCorrectors,\n addScaleCorrector,\n} from \"../../projection/styles/scale-correction\"\n\nexport { scaleCorrectors, addScaleCorrector }\n\nexport function isForcedMotionValue(\n key: string,\n { layout, layoutId }: MotionNodeOptions\n) {\n return (\n transformProps.has(key) ||\n key.startsWith(\"origin\") ||\n ((layout || layoutId !== undefined) &&\n (!!scaleCorrectors[key] || key === \"opacity\"))\n )\n}\n","import { addDomEvent } from \"../../events/add-dom-event\"\nimport { createProjectionNode } from \"./create-projection-node\"\n\nexport const DocumentProjectionNode = createProjectionNode<Window>({\n attachResizeListener: (\n ref: Window | Element,\n notify: VoidFunction\n ): VoidFunction => addDomEvent(ref, \"resize\", notify),\n measureScroll: () => ({\n x: document.documentElement.scrollLeft || document.body?.scrollLeft || 0,\n y: document.documentElement.scrollTop || document.body?.scrollTop || 0,\n }),\n checkIsScrollRoot: () => true,\n})\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport { animateVariant } from \"./visual-element-variant\"\n\nexport function animateVisualElement(\n visualElement: VisualElement,\n definition: AnimationDefinition,\n options: VisualElementAnimationOptions = {}\n) {\n visualElement.notify(\"AnimationStart\", definition)\n let animation: Promise<any>\n\n if (Array.isArray(definition)) {\n const animations = definition.map((variant) =>\n animateVariant(visualElement, variant, options)\n )\n animation = Promise.all(animations)\n } else if (typeof definition === \"string\") {\n animation = animateVariant(visualElement, definition, options)\n } else {\n const resolvedDefinition =\n typeof definition === \"function\"\n ? resolveVariant(visualElement, definition, options.custom)\n : definition\n\n animation = Promise.all(\n animateTarget(visualElement, resolvedDefinition, options)\n )\n }\n\n return animation.then(() => {\n visualElement.notify(\"AnimationComplete\", definition)\n })\n}\n","import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport { resolveVariantFromProps } from \"./resolve-variants\"\n\n/**\n * Resolves a variant if it's a variant resolver.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function resolveVariant(\n visualElement: any,\n definition?: TargetAndTransition | TargetResolver,\n custom?: any\n): TargetAndTransition\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n): TargetAndTransition | undefined\nexport function resolveVariant(\n visualElement: any,\n definition?: AnimationDefinition,\n custom?: any\n) {\n const props = visualElement.getProps()\n return resolveVariantFromProps(\n props,\n definition,\n custom !== undefined ? custom : props.custom,\n visualElement\n )\n}\n","import { addDomEvent } from \"motion-dom\"\nimport { addPointerInfo, EventListenerWithPointInfo } from \"./event-info\"\n\nexport function addPointerEvent(\n target: EventTarget,\n eventName: string,\n handler: EventListenerWithPointInfo,\n options?: AddEventListenerOptions\n) {\n return addDomEvent(target, eventName, addPointerInfo(handler), options)\n}\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n warning,\n} from \"motion-utils\"\nimport { SpringOptions } from \"../../types\"\nimport { springDefaults } from \"./defaults\"\n\n/**\n * This is ported from the Framer implementation of duration-based spring resolution.\n */\n\ntype Resolver = (num: number) => number\n\nconst safeMin = 0.001\n\nexport function findSpring({\n duration = springDefaults.duration,\n bounce = springDefaults.bounce,\n velocity = springDefaults.velocity,\n mass = springDefaults.mass,\n}: SpringOptions) {\n let envelope: Resolver\n let derivative: Resolver\n\n warning(\n duration <= secondsToMilliseconds(springDefaults.maxDuration),\n \"Spring duration must be 10 seconds or less\",\n \"spring-duration-limit\"\n )\n\n let dampingRatio = 1 - bounce\n\n /**\n * Restrict dampingRatio and duration to within acceptable ranges.\n */\n dampingRatio = clamp(\n springDefaults.minDamping,\n springDefaults.maxDamping,\n dampingRatio\n )\n duration = clamp(\n springDefaults.minDuration,\n springDefaults.maxDuration,\n millisecondsToSeconds(duration)\n )\n\n if (dampingRatio < 1) {\n /**\n * Underdamped spring\n */\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const a = exponentialDecay - velocity\n const b = calcAngularFreq(undampedFreq, dampingRatio)\n const c = Math.exp(-delta)\n return safeMin - (a / b) * c\n }\n\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio\n const delta = exponentialDecay * duration\n const d = delta * velocity + velocity\n const e =\n Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration\n const f = Math.exp(-delta)\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio)\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1\n return (factor * ((d - e) * f)) / g\n }\n } else {\n /**\n * Critically-damped spring\n */\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (undampedFreq - velocity) * duration + 1\n return -safeMin + a * b\n }\n\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration)\n const b = (velocity - undampedFreq) * (duration * duration)\n return a * b\n }\n }\n\n const initialGuess = 5 / duration\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess)\n\n duration = secondsToMilliseconds(duration)\n if (isNaN(undampedFreq)) {\n return {\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n duration,\n }\n } else {\n const stiffness = Math.pow(undampedFreq, 2) * mass\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n }\n }\n}\n\nconst rootIterations = 12\nfunction approximateRoot(\n envelope: Resolver,\n derivative: Resolver,\n initialGuess: number\n): number {\n let result = initialGuess\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result)\n }\n return result\n}\n\nexport function calcAngularFreq(undampedFreq: number, dampingRatio: number) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio)\n}\n","import { AnyResolvedKeyframe } from \"../../../animation/types\"\nimport { CSSVariableToken } from \"../../../animation/utils/is-css-variable\"\nimport { color } from \"../color\"\nimport { Color } from \"../types\"\nimport { colorRegex } from \"../utils/color-regex\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { sanitize } from \"../utils/sanitize\"\n\nfunction test(v: any) {\n return (\n isNaN(v) &&\n typeof v === \"string\" &&\n (v.match(floatRegex)?.length || 0) +\n (v.match(colorRegex)?.length || 0) >\n 0\n )\n}\n\nconst NUMBER_TOKEN = \"number\"\nconst COLOR_TOKEN = \"color\"\nconst VAR_TOKEN = \"var\"\nconst VAR_FUNCTION_TOKEN = \"var(\"\nconst SPLIT_TOKEN = \"${}\"\n\nexport type ComplexValues = Array<\n CSSVariableToken | AnyResolvedKeyframe | Color\n>\n\nexport interface ValueIndexes {\n color: number[]\n number: number[]\n var: number[]\n}\n\nexport interface ComplexValueInfo {\n values: ComplexValues\n split: string[]\n indexes: ValueIndexes\n types: Array<keyof ValueIndexes>\n}\n\n// this regex consists of the `singleCssVariableRegex|rgbHSLValueRegex|digitRegex`\nconst complexRegex =\n /var\\s*\\(\\s*--(?:[\\w-]+\\s*|[\\w-]+\\s*,(?:\\s*[^)(\\s]|\\s*\\((?:[^)(]|\\([^)(]*\\))*\\))+\\s*)\\)|#[\\da-f]{3,8}|(?:rgb|hsl)a?\\((?:-?[\\d.]+%?[,\\s]+){2}-?[\\d.]+%?\\s*(?:[,/]\\s*)?(?:\\b\\d+(?:\\.\\d+)?|\\.\\d+)?%?\\)|-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)/giu\n\nexport function analyseComplexValue(\n value: AnyResolvedKeyframe\n): ComplexValueInfo {\n const originalValue = value.toString()\n\n const values: ComplexValues = []\n const indexes: ValueIndexes = {\n color: [],\n number: [],\n var: [],\n }\n const types: Array<keyof ValueIndexes> = []\n\n let i = 0\n const tokenised = originalValue.replace(complexRegex, (parsedValue) => {\n if (color.test(parsedValue)) {\n indexes.color.push(i)\n types.push(COLOR_TOKEN)\n values.push(color.parse(parsedValue))\n } else if (parsedValue.startsWith(VAR_FUNCTION_TOKEN)) {\n indexes.var.push(i)\n types.push(VAR_TOKEN)\n values.push(parsedValue)\n } else {\n indexes.number.push(i)\n types.push(NUMBER_TOKEN)\n values.push(parseFloat(parsedValue))\n }\n ++i\n return SPLIT_TOKEN\n })\n const split = tokenised.split(SPLIT_TOKEN)\n\n return { values, split, indexes, types }\n}\n\nfunction parseComplexValue(v: AnyResolvedKeyframe) {\n return analyseComplexValue(v).values\n}\n\nfunction createTransformer(source: AnyResolvedKeyframe) {\n const { split, types } = analyseComplexValue(source)\n\n const numSections = split.length\n return (v: Array<CSSVariableToken | Color | number | string>) => {\n let output = \"\"\n for (let i = 0; i < numSections; i++) {\n output += split[i]\n if (v[i] !== undefined) {\n const type = types[i]\n if (type === NUMBER_TOKEN) {\n output += sanitize(v[i] as number)\n } else if (type === COLOR_TOKEN) {\n output += color.transform(v[i] as Color)\n } else {\n output += v[i]\n }\n }\n }\n\n return output\n }\n}\n\nconst convertNumbersToZero = (v: number | string) =>\n typeof v === \"number\" ? 0 : color.test(v) ? color.getAnimatableNone(v) : v\n\nfunction getAnimatableNone(v: AnyResolvedKeyframe) {\n const parsed = parseComplexValue(v)\n const transformer = createTransformer(v)\n return transformer(parsed.map(convertNumbersToZero))\n}\n\nexport const complex = {\n test,\n parse: parseComplexValue,\n createTransformer,\n getAnimatableNone,\n}\n","import { HTMLProjectionNode } from \"motion-dom\"\nimport { MeasureLayout } from \"./layout/MeasureLayout\"\nimport { FeaturePackages } from \"./types\"\n\nexport const layout: FeaturePackages = {\n layout: {\n ProjectionNode: HTMLProjectionNode,\n MeasureLayout,\n },\n}\n","import type { AnyResolvedKeyframe } from \"../types\"\nimport type { Transition } from \"../types\"\n\n/**\n * Decide whether a transition is defined on a given Transition.\n * This filters out orchestration options and returns true\n * if any options are left.\n */\nexport function isTransitionDefined({\n when,\n delay: _delay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n repeat,\n repeatType,\n repeatDelay,\n from,\n elapsed,\n ...transition\n}: Transition & { elapsed?: number; from?: AnyResolvedKeyframe }) {\n return !!Object.keys(transition).length\n}\n","import { animateMotionValue } from \"../interfaces/motion-value\"\nimport type {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueAnimationTransition,\n} from \"../types\"\nimport {\n motionValue as createMotionValue,\n MotionValue,\n} from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\nexport function animateSingleValue<V extends AnyResolvedKeyframe>(\n value: MotionValue<V> | V,\n keyframes: V | UnresolvedValueKeyframe<V>[],\n options?: ValueAnimationTransition\n): AnimationPlaybackControlsWithThen {\n const motionValue = isMotionValue(value) ? value : createMotionValue(value)\n\n motionValue.start(animateMotionValue(\"\", motionValue, keyframes, options))\n\n return motionValue.animation!\n}\n","import type { Box } from \"motion-utils\"\nimport { parseValueFromTransform } from \"../../../render/dom/parse-transform\"\nimport { transformPropOrder } from \"../../../render/utils/keys-transform\"\nimport { MotionValue } from \"../../../value\"\nimport { number } from \"../../../value/types/numbers\"\nimport { px } from \"../../../value/types/numbers/units\"\nimport { ValueType } from \"../../../value/types/types\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { WithRender } from \"../types\"\n\nexport const isNumOrPxType = (v?: ValueType): v is ValueType =>\n v === number || v === px\n\ntype GetActualMeasurementInPixels = (\n bbox: Box,\n computedStyle: Partial<CSSStyleDeclaration>\n) => number\n\nconst transformKeys = new Set([\"x\", \"y\", \"z\"])\nconst nonTranslationalTransformKeys = transformPropOrder.filter(\n (key) => !transformKeys.has(key)\n)\n\ntype RemovedTransforms = [string, AnyResolvedKeyframe][]\nexport function removeNonTranslationalTransform(visualElement: WithRender) {\n const removedTransforms: RemovedTransforms = []\n\n nonTranslationalTransformKeys.forEach((key) => {\n const value: MotionValue<AnyResolvedKeyframe> | undefined =\n visualElement.getValue(key)\n if (value !== undefined) {\n removedTransforms.push([key, value.get()])\n value.set(key.startsWith(\"scale\") ? 1 : 0)\n }\n })\n\n return removedTransforms\n}\n\nexport const positionalValues: { [key: string]: GetActualMeasurementInPixels } =\n {\n // Dimensions\n width: ({ x }, { paddingLeft = \"0\", paddingRight = \"0\" }) =>\n x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),\n height: ({ y }, { paddingTop = \"0\", paddingBottom = \"0\" }) =>\n y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),\n\n top: (_bbox, { top }) => parseFloat(top as string),\n left: (_bbox, { left }) => parseFloat(left as string),\n bottom: ({ y }, { top }) => parseFloat(top as string) + (y.max - y.min),\n right: ({ x }, { left }) =>\n parseFloat(left as string) + (x.max - x.min),\n\n // Transform\n x: (_bbox, { transform }) => parseValueFromTransform(transform, \"x\"),\n y: (_bbox, { transform }) => parseValueFromTransform(transform, \"y\"),\n }\n\n// Alias translate longform names\npositionalValues.translateX = positionalValues.x\npositionalValues.translateY = positionalValues.y\n","import { memo } from \"motion-utils\"\nimport { supportsFlags } from \"./flags\"\n\nexport function memoSupports<T extends any>(\n callback: () => T,\n supportsFlag: keyof typeof supportsFlags\n) {\n const memoized = memo(callback)\n return () => supportsFlags[supportsFlag] ?? memoized()\n}\n","import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function calcGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n","import { resolveVariant } from \"../../render/utils/resolve-dynamic-variants\"\nimport { calcChildStagger } from \"../utils/calc-child-stagger\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport { animateTarget } from \"./visual-element-target\"\nimport type { DynamicOption } from \"../types\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport function animateVariant(\n visualElement: VisualElement,\n variant: string,\n options: VisualElementAnimationOptions = {}\n): Promise<any> {\n const resolved = resolveVariant(\n visualElement,\n variant,\n options.type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n let { transition = visualElement.getDefaultTransition() || {} } =\n resolved || {}\n\n if (options.transitionOverride) {\n transition = options.transitionOverride\n }\n\n /**\n * If we have a variant, create a callback that runs it as an animation.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getAnimation: () => Promise<any> = resolved\n ? () => Promise.all(animateTarget(visualElement, resolved, options))\n : () => Promise.resolve()\n\n /**\n * If we have children, create a callback that runs all their animations.\n * Otherwise, we resolve a Promise immediately for a composable no-op.\n */\n const getChildAnimations =\n visualElement.variantChildren && visualElement.variantChildren.size\n ? (forwardDelay = 0) => {\n const {\n delayChildren = 0,\n staggerChildren,\n staggerDirection,\n } = transition\n\n return animateChildren(\n visualElement,\n variant,\n forwardDelay,\n delayChildren,\n staggerChildren,\n staggerDirection,\n options\n )\n }\n : () => Promise.resolve()\n\n /**\n * If the transition explicitly defines a \"when\" option, we need to resolve either\n * this animation or all children animations before playing the other.\n */\n const { when } = transition\n if (when) {\n const [first, last] =\n when === \"beforeChildren\"\n ? [getAnimation, getChildAnimations]\n : [getChildAnimations, getAnimation]\n\n return first().then(() => last())\n } else {\n return Promise.all([getAnimation(), getChildAnimations(options.delay)])\n }\n}\n\nfunction animateChildren(\n visualElement: VisualElement,\n variant: string,\n delay: number = 0,\n delayChildren: number | DynamicOption<number> = 0,\n staggerChildren = 0,\n staggerDirection = 1,\n options: VisualElementAnimationOptions\n) {\n const animations: Promise<any>[] = []\n\n for (const child of visualElement.variantChildren!) {\n child.notify(\"AnimationStart\", variant)\n animations.push(\n animateVariant(child, variant, {\n ...options,\n delay:\n delay +\n (typeof delayChildren === \"function\" ? 0 : delayChildren) +\n calcChildStagger(\n visualElement.variantChildren!,\n child,\n delayChildren,\n staggerChildren,\n staggerDirection\n ),\n }).then(() => child.notify(\"AnimationComplete\", variant))\n )\n }\n\n return Promise.all(animations)\n}\n","import { HoverGesture } from \"../../gestures/hover\"\nimport { FocusGesture } from \"../../gestures/focus\"\nimport { PressGesture } from \"../../gestures/press\"\nimport { InViewFeature } from \"./viewport\"\nimport { FeaturePackages } from \"./types\"\n\nexport const gestureAnimations: FeaturePackages = {\n inView: {\n Feature: InViewFeature,\n },\n tap: {\n Feature: PressGesture,\n },\n focus: {\n Feature: FocusGesture,\n },\n hover: {\n Feature: HoverGesture,\n },\n}\n","import { animations } from \"../../../motion/features/animations\"\nimport { drag } from \"../../../motion/features/drag\"\nimport { gestureAnimations } from \"../../../motion/features/gestures\"\nimport { layout } from \"../../../motion/features/layout\"\n\nexport const featureBundle = {\n ...animations,\n ...gestureAnimations,\n ...drag,\n ...layout,\n}\n","import { Feature, addDomEvent } from \"motion-dom\"\nimport { pipe } from \"motion-utils\"\n\nexport class FocusGesture extends Feature<Element> {\n private isActive = false\n\n onFocus() {\n let isFocusVisible = false\n\n /**\n * If this element doesn't match focus-visible then don't\n * apply whileHover. But, if matches throws that focus-visible\n * is not a valid selector then in that browser outline styles will be applied\n * to the element by default and we want to match that behaviour with whileFocus.\n */\n try {\n isFocusVisible = this.node.current!.matches(\":focus-visible\")\n } catch (e) {\n isFocusVisible = true\n }\n\n if (!isFocusVisible || !this.node.animationState) return\n\n this.node.animationState.setActive(\"whileFocus\", true)\n this.isActive = true\n }\n\n onBlur() {\n if (!this.isActive || !this.node.animationState) return\n this.node.animationState.setActive(\"whileFocus\", false)\n this.isActive = false\n }\n\n mount() {\n this.unmount = pipe(\n addDomEvent(this.node.current!, \"focus\", () => this.onFocus()),\n addDomEvent(this.node.current!, \"blur\", () => this.onBlur())\n ) as VoidFunction\n }\n\n unmount() {}\n}\n","export const invisibleValues = new Set([\"none\", \"hidden\"])\n\n/**\n * Returns a function that, when provided a progress value between 0 and 1,\n * will return the \"none\" or \"hidden\" string only when the progress is that of\n * the origin or target.\n */\nexport function mixVisibility(origin: string, target: string) {\n if (invisibleValues.has(origin)) {\n return (p: number) => (p <= 0 ? origin : target)\n } else {\n return (p: number) => (p >= 1 ? target : origin)\n }\n}\n","export function shallowCompare(next: any[], prev: any[] | null) {\n if (!Array.isArray(prev)) return false\n\n const prevLength = prev.length\n\n if (prevLength !== next.length) return false\n\n for (let i = 0; i < prevLength; i++) {\n if (prev[i] !== next[i]) return false\n }\n\n return true\n}\n","import { isControllingVariants, isVariantLabel } from \"motion-dom\"\nimport type { MotionContextProps } from \".\"\nimport { MotionProps } from \"../../motion/types\"\n\nexport function getCurrentTreeVariants(\n props: MotionProps,\n context: MotionContextProps\n): MotionContextProps {\n if (isControllingVariants(props)) {\n const { initial, animate } = props\n return {\n initial:\n initial === false || isVariantLabel(initial)\n ? (initial as any)\n : undefined,\n animate: isVariantLabel(animate) ? animate : undefined,\n }\n }\n return props.inherit !== false ? context : {}\n}\n","import { mixNumber } from \"../../utils/mix/number\"\nimport { percent, px } from \"../../value/types/numbers/units\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport {\n progress as calcProgress,\n circOut,\n EasingFunction,\n noop,\n} from \"motion-utils\"\nimport type { ResolvedValues } from \"../../node/types\"\n\nconst borders = [\"TopLeft\", \"TopRight\", \"BottomLeft\", \"BottomRight\"]\nconst numBorders = borders.length\n\nconst asNumber = (value: AnyResolvedKeyframe) =>\n typeof value === \"string\" ? parseFloat(value) : value\n\nconst isPx = (value: AnyResolvedKeyframe) =>\n typeof value === \"number\" || px.test(value)\n\nexport function mixValues(\n target: ResolvedValues,\n follow: ResolvedValues,\n lead: ResolvedValues,\n progress: number,\n shouldCrossfadeOpacity: boolean,\n isOnlyMember: boolean\n) {\n if (shouldCrossfadeOpacity) {\n target.opacity = mixNumber(\n 0,\n (lead.opacity as number) ?? 1,\n easeCrossfadeIn(progress)\n )\n target.opacityExit = mixNumber(\n (follow.opacity as number) ?? 1,\n 0,\n easeCrossfadeOut(progress)\n )\n } else if (isOnlyMember) {\n target.opacity = mixNumber(\n (follow.opacity as number) ?? 1,\n (lead.opacity as number) ?? 1,\n progress\n )\n }\n\n /**\n * Mix border radius\n */\n for (let i = 0; i < numBorders; i++) {\n const borderLabel = `border${borders[i]}Radius`\n let followRadius = getRadius(follow, borderLabel)\n let leadRadius = getRadius(lead, borderLabel)\n\n if (followRadius === undefined && leadRadius === undefined) continue\n\n followRadius ||= 0\n leadRadius ||= 0\n\n const canMix =\n followRadius === 0 ||\n leadRadius === 0 ||\n isPx(followRadius) === isPx(leadRadius)\n\n if (canMix) {\n target[borderLabel] = Math.max(\n mixNumber(\n asNumber(followRadius),\n asNumber(leadRadius),\n progress\n ),\n 0\n )\n\n if (percent.test(leadRadius) || percent.test(followRadius)) {\n target[borderLabel] += \"%\"\n }\n } else {\n target[borderLabel] = leadRadius\n }\n }\n\n /**\n * Mix rotation\n */\n if (follow.rotate || lead.rotate) {\n target.rotate = mixNumber(\n (follow.rotate as number) || 0,\n (lead.rotate as number) || 0,\n progress\n )\n }\n}\n\nfunction getRadius(values: ResolvedValues, radiusName: string) {\n return values[radiusName] !== undefined\n ? values[radiusName]\n : values.borderRadius\n}\n\nconst easeCrossfadeIn = /*@__PURE__*/ compress(0, 0.5, circOut)\nconst easeCrossfadeOut = /*@__PURE__*/ compress(0.5, 0.95, noop)\n\nfunction compress(\n min: number,\n max: number,\n easing: EasingFunction\n): EasingFunction {\n return (p: number) => {\n // Could replace ifs with clamp\n if (p < min) return 0\n if (p > max) return 1\n return easing(calcProgress(min, max, p))\n }\n}\n","import { TransformPoint } from \"motion-utils\"\nimport {\n convertBoundingBoxToBox,\n transformBoxPoints,\n} from \"../geometry/conversion\"\nimport { translateAxis } from \"../geometry/delta-apply\"\n\nexport function measureViewportBox(\n instance: HTMLElement,\n transformPoint?: TransformPoint\n) {\n return convertBoundingBoxToBox(\n transformBoxPoints(instance.getBoundingClientRect(), transformPoint)\n )\n}\n\nexport function measurePageBox(\n element: HTMLElement,\n rootProjectionNode: any,\n transformPagePoint?: TransformPoint\n) {\n const viewportBox = measureViewportBox(element, transformPagePoint)\n const { scroll } = rootProjectionNode\n\n if (scroll) {\n translateAxis(viewportBox.x, scroll.offset.x)\n translateAxis(viewportBox.y, scroll.offset.y)\n }\n\n return viewportBox\n}\n","import {\n easeInOut,\n easingDefinitionToFunction,\n EasingFunction,\n isEasingArray,\n} from \"motion-utils\"\nimport { interpolate } from \"../../utils/interpolate\"\nimport { defaultOffset } from \"../keyframes/offsets/default\"\nimport { convertOffsetToTimes } from \"../keyframes/offsets/time\"\nimport {\n AnimationState,\n AnyResolvedKeyframe,\n KeyframeGenerator,\n ValueAnimationOptions,\n} from \"../types\"\n\nexport function defaultEasing(\n values: any[],\n easing?: EasingFunction\n): EasingFunction[] {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1)\n}\n\nexport function keyframes<T extends AnyResolvedKeyframe>({\n duration = 300,\n keyframes: keyframeValues,\n times,\n ease = \"easeInOut\",\n}: ValueAnimationOptions<T>): KeyframeGenerator<T> {\n /**\n * Easing functions can be externally defined as strings. Here we convert them\n * into actual functions.\n */\n const easingFunctions = isEasingArray(ease)\n ? ease.map(easingDefinitionToFunction)\n : easingDefinitionToFunction(ease)\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState<T> = {\n done: false,\n value: keyframeValues[0],\n }\n\n /**\n * Create a times array based on the provided 0-1 offsets\n */\n const absoluteTimes = convertOffsetToTimes(\n // Only use the provided offsets if they're the correct length\n // TODO Maybe we should warn here if there's a length mismatch\n times && times.length === keyframeValues.length\n ? times\n : defaultOffset(keyframeValues),\n duration\n )\n\n const mapTimeToKeyframe = interpolate<T>(absoluteTimes, keyframeValues, {\n ease: Array.isArray(easingFunctions)\n ? easingFunctions\n : defaultEasing(keyframeValues, easingFunctions),\n })\n\n return {\n calculatedDuration: duration,\n next: (t: number) => {\n state.value = mapTimeToKeyframe(t)\n state.done = t >= duration\n return state\n },\n }\n}\n","import { complex } from \".\"\nimport { floatRegex } from \"../utils/float-regex\"\n\n/**\n * Properties that should default to 1 or 100%\n */\nconst maxDefaults = new Set([\"brightness\", \"contrast\", \"saturate\", \"opacity\"])\n\nfunction applyDefaultFilter(v: string) {\n const [name, value] = v.slice(0, -1).split(\"(\")\n\n if (name === \"drop-shadow\") return v\n\n const [number] = value.match(floatRegex) || []\n if (!number) return v\n\n const unit = value.replace(number, \"\")\n let defaultValue = maxDefaults.has(name) ? 1 : 0\n if (number !== value) defaultValue *= 100\n\n return name + \"(\" + defaultValue + unit + \")\"\n}\n\nconst functionRegex = /\\b([a-z-]*)\\(.*?\\)/gu\n\nexport const filter = {\n ...complex,\n getAnimatableNone: (v: string) => {\n const functions = v.match(functionRegex)\n return functions ? functions.map(applyDefaultFilter).join(\" \") : v\n },\n}\n","import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n","import { clamp } from \"motion-utils\"\nimport { alpha as alphaType, number } from \"../numbers\"\nimport { RGBA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nconst clampRgbUnit = (v: number) => clamp(0, 255, v)\nexport const rgbUnit = {\n ...number,\n transform: (v: number) => Math.round(clampRgbUnit(v)),\n}\n\nexport const rgba = {\n test: /*@__PURE__*/ isColorString(\"rgb\", \"red\"),\n parse: /*@__PURE__*/ splitColor<RGBA>(\"red\", \"green\", \"blue\"),\n transform: ({ red, green, blue, alpha = 1 }: RGBA) =>\n \"rgba(\" +\n rgbUnit.transform(red) +\n \", \" +\n rgbUnit.transform(green) +\n \", \" +\n rgbUnit.transform(blue) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\",\n}\n","import { millisecondsToSeconds } from \"motion-utils\"\nimport { GeneratorFactory, Transition } from \"../../types\"\nimport { calcGeneratorDuration, maxGeneratorDuration } from \"./calc-duration\"\n\n/**\n * Create a progress => progress easing function from a generator.\n */\nexport function createGeneratorEasing(\n options: Transition,\n scale = 100,\n createGenerator: GeneratorFactory\n) {\n const generator = createGenerator({ ...options, keyframes: [0, scale] })\n const duration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n return {\n type: \"keyframes\",\n ease: (progress: number) => {\n return generator.next(duration * progress).value / scale\n },\n duration: millisecondsToSeconds(duration),\n }\n}\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformProps } from \"../../utils/keys-transform\"\nimport { isCSSVariableName } from \"../../../animation/utils/is-css-variable\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport { buildTransform } from \"./build-transform\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nexport function buildHTMLStyles(\n state: HTMLRenderState,\n latestValues: ResolvedValues,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n const { style, vars, transformOrigin } = state\n\n // Track whether we encounter any transform or transformOrigin values.\n let hasTransform = false\n let hasTransformOrigin = false\n\n /**\n * Loop over all our latest animated values and decide whether to handle them\n * as a style or CSS variable.\n *\n * Transforms and transform origins are kept separately for further processing.\n */\n for (const key in latestValues) {\n const value = latestValues[key]\n\n if (transformProps.has(key)) {\n // If this is a transform, flag to enable further transform processing\n hasTransform = true\n continue\n } else if (isCSSVariableName(key)) {\n vars[key] = value\n continue\n } else {\n // Convert the value to its default value type, ie 0 -> \"0px\"\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (key.startsWith(\"origin\")) {\n // If this is a transform origin, flag and enable further transform-origin processing\n hasTransformOrigin = true\n transformOrigin[key as keyof typeof transformOrigin] =\n valueAsType\n } else {\n style[key] = valueAsType\n }\n }\n }\n\n if (!latestValues.transform) {\n if (hasTransform || transformTemplate) {\n style.transform = buildTransform(\n latestValues,\n state.transform,\n transformTemplate\n )\n } else if (style.transform) {\n /**\n * If we have previously created a transform but currently don't have any,\n * reset transform style to none.\n */\n style.transform = \"none\"\n }\n }\n\n /**\n * Build a transformOrigin style. Uses the same defaults as the browser for\n * undefined origins.\n */\n if (hasTransformOrigin) {\n const {\n originX = \"50%\",\n originY = \"50%\",\n originZ = 0,\n } = transformOrigin\n style.transformOrigin = `${originX} ${originY} ${originZ}`\n }\n}\n","import type { MotionStyle } from \"../../VisualElement\"\nimport { camelToDash } from \"../../dom/utils/camel-to-dash\"\nimport { renderHTML } from \"../../html/utils/render\"\nimport { SVGRenderState } from \"../types\"\nimport { camelCaseAttributes } from \"./camel-case-attrs\"\n\nexport function renderSVG(\n element: SVGElement,\n renderState: SVGRenderState,\n _styleProp?: MotionStyle,\n projection?: any\n) {\n renderHTML(element as any, renderState, undefined, projection)\n\n for (const key in renderState.attrs) {\n element.setAttribute(\n !camelCaseAttributes.has(key) ? camelToDash(key) : key,\n renderState.attrs[key] as string\n )\n }\n}\n","import { motionValue } from \"../../value\"\nimport { isMotionValue } from \"../../value/utils/is-motion-value\"\n\ntype MotionStyleLike = Record<string, any>\n\n/**\n * Updates motion values from props changes.\n * Uses `any` type for element to avoid circular dependencies with VisualElement.\n */\nexport function updateMotionValuesFromProps(\n element: any,\n next: MotionStyleLike,\n prev: MotionStyleLike\n) {\n for (const key in next) {\n const nextValue = next[key]\n const prevValue = prev[key]\n\n if (isMotionValue(nextValue)) {\n /**\n * If this is a motion value found in props or style, we want to add it\n * to our visual element's motion value map.\n */\n element.addValue(key, nextValue)\n } else if (isMotionValue(prevValue)) {\n /**\n * If we're swapping from a motion value to a static value,\n * create a new motion value from that\n */\n element.addValue(key, motionValue(nextValue, { owner: element }))\n } else if (prevValue !== nextValue) {\n /**\n * If this is a flat value that has changed, update the motion value\n * or create one if it doesn't exist. We only want to do this if we're\n * not handling the value with our animation state.\n */\n if (element.hasValue(key)) {\n const existingValue = element.getValue(key)!\n\n if (existingValue.liveStyle === true) {\n existingValue.jump(nextValue)\n } else if (!existingValue.hasAnimated) {\n existingValue.set(nextValue)\n }\n } else {\n const latestValue = element.getStaticValue(key)\n element.addValue(\n key,\n motionValue(\n latestValue !== undefined ? latestValue : nextValue,\n { owner: element }\n )\n )\n }\n }\n }\n\n // Handle removed values\n for (const key in prev) {\n if (next[key] === undefined) element.removeValue(key)\n }\n\n return next\n}\n","/*\n Convert velocity into velocity per second\n\n @param [number]: Unit per frame\n @param [number]: Frame duration in ms\n*/\nexport function velocityPerSecond(velocity: number, frameDuration: number) {\n return frameDuration ? velocity * (1000 / frameDuration) : 0\n}\n","import { alpha as alphaType } from \"../numbers\"\nimport { percent } from \"../numbers/units\"\nimport { HSLA } from \"../types\"\nimport { sanitize } from \"../utils/sanitize\"\nimport { isColorString, splitColor } from \"./utils\"\n\nexport const hsla = {\n test: /*@__PURE__*/ isColorString(\"hsl\", \"hue\"),\n parse: /*@__PURE__*/ splitColor<HSLA>(\"hue\", \"saturation\", \"lightness\"),\n transform: ({ hue, saturation, lightness, alpha = 1 }: HSLA) => {\n return (\n \"hsla(\" +\n Math.round(hue) +\n \", \" +\n percent.transform(sanitize(saturation)) +\n \", \" +\n percent.transform(sanitize(lightness)) +\n \", \" +\n sanitize(alphaType.transform(alpha)) +\n \")\"\n )\n },\n}\n","import type { MotionProps } from \"../../../motion/types\"\nimport { isValidMotionProp } from \"../../../motion/utils/valid-prop\"\n\nlet shouldForward = (key: string) => !isValidMotionProp(key)\n\nexport type IsValidProp = (key: string) => boolean\n\nexport function loadExternalIsValidProp(isValidProp?: IsValidProp) {\n if (typeof isValidProp !== \"function\") return\n\n // Explicitly filter our events\n shouldForward = (key: string) =>\n key.startsWith(\"on\") ? !isValidMotionProp(key) : isValidProp(key)\n}\n\n/**\n * Emotion and Styled Components both allow users to pass through arbitrary props to their components\n * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which\n * of these should be passed to the underlying DOM node.\n *\n * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props\n * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props\n * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of\n * `@emotion/is-prop-valid`, however to fix this problem we need to use it.\n *\n * By making it an optionalDependency we can offer this functionality only in the situations where it's\n * actually required.\n */\ntry {\n /**\n * We attempt to import this package but require won't be defined in esm environments, in that case\n * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed\n * in favour of explicit injection.\n */\n loadExternalIsValidProp(require(\"@emotion/is-prop-valid\").default)\n} catch {\n // We don't need to actually do anything here - the fallback is the existing `isPropValid`.\n}\n\nexport function filterProps(\n props: MotionProps,\n isDom: boolean,\n forwardMotionProps: boolean\n) {\n const filteredProps: MotionProps = {}\n\n for (const key in props) {\n /**\n * values is considered a valid prop by Emotion, so if it's present\n * this will be rendered out to the DOM unless explicitly filtered.\n *\n * We check the type as it could be used with the `feColorMatrix`\n * element, which we support.\n */\n if (key === \"values\" && typeof props.values === \"object\") continue\n\n if (\n shouldForward(key) ||\n (forwardMotionProps === true && isValidMotionProp(key)) ||\n (!isDom && !isValidMotionProp(key)) ||\n // If trying to use native HTML drag events, forward drag listeners\n (props[\"draggable\" as keyof MotionProps] &&\n key.startsWith(\"onDrag\"))\n ) {\n filteredProps[key as keyof MotionProps] =\n props[key as keyof MotionProps]\n }\n }\n\n return filteredProps\n}\n","import { motionValue } from \"../../value\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport type { AnimationDefinition } from \"../../node/types\"\nimport type {\n AnyResolvedKeyframe,\n UnresolvedValueKeyframe,\n ValueKeyframesDefinition,\n} from \"../../animation/types\"\nimport type { VisualElement } from \"../VisualElement\"\n\n/**\n * Set VisualElement's MotionValue, creating a new MotionValue for it if\n * it doesn't exist.\n */\nfunction setMotionValue(\n visualElement: VisualElement,\n key: string,\n value: AnyResolvedKeyframe\n) {\n if (visualElement.hasValue(key)) {\n visualElement.getValue(key)!.set(value)\n } else {\n visualElement.addValue(key, motionValue(value))\n }\n}\n\nfunction resolveFinalValueInKeyframes(\n v: ValueKeyframesDefinition\n): UnresolvedValueKeyframe {\n // TODO maybe throw if v.length - 1 is placeholder token?\n return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v\n}\n\nexport function setTarget(\n visualElement: VisualElement,\n definition: AnimationDefinition\n) {\n const resolved = resolveVariant(visualElement, definition)\n let { transitionEnd = {}, transition = {}, ...target } = resolved || {}\n\n target = { ...target, ...transitionEnd }\n\n for (const key in target) {\n const value = resolveFinalValueInKeyframes(\n target[key as keyof typeof target] as any\n )\n setMotionValue(visualElement, key, value as AnyResolvedKeyframe)\n }\n}\n","import { auto } from \"./auto\"\nimport { number } from \"./numbers\"\nimport { degrees, percent, px, vh, vw } from \"./numbers/units\"\nimport { testValueType } from \"./test\"\n\n/**\n * A list of value types commonly used for dimensions\n */\nexport const dimensionValueTypes = [number, px, percent, degrees, vw, vh, auto]\n\n/**\n * Tests a dimensional value against the list of dimension ValueTypes\n */\nexport const findDimensionValueType = (v: any) =>\n dimensionValueTypes.find(testValueType(v))\n","import {\n clamp,\n millisecondsToSeconds,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport {\n AnimationState,\n KeyframeGenerator,\n SpringOptions,\n Transition,\n ValueAnimationOptions,\n} from \"../../types\"\nimport { generateLinearEasing } from \"../../waapi/utils/linear\"\nimport {\n calcGeneratorDuration,\n maxGeneratorDuration,\n} from \"../utils/calc-duration\"\nimport { createGeneratorEasing } from \"../utils/create-generator-easing\"\nimport { calcGeneratorVelocity } from \"../utils/velocity\"\nimport { springDefaults } from \"./defaults\"\nimport { calcAngularFreq, findSpring } from \"./find\"\n\nconst durationKeys = [\"duration\", \"bounce\"]\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"]\n\nfunction isSpringType(options: SpringOptions, keys: string[]) {\n return keys.some((key) => (options as any)[key] !== undefined)\n}\n\nfunction getSpringOptions(options: SpringOptions) {\n let springOptions = {\n velocity: springDefaults.velocity,\n stiffness: springDefaults.stiffness,\n damping: springDefaults.damping,\n mass: springDefaults.mass,\n isResolvedFromDuration: false,\n ...options,\n }\n // stiffness/damping/mass overrides duration/bounce\n if (\n !isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)\n ) {\n if (options.visualDuration) {\n const visualDuration = options.visualDuration\n const root = (2 * Math.PI) / (visualDuration * 1.2)\n const stiffness = root * root\n const damping =\n 2 *\n clamp(0.05, 1, 1 - (options.bounce || 0)) *\n Math.sqrt(stiffness)\n\n springOptions = {\n ...springOptions,\n mass: springDefaults.mass,\n stiffness,\n damping,\n }\n } else {\n const derived = findSpring(options)\n\n springOptions = {\n ...springOptions,\n ...derived,\n mass: springDefaults.mass,\n }\n springOptions.isResolvedFromDuration = true\n }\n }\n\n return springOptions\n}\n\nfunction spring(\n optionsOrVisualDuration:\n | ValueAnimationOptions<number>\n | number = springDefaults.visualDuration,\n bounce = springDefaults.bounce\n): KeyframeGenerator<number> {\n const options =\n typeof optionsOrVisualDuration !== \"object\"\n ? ({\n visualDuration: optionsOrVisualDuration,\n keyframes: [0, 1],\n bounce,\n } as ValueAnimationOptions<number>)\n : optionsOrVisualDuration\n\n let { restSpeed, restDelta } = options\n\n const origin = options.keyframes[0]\n const target = options.keyframes[options.keyframes.length - 1]\n\n /**\n * This is the Iterator-spec return value. We ensure it's mutable rather than using a generator\n * to reduce GC during animation.\n */\n const state: AnimationState<number> = { done: false, value: origin }\n\n const {\n stiffness,\n damping,\n mass,\n duration,\n velocity,\n isResolvedFromDuration,\n } = getSpringOptions({\n ...options,\n velocity: -millisecondsToSeconds(options.velocity || 0),\n })\n\n const initialVelocity = velocity || 0.0\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass))\n\n const initialDelta = target - origin\n const undampedAngularFreq = millisecondsToSeconds(\n Math.sqrt(stiffness / mass)\n )\n\n /**\n * If we're working on a granular scale, use smaller defaults for determining\n * when the spring is finished.\n *\n * These defaults have been selected emprically based on what strikes a good\n * ratio between feeling good and finishing as soon as changes are imperceptible.\n */\n const isGranularScale = Math.abs(initialDelta) < 5\n restSpeed ||= isGranularScale\n ? springDefaults.restSpeed.granular\n : springDefaults.restSpeed.default\n restDelta ||= isGranularScale\n ? springDefaults.restDelta.granular\n : springDefaults.restDelta.default\n\n let resolveSpring: (v: number) => number\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio)\n\n // Underdamped spring\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n return (\n target -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t))\n )\n }\n } else if (dampingRatio === 1) {\n // Critically damped spring\n resolveSpring = (t: number) =>\n target -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) * t)\n } else {\n // Overdamped spring\n const dampedAngularFreq =\n undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1)\n\n resolveSpring = (t: number) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t)\n\n // When performing sinh or cosh values can hit Infinity so we cap them here\n const freqForT = Math.min(dampedAngularFreq * t, 300)\n\n return (\n target -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq\n )\n }\n }\n\n const generator = {\n calculatedDuration: isResolvedFromDuration ? duration || null : null,\n next: (t: number) => {\n const current = resolveSpring(t)\n\n if (!isResolvedFromDuration) {\n let currentVelocity = t === 0 ? initialVelocity : 0.0\n\n /**\n * We only need to calculate velocity for under-damped springs\n * as over- and critically-damped springs can't overshoot, so\n * checking only for displacement is enough.\n */\n if (dampingRatio < 1) {\n currentVelocity =\n t === 0\n ? secondsToMilliseconds(initialVelocity)\n : calcGeneratorVelocity(resolveSpring, t, current)\n }\n\n const isBelowVelocityThreshold =\n Math.abs(currentVelocity) <= restSpeed!\n const isBelowDisplacementThreshold =\n Math.abs(target - current) <= restDelta!\n\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold\n } else {\n state.done = t >= duration!\n }\n\n state.value = state.done ? target : current\n\n return state\n },\n toString: () => {\n const calculatedDuration = Math.min(\n calcGeneratorDuration(generator),\n maxGeneratorDuration\n )\n\n const easing = generateLinearEasing(\n (progress: number) =>\n generator.next(calculatedDuration * progress).value,\n calculatedDuration,\n 30\n )\n\n return calculatedDuration + \"ms \" + easing\n },\n toTransition: () => {},\n }\n\n return generator\n}\n\nspring.applyToOptions = (options: Transition) => {\n const generatorOptions = createGeneratorEasing(options as any, 100, spring)\n\n options.ease = generatorOptions.ease\n options.duration = secondsToMilliseconds(generatorOptions.duration)\n options.type = \"keyframes\"\n return options\n}\n\nexport { spring }\n","import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n","import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n","import type { MotionNodeOptions } from \"../../node/types\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nexport function isControllingVariants(props: MotionNodeOptions) {\n return (\n isAnimationControls(props.animate) ||\n variantProps.some((name) =>\n isVariantLabel(props[name as keyof typeof props])\n )\n )\n}\n\nexport function isVariantNode(props: MotionNodeOptions) {\n return Boolean(isControllingVariants(props) || props.variants)\n}\n","import { hasReducedMotionListener, prefersReducedMotion } from \"./state\"\n\nconst isBrowser = typeof window !== \"undefined\"\n\nexport function initPrefersReducedMotion() {\n hasReducedMotionListener.current = true\n if (!isBrowser) return\n\n if (window.matchMedia) {\n const motionMediaQuery = window.matchMedia(\"(prefers-reduced-motion)\")\n\n const setReducedMotionPreferences = () =>\n (prefersReducedMotion.current = motionMediaQuery.matches)\n\n motionMediaQuery.addEventListener(\"change\", setReducedMotionPreferences)\n\n setReducedMotionPreferences()\n } else {\n prefersReducedMotion.current = false\n }\n}\n\nexport { prefersReducedMotion, hasReducedMotionListener }\n","import { transformPropOrder } from \"./keys-transform\"\n\nexport const positionalKeys = new Set([\n \"width\",\n \"height\",\n \"top\",\n \"left\",\n \"right\",\n \"bottom\",\n ...transformPropOrder,\n])\n","import { clamp } from \"motion-utils\"\n\nexport const number = {\n test: (v: number) => typeof v === \"number\",\n parse: parseFloat,\n transform: (v: number) => v,\n}\n\nexport const alpha = {\n ...number,\n transform: (v: number) => clamp(0, 1, v),\n}\n\nexport const scale = {\n ...number,\n default: 1,\n}\n","import { Feature, frame, type PanInfo } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { PanSession } from \"./PanSession\"\n\ntype PanEventHandler = (event: PointerEvent, info: PanInfo) => void\nconst asyncHandler =\n (handler?: PanEventHandler) => (event: PointerEvent, info: PanInfo) => {\n if (handler) {\n frame.postRender(() => handler(event, info))\n }\n }\n\nexport class PanGesture extends Feature<Element> {\n private session?: PanSession\n\n private removePointerDownListener: Function = noop\n\n onPointerDown(pointerDownEvent: PointerEvent) {\n this.session = new PanSession(\n pointerDownEvent,\n this.createPanHandlers(),\n {\n transformPagePoint: this.node.getTransformPagePoint(),\n contextWindow: getContextWindow(this.node),\n }\n )\n }\n\n createPanHandlers() {\n const { onPanSessionStart, onPanStart, onPan, onPanEnd } =\n this.node.getProps()\n\n return {\n onSessionStart: asyncHandler(onPanSessionStart),\n onStart: asyncHandler(onPanStart),\n onMove: onPan,\n onEnd: (event: PointerEvent, info: PanInfo) => {\n delete this.session\n if (onPanEnd) {\n frame.postRender(() => onPanEnd(event, info))\n }\n },\n }\n }\n\n mount() {\n this.removePointerDownListener = addPointerEvent(\n this.node.current!,\n \"pointerdown\",\n (event: PointerEvent) => this.onPointerDown(event)\n )\n }\n\n update() {\n this.session && this.session.updateHandlers(this.createPanHandlers())\n }\n\n unmount() {\n this.removePointerDownListener()\n this.session && this.session.end()\n }\n}\n","import { inertia } from \"../generators/inertia\"\nimport { keyframes } from \"../generators/keyframes\"\nimport { spring } from \"../generators/spring\"\nimport { GeneratorFactory, ValueAnimationTransition } from \"../types\"\n\nconst transitionTypeMap: { [key: string]: GeneratorFactory } = {\n decay: inertia,\n inertia,\n tween: keyframes,\n keyframes: keyframes,\n spring,\n}\n\nexport function replaceTransitionType(transition: ValueAnimationTransition) {\n if (typeof transition.type === \"string\") {\n transition.type = transitionTypeMap[transition.type]\n }\n}\n","import { SubscriptionManager, velocityPerSecond, warnOnce } from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber<T> = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks<V> {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue<V = any> {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect<V>\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set<MotionValue> | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n setPrevFrameValue(prevFrameValue: V | undefined = this.current) {\n this.prevFrameValue = prevFrameValue\n this.prevUpdatedAt = this.updatedAt\n }\n\n /**\n * Adds a function that will be notified when the `MotionValue` is updated.\n *\n * It returns a function that, when called, will cancel the subscription.\n *\n * When calling `onChange` inside a React component, it should be wrapped with the\n * `useEffect` hook. As it returns an unsubscribe function, this should be returned\n * from the `useEffect` function to ensure you don't add duplicate subscribers..\n *\n * ```jsx\n * export const MyComponent = () => {\n * const x = useMotionValue(0)\n * const y = useMotionValue(0)\n * const opacity = useMotionValue(1)\n *\n * useEffect(() => {\n * function updateOpacity() {\n * const maxXY = Math.max(x.get(), y.get())\n * const newOpacity = transform(maxXY, [0, 100], [1, 0])\n * opacity.set(newOpacity)\n * }\n *\n * const unsubscribeX = x.on(\"change\", updateOpacity)\n * const unsubscribeY = y.on(\"change\", updateOpacity)\n *\n * return () => {\n * unsubscribeX()\n * unsubscribeY()\n * }\n * }, [])\n *\n * return <motion.div style={{ x }} />\n * }\n * ```\n *\n * @param subscriber - A function that receives the latest value.\n * @returns A function that, when called, will cancel this subscription.\n *\n * @deprecated\n */\n onChange(subscription: Subscriber<V>): () => void {\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n false,\n `value.onChange(callback) is deprecated. Switch to value.on(\"change\", callback).`\n )\n }\n return this.on(\"change\", subscription)\n }\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager<any>\n } = {}\n\n on<EventName extends keyof MotionValueEventCallbacks<V>>(\n eventName: EventName,\n callback: MotionValueEventCallbacks<V>[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n const unsubscribe = this.events[eventName].add(callback)\n\n if (eventName === \"change\") {\n return () => {\n unsubscribe()\n\n /**\n * If we have no more change listeners by the start\n * of the next frame, stop active animations.\n */\n frame.read(() => {\n if (!this.events.change.getSize()) {\n this.stop()\n }\n })\n }\n }\n\n return unsubscribe\n }\n\n clearListeners() {\n for (const eventManagers in this.events) {\n this.events[eventManagers].clear()\n }\n }\n\n /**\n * Attaches a passive effect to the `MotionValue`.\n */\n attach(passiveEffect: PassiveEffect<V>, stopPassiveEffect: VoidFunction) {\n this.passiveEffect = passiveEffect\n this.stopPassiveEffect = stopPassiveEffect\n }\n\n /**\n * Sets the state of the `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * const x = useMotionValue(0)\n * x.set(10)\n * ```\n *\n * @param latest - Latest value to set.\n * @param render - Whether to notify render subscribers. Defaults to `true`\n *\n * @public\n */\n set(v: V) {\n if (!this.passiveEffect) {\n this.updateAndNotify(v)\n } else {\n this.passiveEffect(v, this.updateAndNotify)\n }\n }\n\n setWithVelocity(prev: V, current: V, delta: number) {\n this.set(current)\n this.prev = undefined\n this.prevFrameValue = prev\n this.prevUpdatedAt = this.updatedAt - delta\n }\n\n /**\n * Set the state of the `MotionValue`, stopping any active animations,\n * effects, and resets velocity to `0`.\n */\n jump(v: V, endAnimation = true) {\n this.updateAndNotify(v)\n this.prev = v\n this.prevUpdatedAt = this.prevFrameValue = undefined\n endAnimation && this.stop()\n if (this.stopPassiveEffect) this.stopPassiveEffect()\n }\n\n dirty() {\n this.events.change?.notify(this.current)\n }\n\n addDependent(dependent: MotionValue) {\n if (!this.dependents) {\n this.dependents = new Set()\n }\n this.dependents.add(dependent)\n }\n\n removeDependent(dependent: MotionValue) {\n if (this.dependents) {\n this.dependents.delete(dependent)\n }\n }\n\n updateAndNotify = (v: V) => {\n const currentTime = time.now()\n\n /**\n * If we're updating the value during another frame or eventloop\n * than the previous frame, then the we set the previous frame value\n * to current.\n */\n if (this.updatedAt !== currentTime) {\n this.setPrevFrameValue()\n }\n\n this.prev = this.current\n\n this.setCurrent(v)\n\n // Update update subscribers\n if (this.current !== this.prev) {\n this.events.change?.notify(this.current)\n\n if (this.dependents) {\n for (const dependent of this.dependents) {\n dependent.dirty()\n }\n }\n }\n }\n\n /**\n * Returns the latest state of `MotionValue`\n *\n * @returns - The latest state of `MotionValue`\n *\n * @public\n */\n get() {\n if (collectMotionValues.current) {\n collectMotionValues.current.push(this)\n }\n\n return this.current!\n }\n\n /**\n * @public\n */\n getPrevious() {\n return this.prev\n }\n\n /**\n * Returns the latest velocity of `MotionValue`\n *\n * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.\n *\n * @public\n */\n getVelocity() {\n const currentTime = time.now()\n\n if (\n !this.canTrackVelocity ||\n this.prevFrameValue === undefined ||\n currentTime - this.updatedAt > MAX_VELOCITY_DELTA\n ) {\n return 0\n }\n\n const delta = Math.min(\n this.updatedAt - this.prevUpdatedAt!,\n MAX_VELOCITY_DELTA\n )\n\n // Casts because of parseFloat's poor typing\n return velocityPerSecond(\n parseFloat(this.current as any) -\n parseFloat(this.prevFrameValue as any),\n delta\n )\n }\n\n hasAnimated = false\n\n /**\n * Registers a new animation to control this `MotionValue`. Only one\n * animation can drive a `MotionValue` at one time.\n *\n * ```jsx\n * value.start()\n * ```\n *\n * @param animation - A function that starts the provided animation\n */\n start(startAnimation: StartAnimation) {\n this.stop()\n\n return new Promise<void>((resolve) => {\n this.hasAnimated = true\n this.animation = startAnimation(resolve)\n\n if (this.events.animationStart) {\n this.events.animationStart.notify()\n }\n }).then(() => {\n if (this.events.animationComplete) {\n this.events.animationComplete.notify()\n }\n this.clearAnimation()\n })\n }\n\n /**\n * Stop the currently active animation.\n *\n * @public\n */\n stop() {\n if (this.animation) {\n this.animation.stop()\n if (this.events.animationCancel) {\n this.events.animationCancel.notify()\n }\n }\n this.clearAnimation()\n }\n\n /**\n * Returns `true` if this value is currently animating.\n *\n * @public\n */\n isAnimating() {\n return !!this.animation\n }\n\n private clearAnimation() {\n delete this.animation\n }\n\n /**\n * Destroy and clean up subscribers to this `MotionValue`.\n *\n * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically\n * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually\n * created a `MotionValue` via the `motionValue` function.\n *\n * @public\n */\n destroy() {\n this.dependents?.clear()\n this.events.destroy?.notify()\n this.clearListeners()\n this.stop()\n\n if (this.stopPassiveEffect) {\n this.stopPassiveEffect()\n }\n }\n}\n\nexport function motionValue<V>(init: V, options?: MotionValueOptions) {\n return new MotionValue<V>(init, options)\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { compareByDepth, WithDepth } from \"./compare-by-depth\"\n\nexport class FlatTree {\n private children: WithDepth[] = []\n\n private isDirty: boolean = false\n\n add(child: WithDepth) {\n addUniqueItem(this.children, child)\n this.isDirty = true\n }\n\n remove(child: WithDepth) {\n removeItem(this.children, child)\n this.isDirty = true\n }\n\n forEach(callback: (child: WithDepth) => void) {\n this.isDirty && this.children.sort(compareByDepth)\n this.isDirty = false\n this.children.forEach(callback)\n }\n}\n","import { MotionGlobalConfig, secondsToMilliseconds } from \"motion-utils\"\nimport { AsyncMotionValueAnimation } from \"../AsyncMotionValueAnimation\"\nimport { JSAnimation } from \"../JSAnimation\"\nimport type {\n AnyResolvedKeyframe,\n ValueAnimationOptions,\n ValueTransition,\n} from \"../types\"\nimport type { UnresolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { makeAnimationInstant } from \"../utils/make-animation-instant\"\nimport { getDefaultTransition } from \"../utils/default-transitions\"\nimport { getFinalKeyframe } from \"../utils/get-final-keyframe\"\nimport { isTransitionDefined } from \"../utils/is-transition-defined\"\nimport { frame } from \"../../frameloop\"\nimport type { MotionValue, StartAnimation } from \"../../value\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\nexport const animateMotionValue =\n <V extends AnyResolvedKeyframe>(\n name: string,\n value: MotionValue<V>,\n target: V | UnresolvedKeyframes<V>,\n transition: ValueTransition & { elapsed?: number } = {},\n element?: VisualElement<any>,\n isHandoff?: boolean\n ): StartAnimation =>\n (onComplete) => {\n const valueTransition = getValueTransition(transition, name) || {}\n\n /**\n * Most transition values are currently completely overwritten by value-specific\n * transitions. In the future it'd be nicer to blend these transitions. But for now\n * delay actually does inherit from the root transition if not value-specific.\n */\n const delay = valueTransition.delay || transition.delay || 0\n\n /**\n * Elapsed isn't a public transition option but can be passed through from\n * optimized appear effects in milliseconds.\n */\n let { elapsed = 0 } = transition\n elapsed = elapsed - secondsToMilliseconds(delay)\n\n const options: ValueAnimationOptions = {\n keyframes: Array.isArray(target) ? target : [null, target],\n ease: \"easeOut\",\n velocity: value.getVelocity(),\n ...valueTransition,\n delay: -elapsed,\n onUpdate: (v) => {\n value.set(v)\n valueTransition.onUpdate && valueTransition.onUpdate(v)\n },\n onComplete: () => {\n onComplete()\n valueTransition.onComplete && valueTransition.onComplete()\n },\n name,\n motionValue: value,\n element: isHandoff ? undefined : element,\n }\n\n /**\n * If there's no transition defined for this value, we can generate\n * unique transition settings for this value.\n */\n if (!isTransitionDefined(valueTransition)) {\n Object.assign(options, getDefaultTransition(name, options))\n }\n\n /**\n * Both WAAPI and our internal animation functions use durations\n * as defined by milliseconds, while our external API defines them\n * as seconds.\n */\n options.duration &&= secondsToMilliseconds(options.duration)\n options.repeatDelay &&= secondsToMilliseconds(options.repeatDelay)\n\n /**\n * Support deprecated way to set initial value. Prefer keyframe syntax.\n */\n if (options.from !== undefined) {\n options.keyframes[0] = options.from as any\n }\n\n let shouldSkip = false\n\n if (\n (options as any).type === false ||\n (options.duration === 0 && !options.repeatDelay)\n ) {\n makeAnimationInstant(options)\n\n if (options.delay === 0) {\n shouldSkip = true\n }\n }\n\n if (\n MotionGlobalConfig.instantAnimations ||\n MotionGlobalConfig.skipAnimations\n ) {\n shouldSkip = true\n makeAnimationInstant(options)\n options.delay = 0\n }\n\n /**\n * If the transition type or easing has been explicitly set by the user\n * then we don't want to allow flattening the animation.\n */\n options.allowFlatten = !valueTransition.type && !valueTransition.ease\n\n /**\n * If we can or must skip creating the animation, and apply only\n * the final keyframe, do so. We also check once keyframes are resolved but\n * this early check prevents the need to create an animation at all.\n */\n if (shouldSkip && !isHandoff && value.get() !== undefined) {\n const finalKeyframe = getFinalKeyframe<V>(\n options.keyframes as V[],\n valueTransition\n )\n\n if (finalKeyframe !== undefined) {\n frame.update(() => {\n options.onUpdate!(finalKeyframe)\n options.onComplete!()\n })\n\n return\n }\n }\n\n return valueTransition.isSync\n ? new JSAnimation(options)\n : new AsyncMotionValueAnimation(options)\n }\n","/**\n * This should only ever be modified on the client otherwise it'll\n * persist through server requests. If we need instanced states we\n * could lazy-init via root.\n */\nexport const globalProjectionState = {\n /**\n * Global flag as to whether the tree has animated since the last time\n * we resized the window\n */\n hasAnimatedSinceResize: true,\n\n /**\n * We set this to true once, on the first update. Any nodes added to the tree beyond that\n * update will be given a `data-projection-id` attribute.\n */\n hasEverUpdated: false,\n}\n","import { analyseComplexValue } from \"../../../value/types/complex\"\nimport { getAnimatableNone } from \"../../../value/types/utils/animatable-none\"\nimport { AnyResolvedKeyframe } from \"../../types\"\nimport { UnresolvedKeyframes } from \"../KeyframesResolver\"\n\n/**\n * If we encounter keyframes like \"none\" or \"0\" and we also have keyframes like\n * \"#fff\" or \"200px 200px\" we want to find a keyframe to serve as a template for\n * the \"none\" keyframes. In this case \"#fff\" or \"200px 200px\" - then these get turned into\n * zero equivalents, i.e. \"#fff0\" or \"0px 0px\".\n */\nconst invalidTemplates = new Set([\"auto\", \"none\", \"0\"])\n\nexport function makeNoneKeyframesAnimatable(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n noneKeyframeIndexes: number[],\n name?: string\n) {\n let i = 0\n let animatableTemplate: string | undefined = undefined\n while (i < unresolvedKeyframes.length && !animatableTemplate) {\n const keyframe = unresolvedKeyframes[i]\n if (\n typeof keyframe === \"string\" &&\n !invalidTemplates.has(keyframe) &&\n analyseComplexValue(keyframe).values.length\n ) {\n animatableTemplate = unresolvedKeyframes[i] as string\n }\n i++\n }\n\n if (animatableTemplate && name) {\n for (const noneIndex of noneKeyframeIndexes) {\n unresolvedKeyframes[noneIndex] = getAnimatableNone(\n name,\n animatableTemplate\n )\n }\n }\n}\n","import { positionalKeys } from \"../../render/utils/keys-position\"\nimport { MotionValue } from \"../../value\"\nimport { findDimensionValueType } from \"../../value/types/dimensions\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { getVariableValue } from \"../utils/css-variables-conversion\"\nimport {\n containsCSSVariable,\n isCSSVariableToken,\n} from \"../utils/is-css-variable\"\nimport {\n KeyframeResolver,\n OnKeyframesResolved,\n UnresolvedKeyframes,\n} from \"./KeyframesResolver\"\nimport { WithRender } from \"./types\"\nimport { isNone } from \"./utils/is-none\"\nimport { makeNoneKeyframesAnimatable } from \"./utils/make-none-animatable\"\nimport { isNumOrPxType, positionalValues } from \"./utils/unit-conversion\"\n\nexport class DOMKeyframesResolver<\n T extends AnyResolvedKeyframe\n> extends KeyframeResolver<T> {\n name: string\n element?: WithRender\n\n private removedTransforms?: [string, AnyResolvedKeyframe][]\n private measuredOrigin?: AnyResolvedKeyframe\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n onComplete: OnKeyframesResolved<T>,\n name?: string,\n motionValue?: MotionValue<T>,\n element?: WithRender\n ) {\n super(unresolvedKeyframes, onComplete, name, motionValue, element, true)\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, element, name } = this\n\n if (!element || !element.current) return\n\n super.readKeyframes()\n\n /**\n * If any keyframe is a CSS variable, we need to find its value by sampling the element\n */\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n let keyframe = unresolvedKeyframes[i]\n\n if (typeof keyframe === \"string\") {\n keyframe = keyframe.trim()\n\n if (isCSSVariableToken(keyframe)) {\n const resolved = getVariableValue(keyframe, element.current)\n\n if (resolved !== undefined) {\n unresolvedKeyframes[i] = resolved as T\n }\n\n if (i === unresolvedKeyframes.length - 1) {\n this.finalKeyframe = keyframe as T\n }\n }\n }\n }\n\n /**\n * Resolve \"none\" values. We do this potentially twice - once before and once after measuring keyframes.\n * This could be seen as inefficient but it's a trade-off to avoid measurements in more situations, which\n * have a far bigger performance impact.\n */\n this.resolveNoneKeyframes()\n\n /**\n * Check to see if unit type has changed. If so schedule jobs that will\n * temporarily set styles to the destination keyframes.\n * Skip if we have more than two keyframes or this isn't a positional value.\n * TODO: We can throw if there are multiple keyframes and the value type changes.\n */\n if (!positionalKeys.has(name) || unresolvedKeyframes.length !== 2) {\n return\n }\n\n const [origin, target] = unresolvedKeyframes\n const originType = findDimensionValueType(origin)\n const targetType = findDimensionValueType(target)\n\n /**\n * If one keyframe contains embedded CSS variables (e.g. in calc()) and the other\n * doesn't, we need to measure to convert to pixels. This handles GitHub issue #3410.\n */\n const originHasVar = containsCSSVariable(origin)\n const targetHasVar = containsCSSVariable(target)\n\n if (originHasVar !== targetHasVar && positionalValues[name]) {\n this.needsMeasurement = true\n return\n }\n\n /**\n * Either we don't recognise these value types or we can animate between them.\n */\n if (originType === targetType) return\n\n /**\n * If both values are numbers or pixels, we can animate between them by\n * converting them to numbers.\n */\n if (isNumOrPxType(originType) && isNumOrPxType(targetType)) {\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n const value = unresolvedKeyframes[i]\n if (typeof value === \"string\") {\n unresolvedKeyframes[i] = parseFloat(value as string)\n }\n }\n } else if (positionalValues[name]) {\n /**\n * Else, the only way to resolve this is by measuring the element.\n */\n this.needsMeasurement = true\n }\n }\n\n resolveNoneKeyframes() {\n const { unresolvedKeyframes, name } = this\n\n const noneKeyframeIndexes: number[] = []\n for (let i = 0; i < unresolvedKeyframes.length; i++) {\n if (\n unresolvedKeyframes[i] === null ||\n isNone(unresolvedKeyframes[i])\n ) {\n noneKeyframeIndexes.push(i)\n }\n }\n\n if (noneKeyframeIndexes.length) {\n makeNoneKeyframesAnimatable(\n unresolvedKeyframes,\n noneKeyframeIndexes,\n name\n )\n }\n }\n\n measureInitialState() {\n const { element, unresolvedKeyframes, name } = this\n\n if (!element || !element.current) return\n\n if (name === \"height\") {\n this.suspendedScrollY = window.pageYOffset\n }\n\n this.measuredOrigin = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n )\n\n unresolvedKeyframes[0] = this.measuredOrigin\n\n // Set final key frame to measure after next render\n const measureKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (measureKeyframe !== undefined) {\n element.getValue(name, measureKeyframe).jump(measureKeyframe, false)\n }\n }\n\n measureEndState() {\n const { element, name, unresolvedKeyframes } = this\n\n if (!element || !element.current) return\n\n const value = element.getValue(name)\n value && value.jump(this.measuredOrigin, false)\n\n const finalKeyframeIndex = unresolvedKeyframes.length - 1\n const finalKeyframe = unresolvedKeyframes[finalKeyframeIndex]\n\n unresolvedKeyframes[finalKeyframeIndex] = positionalValues[name](\n element.measureViewportBox(),\n window.getComputedStyle(element.current)\n ) as any\n\n if (finalKeyframe !== null && this.finalKeyframe === undefined) {\n this.finalKeyframe = finalKeyframe as T\n }\n\n // If we removed transform values, reapply them before the next render\n if (this.removedTransforms?.length) {\n this.removedTransforms.forEach(\n ([unsetTransformName, unsetTransformValue]) => {\n element\n .getValue(unsetTransformName)!\n .set(unsetTransformValue)\n }\n )\n }\n\n this.resolveNoneKeyframes()\n }\n}\n","import { frame } from \"../../frameloop\"\nimport { MotionValue } from \"../../value\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { WithRender } from \"./types\"\nimport { fillWildcards } from \"./utils/fill-wildcards\"\nimport { removeNonTranslationalTransform } from \"./utils/unit-conversion\"\n\nexport type UnresolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T | null>\n\nexport type ResolvedKeyframes<T extends AnyResolvedKeyframe> = Array<T>\n\nconst toResolve = new Set<KeyframeResolver>()\nlet isScheduled = false\nlet anyNeedsMeasurement = false\nlet isForced = false\n\nfunction measureAllKeyframes() {\n if (anyNeedsMeasurement) {\n const resolversToMeasure = Array.from(toResolve).filter(\n (resolver: KeyframeResolver) => resolver.needsMeasurement\n )\n const elementsToMeasure = new Set(\n resolversToMeasure.map((resolver) => resolver.element)\n )\n const transformsToRestore = new Map<\n WithRender,\n [string, AnyResolvedKeyframe][]\n >()\n\n /**\n * Write pass\n * If we're measuring elements we want to remove bounding box-changing transforms.\n */\n elementsToMeasure.forEach((element: WithRender) => {\n const removedTransforms = removeNonTranslationalTransform(\n element as any\n )\n\n if (!removedTransforms.length) return\n\n transformsToRestore.set(element, removedTransforms)\n\n element.render()\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureInitialState())\n\n // Write\n elementsToMeasure.forEach((element: WithRender) => {\n element.render()\n\n const restore = transformsToRestore.get(element)\n if (restore) {\n restore.forEach(([key, value]) => {\n element.getValue(key)?.set(value)\n })\n }\n })\n\n // Read\n resolversToMeasure.forEach((resolver) => resolver.measureEndState())\n\n // Write\n resolversToMeasure.forEach((resolver) => {\n if (resolver.suspendedScrollY !== undefined) {\n window.scrollTo(0, resolver.suspendedScrollY)\n }\n })\n }\n\n anyNeedsMeasurement = false\n isScheduled = false\n\n toResolve.forEach((resolver) => resolver.complete(isForced))\n toResolve.clear()\n}\n\nfunction readAllKeyframes() {\n toResolve.forEach((resolver) => {\n resolver.readKeyframes()\n\n if (resolver.needsMeasurement) {\n anyNeedsMeasurement = true\n }\n })\n}\n\nexport function flushKeyframeResolvers() {\n isForced = true\n readAllKeyframes()\n measureAllKeyframes()\n isForced = false\n}\n\nexport type OnKeyframesResolved<T extends AnyResolvedKeyframe> = (\n resolvedKeyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n forced: boolean\n) => void\n\nexport class KeyframeResolver<T extends AnyResolvedKeyframe = any> {\n name?: string\n element?: WithRender\n finalKeyframe?: T\n suspendedScrollY?: number\n\n protected unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>\n\n private motionValue?: MotionValue<T>\n private onComplete: OnKeyframesResolved<T>\n\n state: \"pending\" | \"scheduled\" | \"complete\" = \"pending\"\n\n /**\n * Track whether this resolver is async. If it is, it'll be added to the\n * resolver queue and flushed in the next frame. Resolvers that aren't going\n * to trigger read/write thrashing don't need to be async.\n */\n private isAsync = false\n\n /**\n * Track whether this resolver needs to perform a measurement\n * to resolve its keyframes.\n */\n needsMeasurement = false\n\n constructor(\n unresolvedKeyframes: UnresolvedKeyframes<AnyResolvedKeyframe>,\n onComplete: OnKeyframesResolved<T>,\n name?: string,\n motionValue?: MotionValue<T>,\n element?: WithRender,\n isAsync = false\n ) {\n this.unresolvedKeyframes = [...unresolvedKeyframes]\n this.onComplete = onComplete\n this.name = name\n this.motionValue = motionValue\n this.element = element\n this.isAsync = isAsync\n }\n\n scheduleResolve() {\n this.state = \"scheduled\"\n\n if (this.isAsync) {\n toResolve.add(this)\n\n if (!isScheduled) {\n isScheduled = true\n frame.read(readAllKeyframes)\n frame.resolveKeyframes(measureAllKeyframes)\n }\n } else {\n this.readKeyframes()\n this.complete()\n }\n }\n\n readKeyframes() {\n const { unresolvedKeyframes, name, element, motionValue } = this\n\n // If initial keyframe is null we need to read it from the DOM\n if (unresolvedKeyframes[0] === null) {\n const currentValue = motionValue?.get()\n\n // TODO: This doesn't work if the final keyframe is a wildcard\n const finalKeyframe =\n unresolvedKeyframes[unresolvedKeyframes.length - 1]\n\n if (currentValue !== undefined) {\n unresolvedKeyframes[0] = currentValue\n } else if (element && name) {\n const valueAsRead = element.readValue(name, finalKeyframe)\n\n if (valueAsRead !== undefined && valueAsRead !== null) {\n unresolvedKeyframes[0] = valueAsRead\n }\n }\n\n if (unresolvedKeyframes[0] === undefined) {\n unresolvedKeyframes[0] = finalKeyframe\n }\n\n if (motionValue && currentValue === undefined) {\n motionValue.set(unresolvedKeyframes[0] as T)\n }\n }\n\n fillWildcards(unresolvedKeyframes)\n }\n\n setFinalKeyframe() {}\n measureInitialState() {}\n renderEndStyles() {}\n measureEndState() {}\n\n complete(isForcedComplete = false) {\n this.state = \"complete\"\n\n this.onComplete(\n this.unresolvedKeyframes as ResolvedKeyframes<T>,\n this.finalKeyframe as T,\n isForcedComplete\n )\n\n toResolve.delete(this)\n }\n\n cancel() {\n if (this.state === \"scheduled\") {\n toResolve.delete(this)\n this.state = \"pending\"\n }\n }\n\n resume() {\n if (this.state === \"pending\") this.scheduleResolve()\n }\n}\n","import { formatErrorMessage } from \"./format-error-message\"\n\nexport type DevMessage = (\n check: boolean,\n message: string,\n errorCode?: string\n) => void\n\nlet warning: DevMessage = () => {}\nlet invariant: DevMessage = () => {}\n\nif (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n) {\n warning = (check, message, errorCode) => {\n if (!check && typeof console !== \"undefined\") {\n console.warn(formatErrorMessage(message, errorCode))\n }\n }\n\n invariant = (check, message, errorCode) => {\n if (!check) {\n throw new Error(formatErrorMessage(message, errorCode))\n }\n }\n}\n\nexport { invariant, warning }\n","import { complex } from \"../../value/types/complex\"\nimport { ValueKeyframesDefinition } from \"../types\"\n\n/**\n * Check if a value is animatable. Examples:\n *\n * ✅: 100, \"100px\", \"#fff\"\n * ❌: \"block\", \"url(2.jpg)\"\n * @param value\n *\n * @internal\n */\nexport const isAnimatable = (\n value: ValueKeyframesDefinition,\n name?: string\n) => {\n // If the list of keys that might be non-animatable grows, replace with Set\n if (name === \"zIndex\") return false\n\n // If it's a number or a keyframes array, we can animate it. We might at some point\n // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,\n // but for now lets leave it like this for performance reasons\n if (typeof value === \"number\" || Array.isArray(value)) return true\n\n if (\n typeof value === \"string\" && // It's animatable if we have a string\n (complex.test(value) || value === \"0\") && // And it contains numbers and/or colors\n !value.startsWith(\"url(\") // Unless it starts with \"url(\"\n ) {\n return true\n }\n\n return false\n}\n","import { complex } from \"../../value/types/complex\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport type { ScaleCorrectorDefinition } from \"./types\"\n\nexport const correctBoxShadow: ScaleCorrectorDefinition = {\n correct: (latest: string, { treeScale, projectionDelta }) => {\n const original = latest\n const shadow = complex.parse(latest)\n\n // TODO: Doesn't support multiple shadows\n if (shadow.length > 5) return original\n\n const template = complex.createTransformer(latest)\n const offset = typeof shadow[0] !== \"number\" ? 1 : 0\n\n // Calculate the overall context scale\n const xScale = projectionDelta!.x.scale * treeScale!.x\n const yScale = projectionDelta!.y.scale * treeScale!.y\n\n // Scale x/y\n ;(shadow[0 + offset] as number) /= xScale\n ;(shadow[1 + offset] as number) /= yScale\n\n /**\n * Ideally we'd correct x and y scales individually, but because blur and\n * spread apply to both we have to take a scale average and apply that instead.\n * We could potentially improve the outcome of this by incorporating the ratio between\n * the two scales.\n */\n const averageScale = mixNumber(xScale, yScale, 0.5)\n\n // Blur\n if (typeof shadow[2 + offset] === \"number\")\n (shadow[2 + offset] as number) /= averageScale\n\n // Spread\n if (typeof shadow[3 + offset] === \"number\")\n (shadow[3 + offset] as number) /= averageScale\n\n return template(shadow)\n },\n}\n","import type { EventInfo, PanHandler } from \"motion-dom\"\nimport { cancelFrame, frame, frameData, isPrimaryPointer } from \"motion-dom\"\nimport {\n millisecondsToSeconds,\n pipe,\n Point,\n secondsToMilliseconds,\n TransformPoint,\n} from \"motion-utils\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { distance2D } from \"../../utils/distance\"\n\ninterface PanSessionHandlers {\n onSessionStart: PanHandler\n onStart: PanHandler\n onMove: PanHandler\n onEnd: PanHandler\n onSessionEnd: PanHandler\n resumeAnimation: () => void\n}\n\ninterface PanSessionOptions {\n transformPagePoint?: TransformPoint\n dragSnapToOrigin?: boolean\n distanceThreshold?: number\n contextWindow?: (Window & typeof globalThis) | null\n /**\n * Element being dragged. When provided, scroll events on its\n * ancestors and window are compensated so the gesture continues\n * smoothly during scroll.\n */\n element?: HTMLElement | null\n}\n\ninterface TimestampedPoint extends Point {\n timestamp: number\n}\n\nconst overflowStyles = /*#__PURE__*/ new Set([\"auto\", \"scroll\"])\n\n/**\n * @internal\n */\nexport class PanSession {\n /**\n * @internal\n */\n private history: TimestampedPoint[]\n\n /**\n * @internal\n */\n private startEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEvent: PointerEvent | null = null\n\n /**\n * @internal\n */\n private lastMoveEventInfo: EventInfo | null = null\n\n /**\n * @internal\n */\n private transformPagePoint?: TransformPoint\n\n /**\n * @internal\n */\n private handlers: Partial<PanSessionHandlers> = {}\n\n /**\n * @internal\n */\n private removeListeners: Function\n\n /**\n * For determining if an animation should resume after it is interupted\n *\n * @internal\n */\n private dragSnapToOrigin: boolean\n\n /**\n * The distance after which panning should start.\n *\n * @internal\n */\n private distanceThreshold: number\n\n /**\n * @internal\n */\n private contextWindow: PanSessionOptions[\"contextWindow\"] = window\n\n /**\n * Scroll positions of scrollable ancestors and window.\n * @internal\n */\n private scrollPositions: Map<Element | Window, Point> = new Map()\n\n /**\n * Cleanup function for scroll listeners.\n * @internal\n */\n private removeScrollListeners: (() => void) | null = null\n\n constructor(\n event: PointerEvent,\n handlers: Partial<PanSessionHandlers>,\n {\n transformPagePoint,\n contextWindow = window,\n dragSnapToOrigin = false,\n distanceThreshold = 3,\n element,\n }: PanSessionOptions = {}\n ) {\n // If we have more than one touch, don't start detecting this gesture\n if (!isPrimaryPointer(event)) return\n\n this.dragSnapToOrigin = dragSnapToOrigin\n this.handlers = handlers\n this.transformPagePoint = transformPagePoint\n this.distanceThreshold = distanceThreshold\n this.contextWindow = contextWindow || window\n\n const info = extractEventInfo(event)\n const initialInfo = transformPoint(info, this.transformPagePoint)\n const { point } = initialInfo\n\n const { timestamp } = frameData\n\n this.history = [{ ...point, timestamp }]\n\n const { onSessionStart } = handlers\n onSessionStart &&\n onSessionStart(event, getPanInfo(initialInfo, this.history))\n\n this.removeListeners = pipe(\n addPointerEvent(\n this.contextWindow,\n \"pointermove\",\n this.handlePointerMove\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointerup\",\n this.handlePointerUp\n ),\n addPointerEvent(\n this.contextWindow,\n \"pointercancel\",\n this.handlePointerUp\n )\n )\n\n // Start scroll tracking if element provided\n if (element) {\n this.startScrollTracking(element)\n }\n }\n\n /**\n * Start tracking scroll on ancestors and window.\n */\n private startScrollTracking(element: HTMLElement): void {\n // Store initial scroll positions for scrollable ancestors\n let current = element.parentElement\n while (current) {\n const style = getComputedStyle(current)\n if (\n overflowStyles.has(style.overflowX) ||\n overflowStyles.has(style.overflowY)\n ) {\n this.scrollPositions.set(current, {\n x: current.scrollLeft,\n y: current.scrollTop,\n })\n }\n current = current.parentElement\n }\n\n // Track window scroll\n this.scrollPositions.set(window, {\n x: window.scrollX,\n y: window.scrollY,\n })\n\n // Capture listener catches element scroll events as they bubble\n window.addEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n passive: true,\n })\n\n // Direct window scroll listener (window scroll doesn't bubble)\n window.addEventListener(\"scroll\", this.onWindowScroll, {\n passive: true,\n })\n\n this.removeScrollListeners = () => {\n window.removeEventListener(\"scroll\", this.onElementScroll, {\n capture: true,\n })\n window.removeEventListener(\"scroll\", this.onWindowScroll)\n }\n }\n\n private onElementScroll = (event: Event): void => {\n this.handleScroll(event.target as Element)\n }\n\n private onWindowScroll = (): void => {\n this.handleScroll(window)\n }\n\n /**\n * Handle scroll compensation during drag.\n *\n * For element scroll: adjusts history origin since pageX/pageY doesn't change.\n * For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.\n */\n private handleScroll(target: Element | Window): void {\n const initial = this.scrollPositions.get(target)\n if (!initial) return\n\n const isWindow = target === window\n const current = isWindow\n ? { x: window.scrollX, y: window.scrollY }\n : {\n x: (target as Element).scrollLeft,\n y: (target as Element).scrollTop,\n }\n\n const delta = { x: current.x - initial.x, y: current.y - initial.y }\n if (delta.x === 0 && delta.y === 0) return\n\n if (isWindow) {\n // Window scroll: pageX/pageY changes, so update lastMoveEventInfo\n if (this.lastMoveEventInfo) {\n this.lastMoveEventInfo.point.x += delta.x\n this.lastMoveEventInfo.point.y += delta.y\n }\n } else {\n // Element scroll: pageX/pageY unchanged, so adjust history origin\n if (this.history.length > 0) {\n this.history[0].x -= delta.x\n this.history[0].y -= delta.y\n }\n }\n\n this.scrollPositions.set(target, current)\n frame.update(this.updatePoint, true)\n }\n\n private updatePoint = () => {\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const info = getPanInfo(this.lastMoveEventInfo, this.history)\n const isPanStarted = this.startEvent !== null\n\n // Only start panning if the offset is larger than 3 pixels. If we make it\n // any larger than this we'll want to reset the pointer history\n // on the first update to avoid visual snapping to the cursor.\n const isDistancePastThreshold =\n distance2D(info.offset, { x: 0, y: 0 }) >= this.distanceThreshold\n\n if (!isPanStarted && !isDistancePastThreshold) return\n\n const { point } = info\n const { timestamp } = frameData\n this.history.push({ ...point, timestamp })\n\n const { onStart, onMove } = this.handlers\n\n if (!isPanStarted) {\n onStart && onStart(this.lastMoveEvent, info)\n this.startEvent = this.lastMoveEvent\n }\n\n onMove && onMove(this.lastMoveEvent, info)\n }\n\n private handlePointerMove = (event: PointerEvent, info: EventInfo) => {\n this.lastMoveEvent = event\n this.lastMoveEventInfo = transformPoint(info, this.transformPagePoint)\n\n // Throttle mouse move event to once per frame\n frame.update(this.updatePoint, true)\n }\n\n private handlePointerUp = (event: PointerEvent, info: EventInfo) => {\n this.end()\n\n const { onEnd, onSessionEnd, resumeAnimation } = this.handlers\n\n // Resume animation if dragSnapToOrigin is set OR if no drag started (user just clicked)\n // This ensures constraint animations continue when interrupted by a click\n if (this.dragSnapToOrigin || !this.startEvent) {\n resumeAnimation && resumeAnimation()\n }\n if (!(this.lastMoveEvent && this.lastMoveEventInfo)) return\n\n const panInfo = getPanInfo(\n event.type === \"pointercancel\"\n ? this.lastMoveEventInfo\n : transformPoint(info, this.transformPagePoint),\n this.history\n )\n\n if (this.startEvent && onEnd) {\n onEnd(event, panInfo)\n }\n\n onSessionEnd && onSessionEnd(event, panInfo)\n }\n\n updateHandlers(handlers: Partial<PanSessionHandlers>) {\n this.handlers = handlers\n }\n\n end() {\n this.removeListeners && this.removeListeners()\n this.removeScrollListeners && this.removeScrollListeners()\n this.scrollPositions.clear()\n cancelFrame(this.updatePoint)\n }\n}\n\nfunction transformPoint(\n info: EventInfo,\n transformPagePoint?: (point: Point) => Point\n) {\n return transformPagePoint ? { point: transformPagePoint(info.point) } : info\n}\n\nfunction subtractPoint(a: Point, b: Point): Point {\n return { x: a.x - b.x, y: a.y - b.y }\n}\n\nfunction getPanInfo({ point }: EventInfo, history: TimestampedPoint[]) {\n return {\n point,\n delta: subtractPoint(point, lastDevicePoint(history)),\n offset: subtractPoint(point, startDevicePoint(history)),\n velocity: getVelocity(history, 0.1),\n }\n}\n\nfunction startDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[0]\n}\n\nfunction lastDevicePoint(history: TimestampedPoint[]): TimestampedPoint {\n return history[history.length - 1]\n}\n\nfunction getVelocity(history: TimestampedPoint[], timeDelta: number): Point {\n if (history.length < 2) {\n return { x: 0, y: 0 }\n }\n\n let i = history.length - 1\n let timestampedPoint: TimestampedPoint | null = null\n const lastPoint = lastDevicePoint(history)\n while (i >= 0) {\n timestampedPoint = history[i]\n if (\n lastPoint.timestamp - timestampedPoint.timestamp >\n secondsToMilliseconds(timeDelta)\n ) {\n break\n }\n i--\n }\n\n if (!timestampedPoint) {\n return { x: 0, y: 0 }\n }\n\n const time = millisecondsToSeconds(\n lastPoint.timestamp - timestampedPoint.timestamp\n )\n if (time === 0) {\n return { x: 0, y: 0 }\n }\n\n const currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time,\n }\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0\n }\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0\n }\n\n return currentVelocity\n}\n","import { EventInfo, isPrimaryPointer } from \"motion-dom\"\n\nexport type EventListenerWithPointInfo = (\n e: PointerEvent,\n info: EventInfo\n) => void\n\nexport function extractEventInfo(event: PointerEvent): EventInfo {\n return {\n point: {\n x: event.pageX,\n y: event.pageY,\n },\n }\n}\n\nexport const addPointerInfo = (\n handler: EventListenerWithPointInfo\n): EventListener => {\n return (event: PointerEvent) =>\n isPrimaryPointer(event) && handler(event, extractEventInfo(event))\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\n\nconst SCALE_PRECISION = 0.0001\nconst SCALE_MIN = 1 - SCALE_PRECISION\nconst SCALE_MAX = 1 + SCALE_PRECISION\nconst TRANSLATE_PRECISION = 0.01\nconst TRANSLATE_MIN = 0 - TRANSLATE_PRECISION\nconst TRANSLATE_MAX = 0 + TRANSLATE_PRECISION\n\nexport function calcLength(axis: Axis) {\n return axis.max - axis.min\n}\n\nexport function isNear(\n value: number,\n target: number,\n maxDistance: number\n): boolean {\n return Math.abs(value - target) <= maxDistance\n}\n\nexport function calcAxisDelta(\n delta: AxisDelta,\n source: Axis,\n target: Axis,\n origin: number = 0.5\n) {\n delta.origin = origin\n delta.originPoint = mixNumber(source.min, source.max, delta.origin)\n delta.scale = calcLength(target) / calcLength(source)\n delta.translate =\n mixNumber(target.min, target.max, delta.origin) - delta.originPoint\n\n if (\n (delta.scale >= SCALE_MIN && delta.scale <= SCALE_MAX) ||\n isNaN(delta.scale)\n ) {\n delta.scale = 1.0\n }\n\n if (\n (delta.translate >= TRANSLATE_MIN &&\n delta.translate <= TRANSLATE_MAX) ||\n isNaN(delta.translate)\n ) {\n delta.translate = 0.0\n }\n}\n\nexport function calcBoxDelta(\n delta: Delta,\n source: Box,\n target: Box,\n origin?: ResolvedValues\n): void {\n calcAxisDelta(\n delta.x,\n source.x,\n target.x,\n origin ? (origin.originX as number) : undefined\n )\n calcAxisDelta(\n delta.y,\n source.y,\n target.y,\n origin ? (origin.originY as number) : undefined\n )\n}\n\nexport function calcRelativeAxis(target: Axis, relative: Axis, parent: Axis) {\n target.min = parent.min + relative.min\n target.max = target.min + calcLength(relative)\n}\n\nexport function calcRelativeBox(target: Box, relative: Box, parent: Box) {\n calcRelativeAxis(target.x, relative.x, parent.x)\n calcRelativeAxis(target.y, relative.y, parent.y)\n}\n\nexport function calcRelativeAxisPosition(\n target: Axis,\n layout: Axis,\n parent: Axis\n) {\n target.min = layout.min - parent.min\n target.max = target.min + calcLength(layout)\n}\n\nexport function calcRelativePosition(target: Box, layout: Box, parent: Box) {\n calcRelativeAxisPosition(target.x, layout.x, parent.x)\n calcRelativeAxisPosition(target.y, layout.y, parent.y)\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\nimport { calcLength } from \"./delta-calc\"\n\nfunction isAxisDeltaZero(delta: AxisDelta) {\n return delta.translate === 0 && delta.scale === 1\n}\n\nexport function isDeltaZero(delta: Delta) {\n return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y)\n}\n\nexport function axisEquals(a: Axis, b: Axis) {\n return a.min === b.min && a.max === b.max\n}\n\nexport function boxEquals(a: Box, b: Box) {\n return axisEquals(a.x, b.x) && axisEquals(a.y, b.y)\n}\n\nexport function axisEqualsRounded(a: Axis, b: Axis) {\n return (\n Math.round(a.min) === Math.round(b.min) &&\n Math.round(a.max) === Math.round(b.max)\n )\n}\n\nexport function boxEqualsRounded(a: Box, b: Box) {\n return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y)\n}\n\nexport function aspectRatio(box: Box): number {\n return calcLength(box.x) / calcLength(box.y)\n}\n\nexport function axisDeltaEquals(a: AxisDelta, b: AxisDelta) {\n return (\n a.translate === b.translate &&\n a.scale === b.scale &&\n a.originPoint === b.originPoint\n )\n}\n","import { BoundingBox, Box, TransformPoint } from \"motion-utils\"\n\n/**\n * Bounding boxes tend to be defined as top, left, right, bottom. For various operations\n * it's easier to consider each axis individually. This function returns a bounding box\n * as a map of single-axis min/max values.\n */\nexport function convertBoundingBoxToBox({\n top,\n left,\n right,\n bottom,\n}: BoundingBox): Box {\n return {\n x: { min: left, max: right },\n y: { min: top, max: bottom },\n }\n}\n\nexport function convertBoxToBoundingBox({ x, y }: Box): BoundingBox {\n return { top: y.min, right: x.max, bottom: y.max, left: x.min }\n}\n\n/**\n * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function\n * provided by Framer to allow measured points to be corrected for device scaling. This is used\n * when measuring DOM elements and DOM event points.\n */\nexport function transformBoxPoints(\n point: BoundingBox,\n transformPoint?: TransformPoint\n) {\n if (!transformPoint) return point\n const topLeft = transformPoint({ x: point.left, y: point.top })\n const bottomRight = transformPoint({ x: point.right, y: point.bottom })\n\n return {\n top: topLeft.y,\n left: topLeft.x,\n bottom: bottomRight.y,\n right: bottomRight.x,\n }\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport type { VisualElement } from \"../../render/VisualElement\"\nimport { isWillChangeMotionValue } from \"./is\"\n\nexport function addValueToWillChange(\n visualElement: VisualElement,\n key: string\n) {\n const willChange = visualElement.getValue(\"willChange\")\n\n /**\n * It could be that a user has set willChange to a regular MotionValue,\n * in which case we can't add the value to it.\n */\n if (isWillChangeMotionValue(willChange)) {\n return willChange.add(key)\n } else if (!willChange && MotionGlobalConfig.WillChange) {\n const newWillChange = new MotionGlobalConfig.WillChange(\"auto\")\n\n visualElement.addValue(\"willChange\", newWillChange)\n newWillChange.add(key)\n }\n}\n","import { Feature } from \"motion-dom\"\n\nlet id = 0\n\nexport class ExitAnimationFeature extends Feature<unknown> {\n private id: number = id++\n\n update() {\n if (!this.node.presenceContext) return\n\n const { isPresent, onExitComplete } = this.node.presenceContext\n const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {}\n\n if (!this.node.animationState || isPresent === prevIsPresent) {\n return\n }\n\n const exitAnimation = this.node.animationState.setActive(\n \"exit\",\n !isPresent\n )\n\n if (onExitComplete && !isPresent) {\n exitAnimation.then(() => {\n onExitComplete(this.id)\n })\n }\n }\n\n mount() {\n const { register, onExitComplete } = this.node.presenceContext || {}\n\n if (onExitComplete) {\n onExitComplete(this.id)\n }\n\n if (register) {\n this.unmount = register(this.id)\n }\n }\n\n unmount() {}\n}\n","import { Axis, AxisDelta, Box, Delta } from \"motion-utils\"\n\nexport const createAxisDelta = (): AxisDelta => ({\n translate: 0,\n scale: 1,\n origin: 0,\n originPoint: 0,\n})\n\nexport const createDelta = (): Delta => ({\n x: createAxisDelta(),\n y: createAxisDelta(),\n})\n\nexport const createAxis = (): Axis => ({ min: 0, max: 0 })\n\nexport const createBox = (): Box => ({\n x: createAxis(),\n y: createAxis(),\n})\n","import { pipe, warning } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableToken } from \"../../animation/utils/is-css-variable\"\nimport { color } from \"../../value/types/color\"\nimport {\n analyseComplexValue,\n complex,\n ComplexValueInfo,\n ComplexValues,\n} from \"../../value/types/complex\"\nimport { HSLA, RGBA } from \"../../value/types/types\"\nimport { mixColor } from \"./color\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber as mixNumberImmediate } from \"./number\"\nimport { invisibleValues, mixVisibility } from \"./visibility\"\n\ntype MixableArray = Array<number | RGBA | HSLA | string>\ninterface MixableObject {\n [key: string]: AnyResolvedKeyframe | RGBA | HSLA\n}\n\nfunction mixNumber(a: number, b: number) {\n return (p: number) => mixNumberImmediate(a, b, p)\n}\n\nexport function getMixer<T>(a: T) {\n if (typeof a === \"number\") {\n return mixNumber\n } else if (typeof a === \"string\") {\n return isCSSVariableToken(a)\n ? mixImmediate\n : color.test(a)\n ? mixColor\n : mixComplex\n } else if (Array.isArray(a)) {\n return mixArray\n } else if (typeof a === \"object\") {\n return color.test(a) ? mixColor : mixObject\n }\n\n return mixImmediate\n}\n\nexport function mixArray(a: MixableArray, b: MixableArray) {\n const output = [...a]\n const numValues = output.length\n\n const blendValue = a.map((v, i) => getMixer(v)(v as any, b[i] as any))\n\n return (p: number) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](p) as any\n }\n return output\n }\n}\n\nexport function mixObject(a: MixableObject, b: MixableObject) {\n const output = { ...a, ...b }\n const blendValue: { [key: string]: (v: number) => any } = {}\n\n for (const key in output) {\n if (a[key] !== undefined && b[key] !== undefined) {\n blendValue[key] = getMixer(a[key])(\n a[key] as any,\n b[key] as any\n ) as any\n }\n }\n\n return (v: number) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v)\n }\n return output\n }\n}\n\nfunction matchOrder(\n origin: ComplexValueInfo,\n target: ComplexValueInfo\n): ComplexValues {\n const orderedOrigin: ComplexValues = []\n\n const pointers = { color: 0, var: 0, number: 0 }\n\n for (let i = 0; i < target.values.length; i++) {\n const type = target.types[i]\n const originIndex = origin.indexes[type][pointers[type]]\n const originValue = origin.values[originIndex] ?? 0\n\n orderedOrigin[i] = originValue\n\n pointers[type]++\n }\n\n return orderedOrigin\n}\n\nexport const mixComplex = (\n origin: AnyResolvedKeyframe,\n target: AnyResolvedKeyframe\n) => {\n const template = complex.createTransformer(target)\n const originStats = analyseComplexValue(origin)\n const targetStats = analyseComplexValue(target)\n const canInterpolate =\n originStats.indexes.var.length === targetStats.indexes.var.length &&\n originStats.indexes.color.length === targetStats.indexes.color.length &&\n originStats.indexes.number.length >= targetStats.indexes.number.length\n\n if (canInterpolate) {\n if (\n (invisibleValues.has(origin as string) &&\n !targetStats.values.length) ||\n (invisibleValues.has(target as string) &&\n !originStats.values.length)\n ) {\n return mixVisibility(origin as string, target as string)\n }\n\n return pipe(\n mixArray(matchOrder(originStats, targetStats), targetStats.values),\n template\n )\n } else {\n warning(\n true,\n `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,\n \"complex-values-different\"\n )\n\n return mixImmediate(origin, target)\n }\n}\n","import { type AnyResolvedKeyframe } from \"../../animation/types\"\nimport { ResolvedValues } from \"../../render/types\"\n\nfunction isIdentityScale(scale: AnyResolvedKeyframe | undefined) {\n return scale === undefined || scale === 1\n}\n\nexport function hasScale({ scale, scaleX, scaleY }: ResolvedValues) {\n return (\n !isIdentityScale(scale) ||\n !isIdentityScale(scaleX) ||\n !isIdentityScale(scaleY)\n )\n}\n\nexport function hasTransform(values: ResolvedValues) {\n return (\n hasScale(values) ||\n has2DTranslate(values) ||\n values.z ||\n values.rotate ||\n values.rotateX ||\n values.rotateY ||\n values.skewX ||\n values.skewY\n )\n}\n\nexport function has2DTranslate(values: ResolvedValues) {\n return is2DTranslate(values.x) || is2DTranslate(values.y)\n}\n\nfunction is2DTranslate(value: AnyResolvedKeyframe | undefined) {\n return value && value !== \"0%\"\n}\n","import { warning } from \"motion-utils\"\nimport { hex } from \"../../value/types/color/hex\"\nimport { hsla } from \"../../value/types/color/hsla\"\nimport { hslaToRgba } from \"../../value/types/color/hsla-to-rgba\"\nimport { rgba } from \"../../value/types/color/rgba\"\nimport { Color, HSLA, RGBA } from \"../../value/types/types\"\nimport { mixImmediate } from \"./immediate\"\nimport { mixNumber } from \"./number\"\n\n// Linear color space blending\n// Explained https://www.youtube.com/watch?v=LKnqECcg6Gw\n// Demonstrated http://codepen.io/osublake/pen/xGVVaN\nexport const mixLinearColor = (from: number, to: number, v: number) => {\n const fromExpo = from * from\n const expo = v * (to * to - fromExpo) + fromExpo\n return expo < 0 ? 0 : Math.sqrt(expo)\n}\n\nconst colorTypes = [hex, rgba, hsla]\nconst getColorType = (v: Color | string) =>\n colorTypes.find((type) => type.test(v))\n\nfunction asRGBA(color: Color | string) {\n const type = getColorType(color)\n\n warning(\n Boolean(type),\n `'${color}' is not an animatable color. Use the equivalent color code instead.`,\n \"color-not-animatable\"\n )\n\n if (!Boolean(type)) return false\n\n let model = type!.parse(color)\n\n if (type === hsla) {\n // TODO Remove this cast - needed since Motion's stricter typing\n model = hslaToRgba(model as HSLA)\n }\n\n return model as RGBA\n}\n\nexport const mixColor = (from: Color | string, to: Color | string) => {\n const fromRGBA = asRGBA(from)\n const toRGBA = asRGBA(to)\n\n if (!fromRGBA || !toRGBA) {\n return mixImmediate(from, to)\n }\n\n const blended = { ...fromRGBA }\n\n return (v: number) => {\n blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v)\n blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v)\n blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v)\n blended.alpha = mixNumber(fromRGBA.alpha, toRGBA.alpha, v)\n return rgba.transform!(blended)\n }\n}\n","import { isVariantLabel } from \"./is-variant-label\"\nimport { variantProps } from \"./variant-props\"\n\nconst numVariantProps = variantProps.length\n\ntype VariantStateContext = {\n initial?: string | string[]\n animate?: string | string[]\n exit?: string | string[]\n whileHover?: string | string[]\n whileDrag?: string | string[]\n whileFocus?: string | string[]\n whileTap?: string | string[]\n}\n\n/**\n * Get variant context from a visual element's parent chain.\n * Uses `any` type for visualElement to avoid circular dependencies.\n */\nexport function getVariantContext(\n visualElement?: any\n): undefined | VariantStateContext {\n if (!visualElement) return undefined\n\n if (!visualElement.isControllingVariants) {\n const context = visualElement.parent\n ? getVariantContext(visualElement.parent) || {}\n : {}\n if (visualElement.props.initial !== undefined) {\n context.initial = visualElement.props.initial as any\n }\n return context\n }\n\n const context: VariantStateContext = {}\n for (let i = 0; i < numVariantProps; i++) {\n const name = variantProps[i] as keyof typeof context\n const prop = visualElement.props[name]\n\n if (isVariantLabel(prop) || prop === false) {\n ;(context as any)[name] = prop\n }\n }\n\n return context\n}\n","import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n","import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\n\n/**\n * A list of values that can be hardware-accelerated.\n */\nconst acceleratedValues = new Set<string>([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Could be re-enabled now we have support for linear() easing\n // \"background-color\"\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation<T extends AnyResolvedKeyframe>(\n options: ValueAnimationOptionsWithRenderContext<T>\n) {\n const { motionValue, name, repeatDelay, repeatType, damping, type } =\n options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n acceleratedValues.has(name) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n","import { isPressing } from \"./state\"\n\n/**\n * Filter out events that are not \"Enter\" keys.\n */\nfunction filterEvents(callback: (event: KeyboardEvent) => void) {\n return (event: KeyboardEvent) => {\n if (event.key !== \"Enter\") return\n callback(event)\n }\n}\n\nfunction firePointerEvent(target: EventTarget, type: \"down\" | \"up\" | \"cancel\") {\n target.dispatchEvent(\n new PointerEvent(\"pointer\" + type, { isPrimary: true, bubbles: true })\n )\n}\n\nexport const enableKeyboardPress = (\n focusEvent: FocusEvent,\n eventOptions: AddEventListenerOptions\n) => {\n const element = focusEvent.currentTarget as HTMLElement\n if (!element) return\n\n const handleKeydown = filterEvents(() => {\n if (isPressing.has(element)) return\n\n firePointerEvent(element, \"down\")\n\n const handleKeyup = filterEvents(() => {\n firePointerEvent(element, \"up\")\n })\n\n const handleBlur = () => firePointerEvent(element, \"cancel\")\n\n element.addEventListener(\"keyup\", handleKeyup, eventOptions)\n element.addEventListener(\"blur\", handleBlur, eventOptions)\n })\n\n element.addEventListener(\"keydown\", handleKeydown, eventOptions)\n\n /**\n * Add an event listener that fires on blur to remove the keydown events.\n */\n element.addEventListener(\n \"blur\",\n () => element.removeEventListener(\"keydown\", handleKeydown),\n eventOptions\n )\n}\n","/*\n Progress within given range\n\n Given a lower limit and an upper limit, we return the progress\n (expressed as a number 0-1) represented by the given value, and\n limit that progress to within 0-1.\n\n @param [number]: Lower limit\n @param [number]: Upper limit\n @param [number]: Value to find progress within given range\n @return [number]: Progress of value within range as expressed 0-1\n*/\n/*#__NO_SIDE_EFFECTS__*/\nexport const progress = (from: number, to: number, value: number) => {\n const toFromDifference = to - from\n\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference\n}\n","import { getFeatureDefinitions, setFeatureDefinitions } from \"motion-dom\"\nimport { MotionProps } from \"../types\"\nimport { FeatureDefinitions } from \"./types\"\n\nconst featureProps = {\n animation: [\n \"animate\",\n \"variants\",\n \"whileHover\",\n \"whileTap\",\n \"exit\",\n \"whileInView\",\n \"whileFocus\",\n \"whileDrag\",\n ],\n exit: [\"exit\"],\n drag: [\"drag\", \"dragControls\"],\n focus: [\"whileFocus\"],\n hover: [\"whileHover\", \"onHoverStart\", \"onHoverEnd\"],\n tap: [\"whileTap\", \"onTap\", \"onTapStart\", \"onTapCancel\"],\n pan: [\"onPan\", \"onPanStart\", \"onPanSessionStart\", \"onPanEnd\"],\n inView: [\"whileInView\", \"onViewportEnter\", \"onViewportLeave\"],\n layout: [\"layout\", \"layoutId\"],\n}\n\nlet isInitialized = false\n\n/**\n * Initialize feature definitions with isEnabled checks.\n * This must be called before any motion components are rendered.\n */\nexport function initFeatureDefinitions() {\n if (isInitialized) return\n\n const initialFeatureDefinitions: Partial<FeatureDefinitions> = {}\n\n for (const key in featureProps) {\n initialFeatureDefinitions[\n key as keyof typeof initialFeatureDefinitions\n ] = {\n isEnabled: (props: MotionProps) =>\n featureProps[key as keyof typeof featureProps].some(\n (name: string) => !!props[name as keyof typeof props]\n ),\n }\n }\n\n setFeatureDefinitions(initialFeatureDefinitions)\n isInitialized = true\n}\n\n/**\n * Get the current feature definitions, initializing if needed.\n */\nexport function getInitializedFeatureDefinitions(): Partial<FeatureDefinitions> {\n initFeatureDefinitions()\n return getFeatureDefinitions()\n}\n","import { isHTMLElement } from \"../../utils/is-html-element\"\nimport { ElementOrSelector } from \"../../utils/resolve-elements\"\nimport { isDragActive } from \"../drag/state/is-active\"\nimport { EventOptions } from \"../types\"\nimport { isNodeOrChild } from \"../utils/is-node-or-child\"\nimport { isPrimaryPointer } from \"../utils/is-primary-pointer\"\nimport { setupGesture } from \"../utils/setup\"\nimport { OnPressStartEvent } from \"./types\"\nimport { isElementKeyboardAccessible } from \"./utils/is-keyboard-accessible\"\nimport { enableKeyboardPress } from \"./utils/keyboard\"\nimport { isPressing } from \"./utils/state\"\n\n/**\n * Filter out events that are not primary pointer events, or are triggering\n * while a Motion gesture is active.\n */\nfunction isValidPressEvent(event: PointerEvent) {\n return isPrimaryPointer(event) && !isDragActive()\n}\n\nexport interface PointerEventOptions extends EventOptions {\n useGlobalTarget?: boolean\n}\n\n/**\n * Create a press gesture.\n *\n * Press is different to `\"pointerdown\"`, `\"pointerup\"` in that it\n * automatically filters out secondary pointer events like right\n * click and multitouch.\n *\n * It also adds accessibility support for keyboards, where\n * an element with a press gesture will receive focus and\n * trigger on Enter `\"keydown\"` and `\"keyup\"` events.\n *\n * This is different to a browser's `\"click\"` event, which does\n * respond to keyboards but only for the `\"click\"` itself, rather\n * than the press start and end/cancel. The element also needs\n * to be focusable for this to work, whereas a press gesture will\n * make an element focusable by default.\n *\n * @public\n */\nexport function press(\n targetOrSelector: ElementOrSelector,\n onPressStart: OnPressStartEvent,\n options: PointerEventOptions = {}\n): VoidFunction {\n const [targets, eventOptions, cancelEvents] = setupGesture(\n targetOrSelector,\n options\n )\n\n const startPress = (startEvent: PointerEvent) => {\n const target = startEvent.currentTarget as Element\n\n if (!isValidPressEvent(startEvent)) return\n\n isPressing.add(target)\n\n const onPressEnd = onPressStart(target, startEvent)\n\n const onPointerEnd = (endEvent: PointerEvent, success: boolean) => {\n window.removeEventListener(\"pointerup\", onPointerUp)\n window.removeEventListener(\"pointercancel\", onPointerCancel)\n\n if (isPressing.has(target)) {\n isPressing.delete(target)\n }\n\n if (!isValidPressEvent(endEvent)) {\n return\n }\n\n if (typeof onPressEnd === \"function\") {\n onPressEnd(endEvent, { success })\n }\n }\n\n const onPointerUp = (upEvent: PointerEvent) => {\n onPointerEnd(\n upEvent,\n (target as any) === window ||\n (target as any) === document ||\n options.useGlobalTarget ||\n isNodeOrChild(target, upEvent.target as Element)\n )\n }\n\n const onPointerCancel = (cancelEvent: PointerEvent) => {\n onPointerEnd(cancelEvent, false)\n }\n\n window.addEventListener(\"pointerup\", onPointerUp, eventOptions)\n window.addEventListener(\"pointercancel\", onPointerCancel, eventOptions)\n }\n\n targets.forEach((target: EventTarget) => {\n const pointerDownTarget = options.useGlobalTarget ? window : target\n pointerDownTarget.addEventListener(\n \"pointerdown\",\n startPress as EventListener,\n eventOptions\n )\n\n if (isHTMLElement(target)) {\n target.addEventListener(\"focus\", (event) =>\n enableKeyboardPress(event as FocusEvent, eventOptions)\n )\n\n if (\n !isElementKeyboardAccessible(target) &&\n !target.hasAttribute(\"tabindex\")\n ) {\n target.tabIndex = 0\n }\n }\n })\n\n return cancelEvents\n}\n","import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise<any>\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise<any>\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise<any>\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n * animation types, we can check if they contain removed values and animate to that.\n */\n const removedKeys = new Set<string>()\n\n /**\n * A dictionary of all encountered keys. This is an object to let us build into and\n * copy it without iteration. Each time we hit an animation type we set its protected\n * keys - the keys its not allowed to animate - to the latest version of this object.\n */\n let encounteredKeys: { [key: string]: any } = {}\n\n /**\n * If a variant has been removed at a given index, and this component is controlling\n * variant animations, we want to ensure lower-priority variants are forced to animate.\n */\n let removedVariantIndex = Infinity\n\n /**\n * Iterate through all animation types in reverse priority order. For each, we want to\n * detect which values it's handling and whether or not they've changed (and therefore\n * need to be animated). If any values have been removed, we want to detect those in\n * lower priority props and flag for animation.\n */\n for (let i = 0; i < numAnimationTypes; i++) {\n const type = reversePriorityOrder[i]\n const typeState = state[type]\n const prop =\n props[type] !== undefined\n ? props[type]\n : context[type as keyof typeof context]\n const propIsVariant = isVariantLabel(prop)\n\n /**\n * If this type has *just* changed isActive status, set activeDelta\n * to that status. Otherwise set to null.\n */\n const activeDelta =\n type === changedActiveType ? typeState.isActive : null\n\n if (activeDelta === false) removedVariantIndex = i\n\n /**\n * If this prop is an inherited variant, rather than been set directly on the\n * component itself, we want to make sure we allow the parent to trigger animations.\n *\n * TODO: Can probably change this to a !isControllingVariants check\n */\n let isInherited =\n prop === context[type as keyof typeof context] &&\n prop !== props[type] &&\n propIsVariant\n\n if (\n isInherited &&\n isInitialRender &&\n visualElement.manuallyAnimateOnMount\n ) {\n isInherited = false\n }\n\n /**\n * Set all encountered keys so far as the protected keys for this type. This will\n * be any key that has been animated or otherwise handled by active, higher-priortiy types.\n */\n typeState.protectedKeys = { ...encounteredKeys }\n\n // Check if we can skip analysing this prop early\n if (\n // If it isn't active and hasn't *just* been set as inactive\n (!typeState.isActive && activeDelta === null) ||\n // If we didn't and don't have any defined prop for this animation type\n (!prop && !typeState.prevProp) ||\n // Or if the prop doesn't define an animation\n isAnimationControls(prop) ||\n typeof prop === \"boolean\"\n ) {\n continue\n }\n\n /**\n * As we go look through the values defined on this type, if we detect\n * a changed value or a value that was removed in a higher priority, we set\n * this to true and add this prop to the animation list.\n */\n const variantDidChange = checkVariantsDidChange(\n typeState.prevProp,\n prop\n )\n\n let shouldAnimateType =\n variantDidChange ||\n // If we're making this variant active, we want to always make it active\n (type === changedActiveType &&\n typeState.isActive &&\n !isInherited &&\n propIsVariant) ||\n // If we removed a higher-priority variant (i is in reverse order)\n (i > removedVariantIndex && propIsVariant)\n\n let handledRemovedValues = false\n\n /**\n * As animations can be set as variant lists, variants or target objects, we\n * coerce everything to an array if it isn't one already\n */\n const definitionList = Array.isArray(prop) ? prop : [prop]\n\n /**\n * Build an object of all the resolved values. We'll use this in the subsequent\n * animateChanges calls to determine whether a value has changed.\n */\n let resolvedValues = definitionList.reduce(\n buildResolvedTypeValues(type),\n {}\n )\n\n if (activeDelta === false) resolvedValues = {}\n\n /**\n * Now we need to loop through all the keys in the prev prop and this prop,\n * and decide:\n * 1. If the value has changed, and needs animating\n * 2. If it has been removed, and needs adding to the removedKeys set\n * 3. If it has been removed in a higher priority type and needs animating\n * 4. If it hasn't been removed in a higher priority but hasn't changed, and\n * needs adding to the type's protectedKeys list.\n */\n const { prevResolvedValues = {} } = typeState\n\n const allKeys = {\n ...prevResolvedValues,\n ...resolvedValues,\n }\n const markToAnimate = (key: string) => {\n shouldAnimateType = true\n if (removedKeys.has(key)) {\n handledRemovedValues = true\n removedKeys.delete(key)\n }\n typeState.needsAnimating[key] = true\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = false\n }\n\n for (const key in allKeys) {\n const next = resolvedValues[key]\n const prev = prevResolvedValues[key]\n\n // If we've already handled this we can just skip ahead\n if (encounteredKeys.hasOwnProperty(key)) continue\n\n /**\n * If the value has changed, we probably want to animate it.\n */\n let valueHasChanged = false\n if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {\n valueHasChanged = !shallowCompare(next, prev)\n } else {\n valueHasChanged = next !== prev\n }\n\n if (valueHasChanged) {\n if (next !== undefined && next !== null) {\n // If next is defined and doesn't equal prev, it needs animating\n markToAnimate(key)\n } else {\n // If it's undefined, it's been removed.\n removedKeys.add(key)\n }\n } else if (next !== undefined && removedKeys.has(key)) {\n /**\n * If next hasn't changed and it isn't undefined, we want to check if it's\n * been removed by a higher priority\n */\n markToAnimate(key)\n } else {\n /**\n * If it hasn't changed, we add it to the list of protected values\n * to ensure it doesn't get animated.\n */\n typeState.protectedKeys[key] = true\n }\n }\n\n /**\n * Update the typeState so next time animateChanges is called we can compare the\n * latest prop and resolvedValues to these.\n */\n typeState.prevProp = prop\n typeState.prevResolvedValues = resolvedValues\n\n if (typeState.isActive) {\n encounteredKeys = { ...encounteredKeys, ...resolvedValues }\n }\n\n if (isInitialRender && visualElement.blockInitialAnimation) {\n shouldAnimateType = false\n }\n\n /**\n * If this is an inherited prop we want to skip this animation\n * unless the inherited variants haven't changed on this render.\n */\n const willAnimateViaParent = isInherited && variantDidChange\n const needsAnimating = !willAnimateViaParent || handledRemovedValues\n if (shouldAnimateType && needsAnimating) {\n animations.push(\n ...definitionList.map((animation) => {\n const options: VisualElementAnimationOptions = { type }\n\n /**\n * If we're performing the initial animation, but we're not\n * rendering at the same time as the variant-controlling parent,\n * we want to use the parent's transition to calculate the stagger.\n */\n if (\n typeof animation === \"string\" &&\n isInitialRender &&\n !willAnimateViaParent &&\n visualElement.manuallyAnimateOnMount &&\n visualElement.parent\n ) {\n const { parent } = visualElement\n const parentVariant = resolveVariant(\n parent,\n animation\n )\n\n if (parent.enteringChildren && parentVariant) {\n const { delayChildren } =\n parentVariant.transition || {}\n options.delay = calcChildStagger(\n parent.enteringChildren,\n visualElement,\n delayChildren\n )\n }\n }\n\n return {\n animation: animation as AnimationDefinition,\n options,\n }\n })\n )\n }\n }\n\n /**\n * If there are some removed value that haven't been dealt with,\n * we need to create a new animation that falls back either to the value\n * defined in the style prop, or the last read value.\n */\n if (removedKeys.size) {\n const fallbackAnimation: TargetAndTransition = {}\n\n /**\n * If the initial prop contains a transition we can use that, otherwise\n * allow the animation function to use the visual element's default.\n */\n if (typeof props.initial !== \"boolean\") {\n const initialTransition = resolveVariant(\n visualElement,\n Array.isArray(props.initial)\n ? props.initial[0]\n : props.initial\n )\n\n if (initialTransition && initialTransition.transition) {\n fallbackAnimation.transition = initialTransition.transition\n }\n }\n\n removedKeys.forEach((key) => {\n const fallbackTarget = visualElement.getBaseTarget(key)\n\n const motionValue = visualElement.getValue(key)\n if (motionValue) motionValue.liveStyle = true\n\n // @ts-expect-error - @mattgperry to figure if we should do something here\n fallbackAnimation[key] = fallbackTarget ?? null\n })\n\n animations.push({ animation: fallbackAnimation })\n }\n\n let shouldAnimate = Boolean(animations.length)\n\n if (\n isInitialRender &&\n (props.initial === false || props.initial === props.animate) &&\n !visualElement.manuallyAnimateOnMount\n ) {\n shouldAnimate = false\n }\n\n isInitialRender = false\n return shouldAnimate ? animate(animations) : Promise.resolve()\n }\n\n /**\n * Change whether a certain animation type is active.\n */\n function setActive(type: AnimationType, isActive: boolean) {\n // If the active state hasn't changed, we can safely do nothing here\n if (state[type].isActive === isActive) return Promise.resolve()\n\n // Propagate active change to children\n visualElement.variantChildren?.forEach((child: any) =>\n child.animationState?.setActive(type, isActive)\n )\n\n state[type].isActive = isActive\n\n const animations = animateChanges(type)\n\n for (const key in state) {\n state[key as keyof typeof state].protectedKeys = {}\n }\n\n return animations\n }\n\n return {\n animateChanges,\n setActive,\n setAnimateFunction,\n getState: () => state,\n reset: () => {\n state = createState()\n /**\n * Temporarily disabling resetting this flag as it prevents components\n * with initial={false} from animating after being remounted, for instance\n * as the child of an Activity component.\n */\n // isInitialRender = true\n },\n }\n}\n\nexport function checkVariantsDidChange(prev: any, next: any) {\n if (typeof next === \"string\") {\n return next !== prev\n } else if (Array.isArray(next)) {\n return !shallowCompare(next, prev)\n }\n\n return false\n}\n\nexport interface AnimationTypeState {\n isActive: boolean\n protectedKeys: { [key: string]: true }\n needsAnimating: { [key: string]: boolean }\n prevResolvedValues: { [key: string]: any }\n prevProp?: VariantLabels | TargetAndTransition\n}\n\nfunction createTypeState(isActive = false): AnimationTypeState {\n return {\n isActive,\n protectedKeys: {},\n needsAnimating: {},\n prevResolvedValues: {},\n }\n}\n\nfunction createState() {\n return {\n animate: createTypeState(true),\n whileInView: createTypeState(),\n whileHover: createTypeState(),\n whileTap: createTypeState(),\n whileDrag: createTypeState(),\n whileFocus: createTypeState(),\n exit: createTypeState(),\n }\n}\n","import { Feature, type VisualElement } from \"motion-dom\"\nimport { noop } from \"motion-utils\"\nimport { VisualElementDragControls } from \"./VisualElementDragControls\"\n\nexport class DragGesture extends Feature<HTMLElement> {\n controls: VisualElementDragControls\n\n removeGroupControls: Function = noop\n removeListeners: Function = noop\n\n constructor(node: VisualElement<HTMLElement>) {\n super(node)\n this.controls = new VisualElementDragControls(node)\n }\n\n mount() {\n // If we've been provided a DragControls for manual control over the drag gesture,\n // subscribe this component to it on mount.\n const { dragControls } = this.node.getProps()\n\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n\n this.removeListeners = this.controls.addListeners() || noop\n }\n\n update() {\n const { dragControls } = this.node.getProps()\n const { dragControls: prevDragControls } = this.node.prevProps || {}\n\n if (dragControls !== prevDragControls) {\n this.removeGroupControls()\n if (dragControls) {\n this.removeGroupControls = dragControls.subscribe(this.controls)\n }\n }\n }\n\n unmount() {\n this.removeGroupControls()\n this.removeListeners()\n /**\n * In React 19, during list reorder reconciliation, components may\n * briefly unmount and remount while the drag is still active. If we're\n * actively dragging, we should NOT end the pan session - it will\n * continue tracking pointer events via its window-level listeners.\n *\n * The pan session will be properly cleaned up when:\n * 1. The drag ends naturally (pointerup/pointercancel)\n * 2. The component is truly removed from the DOM\n */\n if (!this.controls.isDragging) {\n this.controls.endPanSession()\n }\n }\n}\n","import { HSLA, RGBA } from \"../types\"\n\n// Adapted from https://gist.github.com/mjackson/5311256\nfunction hueToRgb(p: number, q: number, t: number) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}\n\nexport function hslaToRgba({ hue, saturation, lightness, alpha }: HSLA): RGBA {\n hue /= 360\n saturation /= 100\n lightness /= 100\n\n let red = 0\n let green = 0\n let blue = 0\n\n if (!saturation) {\n red = green = blue = lightness\n } else {\n const q =\n lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation\n const p = 2 * lightness - q\n\n red = hueToRgb(p, q, hue + 1 / 3)\n green = hueToRgb(p, q, hue)\n blue = hueToRgb(p, q, hue - 1 / 3)\n }\n\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n }\n}\n","import { frame } from \"../../frameloop\"\nimport { getValueTransition } from \"../utils/get-value-transition\"\nimport { positionalKeys } from \"../../render/utils/keys-position\"\nimport { setTarget } from \"../../render/utils/setters\"\nimport { addValueToWillChange } from \"../../value/will-change/add-will-change\"\nimport { getOptimisedAppearId } from \"../optimized-appear/get-appear-id\"\nimport { animateMotionValue } from \"./motion-value\"\nimport type { VisualElementAnimationOptions } from \"./types\"\nimport type { AnimationPlaybackControlsWithThen } from \"../types\"\nimport type { TargetAndTransition } from \"../../node/types\"\nimport type { AnimationTypeState } from \"../../render/utils/animation-state\"\nimport type { VisualElement } from \"../../render/VisualElement\"\n\n/**\n * Decide whether we should block this animation. Previously, we achieved this\n * just by checking whether the key was listed in protectedKeys, but this\n * posed problems if an animation was triggered by afterChildren and protectedKeys\n * had been set to true in the meantime.\n */\nfunction shouldBlockAnimation(\n { protectedKeys, needsAnimating }: AnimationTypeState,\n key: string\n) {\n const shouldBlock =\n protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true\n\n needsAnimating[key] = false\n return shouldBlock\n}\n\nexport function animateTarget(\n visualElement: VisualElement,\n targetAndTransition: TargetAndTransition,\n { delay = 0, transitionOverride, type }: VisualElementAnimationOptions = {}\n): AnimationPlaybackControlsWithThen[] {\n let {\n transition = visualElement.getDefaultTransition(),\n transitionEnd,\n ...target\n } = targetAndTransition\n\n if (transitionOverride) transition = transitionOverride\n\n const animations: AnimationPlaybackControlsWithThen[] = []\n\n const animationTypeState =\n type &&\n visualElement.animationState &&\n visualElement.animationState.getState()[type]\n\n for (const key in target) {\n const value = visualElement.getValue(\n key,\n visualElement.latestValues[key] ?? null\n )\n const valueTarget = target[key as keyof typeof target]\n\n if (\n valueTarget === undefined ||\n (animationTypeState &&\n shouldBlockAnimation(animationTypeState, key))\n ) {\n continue\n }\n\n const valueTransition = {\n delay,\n ...getValueTransition(transition || {}, key),\n }\n\n /**\n * If the value is already at the defined target, skip the animation.\n */\n const currentValue = value.get()\n if (\n currentValue !== undefined &&\n !value.isAnimating &&\n !Array.isArray(valueTarget) &&\n valueTarget === currentValue &&\n !valueTransition.velocity\n ) {\n continue\n }\n\n /**\n * If this is the first time a value is being animated, check\n * to see if we're handling off from an existing animation.\n */\n let isHandoff = false\n if (window.MotionHandoffAnimation) {\n const appearId = getOptimisedAppearId(visualElement)\n\n if (appearId) {\n const startTime = window.MotionHandoffAnimation(\n appearId,\n key,\n frame\n )\n\n if (startTime !== null) {\n valueTransition.startTime = startTime\n isHandoff = true\n }\n }\n }\n\n addValueToWillChange(visualElement, key)\n\n value.start(\n animateMotionValue(\n key,\n value,\n valueTarget,\n visualElement.shouldReduceMotion && positionalKeys.has(key)\n ? { type: false }\n : valueTransition,\n visualElement,\n isHandoff\n )\n )\n\n const animation = value.animation\n\n if (animation) {\n animations.push(animation)\n }\n }\n\n if (transitionEnd) {\n Promise.all(animations).then(() => {\n frame.update(() => {\n transitionEnd && setTarget(visualElement, transitionEnd)\n })\n })\n }\n\n return animations\n}\n","import type {\n AnimationDefinition,\n MotionNodeOptions,\n TargetAndTransition,\n TargetResolver,\n} from \"../../node/types\"\nimport type { ResolvedValues } from \"../types\"\n\nfunction getValueState(visualElement?: any): [ResolvedValues, ResolvedValues] {\n const state: [ResolvedValues, ResolvedValues] = [{}, {}]\n\n visualElement?.values.forEach((value: any, key: string) => {\n state[0][key] = value.get()\n state[1][key] = value.getVelocity()\n })\n\n return state\n}\n\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition: TargetAndTransition | TargetResolver,\n custom?: any,\n visualElement?: any\n): TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n): undefined | TargetAndTransition\nexport function resolveVariantFromProps(\n props: MotionNodeOptions,\n definition?: AnimationDefinition,\n custom?: any,\n visualElement?: any\n) {\n /**\n * If the variant definition is a function, resolve.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n /**\n * If the variant definition is a variant label, or\n * the function returned a variant label, resolve.\n */\n if (typeof definition === \"string\") {\n definition = props.variants && props.variants[definition]\n }\n\n /**\n * At this point we've resolved both functions and variant labels,\n * but the resolved variant label might itself have been a function.\n * If so, resolve. This can only have returned a valid target object.\n */\n if (typeof definition === \"function\") {\n const [current, velocity] = getValueState(visualElement)\n definition = definition(\n custom !== undefined ? custom : props.custom,\n current,\n velocity\n )\n }\n\n return definition\n}\n","import { createProjectionNode } from \"./create-projection-node\"\nimport { DocumentProjectionNode } from \"./DocumentProjectionNode\"\nimport { IProjectionNode } from \"./types\"\n\nexport const rootProjectionNode: { current: IProjectionNode | undefined } = {\n current: undefined,\n}\n\nexport const HTMLProjectionNode = createProjectionNode<HTMLElement>({\n measureScroll: (instance) => ({\n x: instance.scrollLeft,\n y: instance.scrollTop,\n }),\n defaultParent: () => {\n if (!rootProjectionNode.current) {\n const documentNode = new DocumentProjectionNode({})\n documentNode.mount(window)\n documentNode.setOptions({ layoutScroll: true })\n rootProjectionNode.current = documentNode\n }\n return rootProjectionNode.current\n },\n resetTransform: (instance, value) => {\n instance.style.transform = value !== undefined ? value : \"none\"\n },\n checkIsScrollRoot: (instance) =>\n Boolean(window.getComputedStyle(instance).position === \"fixed\"),\n})\n","export function addUniqueItem<T>(arr: T[], item: T) {\n if (arr.indexOf(item) === -1) arr.push(item)\n}\n\nexport function removeItem<T>(arr: T[], item: T) {\n const index = arr.indexOf(item)\n if (index > -1) arr.splice(index, 1)\n}\n\n// Adapted from array-move\nexport function moveItem<T>([...arr]: T[], fromIndex: number, toIndex: number) {\n const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex\n\n if (startIndex >= 0 && startIndex < arr.length) {\n const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex\n\n const [item] = arr.splice(fromIndex, 1)\n arr.splice(endIndex, 0, item)\n }\n\n return arr\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { stepsOrder } from \"./order\"\nimport { createRenderStep } from \"./render-step\"\nimport { Batcher, FrameData, Process, Steps } from \"./types\"\n\nconst maxElapsed = 40\n\nexport function createRenderBatcher(\n scheduleNextBatch: (callback: Function) => void,\n allowKeepAlive: boolean\n) {\n let runNextFrame = false\n let useDefaultElapsed = true\n\n const state: FrameData = {\n delta: 0.0,\n timestamp: 0.0,\n isProcessing: false,\n }\n\n const flagRunNextFrame = () => (runNextFrame = true)\n\n const steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(\n flagRunNextFrame,\n allowKeepAlive ? key : undefined\n )\n return acc\n }, {} as Steps)\n\n const {\n setup,\n read,\n resolveKeyframes,\n preUpdate,\n update,\n preRender,\n render,\n postRender,\n } = steps\n\n const processBatch = () => {\n const timestamp = MotionGlobalConfig.useManualTiming\n ? state.timestamp\n : performance.now()\n runNextFrame = false\n\n if (!MotionGlobalConfig.useManualTiming) {\n state.delta = useDefaultElapsed\n ? 1000 / 60\n : Math.max(Math.min(timestamp - state.timestamp, maxElapsed), 1)\n }\n\n state.timestamp = timestamp\n state.isProcessing = true\n\n // Unrolled render loop for better per-frame performance\n setup.process(state)\n read.process(state)\n resolveKeyframes.process(state)\n preUpdate.process(state)\n update.process(state)\n preRender.process(state)\n render.process(state)\n postRender.process(state)\n\n state.isProcessing = false\n\n if (runNextFrame && allowKeepAlive) {\n useDefaultElapsed = false\n scheduleNextBatch(processBatch)\n }\n }\n\n const wake = () => {\n runNextFrame = true\n useDefaultElapsed = true\n\n if (!state.isProcessing) {\n scheduleNextBatch(processBatch)\n }\n }\n\n const schedule = stepsOrder.reduce((acc, key) => {\n const step = steps[key]\n acc[key] = (process: Process, keepAlive = false, immediate = false) => {\n if (!runNextFrame) wake()\n\n return step.schedule(process, keepAlive, immediate)\n }\n return acc\n }, {} as Batcher)\n\n const cancel = (process: Process) => {\n for (let i = 0; i < stepsOrder.length; i++) {\n steps[stepsOrder[i]].cancel(process)\n }\n }\n\n return { schedule, cancel, state, steps }\n}\n","import {\n createAnimationState,\n Feature,\n isAnimationControls,\n type VisualElement,\n} from \"motion-dom\"\n\nexport class AnimationFeature extends Feature<unknown> {\n unmountControls?: () => void\n\n /**\n * We dynamically generate the AnimationState manager as it contains a reference\n * to the underlying animation library. We only want to load that if we load this,\n * so people can optionally code split it out using the `m` component.\n */\n constructor(node: VisualElement) {\n super(node)\n node.animationState ||= createAnimationState(node)\n }\n\n updateAnimationControlsSubscription() {\n const { animate } = this.node.getProps()\n if (isAnimationControls(animate)) {\n this.unmountControls = animate.subscribe(this.node)\n }\n }\n\n /**\n * Subscribe any provided AnimationControls to the component's VisualElement\n */\n mount() {\n this.updateAnimationControlsSubscription()\n }\n\n update() {\n const { animate } = this.node.getProps()\n const { animate: prevAnimate } = this.node.prevProps || {}\n if (animate !== prevAnimate) {\n this.updateAnimationControlsSubscription()\n }\n }\n\n unmount() {\n this.node.animationState!.reset()\n this.unmountControls?.()\n }\n}\n","import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record<string, any>\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform\n delete attrs.transform\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n","type IntersectionHandler = (entry: IntersectionObserverEntry) => void\n\ninterface ElementIntersectionObservers {\n [key: string]: IntersectionObserver\n}\n\n/**\n * Map an IntersectionHandler callback to an element. We only ever make one handler for one\n * element, so even though these handlers might all be triggered by different\n * observers, we can keep them in the same map.\n */\nconst observerCallbacks = new WeakMap<Element, IntersectionHandler>()\n\n/**\n * Multiple observers can be created for multiple element/document roots. Each with\n * different settings. So here we store dictionaries of observers to each root,\n * using serialised settings (threshold/margin) as lookup keys.\n */\nconst observers = new WeakMap<\n Element | Document,\n ElementIntersectionObservers\n>()\n\nconst fireObserverCallback = (entry: IntersectionObserverEntry) => {\n const callback = observerCallbacks.get(entry.target)\n callback && callback(entry)\n}\n\nconst fireAllObserverCallbacks: IntersectionObserverCallback = (entries) => {\n entries.forEach(fireObserverCallback)\n}\n\nfunction initIntersectionObserver({\n root,\n ...options\n}: IntersectionObserverInit): IntersectionObserver {\n const lookupRoot = root || document\n\n /**\n * If we don't have an observer lookup map for this root, create one.\n */\n if (!observers.has(lookupRoot)) {\n observers.set(lookupRoot, {})\n }\n const rootObservers = observers.get(lookupRoot)!\n\n const key = JSON.stringify(options)\n\n /**\n * If we don't have an observer for this combination of root and settings,\n * create one.\n */\n if (!rootObservers[key]) {\n rootObservers[key] = new IntersectionObserver(\n fireAllObserverCallbacks,\n { root, ...options }\n )\n }\n\n return rootObservers[key]\n}\n\nexport function observeIntersection(\n element: Element,\n options: IntersectionObserverInit,\n callback: IntersectionHandler\n) {\n const rootInteresectionObserver = initIntersectionObserver(options)\n\n observerCallbacks.set(element, callback)\n rootInteresectionObserver.observe(element)\n\n return () => {\n observerCallbacks.delete(element)\n rootInteresectionObserver.unobserve(element)\n }\n}\n","import { MotionGlobalConfig } from \"motion-utils\"\nimport { frameData } from \"./frame\"\n\nlet now: number | undefined\n\nfunction clearTime() {\n now = undefined\n}\n\n/**\n * An eventloop-synchronous alternative to performance.now().\n *\n * Ensures that time measurements remain consistent within a synchronous context.\n * Usually calling performance.now() twice within the same synchronous context\n * will return different values which isn't useful for animations when we're usually\n * trying to sync animations to the same frame.\n */\nexport const time = {\n now: (): number => {\n if (now === undefined) {\n time.set(\n frameData.isProcessing || MotionGlobalConfig.useManualTiming\n ? frameData.timestamp\n : performance.now()\n )\n }\n\n return now!\n },\n set: (newTime: number) => {\n now = newTime\n queueMicrotask(clearTime)\n },\n}\n","import { addUniqueItem, removeItem } from \"motion-utils\"\nimport { IProjectionNode } from \"../node/types\"\n\nexport class NodeStack {\n lead?: IProjectionNode\n prevLead?: IProjectionNode\n members: IProjectionNode[] = []\n\n add(node: IProjectionNode) {\n addUniqueItem(this.members, node)\n node.scheduleRender()\n }\n\n remove(node: IProjectionNode) {\n removeItem(this.members, node)\n if (node === this.prevLead) {\n this.prevLead = undefined\n }\n if (node === this.lead) {\n const prevLead = this.members[this.members.length - 1]\n if (prevLead) {\n this.promote(prevLead)\n }\n }\n }\n\n relegate(node: IProjectionNode): boolean {\n const indexOfNode = this.members.findIndex((member) => node === member)\n if (indexOfNode === 0) return false\n\n /**\n * Find the next projection node that is present\n */\n let prevLead: IProjectionNode | undefined\n for (let i = indexOfNode; i >= 0; i--) {\n const member = this.members[i]\n if (member.isPresent !== false) {\n prevLead = member\n break\n }\n }\n\n if (prevLead) {\n this.promote(prevLead)\n return true\n } else {\n return false\n }\n }\n\n promote(node: IProjectionNode, preserveFollowOpacity?: boolean) {\n const prevLead = this.lead\n\n if (node === prevLead) return\n\n this.prevLead = prevLead\n this.lead = node\n\n node.show()\n\n if (prevLead) {\n prevLead.instance && prevLead.scheduleRender()\n node.scheduleRender()\n\n /**\n * If both the new and previous lead have the same defined layoutDependency,\n * skip the shared layout animation. This allows components with layoutId\n * to opt-out of animations when their layoutDependency hasn't changed,\n * even when the component unmounts and remounts in a different location.\n */\n const prevDep = prevLead.options.layoutDependency\n const nextDep = node.options.layoutDependency\n const dependencyMatches =\n prevDep !== undefined &&\n nextDep !== undefined &&\n prevDep === nextDep\n\n if (!dependencyMatches) {\n node.resumeFrom = prevLead\n\n if (preserveFollowOpacity) {\n node.resumeFrom.preserveOpacity = true\n }\n\n if (prevLead.snapshot) {\n node.snapshot = prevLead.snapshot\n node.snapshot.latestValues =\n prevLead.animationValues || prevLead.latestValues\n }\n\n if (node.root && node.root.isUpdating) {\n node.isLayoutDirty = true\n }\n }\n\n const { crossfade } = node.options\n if (crossfade === false) {\n prevLead.hide()\n }\n }\n }\n\n exitAnimationComplete() {\n this.members.forEach((node) => {\n const { options, resumingFrom } = node\n\n options.onExitComplete && options.onExitComplete()\n\n if (resumingFrom) {\n resumingFrom.options.onExitComplete &&\n resumingFrom.options.onExitComplete()\n }\n })\n }\n\n scheduleRender() {\n this.members.forEach((node) => {\n node.instance && node.scheduleRender(false)\n })\n }\n\n /**\n * Clear any leads that have been removed this render to prevent them from being\n * used in future animations and to prevent memory leaks\n */\n removeLeadSnapshot() {\n if (this.lead && this.lead.snapshot) {\n this.lead.snapshot = undefined\n }\n }\n}\n","import { Feature } from \"motion-dom\"\nimport { MotionProps } from \"../../types\"\nimport { observeIntersection } from \"./observers\"\n\nconst thresholdNames = {\n some: 0,\n all: 1,\n}\n\nexport class InViewFeature extends Feature<Element> {\n private hasEnteredView = false\n\n private isInView = false\n\n private startObserver() {\n this.unmount()\n\n const { viewport = {} } = this.node.getProps()\n const { root, margin: rootMargin, amount = \"some\", once } = viewport\n\n const options = {\n root: root ? root.current : undefined,\n rootMargin,\n threshold:\n typeof amount === \"number\" ? amount : thresholdNames[amount],\n }\n\n const onIntersectionUpdate = (entry: IntersectionObserverEntry) => {\n const { isIntersecting } = entry\n\n /**\n * If there's been no change in the viewport state, early return.\n */\n if (this.isInView === isIntersecting) return\n\n this.isInView = isIntersecting\n\n /**\n * Handle hasEnteredView. If this is only meant to run once, and\n * element isn't visible, early return. Otherwise set hasEnteredView to true.\n */\n if (once && !isIntersecting && this.hasEnteredView) {\n return\n } else if (isIntersecting) {\n this.hasEnteredView = true\n }\n\n if (this.node.animationState) {\n this.node.animationState.setActive(\n \"whileInView\",\n isIntersecting\n )\n }\n\n /**\n * Use the latest committed props rather than the ones in scope\n * when this observer is created\n */\n const { onViewportEnter, onViewportLeave } = this.node.getProps()\n const callback = isIntersecting ? onViewportEnter : onViewportLeave\n callback && callback(entry)\n }\n\n return observeIntersection(\n this.node.current!,\n options,\n onIntersectionUpdate\n )\n }\n\n mount() {\n this.startObserver()\n }\n\n update() {\n if (typeof IntersectionObserver === \"undefined\") return\n\n const { props, prevProps } = this.node\n const hasOptionsChanged = [\"amount\", \"margin\", \"root\"].some(\n hasViewportOptionChanged(props, prevProps)\n )\n\n if (hasOptionsChanged) {\n this.startObserver()\n }\n }\n\n unmount() {}\n}\n\nfunction hasViewportOptionChanged(\n { viewport = {} }: MotionProps,\n { viewport: prevViewport = {} }: MotionProps = {}\n) {\n return (name: keyof typeof viewport) =>\n viewport[name] !== prevViewport[name]\n}\n","import { Color, HSLA, RGBA } from \"../types\"\nimport { floatRegex } from \"../utils/float-regex\"\nimport { isNullish } from \"../utils/is-nullish\"\nimport { singleColorRegex } from \"../utils/single-color-regex\"\n\n/**\n * Returns true if the provided string is a color, ie rgba(0,0,0,0) or #000,\n * but false if a number or multiple colors\n */\nexport const isColorString = (type: string, testProp?: string) => (v: any) => {\n return Boolean(\n (typeof v === \"string\" &&\n singleColorRegex.test(v) &&\n v.startsWith(type)) ||\n (testProp &&\n !isNullish(v) &&\n Object.prototype.hasOwnProperty.call(v, testProp))\n )\n}\n\nexport const splitColor =\n <V extends RGBA | HSLA>(aName: string, bName: string, cName: string) =>\n (v: string | Color): V => {\n if (typeof v !== \"string\") return v as any\n\n const [a, b, c, alpha] = v.match(floatRegex) as any\n\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n } as V\n }\n","import { getValueAsType } from \"../../../value/types/utils/get-as-type\"\nimport { numberValueTypes } from \"../../../value/types/maps/number\"\nimport { transformPropOrder } from \"../../utils/keys-transform\"\nimport { ResolvedValues } from \"../../types\"\nimport { HTMLRenderState } from \"../types\"\nimport type { MotionNodeOptions } from \"../../../node/types\"\n\nconst translateAlias = {\n x: \"translateX\",\n y: \"translateY\",\n z: \"translateZ\",\n transformPerspective: \"perspective\",\n}\n\nconst numTransforms = transformPropOrder.length\n\n/**\n * Build a CSS transform style from individual x/y/scale etc properties.\n *\n * This outputs with a default order of transforms/scales/rotations, this can be customised by\n * providing a transformTemplate function.\n */\nexport function buildTransform(\n latestValues: ResolvedValues,\n transform: HTMLRenderState[\"transform\"],\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"]\n) {\n // The transform string we're going to build into.\n let transformString = \"\"\n let transformIsDefault = true\n\n /**\n * Loop over all possible transforms in order, adding the ones that\n * are present to the transform string.\n */\n for (let i = 0; i < numTransforms; i++) {\n const key = transformPropOrder[i] as keyof typeof translateAlias\n const value = latestValues[key]\n\n if (value === undefined) continue\n\n let valueIsDefault = true\n if (typeof value === \"number\") {\n valueIsDefault = value === (key.startsWith(\"scale\") ? 1 : 0)\n } else {\n const parsed = parseFloat(value)\n valueIsDefault = key.startsWith(\"scale\") ? parsed === 1 : parsed === 0\n }\n\n if (!valueIsDefault || transformTemplate) {\n const valueAsType = getValueAsType(value, numberValueTypes[key])\n\n if (!valueIsDefault) {\n transformIsDefault = false\n const transformName = translateAlias[key] || key\n transformString += `${transformName}(${valueAsType}) `\n }\n\n if (transformTemplate) {\n transform[key] = valueAsType\n }\n }\n }\n\n transformString = transformString.trim()\n\n // If we have a custom `transform` template, pass our transform values and\n // generated transformString to that before returning\n if (transformTemplate) {\n transformString = transformTemplate(\n transform,\n transformIsDefault ? \"\" : transformString\n )\n } else if (transformIsDefault) {\n transformString = \"none\"\n }\n\n return transformString\n}\n","import { isMotionValue } from \"../../value/utils/is-motion-value\"\nimport type { MotionValue } from \"../../value\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { DOMKeyframesResolver } from \"../../animation/keyframes/DOMKeyframesResolver\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport type { DOMVisualElementOptions } from \"./types\"\nimport type { HTMLRenderState } from \"../html/types\"\nimport { VisualElement, MotionStyle } from \"../VisualElement\"\n\nexport abstract class DOMVisualElement<\n Instance extends HTMLElement | SVGElement = HTMLElement,\n State extends HTMLRenderState = HTMLRenderState,\n Options extends DOMVisualElementOptions = DOMVisualElementOptions\n> extends VisualElement<Instance, State, Options> {\n sortInstanceNodePosition(a: Instance, b: Instance): number {\n /**\n * compareDocumentPosition returns a bitmask, by using the bitwise &\n * we're returning true if 2 in that bitmask is set to true. 2 is set\n * to true if b preceeds a.\n */\n return a.compareDocumentPosition(b) & 2 ? 1 : -1\n }\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue<any> | undefined {\n const style = (props as MotionNodeOptions & { style?: MotionStyle }).style\n return style ? (style[key] as string) : undefined\n }\n\n removeValueFromRenderState(\n key: string,\n { vars, style }: HTMLRenderState\n ): void {\n delete vars[key]\n delete style[key]\n }\n\n KeyframeResolver = DOMKeyframesResolver\n\n childSubscription?: VoidFunction\n handleChildMotionValue() {\n if (this.childSubscription) {\n this.childSubscription()\n delete this.childSubscription\n }\n\n const { children } = this.props as MotionNodeOptions & { children?: MotionValue | any }\n if (isMotionValue(children)) {\n this.childSubscription = children.on(\"change\", (latest) => {\n if (this.current) {\n this.current.textContent = `${latest}`\n }\n })\n }\n }\n}\n","import { Axis, Box } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { percent } from \"../../value/types/numbers/units\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { scalePoint } from \"./delta-apply\"\n\n/**\n * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse\n */\nexport function removePointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n point -= translate\n point = scalePoint(point, 1 / scale, originPoint)\n\n if (boxScale !== undefined) {\n point = scalePoint(point, 1 / boxScale, originPoint)\n }\n\n return point\n}\n\n/**\n * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse\n */\nexport function removeAxisDelta(\n axis: Axis,\n translate: number | string = 0,\n scale: number = 1,\n origin: number = 0.5,\n boxScale?: number,\n originAxis: Axis = axis,\n sourceAxis: Axis = axis\n): void {\n if (percent.test(translate)) {\n translate = parseFloat(translate as string)\n const relativeProgress = mixNumber(\n sourceAxis.min,\n sourceAxis.max,\n translate / 100\n )\n translate = relativeProgress - sourceAxis.min\n }\n\n if (typeof translate !== \"number\") return\n\n let originPoint = mixNumber(originAxis.min, originAxis.max, origin)\n if (axis === originAxis) originPoint -= translate\n\n axis.min = removePointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = removePointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeAxisTransforms(\n axis: Axis,\n transforms: ResolvedValues,\n [key, scaleKey, originKey]: string[],\n origin?: Axis,\n sourceAxis?: Axis\n) {\n removeAxisDelta(\n axis,\n transforms[key] as number,\n transforms[scaleKey] as number,\n transforms[originKey] as number,\n transforms.scale as number,\n origin,\n sourceAxis\n )\n}\n\n/**\n * The names of the motion values we want to apply as translation, scale and origin.\n */\nconst xKeys = [\"x\", \"scaleX\", \"originX\"]\nconst yKeys = [\"y\", \"scaleY\", \"originY\"]\n\n/**\n * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse\n * and acts as a bridge between motion values and removeAxisDelta\n */\nexport function removeBoxTransforms(\n box: Box,\n transforms: ResolvedValues,\n originBox?: Box,\n sourceBox?: Box\n): void {\n removeAxisTransforms(\n box.x,\n transforms,\n xKeys,\n originBox ? originBox.x : undefined,\n sourceBox ? sourceBox.x : undefined\n )\n removeAxisTransforms(\n box.y,\n transforms,\n yKeys,\n originBox ? originBox.y : undefined,\n sourceBox ? sourceBox.y : undefined\n )\n}\n","import { ResolvedValues } from \"../../types\"\n\nconst dashKeys = {\n offset: \"stroke-dashoffset\",\n array: \"stroke-dasharray\",\n}\n\nconst camelKeys = {\n offset: \"strokeDashoffset\",\n array: \"strokeDasharray\",\n}\n\n/**\n * Build SVG path properties. Uses the path's measured length to convert\n * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset\n * and stroke-dasharray attributes.\n *\n * This function is mutative to reduce per-frame GC.\n *\n * Note: We use unitless values for stroke-dasharray and stroke-dashoffset\n * because Safari incorrectly scales px values when the page is zoomed.\n */\nexport function buildSVGPath(\n attrs: ResolvedValues,\n length: number,\n spacing = 1,\n offset = 0,\n useDashCase: boolean = true\n): void {\n // Normalise path length by setting SVG attribute pathLength to 1\n attrs.pathLength = 1\n\n // We use dash case when setting attributes directly to the DOM node and camel case\n // when defining props on a React component.\n const keys = useDashCase ? dashKeys : camelKeys\n\n // Build the dash offset (unitless to avoid Safari zoom bug)\n attrs[keys.offset] = `${-offset}`\n\n // Build the dash array (unitless to avoid Safari zoom bug)\n attrs[keys.array] = `${length} ${spacing}`\n}\n","import { alpha, scale } from \"../numbers\"\nimport { degrees, progressPercentage, px } from \"../numbers/units\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const transformValueTypes: ValueTypeMap = {\n rotate: degrees,\n rotateX: degrees,\n rotateY: degrees,\n rotateZ: degrees,\n scale,\n scaleX: scale,\n scaleY: scale,\n scaleZ: scale,\n skew: degrees,\n skewX: degrees,\n skewY: degrees,\n distance: px,\n translateX: px,\n translateY: px,\n translateZ: px,\n x: px,\n y: px,\n z: px,\n perspective: px,\n transformPerspective: px,\n opacity: alpha,\n originX: progressPercentage,\n originY: progressPercentage,\n originZ: px,\n}\n","import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n","import { invariant, isNumericalString } from \"motion-utils\"\nimport { AnyResolvedKeyframe } from \"../types\"\nimport { CSSVariableToken, isCSSVariableToken } from \"./is-css-variable\"\n\n/**\n * Parse Framer's special CSS variable format into a CSS token and a fallback.\n *\n * ```\n * `var(--foo, #fff)` => [`--foo`, '#fff']\n * ```\n *\n * @param current\n */\n\nconst splitCSSVariableRegex =\n // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words\n /^var\\(--(?:([\\w-]+)|([\\w-]+), ?([a-zA-Z\\d ()%#.,-]+))\\)/u\nexport function parseCSSVariable(current: string) {\n const match = splitCSSVariableRegex.exec(current)\n if (!match) return [,]\n\n const [, token1, token2, fallback] = match\n return [`--${token1 ?? token2}`, fallback]\n}\n\nconst maxDepth = 4\nexport function getVariableValue(\n current: CSSVariableToken,\n element: Element,\n depth = 1\n): AnyResolvedKeyframe | undefined {\n invariant(\n depth <= maxDepth,\n `Max CSS variable fallback depth detected in property \"${current}\". This may indicate a circular fallback dependency.`,\n \"max-css-var-depth\"\n )\n\n const [token, fallback] = parseCSSVariable(current)\n\n // No CSS variable detected\n if (!token) return\n\n // Attempt to read this CSS variable off the element\n const resolved = window.getComputedStyle(element).getPropertyValue(token)\n\n if (resolved) {\n const trimmed = resolved.trim()\n return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed\n }\n\n return isCSSVariableToken(fallback)\n ? getVariableValue(fallback, element, depth + 1)\n : fallback\n}\n","/*\n Bezier function generator\n This has been modified from Gaëtan Renaudeau's BezierEasing\n https://github.com/gre/bezier-easing/blob/master/src/index.js\n https://github.com/gre/bezier-easing/blob/master/LICENSE\n \n I've removed the newtonRaphsonIterate algo because in benchmarking it\n wasn't noticeably faster than binarySubdivision, indeed removing it\n usually improved times, depending on the curve.\n I also removed the lookup table, as for the added bundle size and loop we're\n only cutting ~4 or so subdivision iterations. I bumped the max iterations up\n to 12 to compensate and this still tended to be faster for no perceivable\n loss in accuracy.\n Usage\n const easeOut = cubicBezier(.17,.67,.83,.67);\n const x = easeOut(0.5); // returns 0.627...\n*/\n\nimport { noop } from \"../noop\"\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nconst calcBezier = (t: number, a1: number, a2: number) =>\n (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) *\n t\n\nconst subdivisionPrecision = 0.0000001\nconst subdivisionMaxIterations = 12\n\nfunction binarySubdivide(\n x: number,\n lowerBound: number,\n upperBound: number,\n mX1: number,\n mX2: number\n) {\n let currentX: number\n let currentT: number\n let i: number = 0\n\n do {\n currentT = lowerBound + (upperBound - lowerBound) / 2.0\n currentX = calcBezier(currentT, mX1, mX2) - x\n if (currentX > 0.0) {\n upperBound = currentT\n } else {\n lowerBound = currentT\n }\n } while (\n Math.abs(currentX) > subdivisionPrecision &&\n ++i < subdivisionMaxIterations\n )\n\n return currentT\n}\n\nexport function cubicBezier(\n mX1: number,\n mY1: number,\n mX2: number,\n mY2: number\n) {\n // If this is a linear gradient, return linear easing\n if (mX1 === mY1 && mX2 === mY2) return noop\n\n const getTForX = (aX: number) => binarySubdivide(aX, 0, 1, mX1, mX2)\n\n // If animation is at start/end, return t without easing\n return (t: number) =>\n t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2)\n}\n","import type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport type { MotionValue } from \"../../value\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport { getDefaultValueType } from \"../../value/types/maps/defaults\"\nimport { createBox } from \"../../projection/geometry/models\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport { camelToDash } from \"../dom/utils/camel-to-dash\"\nimport type { ResolvedValues } from \"../types\"\nimport type { VisualElement, MotionStyle } from \"../VisualElement\"\nimport { SVGRenderState } from \"./types\"\nimport { buildSVGAttrs } from \"./utils/build-attrs\"\nimport { camelCaseAttributes } from \"./utils/camel-case-attrs\"\nimport { isSVGTag } from \"./utils/is-svg-tag\"\nimport { renderSVG } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\nexport class SVGVisualElement extends DOMVisualElement<\n SVGElement,\n SVGRenderState,\n DOMVisualElementOptions\n> {\n type = \"svg\"\n\n isSVGTag = false\n\n getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | MotionValue<any> | undefined {\n return props[key as keyof MotionNodeOptions]\n }\n\n readValueFromInstance(instance: SVGElement, key: string) {\n if (transformProps.has(key)) {\n const defaultType = getDefaultValueType(key)\n return defaultType ? defaultType.default || 0 : 0\n }\n key = !camelCaseAttributes.has(key) ? camelToDash(key) : key\n return instance.getAttribute(key)\n }\n\n measureInstanceViewportBox = createBox\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n build(\n renderState: SVGRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildSVGAttrs(\n renderState,\n latestValues,\n this.isSVGTag,\n props.transformTemplate,\n (props as any).style\n )\n }\n\n renderInstance(\n instance: SVGElement,\n renderState: SVGRenderState,\n styleProp?: MotionStyle | undefined,\n projection?: any\n ): void {\n renderSVG(instance, renderState, styleProp, projection)\n }\n\n mount(instance: SVGElement) {\n this.isSVGTag = isSVGTag(instance.tagName)\n super.mount(instance)\n }\n}\n","import { isDragging } from \"./is-active\"\n\nexport function setDragLock(axis: boolean | \"x\" | \"y\" | \"lockDirection\") {\n if (axis === \"x\" || axis === \"y\") {\n if (isDragging[axis]) {\n return null\n } else {\n isDragging[axis] = true\n return () => {\n isDragging[axis] = false\n }\n }\n } else {\n if (isDragging.x || isDragging.y) {\n return null\n } else {\n isDragging.x = isDragging.y = true\n return () => {\n isDragging.x = isDragging.y = false\n }\n }\n }\n}\n","import { addUniqueItem, removeItem } from \"./array\"\n\ntype GenericHandler = (...args: any) => void\n\nexport class SubscriptionManager<Handler extends GenericHandler> {\n private subscriptions: Handler[] = []\n\n add(handler: Handler): VoidFunction {\n addUniqueItem(this.subscriptions, handler)\n return () => removeItem(this.subscriptions, handler)\n }\n\n notify(\n a?: Parameters<Handler>[0],\n b?: Parameters<Handler>[1],\n c?: Parameters<Handler>[2]\n ) {\n const numSubscriptions = this.subscriptions.length\n\n if (!numSubscriptions) return\n\n if (numSubscriptions === 1) {\n /**\n * If there's only a single handler we can just call it without invoking a loop.\n */\n this.subscriptions[0](a, b, c)\n } else {\n for (let i = 0; i < numSubscriptions; i++) {\n /**\n * Check whether the handler exists before firing as it's possible\n * the subscriptions were modified during this loop running.\n */\n const handler = this.subscriptions[i]\n handler && handler(a, b, c)\n }\n }\n }\n\n getSize() {\n return this.subscriptions.length\n }\n\n clear() {\n this.subscriptions.length = 0\n }\n}\n","import { Feature, frame, hover, type VisualElement } from \"motion-dom\"\nimport { extractEventInfo } from \"../events/event-info\"\n\nfunction handleHoverEvent(\n node: VisualElement<Element>,\n event: PointerEvent,\n lifecycle: \"Start\" | \"End\"\n) {\n const { props } = node\n\n if (node.animationState && props.whileHover) {\n node.animationState.setActive(\"whileHover\", lifecycle === \"Start\")\n }\n\n const eventName = (\"onHover\" + lifecycle) as \"onHoverStart\" | \"onHoverEnd\"\n const callback = props[eventName]\n if (callback) {\n frame.postRender(() => callback(event, extractEventInfo(event)))\n }\n}\n\nexport class HoverGesture extends Feature<Element> {\n mount() {\n const { current } = this.node\n if (!current) return\n\n this.unmount = hover(current, (_element, startEvent) => {\n handleHoverEvent(this.node, startEvent, \"Start\")\n\n return (endEvent) => handleHoverEvent(this.node, endEvent, \"End\")\n })\n }\n\n unmount() {}\n}\n","import { MotionGlobalConfig, noop } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n KeyframeResolver as DefaultKeyframeResolver,\n flushKeyframeResolvers,\n ResolvedKeyframes,\n} from \"./keyframes/KeyframesResolver\"\nimport { NativeAnimationExtended } from \"./NativeAnimationExtended\"\nimport {\n AnimationPlaybackControls,\n AnyResolvedKeyframe,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { canAnimate } from \"./utils/can-animate\"\nimport { makeAnimationInstant } from \"./utils/make-animation-instant\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { supportsBrowserAnimation } from \"./waapi/supports/waapi\"\n\n/**\n * Maximum time allowed between an animation being created and it being\n * resolved for us to use the latter as the start time.\n *\n * This is to ensure that while we prefer to \"start\" an animation as soon\n * as it's triggered, we also want to avoid a visual jump if there's a big delay\n * between these two moments.\n */\nconst MAX_RESOLVE_DELAY = 40\n\ntype OptionsWithoutKeyframes<T extends AnyResolvedKeyframe> = Omit<\n ValueAnimationOptions<T>,\n \"keyframes\"\n>\n\nexport class AsyncMotionValueAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControls\n{\n private createdAt: number\n\n private resolvedAt: number | undefined\n\n private _animation: AnimationPlaybackControls | undefined\n\n private pendingTimeline: TimelineWithFallback | undefined\n\n private keyframeResolver: DefaultKeyframeResolver | undefined\n\n private stopTimeline: VoidFunction | undefined\n\n constructor({\n autoplay = true,\n delay = 0,\n type = \"keyframes\",\n repeat = 0,\n repeatDelay = 0,\n repeatType = \"loop\",\n keyframes,\n name,\n motionValue,\n element,\n ...options\n }: ValueAnimationOptions<T>) {\n super()\n\n this.createdAt = time.now()\n\n const optionsWithDefaults: OptionsWithoutKeyframes<T> = {\n autoplay,\n delay,\n type,\n repeat,\n repeatDelay,\n repeatType,\n name,\n motionValue,\n element,\n ...options,\n }\n\n const KeyframeResolver =\n element?.KeyframeResolver || DefaultKeyframeResolver\n\n this.keyframeResolver = new KeyframeResolver(\n keyframes,\n (\n resolvedKeyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n forced: boolean\n ) =>\n this.onKeyframesResolved(\n resolvedKeyframes,\n finalKeyframe,\n optionsWithDefaults,\n !forced\n ),\n name,\n motionValue,\n element\n )\n this.keyframeResolver?.scheduleResolve()\n }\n\n onKeyframesResolved(\n keyframes: ResolvedKeyframes<T>,\n finalKeyframe: T,\n options: OptionsWithoutKeyframes<T>,\n sync: boolean\n ) {\n this.keyframeResolver = undefined\n\n const { name, type, velocity, delay, isHandoff, onUpdate } = options\n this.resolvedAt = time.now()\n\n /**\n * If we can't animate this value with the resolved keyframes\n * then we should complete it immediately.\n */\n if (!canAnimate(keyframes, name, type, velocity)) {\n if (MotionGlobalConfig.instantAnimations || !delay) {\n onUpdate?.(getFinalKeyframe(keyframes, options, finalKeyframe))\n }\n\n keyframes[0] = keyframes[keyframes.length - 1]\n\n makeAnimationInstant(options)\n options.repeat = 0\n }\n\n /**\n * Resolve startTime for the animation.\n *\n * This method uses the createdAt and resolvedAt to calculate the\n * animation startTime. *Ideally*, we would use the createdAt time as t=0\n * as the following frame would then be the first frame of the animation in\n * progress, which would feel snappier.\n *\n * However, if there's a delay (main thread work) between the creation of\n * the animation and the first committed frame, we prefer to use resolvedAt\n * to avoid a sudden jump into the animation.\n */\n const startTime = sync\n ? !this.resolvedAt\n ? this.createdAt\n : this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY\n ? this.resolvedAt\n : this.createdAt\n : undefined\n\n const resolvedOptions = {\n startTime,\n finalKeyframe,\n ...options,\n keyframes,\n }\n\n /**\n * Animate via WAAPI if possible. If this is a handoff animation, the optimised animation will be running via\n * WAAPI. Therefore, this animation must be JS to ensure it runs \"under\" the\n * optimised animation.\n */\n const useWaapi = !isHandoff && supportsBrowserAnimation(resolvedOptions)\n const element = resolvedOptions.motionValue?.owner?.current\n\n const animation = useWaapi\n ? new NativeAnimationExtended({\n ...resolvedOptions,\n element,\n } as any)\n : new JSAnimation(resolvedOptions)\n\n animation.finished.then(() => {\n this.notifyFinished()\n }).catch(noop)\n\n if (this.pendingTimeline) {\n this.stopTimeline = animation.attachTimeline(this.pendingTimeline)\n this.pendingTimeline = undefined\n }\n\n this._animation = animation\n }\n\n get finished() {\n if (!this._animation) {\n return this._finished\n } else {\n return this.animation.finished\n }\n }\n\n then(onResolve: VoidFunction, _onReject?: VoidFunction) {\n return this.finished.finally(onResolve).then(() => {})\n }\n\n get animation(): AnimationPlaybackControls {\n if (!this._animation) {\n this.keyframeResolver?.resume()\n flushKeyframeResolvers()\n }\n\n return this._animation!\n }\n\n get duration() {\n return this.animation.duration\n }\n\n get iterationDuration() {\n return this.animation.iterationDuration\n }\n\n get time() {\n return this.animation.time\n }\n\n set time(newTime: number) {\n this.animation.time = newTime\n }\n\n get speed() {\n return this.animation.speed\n }\n\n get state() {\n return this.animation.state\n }\n\n set speed(newSpeed: number) {\n this.animation.speed = newSpeed\n }\n\n get startTime() {\n return this.animation.startTime\n }\n\n attachTimeline(timeline: TimelineWithFallback) {\n if (this._animation) {\n this.stopTimeline = this.animation.attachTimeline(timeline)\n } else {\n this.pendingTimeline = timeline\n }\n\n return () => this.stop()\n }\n\n play() {\n this.animation.play()\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.complete()\n }\n\n cancel() {\n if (this._animation) {\n this.animation.cancel()\n }\n\n this.keyframeResolver?.cancel()\n }\n\n /**\n * Bound to support return animation.stop pattern\n */\n stop = () => {\n if (this._animation) {\n this._animation.stop()\n this.stopTimeline?.()\n }\n\n this.keyframeResolver?.cancel()\n }\n}\n","import { Axis, Box, Delta, Point } from \"motion-utils\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { ResolvedValues } from \"../../render/types\"\nimport { hasTransform } from \"../utils/has-transform\"\n\n/**\n * Scales a point based on a factor and an originPoint\n */\nexport function scalePoint(point: number, scale: number, originPoint: number) {\n const distanceFromOrigin = point - originPoint\n const scaled = scale * distanceFromOrigin\n return originPoint + scaled\n}\n\n/**\n * Applies a translate/scale delta to a point\n */\nexport function applyPointDelta(\n point: number,\n translate: number,\n scale: number,\n originPoint: number,\n boxScale?: number\n): number {\n if (boxScale !== undefined) {\n point = scalePoint(point, boxScale, originPoint)\n }\n\n return scalePoint(point, scale, originPoint) + translate\n}\n\n/**\n * Applies a translate/scale delta to an axis\n */\nexport function applyAxisDelta(\n axis: Axis,\n translate: number = 0,\n scale: number = 1,\n originPoint: number,\n boxScale?: number\n): void {\n axis.min = applyPointDelta(\n axis.min,\n translate,\n scale,\n originPoint,\n boxScale\n )\n\n axis.max = applyPointDelta(\n axis.max,\n translate,\n scale,\n originPoint,\n boxScale\n )\n}\n\n/**\n * Applies a translate/scale delta to a box\n */\nexport function applyBoxDelta(box: Box, { x, y }: Delta): void {\n applyAxisDelta(box.x, x.translate, x.scale, x.originPoint)\n applyAxisDelta(box.y, y.translate, y.scale, y.originPoint)\n}\n\nconst TREE_SCALE_SNAP_MIN = 0.999999999999\nconst TREE_SCALE_SNAP_MAX = 1.0000000000001\n\n/**\n * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms\n * in a tree upon our box before then calculating how to project it into our desired viewport-relative box\n *\n * This is the final nested loop within updateLayoutDelta for future refactoring\n */\nexport function applyTreeDeltas(\n box: Box,\n treeScale: Point,\n treePath: any[],\n isSharedTransition: boolean = false\n) {\n const treeLength = treePath.length\n if (!treeLength) return\n\n // Reset the treeScale\n treeScale.x = treeScale.y = 1\n\n let node: any\n let delta: Delta | undefined\n\n for (let i = 0; i < treeLength; i++) {\n node = treePath[i]\n delta = node.projectionDelta\n\n /**\n * TODO: Prefer to remove this, but currently we have motion components with\n * display: contents in Framer.\n */\n const { visualElement } = node.options\n if (\n visualElement &&\n visualElement.props.style &&\n visualElement.props.style.display === \"contents\"\n ) {\n continue\n }\n\n if (\n isSharedTransition &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(box, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (delta) {\n // Incoporate each ancestor's scale into a cumulative treeScale for this component\n treeScale.x *= delta.x.scale\n treeScale.y *= delta.y.scale\n\n // Apply each ancestor's calculated delta into this component's recorded layout box\n applyBoxDelta(box, delta)\n }\n\n if (isSharedTransition && hasTransform(node.latestValues)) {\n transformBox(box, node.latestValues)\n }\n }\n\n /**\n * Snap tree scale back to 1 if it's within a non-perceivable threshold.\n * This will help reduce useless scales getting rendered.\n */\n if (\n treeScale.x < TREE_SCALE_SNAP_MAX &&\n treeScale.x > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.x = 1.0\n }\n if (\n treeScale.y < TREE_SCALE_SNAP_MAX &&\n treeScale.y > TREE_SCALE_SNAP_MIN\n ) {\n treeScale.y = 1.0\n }\n}\n\nexport function translateAxis(axis: Axis, distance: number) {\n axis.min = axis.min + distance\n axis.max = axis.max + distance\n}\n\n/**\n * Apply a transform to an axis from the latest resolved motion values.\n * This function basically acts as a bridge between a flat motion value map\n * and applyAxisDelta\n */\nexport function transformAxis(\n axis: Axis,\n axisTranslate?: number,\n axisScale?: number,\n boxScale?: number,\n axisOrigin: number = 0.5\n): void {\n const originPoint = mixNumber(axis.min, axis.max, axisOrigin)\n\n // Apply the axis delta to the final axis\n applyAxisDelta(axis, axisTranslate, axisScale, originPoint, boxScale)\n}\n\n/**\n * Apply a transform to a box from the latest resolved motion values.\n */\nexport function transformBox(box: Box, transform: ResolvedValues) {\n transformAxis(\n box.x,\n transform.x as number,\n transform.scaleX as number,\n transform.scale as number,\n transform.originX as number\n )\n transformAxis(\n box.y,\n transform.y as number,\n transform.scaleY as number,\n transform.scale as number,\n transform.originY as number\n )\n}\n","import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions<V extends AnyResolvedKeyframe = number>\n extends DOMValueAnimationOptions<V> {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n } else {\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n */\n setStyle(element, name, keyframe)\n }\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\n * This is designed to be overridden by NativeAnimationExtended, which\n * will create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to also correctly calculate velocity for any subsequent animation\n * while deferring the commit until the next animation frame.\n */\n protected commitStyles() {\n if (!this.isPseudoElement) {\n this.animation.commitStyles?.()\n }\n }\n\n get duration() {\n const duration =\n this.animation.effect?.getComputedTiming?.().duration || 0\n\n return millisecondsToSeconds(Number(duration))\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(Number(this.animation.currentTime) || 0)\n }\n\n set time(newTime: number) {\n this.manualStartTime = null\n this.finishedTime = null\n this.animation.currentTime = secondsToMilliseconds(newTime)\n }\n\n /**\n * The playback speed of the animation.\n * 1 = normal speed, 2 = double speed, 0.5 = half speed.\n */\n get speed() {\n return this.animation.playbackRate\n }\n\n set speed(newSpeed: number) {\n // Allow backwards playback after finishing\n if (newSpeed < 0) this.finishedTime = null\n\n this.animation.playbackRate = newSpeed\n }\n\n get state() {\n return this.finishedTime !== null\n ? \"finished\"\n : this.animation.playState\n }\n\n get startTime() {\n return this.manualStartTime ?? Number(this.animation.startTime)\n }\n\n set startTime(newStartTime: number) {\n this.manualStartTime = this.animation.startTime = newStartTime\n }\n\n /**\n * Attaches a timeline to the animation, for instance the `ScrollTimeline`.\n */\n attachTimeline({ timeline, observe }: TimelineWithFallback): VoidFunction {\n if (this.allowFlatten) {\n this.animation.effect?.updateTiming({ easing: \"linear\" })\n }\n\n this.animation.onfinish = null\n\n if (timeline && supportsScrollTimeline()) {\n this.animation.timeline = timeline as any\n\n return noop<void>\n } else {\n return observe(this)\n }\n }\n}\n","import { Axis, AxisDelta, Box } from \"motion-utils\"\n\n/**\n * Reset an axis to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisInto(axis: Axis, originAxis: Axis) {\n axis.min = originAxis.min\n axis.max = originAxis.max\n}\n\n/**\n * Reset a box to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyBoxInto(box: Box, originBox: Box) {\n copyAxisInto(box.x, originBox.x)\n copyAxisInto(box.y, originBox.y)\n}\n\n/**\n * Reset a delta to the provided origin box.\n *\n * This is a mutative operation.\n */\nexport function copyAxisDeltaInto(delta: AxisDelta, originDelta: AxisDelta) {\n delta.translate = originDelta.translate\n delta.scale = originDelta.scale\n delta.originPoint = originDelta.originPoint\n delta.origin = originDelta.origin\n}\n","/**\n * Generate a list of every possible transform key.\n */\nexport const transformPropOrder = [\n \"transformPerspective\",\n \"x\",\n \"y\",\n \"z\",\n \"translateX\",\n \"translateY\",\n \"translateZ\",\n \"scale\",\n \"scaleX\",\n \"scaleY\",\n \"rotate\",\n \"rotateX\",\n \"rotateY\",\n \"rotateZ\",\n \"skew\",\n \"skewX\",\n \"skewY\",\n]\n\n/**\n * A quick lookup for transform props.\n */\nexport const transformProps = /*@__PURE__*/ (() =>\n new Set(transformPropOrder))()\n","/**\n * A set of attribute names that are always read/written as camel case.\n */\nexport const camelCaseAttributes = new Set([\n \"baseFrequency\",\n \"diffuseConstant\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keySplines\",\n \"keyTimes\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerWidth\",\n \"numOctaves\",\n \"targetX\",\n \"targetY\",\n \"surfaceScale\",\n \"specularConstant\",\n \"specularExponent\",\n \"stdDeviation\",\n \"tableValues\",\n \"viewBox\",\n \"gradientTransform\",\n \"pathLength\",\n \"startOffset\",\n \"textLength\",\n \"lengthAdjust\",\n])\n","import { warning } from \"motion-utils\"\nimport { isGenerator } from \"../generators/utils/is-generator\"\nimport { ResolvedKeyframes } from \"../keyframes/KeyframesResolver\"\nimport { AnimationGeneratorType } from \"../types\"\nimport { isAnimatable } from \"./is-animatable\"\n\nfunction hasKeyframesChanged(keyframes: ResolvedKeyframes<any>) {\n const current = keyframes[0]\n if (keyframes.length === 1) return true\n for (let i = 0; i < keyframes.length; i++) {\n if (keyframes[i] !== current) return true\n }\n}\n\nexport function canAnimate(\n keyframes: ResolvedKeyframes<any>,\n name?: string,\n type?: AnimationGeneratorType,\n velocity?: number\n) {\n /**\n * Check if we're able to animate between the start and end keyframes,\n * and throw a warning if we're attempting to animate between one that's\n * animatable and another that isn't.\n */\n const originKeyframe = keyframes[0]\n if (originKeyframe === null) {\n return false\n }\n\n /**\n * These aren't traditionally animatable but we do support them.\n * In future we could look into making this more generic or replacing\n * this function with mix() === mixImmediate\n */\n if (name === \"display\" || name === \"visibility\") return true\n\n const targetKeyframe = keyframes[keyframes.length - 1]\n const isOriginAnimatable = isAnimatable(originKeyframe, name)\n const isTargetAnimatable = isAnimatable(targetKeyframe, name)\n\n warning(\n isOriginAnimatable === isTargetAnimatable,\n `You are trying to animate ${name} from \"${originKeyframe}\" to \"${targetKeyframe}\". \"${\n isOriginAnimatable ? targetKeyframe : originKeyframe\n }\" is not an animatable value.`,\n \"value-not-animatable\"\n )\n\n // Always skip if any of these are true\n if (!isOriginAnimatable || !isTargetAnimatable) {\n return false\n }\n\n return (\n hasKeyframesChanged(keyframes) ||\n ((type === \"spring\" || isGenerator(type)) && velocity)\n )\n}\n","import { invariant } from \"../../errors\"\nimport { noop } from \"../../noop\"\nimport { anticipate } from \"../anticipate\"\nimport { backIn, backInOut, backOut } from \"../back\"\nimport { circIn, circInOut, circOut } from \"../circ\"\nimport { cubicBezier } from \"../cubic-bezier\"\nimport { easeIn, easeInOut, easeOut } from \"../ease\"\nimport { Easing, EasingFunction } from \"../types\"\nimport { isBezierDefinition } from \"./is-bezier-definition\"\n\nconst easingLookup = {\n linear: noop,\n easeIn,\n easeInOut,\n easeOut,\n circIn,\n circInOut,\n circOut,\n backIn,\n backInOut,\n backOut,\n anticipate,\n}\n\nconst isValidEasing = (easing: Easing): easing is keyof typeof easingLookup => {\n return typeof easing === \"string\"\n}\n\nexport const easingDefinitionToFunction = (\n definition: Easing\n): EasingFunction => {\n if (isBezierDefinition(definition)) {\n // If cubic bezier definition, create bezier curve\n invariant(\n definition.length === 4,\n `Cubic bezier arrays must contain four numerical values.`,\n \"cubic-bezier-length\"\n )\n\n const [x1, y1, x2, y2] = definition\n return cubicBezier(x1, y1, x2, y2)\n } else if (isValidEasing(definition)) {\n // Else lookup from table\n invariant(\n easingLookup[definition] !== undefined,\n `Invalid easing type '${definition}'`,\n \"invalid-easing-type\"\n )\n return easingLookup[definition]\n }\n\n return definition\n}\n","import { int } from \"../int\"\nimport { alpha } from \"../numbers\"\nimport { px } from \"../numbers/units\"\nimport { transformValueTypes } from \"./transform\"\nimport { ValueTypeMap } from \"./types\"\n\nexport const numberValueTypes: ValueTypeMap = {\n // Border props\n borderWidth: px,\n borderTopWidth: px,\n borderRightWidth: px,\n borderBottomWidth: px,\n borderLeftWidth: px,\n borderRadius: px,\n borderTopLeftRadius: px,\n borderTopRightRadius: px,\n borderBottomRightRadius: px,\n borderBottomLeftRadius: px,\n\n // Positioning props\n width: px,\n maxWidth: px,\n height: px,\n maxHeight: px,\n top: px,\n right: px,\n bottom: px,\n left: px,\n inset: px,\n insetBlock: px,\n insetBlockStart: px,\n insetBlockEnd: px,\n insetInline: px,\n insetInlineStart: px,\n insetInlineEnd: px,\n\n // Spacing props\n padding: px,\n paddingTop: px,\n paddingRight: px,\n paddingBottom: px,\n paddingLeft: px,\n paddingBlock: px,\n paddingBlockStart: px,\n paddingBlockEnd: px,\n paddingInline: px,\n paddingInlineStart: px,\n paddingInlineEnd: px,\n margin: px,\n marginTop: px,\n marginRight: px,\n marginBottom: px,\n marginLeft: px,\n marginBlock: px,\n marginBlockStart: px,\n marginBlockEnd: px,\n marginInline: px,\n marginInlineStart: px,\n marginInlineEnd: px,\n\n // Typography\n fontSize: px,\n\n // Misc\n backgroundPositionX: px,\n backgroundPositionY: px,\n\n ...transformValueTypes,\n zIndex: int,\n\n // SVG\n fillOpacity: alpha,\n strokeOpacity: alpha,\n numOctaves: int,\n}\n","import type { Box } from \"motion-utils\"\nimport type { AnyResolvedKeyframe } from \"../../animation/types\"\nimport { isCSSVariableName } from \"../../animation/utils/is-css-variable\"\nimport type { MotionNodeOptions } from \"../../node/types\"\nimport { transformProps } from \"../utils/keys-transform\"\nimport {\n defaultTransformValue,\n readTransformValue,\n} from \"../dom/parse-transform\"\nimport { measureViewportBox } from \"../../projection/utils/measure\"\nimport { DOMVisualElement } from \"../dom/DOMVisualElement\"\nimport type { DOMVisualElementOptions } from \"../dom/types\"\nimport type { ResolvedValues, MotionConfigContextProps } from \"../types\"\nimport type { VisualElement } from \"../VisualElement\"\nimport { HTMLRenderState } from \"./types\"\nimport { buildHTMLStyles } from \"./utils/build-styles\"\nimport { renderHTML } from \"./utils/render\"\nimport { scrapeMotionValuesFromProps } from \"./utils/scrape-motion-values\"\n\nexport function getComputedStyle(element: HTMLElement) {\n return window.getComputedStyle(element)\n}\n\nexport class HTMLVisualElement extends DOMVisualElement<\n HTMLElement,\n HTMLRenderState,\n DOMVisualElementOptions\n> {\n type = \"html\"\n\n readValueFromInstance(\n instance: HTMLElement,\n key: string\n ): AnyResolvedKeyframe | null | undefined {\n if (transformProps.has(key)) {\n return this.projection?.isProjecting\n ? defaultTransformValue(key)\n : readTransformValue(instance, key)\n } else {\n const computedStyle = getComputedStyle(instance)\n const value =\n (isCSSVariableName(key)\n ? computedStyle.getPropertyValue(key)\n : computedStyle[key as keyof typeof computedStyle]) || 0\n\n return typeof value === \"string\" ? value.trim() : (value as number)\n }\n }\n\n measureInstanceViewportBox(\n instance: HTMLElement,\n { transformPagePoint }: MotionNodeOptions & Partial<MotionConfigContextProps>\n ): Box {\n return measureViewportBox(instance, transformPagePoint)\n }\n\n build(\n renderState: HTMLRenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ) {\n buildHTMLStyles(renderState, latestValues, props.transformTemplate)\n }\n\n scrapeMotionValuesFromProps(\n props: MotionNodeOptions,\n prevProps: MotionNodeOptions,\n visualElement: VisualElement\n ) {\n return scrapeMotionValuesFromProps(props, prevProps, visualElement)\n }\n\n renderInstance = renderHTML\n}\n","import { calcLength, mixNumber, type DragElastic, type ResolvedConstraints } from \"motion-dom\"\nimport {\n Axis,\n BoundingBox,\n Box,\n progress as calcProgress,\n clamp,\n Point,\n} from \"motion-utils\"\n\n/**\n * Apply constraints to a point. These constraints are both physical along an\n * axis, and an elastic factor that determines how much to constrain the point\n * by if it does lie outside the defined parameters.\n */\nexport function applyConstraints(\n point: number,\n { min, max }: Partial<Axis>,\n elastic?: Axis\n): number {\n if (min !== undefined && point < min) {\n // If we have a min point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(min, point, elastic.min)\n : Math.max(point, min)\n } else if (max !== undefined && point > max) {\n // If we have a max point defined, and this is outside of that, constrain\n point = elastic\n ? mixNumber(max, point, elastic.max)\n : Math.min(point, max)\n }\n\n return point\n}\n\n/**\n * Calculates a min projection point based on a pointer, pointer progress\n * within the drag target, and constraints.\n *\n * For instance if an element was 100px width, we were dragging from 0.25\n * along this axis, the pointer is at 200px, and there were no constraints,\n * we would calculate a min projection point of 175px.\n */\nexport function calcConstrainedMinPoint(\n point: number,\n length: number,\n progress: number,\n constraints?: Partial<Axis>,\n elastic?: Axis\n): number {\n // Calculate a min point for this axis and apply it to the current pointer\n const min = point - length * progress\n\n return constraints ? applyConstraints(min, constraints, elastic) : min\n}\n\n/**\n * Calculate constraints in terms of the viewport when defined relatively to the\n * measured axis. This is measured from the nearest edge, so a max constraint of 200\n * on an axis with a max value of 300 would return a constraint of 500 - axis length\n */\nexport function calcRelativeAxisConstraints(\n axis: Axis,\n min?: number,\n max?: number\n): Partial<Axis> {\n return {\n min: min !== undefined ? axis.min + min : undefined,\n max:\n max !== undefined\n ? axis.max + max - (axis.max - axis.min)\n : undefined,\n }\n}\n\n/**\n * Calculate constraints in terms of the viewport when\n * defined relatively to the measured bounding box.\n */\nexport function calcRelativeConstraints(\n layoutBox: Box,\n { top, left, bottom, right }: Partial<BoundingBox>\n): ResolvedConstraints {\n return {\n x: calcRelativeAxisConstraints(layoutBox.x, left, right),\n y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),\n }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative axis\n */\nexport function calcViewportAxisConstraints(\n layoutAxis: Axis,\n constraintsAxis: Axis\n) {\n let min = constraintsAxis.min - layoutAxis.min\n let max = constraintsAxis.max - layoutAxis.max\n\n // If the constraints axis is actually smaller than the layout axis then we can\n // flip the constraints\n if (\n constraintsAxis.max - constraintsAxis.min <\n layoutAxis.max - layoutAxis.min\n ) {\n ;[min, max] = [max, min]\n }\n\n return { min, max }\n}\n\n/**\n * Calculate viewport constraints when defined as another viewport-relative box\n */\nexport function calcViewportConstraints(layoutBox: Box, constraintsBox: Box) {\n return {\n x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),\n y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate a transform origin relative to the source axis, between 0-1, that results\n * in an asthetically pleasing scale/transform needed to project from source to target.\n */\nexport function calcOrigin(source: Axis, target: Axis): number {\n let origin = 0.5\n const sourceLength = calcLength(source)\n const targetLength = calcLength(target)\n\n if (targetLength > sourceLength) {\n origin = calcProgress(target.min, target.max - sourceLength, source.min)\n } else if (sourceLength > targetLength) {\n origin = calcProgress(source.min, source.max - targetLength, target.min)\n }\n\n return clamp(0, 1, origin)\n}\n\n/**\n * Calculate the relative progress of one constraints box relative to another.\n * Imagine a page scroll bar. At the top, this would return 0, at the bottom, 1.\n * Anywhere in-between, a value between 0 and 1.\n *\n * This also handles flipped constraints, for instance a draggable container within\n * a smaller viewport like a scrollable view.\n */\nexport function calcProgressWithinConstraints(\n layoutBox: Box,\n constraintsBox: Box\n): Point {\n return {\n x: calcOrigin(layoutBox.x, constraintsBox.x),\n y: calcOrigin(layoutBox.y, constraintsBox.y),\n }\n}\n\n/**\n * Calculate the an axis position based on two axes and a progress value.\n */\nexport function calcPositionFromProgress(\n axis: Axis,\n constraints: Axis,\n progress: number\n): Axis {\n const axisLength = axis.max - axis.min\n const min = mixNumber(\n constraints.min,\n constraints.max - axisLength,\n progress\n )\n return { min, max: min + axisLength }\n}\n\n/**\n * Rebase the calculated viewport constraints relative to the layout.min point.\n */\nexport function rebaseAxisConstraints(\n layout: Axis,\n constraints: Partial<Axis>\n): Partial<Axis> {\n const relativeConstraints: Partial<Axis> = {}\n\n if (constraints.min !== undefined) {\n relativeConstraints.min = constraints.min - layout.min\n }\n\n if (constraints.max !== undefined) {\n relativeConstraints.max = constraints.max - layout.min\n }\n\n return relativeConstraints\n}\n\nexport const defaultElastic = 0.35\n/**\n * Accepts a dragElastic prop and returns resolved elastic values for each axis.\n */\nexport function resolveDragElastic(\n dragElastic: DragElastic = defaultElastic\n): Box {\n if (dragElastic === false) {\n dragElastic = 0\n } else if (dragElastic === true) {\n dragElastic = defaultElastic\n }\n\n return {\n x: resolveAxisElastic(dragElastic, \"left\", \"right\"),\n y: resolveAxisElastic(dragElastic, \"top\", \"bottom\"),\n }\n}\n\nexport function resolveAxisElastic(\n dragElastic: DragElastic,\n minLabel: string,\n maxLabel: string\n): Axis {\n return {\n min: resolvePointElastic(dragElastic, minLabel),\n max: resolvePointElastic(dragElastic, maxLabel),\n }\n}\n\nexport function resolvePointElastic(\n dragElastic: DragElastic,\n label: string\n): number {\n return typeof dragElastic === \"number\"\n ? dragElastic\n : dragElastic[label as keyof typeof dragElastic] || 0\n}\n","import { transformProps } from \"../../render/utils/keys-transform\"\nimport type { ValueAnimationOptions } from \"../types\"\n\nconst underDampedSpring: Partial<ValueAnimationOptions> = {\n type: \"spring\",\n stiffness: 500,\n damping: 25,\n restSpeed: 10,\n}\n\nconst criticallyDampedSpring = (\n target: unknown\n): Partial<ValueAnimationOptions> => ({\n type: \"spring\",\n stiffness: 550,\n damping: target === 0 ? 2 * Math.sqrt(550) : 30,\n restSpeed: 10,\n})\n\nconst keyframesTransition: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n duration: 0.8,\n}\n\n/**\n * Default easing curve is a slightly shallower version of\n * the default browser easing curve.\n */\nconst ease: Partial<ValueAnimationOptions> = {\n type: \"keyframes\",\n ease: [0.25, 0.1, 0.35, 1],\n duration: 0.3,\n}\n\nexport const getDefaultTransition = (\n valueKey: string,\n { keyframes }: ValueAnimationOptions\n): Partial<ValueAnimationOptions> => {\n if (keyframes.length > 2) {\n return keyframesTransition\n } else if (transformProps.has(valueKey)) {\n return valueKey.startsWith(\"scale\")\n ? criticallyDampedSpring(keyframes[1])\n : underDampedSpring\n }\n\n return ease\n}\n","import { RGBA } from \"../types\"\nimport { rgba } from \"./rgba\"\nimport { isColorString } from \"./utils\"\n\nfunction parseHex(v: string): RGBA {\n let r = \"\"\n let g = \"\"\n let b = \"\"\n let a = \"\"\n\n // If we have 6 characters, ie #FF0000\n if (v.length > 5) {\n r = v.substring(1, 3)\n g = v.substring(3, 5)\n b = v.substring(5, 7)\n a = v.substring(7, 9)\n\n // Or we have 3 characters, ie #F00\n } else {\n r = v.substring(1, 2)\n g = v.substring(2, 3)\n b = v.substring(3, 4)\n a = v.substring(4, 5)\n r += r\n g += g\n b += b\n a += a\n }\n\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n }\n}\n\nexport const hex = {\n test: /*@__PURE__*/ isColorString(\"#\"),\n parse: parseHex,\n transform: rgba.transform,\n}\n","import { activeAnimations } from \"../../stats/animation-count\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { Transition, ValueAnimationOptions } from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { copyAxisDeltaInto, copyBoxInto } from \"../geometry/copy\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { delay } from \"../../utils/delay\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { NodeStack } from \"../shared/stack\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode<I>({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig<I>) {\n return class ProjectionNode implements IProjectionNode<I> {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An id that represents a unique session instigated by startUpdate.\n */\n animationId: number = 0\n\n animationCommitId = 0\n\n /**\n * A reference to the platform-native node (currently this will be a HTMLElement).\n */\n instance: I | undefined\n\n /**\n * A reference to the root projection node. There'll only ever be one tree and one root.\n */\n root: IProjectionNode\n\n /**\n * A reference to this node's parent.\n */\n parent?: IProjectionNode\n\n /**\n * A path from this node to the root node. This provides a fast way to iterate\n * back up the tree.\n */\n path: IProjectionNode[]\n\n /**\n * A Set containing all this component's children. This is used to iterate\n * through the children.\n *\n * TODO: This could be faster to iterate as a flat array stored on the root node.\n */\n children = new Set<IProjectionNode>()\n\n /**\n * Options for the node. We use this to configure what kind of layout animations\n * we should perform (if any).\n */\n options: ProjectionNodeOptions = {}\n\n /**\n * A snapshot of the element's state just before the current update. This is\n * hydrated when this node's `willUpdate` method is called and scrubbed at the\n * end of the tree's `didUpdate` method.\n */\n snapshot: Measurements | undefined\n\n /**\n * A box defining the element's layout relative to the page. This will have been\n * captured with all parent scrolls and projection transforms unset.\n */\n layout: Measurements | undefined\n\n /**\n * The layout used to calculate the previous layout animation. We use this to compare\n * layouts between renders and decide whether we need to trigger a new layout animation\n * or just let the current one play out.\n */\n targetLayout?: Box\n\n /**\n * A mutable data structure we use to apply all parent transforms currently\n * acting on the element's layout. It's from here we can calculate the projectionDelta\n * required to get the element from its layout into its calculated target box.\n */\n layoutCorrected: Box\n\n /**\n * An ideal projection transform we want to apply to the element. This is calculated,\n * usually when an element's layout has changed, and we want the element to look as though\n * its in its previous layout on the next frame. From there, we animated it down to 0\n * to animate the element to its new layout.\n */\n targetDelta?: Delta\n\n /**\n * A mutable structure representing the visual bounding box on the page where we want\n * and element to appear. This can be set directly but is currently derived once a frame\n * from apply targetDelta to layout.\n */\n target?: Box\n\n /**\n * A mutable structure describing a visual bounding box relative to the element's\n * projected parent. If defined, target will be derived from this rather than targetDelta.\n * If not defined, we'll attempt to calculate on the first layout animation frame\n * based on the targets calculated from targetDelta. This will transfer a layout animation\n * from viewport-relative to parent-relative.\n */\n relativeTarget?: Box\n\n relativeTargetOrigin?: Box\n relativeParent?: IProjectionNode\n\n /**\n * We use this to detect when its safe to shut down part of a projection tree.\n * We have to keep projecting children for scale correction and relative projection\n * until all their parents stop performing layout animations.\n */\n isTreeAnimating = false\n\n isAnimationBlocked = false\n\n /**\n * If true, attempt to resolve relativeTarget.\n */\n attemptToResolveRelativeTarget?: boolean\n\n /**\n * A mutable structure that represents the target as transformed by the element's\n * latest user-set transforms (ie scale, x)\n */\n targetWithTransforms?: Box\n\n /**\n * The previous projection delta, which we can compare with the newly calculated\n * projection delta to see if we need to render.\n */\n prevProjectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the target. This will be used by children to calculate their own layoutCorrect boxes.\n */\n projectionDelta?: Delta\n\n /**\n * A calculated transform that will project an element from its layoutCorrected\n * into the targetWithTransforms.\n */\n projectionDeltaWithTransform?: Delta\n\n /**\n * If we're tracking the scroll of this element, we store it here.\n */\n scroll?: ScrollMeasurements\n\n /**\n * Flag to true if we think this layout has been changed. We can't always know this,\n * currently we set it to true every time a component renders, or if it has a layoutDependency\n * if that has changed between renders. Additionally, components can be grouped by LayoutGroup\n * and if one node is dirtied, they all are.\n */\n isLayoutDirty = false\n\n /**\n * Flag to true if we think the projection calculations for this node needs\n * recalculating as a result of an updated transform or layout animation.\n */\n isProjectionDirty = false\n\n /**\n * Flag to true if the layout *or* transform has changed. This then gets propagated\n * throughout the projection tree, forcing any element below to recalculate on the next frame.\n */\n isSharedProjectionDirty = false\n\n /**\n * Flag transform dirty. This gets propagated throughout the whole tree but is only\n * respected by shared nodes.\n */\n isTransformDirty = false\n\n /**\n * Block layout updates for instant layout transitions throughout the tree.\n */\n updateManuallyBlocked = false\n\n updateBlockedByResize = false\n\n /**\n * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate`\n * call.\n */\n isUpdating = false\n\n /**\n * If this is an SVG element we currently disable projection transforms\n */\n isSVG = false\n\n /**\n * Flag to true (during promotion) if a node doing an instant layout transition needs to reset\n * its projection styles.\n */\n needsReset = false\n\n /**\n * Flags whether this node should have its transform reset prior to measuring.\n */\n shouldResetTransform = false\n\n /**\n * Store whether this node has been checked for optimised appear animations. As\n * effects fire bottom-up, and we want to look up the tree for appear animations,\n * this makes sure we only check each path once, stopping at nodes that\n * have already been checked.\n */\n hasCheckedOptimisedAppear = false\n\n /**\n * An object representing the calculated contextual/accumulated/tree scale.\n * This will be used to scale calculcated projection transforms, as these are\n * calculated in screen-space but need to be scaled for elements to layoutly\n * make it to their calculated destinations.\n *\n * TODO: Lazy-init\n */\n treeScale: Point = { x: 1, y: 1 }\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumeFrom?: IProjectionNode\n\n /**\n * Is hydrated with a projection node if an element is animating from another.\n */\n resumingFrom?: IProjectionNode\n\n /**\n * A reference to the element's latest animated values. This is a reference shared\n * between the element's VisualElement and the ProjectionNode.\n */\n latestValues: ResolvedValues\n\n /**\n *\n */\n eventHandlers = new Map<LayoutEvents, SubscriptionManager<any>>()\n\n nodes?: FlatTree\n\n depth: number\n\n /**\n * If transformTemplate generates a different value before/after the\n * update, we need to reset the transform.\n */\n prevTransformTemplateValue: string | undefined\n\n preserveOpacity?: boolean\n\n hasTreeAnimated = false\n\n layoutVersion: number = 0\n\n constructor(\n latestValues: ResolvedValues = {},\n parent: IProjectionNode | undefined = defaultParent?.()\n ) {\n this.latestValues = latestValues\n this.root = parent ? parent.root || parent : this\n this.path = parent ? [...parent.path, parent] : []\n this.parent = parent\n\n this.depth = parent ? parent.depth + 1 : 0\n\n for (let i = 0; i < this.path.length; i++) {\n this.path[i].shouldResetTransform = true\n }\n\n if (this.root === this) this.nodes = new FlatTree()\n }\n\n addEventListener(name: LayoutEvents, handler: any) {\n if (!this.eventHandlers.has(name)) {\n this.eventHandlers.set(name, new SubscriptionManager())\n }\n\n return this.eventHandlers.get(name)!.add(handler)\n }\n\n notifyListeners(name: LayoutEvents, ...args: any) {\n const subscriptionManager = this.eventHandlers.get(name)\n subscriptionManager && subscriptionManager.notify(...args)\n }\n\n hasListeners(name: LayoutEvents) {\n return this.eventHandlers.has(name)\n }\n\n /**\n * Lifecycles\n */\n mount(instance: I) {\n if (this.instance) return\n\n this.isSVG = isSVGElement(instance) && !isSVGSVGElement(instance)\n\n this.instance = instance\n\n const { layoutId, layout, visualElement } = this.options\n if (visualElement && !visualElement.current) {\n visualElement.mount(instance)\n }\n\n this.root.nodes!.add(this)\n this.parent && this.parent.children.add(this)\n\n if (this.root.hasTreeAnimated && (layout || layoutId)) {\n this.isLayoutDirty = true\n }\n\n if (attachResizeListener) {\n let cancelDelay: VoidFunction\n let innerWidth = 0\n\n const resizeUnblockUpdate = () =>\n (this.root.updateBlockedByResize = false)\n\n // Set initial innerWidth in a frame.read callback to batch the read\n frame.read(() => {\n innerWidth = window.innerWidth\n })\n\n attachResizeListener(instance, () => {\n const newInnerWidth = window.innerWidth\n if (newInnerWidth === innerWidth) return\n\n innerWidth = newInnerWidth\n\n this.root.updateBlockedByResize = true\n\n cancelDelay && cancelDelay()\n cancelDelay = delay(resizeUnblockUpdate, 250)\n\n if (globalProjectionState.hasAnimatedSinceResize) {\n globalProjectionState.hasAnimatedSinceResize = false\n this.nodes!.forEach(finishAnimation)\n }\n })\n }\n\n if (layoutId) {\n this.root.registerSharedNode(layoutId, this)\n }\n\n // Only register the handler if it requires layout animation\n if (\n this.options.animate !== false &&\n visualElement &&\n (layoutId || layout)\n ) {\n this.addEventListener(\n \"didUpdate\",\n ({\n delta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n layout: newLayout,\n }: LayoutUpdateData) => {\n if (this.isTreeAnimationBlocked()) {\n this.target = undefined\n this.relativeTarget = undefined\n return\n }\n\n // TODO: Check here if an animation exists\n const layoutTransition =\n this.options.transition ||\n visualElement.getDefaultTransition() ||\n defaultLayoutTransition\n\n const {\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n } = visualElement.getProps()\n\n /**\n * The target layout of the element might stay the same,\n * but its position relative to its parent has changed.\n */\n const hasTargetChanged =\n !this.targetLayout ||\n !boxEqualsRounded(this.targetLayout, newLayout)\n /*\n * Note: Disabled to fix relative animations always triggering new\n * layout animations. If this causes further issues, we can try\n * a different approach to detecting relative target changes.\n */\n // || hasRelativeLayoutChanged\n\n /**\n * If the layout hasn't seemed to have changed, it might be that the\n * element is visually in the same place in the document but its position\n * relative to its parent has indeed changed. So here we check for that.\n */\n const hasOnlyRelativeTargetChanged =\n !hasLayoutChanged && hasRelativeLayoutChanged\n\n if (\n this.options.layoutRoot ||\n this.resumeFrom ||\n hasOnlyRelativeTargetChanged ||\n (hasLayoutChanged &&\n (hasTargetChanged || !this.currentAnimation))\n ) {\n if (this.resumeFrom) {\n this.resumingFrom = this.resumeFrom\n this.resumingFrom.resumingFrom = undefined\n }\n\n const animationOptions = {\n ...getValueTransition(\n layoutTransition,\n \"layout\"\n ),\n onPlay: onLayoutAnimationStart,\n onComplete: onLayoutAnimationComplete,\n }\n\n if (\n visualElement.shouldReduceMotion ||\n this.options.layoutRoot\n ) {\n animationOptions.delay = 0\n animationOptions.type = false\n }\n\n this.startAnimation(animationOptions)\n /**\n * Set animation origin after starting animation to avoid layout jump\n * caused by stopping previous layout animation\n */\n this.setAnimationOrigin(\n delta,\n hasOnlyRelativeTargetChanged\n )\n } else {\n /**\n * If the layout hasn't changed and we have an animation that hasn't started yet,\n * finish it immediately. Otherwise it will be animating from a location\n * that was probably never committed to screen and look like a jumpy box.\n */\n\n if (!hasLayoutChanged) {\n finishAnimation(this)\n }\n\n if (this.isLead() && this.options.onExitComplete) {\n this.options.onExitComplete()\n }\n }\n\n this.targetLayout = newLayout\n }\n )\n }\n }\n\n unmount() {\n this.options.layoutId && this.willUpdate()\n this.root.nodes!.remove(this)\n const stack = this.getStack()\n stack && stack.remove(this)\n this.parent && this.parent.children.delete(this)\n this.instance = undefined\n this.eventHandlers.clear()\n\n cancelFrame(this.updateProjection)\n }\n\n // only on the root\n blockUpdate() {\n this.updateManuallyBlocked = true\n }\n\n unblockUpdate() {\n this.updateManuallyBlocked = false\n }\n\n isUpdateBlocked() {\n return this.updateManuallyBlocked || this.updateBlockedByResize\n }\n\n isTreeAnimationBlocked() {\n return (\n this.isAnimationBlocked ||\n (this.parent && this.parent.isTreeAnimationBlocked()) ||\n false\n )\n }\n\n // Note: currently only running on root node\n startUpdate() {\n if (this.isUpdateBlocked()) return\n\n this.isUpdating = true\n\n this.nodes && this.nodes.forEach(resetSkewAndRotation)\n this.animationId++\n }\n\n getTransformTemplate() {\n const { visualElement } = this.options\n return visualElement && visualElement.getProps().transformTemplate\n }\n\n willUpdate(shouldNotifyListeners = true) {\n this.root.hasTreeAnimated = true\n\n if (this.root.isUpdateBlocked()) {\n this.options.onExitComplete && this.options.onExitComplete()\n return\n }\n\n /**\n * If we're running optimised appear animations then these must be\n * cancelled before measuring the DOM. This is so we can measure\n * the true layout of the element rather than the WAAPI animation\n * which will be unaffected by the resetSkewAndRotate step.\n *\n * Note: This is a DOM write. Worst case scenario is this is sandwiched\n * between other snapshot reads which will cause unnecessary style recalculations.\n * This has to happen here though, as we don't yet know which nodes will need\n * snapshots in startUpdate(), but we only want to cancel optimised animations\n * if a layout animation measurement is actually going to be affected by them.\n */\n if (\n window.MotionCancelOptimisedAnimation &&\n !this.hasCheckedOptimisedAppear\n ) {\n cancelTreeOptimisedTransformAnimations(this)\n }\n\n !this.root.isUpdating && this.root.startUpdate()\n\n if (this.isLayoutDirty) return\n\n this.isLayoutDirty = true\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.shouldResetTransform = true\n\n node.updateScroll(\"snapshot\")\n\n if (node.options.layoutRoot) {\n node.willUpdate(false)\n }\n }\n\n const { layoutId, layout } = this.options\n if (layoutId === undefined && !layout) return\n\n const transformTemplate = this.getTransformTemplate()\n this.prevTransformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n this.updateSnapshot()\n shouldNotifyListeners && this.notifyListeners(\"willUpdate\")\n }\n\n // Note: Currently only running on root node\n updateScheduled = false\n\n update() {\n this.updateScheduled = false\n\n const updateWasBlocked = this.isUpdateBlocked()\n\n // When doing an instant transition, we skip the layout update,\n // but should still clean up the measurements so that the next\n // snapshot could be taken correctly.\n if (updateWasBlocked) {\n this.unblockUpdate()\n this.clearAllSnapshots()\n this.nodes!.forEach(clearMeasurements)\n return\n }\n\n /**\n * If this is a repeat of didUpdate then ignore the animation.\n */\n if (this.animationId <= this.animationCommitId) {\n this.nodes!.forEach(clearIsLayoutDirty)\n return\n }\n\n this.animationCommitId = this.animationId\n\n if (!this.isUpdating) {\n this.nodes!.forEach(clearIsLayoutDirty)\n } else {\n this.isUpdating = false\n\n /**\n * Write\n */\n this.nodes!.forEach(resetTransformStyle)\n\n /**\n * Read ==================\n */\n // Update layout measurements of updated children\n this.nodes!.forEach(updateLayout)\n\n /**\n * Write\n */\n // Notify listeners that the layout is updated\n this.nodes!.forEach(notifyLayoutUpdate)\n }\n\n this.clearAllSnapshots()\n\n /**\n * Manually flush any pending updates. Ideally\n * we could leave this to the following requestAnimationFrame but this seems\n * to leave a flash of incorrectly styled content.\n */\n const now = time.now()\n frameData.delta = clamp(0, 1000 / 60, now - frameData.timestamp)\n frameData.timestamp = now\n frameData.isProcessing = true\n frameSteps.update.process(frameData)\n frameSteps.preRender.process(frameData)\n frameSteps.render.process(frameData)\n frameData.isProcessing = false\n }\n\n scheduleUpdate = () => this.update()\n\n didUpdate() {\n if (!this.updateScheduled) {\n this.updateScheduled = true\n microtask.read(this.scheduleUpdate)\n }\n }\n\n clearAllSnapshots() {\n this.nodes!.forEach(clearSnapshot)\n this.sharedNodes.forEach(removeLeadSnapshots)\n }\n\n projectionUpdateScheduled = false\n scheduleUpdateProjection() {\n if (!this.projectionUpdateScheduled) {\n this.projectionUpdateScheduled = true\n frame.preRender(this.updateProjection, false, true)\n }\n }\n\n scheduleCheckAfterUnmount() {\n /**\n * If the unmounting node is in a layoutGroup and did trigger a willUpdate,\n * we manually call didUpdate to give a chance to the siblings to animate.\n * Otherwise, cleanup all snapshots to prevents future nodes from reusing them.\n */\n frame.postRender(() => {\n if (this.isLayoutDirty) {\n this.root.didUpdate()\n } else {\n this.root.checkUpdateFailed()\n }\n })\n }\n\n checkUpdateFailed = () => {\n if (this.isUpdating) {\n this.isUpdating = false\n this.clearAllSnapshots()\n }\n }\n\n /**\n * This is a multi-step process as shared nodes might be of different depths. Nodes\n * are sorted by depth order, so we need to resolve the entire tree before moving to\n * the next step.\n */\n updateProjection = () => {\n this.projectionUpdateScheduled = false\n\n /**\n * Reset debug counts. Manually resetting rather than creating a new\n * object each frame.\n */\n if (statsBuffer.value) {\n metrics.nodes =\n metrics.calculatedTargetDeltas =\n metrics.calculatedProjections =\n 0\n }\n\n this.nodes!.forEach(propagateDirtyNodes)\n this.nodes!.forEach(resolveTargetDelta)\n this.nodes!.forEach(calcProjection)\n this.nodes!.forEach(cleanDirtyNodes)\n\n if (statsBuffer.addProjectionMetrics) {\n statsBuffer.addProjectionMetrics(metrics)\n }\n }\n\n /**\n * Update measurements\n */\n updateSnapshot() {\n if (this.snapshot || !this.instance) return\n\n this.snapshot = this.measure()\n\n if (\n this.snapshot &&\n !calcLength(this.snapshot.measuredBox.x) &&\n !calcLength(this.snapshot.measuredBox.y)\n ) {\n this.snapshot = undefined\n }\n }\n\n updateLayout() {\n if (!this.instance) return\n\n this.updateScroll()\n\n if (\n !(this.options.alwaysMeasureLayout && this.isLead()) &&\n !this.isLayoutDirty\n ) {\n return\n }\n\n /**\n * When a node is mounted, it simply resumes from the prevLead's\n * snapshot instead of taking a new one, but the ancestors scroll\n * might have updated while the prevLead is unmounted. We need to\n * update the scroll again to make sure the layout we measure is\n * up to date.\n */\n if (this.resumeFrom && !this.resumeFrom.instance) {\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n node.updateScroll()\n }\n }\n\n const prevLayout = this.layout\n this.layout = this.measure(false)\n this.layoutVersion++\n this.layoutCorrected = createBox()\n this.isLayoutDirty = false\n this.projectionDelta = undefined\n this.notifyListeners(\"measure\", this.layout.layoutBox)\n\n const { visualElement } = this.options\n visualElement &&\n visualElement.notify(\n \"LayoutMeasure\",\n this.layout.layoutBox,\n prevLayout ? prevLayout.layoutBox : undefined\n )\n }\n\n updateScroll(phase: Phase = \"measure\") {\n let needsMeasurement = Boolean(\n this.options.layoutScroll && this.instance\n )\n\n if (\n this.scroll &&\n this.scroll.animationId === this.root.animationId &&\n this.scroll.phase === phase\n ) {\n needsMeasurement = false\n }\n\n if (needsMeasurement && this.instance) {\n const isRoot = checkIsScrollRoot(this.instance)\n this.scroll = {\n animationId: this.root.animationId,\n phase,\n isRoot,\n offset: measureScroll(this.instance),\n wasRoot: this.scroll ? this.scroll.isRoot : isRoot,\n }\n }\n }\n\n resetTransform() {\n if (!resetTransform) return\n\n const isResetRequested =\n this.isLayoutDirty ||\n this.shouldResetTransform ||\n this.options.alwaysMeasureLayout\n\n const hasProjection =\n this.projectionDelta && !isDeltaZero(this.projectionDelta)\n\n const transformTemplate = this.getTransformTemplate()\n const transformTemplateValue = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : undefined\n\n const transformTemplateHasChanged =\n transformTemplateValue !== this.prevTransformTemplateValue\n\n if (\n isResetRequested &&\n this.instance &&\n (hasProjection ||\n hasTransform(this.latestValues) ||\n transformTemplateHasChanged)\n ) {\n resetTransform(this.instance, transformTemplateValue)\n this.shouldResetTransform = false\n this.scheduleRender()\n }\n }\n\n measure(removeTransform = true) {\n const pageBox = this.measurePageBox()\n\n let layoutBox = this.removeElementScroll(pageBox)\n\n /**\n * Measurements taken during the pre-render stage\n * still have transforms applied so we remove them\n * via calculation.\n */\n if (removeTransform) {\n layoutBox = this.removeTransform(layoutBox)\n }\n\n roundBox(layoutBox)\n\n return {\n animationId: this.root.animationId,\n measuredBox: pageBox,\n layoutBox,\n latestValues: {},\n source: this.id,\n }\n }\n\n measurePageBox() {\n const { visualElement } = this.options\n if (!visualElement) return createBox()\n\n const box = visualElement.measureViewportBox()\n\n const wasInScrollRoot =\n this.scroll?.wasRoot || this.path.some(checkNodeWasScrollRoot)\n\n if (!wasInScrollRoot) {\n // Remove viewport scroll to give page-relative coordinates\n const { scroll } = this.root\n if (scroll) {\n translateAxis(box.x, scroll.offset.x)\n translateAxis(box.y, scroll.offset.y)\n }\n }\n\n return box\n }\n\n removeElementScroll(box: Box): Box {\n const boxWithoutScroll = createBox()\n copyBoxInto(boxWithoutScroll, box)\n\n if (this.scroll?.wasRoot) {\n return boxWithoutScroll\n }\n\n /**\n * Performance TODO: Keep a cumulative scroll offset down the tree\n * rather than loop back up the path.\n */\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n const { scroll, options } = node\n\n if (node !== this.root && scroll && options.layoutScroll) {\n /**\n * If this is a new scroll root, we want to remove all previous scrolls\n * from the viewport box.\n */\n if (scroll.wasRoot) {\n copyBoxInto(boxWithoutScroll, box)\n }\n\n translateAxis(boxWithoutScroll.x, scroll.offset.x)\n translateAxis(boxWithoutScroll.y, scroll.offset.y)\n }\n }\n\n return boxWithoutScroll\n }\n\n applyTransform(box: Box, transformOnly = false): Box {\n const withTransforms = createBox()\n copyBoxInto(withTransforms, box)\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n\n if (\n !transformOnly &&\n node.options.layoutScroll &&\n node.scroll &&\n node !== node.root\n ) {\n transformBox(withTransforms, {\n x: -node.scroll.offset.x,\n y: -node.scroll.offset.y,\n })\n }\n\n if (!hasTransform(node.latestValues)) continue\n transformBox(withTransforms, node.latestValues)\n }\n\n if (hasTransform(this.latestValues)) {\n transformBox(withTransforms, this.latestValues)\n }\n\n return withTransforms\n }\n\n removeTransform(box: Box): Box {\n const boxWithoutTransform = createBox()\n copyBoxInto(boxWithoutTransform, box)\n\n for (let i = 0; i < this.path.length; i++) {\n const node = this.path[i]\n if (!node.instance) continue\n if (!hasTransform(node.latestValues)) continue\n\n hasScale(node.latestValues) && node.updateSnapshot()\n\n const sourceBox = createBox()\n const nodeBox = node.measurePageBox()\n copyBoxInto(sourceBox, nodeBox)\n\n removeBoxTransforms(\n boxWithoutTransform,\n node.latestValues,\n node.snapshot ? node.snapshot.layoutBox : undefined,\n sourceBox\n )\n }\n\n if (hasTransform(this.latestValues)) {\n removeBoxTransforms(boxWithoutTransform, this.latestValues)\n }\n\n return boxWithoutTransform\n }\n\n setTargetDelta(delta: Delta) {\n this.targetDelta = delta\n this.root.scheduleUpdateProjection()\n this.isProjectionDirty = true\n }\n\n setOptions(options: ProjectionNodeOptions) {\n this.options = {\n ...this.options,\n ...options,\n crossfade:\n options.crossfade !== undefined ? options.crossfade : true,\n }\n }\n\n clearMeasurements() {\n this.scroll = undefined\n this.layout = undefined\n this.snapshot = undefined\n this.prevTransformTemplateValue = undefined\n this.targetDelta = undefined\n this.target = undefined\n this.isLayoutDirty = false\n }\n\n forceRelativeParentToResolveTarget() {\n if (!this.relativeParent) return\n\n /**\n * If the parent target isn't up-to-date, force it to update.\n * This is an unfortunate de-optimisation as it means any updating relative\n * projection will cause all the relative parents to recalculate back\n * up the tree.\n */\n if (\n this.relativeParent.resolvedRelativeTargetAt !==\n frameData.timestamp\n ) {\n this.relativeParent.resolveTargetDelta(true)\n }\n }\n\n /**\n * Frame calculations\n */\n resolvedRelativeTargetAt: number = 0.0\n resolveTargetDelta(forceRecalculation = false) {\n /**\n * Once the dirty status of nodes has been spread through the tree, we also\n * need to check if we have a shared node of a different depth that has itself\n * been dirtied.\n */\n const lead = this.getLead()\n this.isProjectionDirty ||= lead.isProjectionDirty\n this.isTransformDirty ||= lead.isTransformDirty\n this.isSharedProjectionDirty ||= lead.isSharedProjectionDirty\n\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n /**\n * We don't use transform for this step of processing so we don't\n * need to check whether any nodes have changed transform.\n */\n const canSkip = !(\n forceRecalculation ||\n (isShared && this.isSharedProjectionDirty) ||\n this.isProjectionDirty ||\n this.parent?.isProjectionDirty ||\n this.attemptToResolveRelativeTarget ||\n this.root.updateBlockedByResize\n )\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If we have no layout, we can't perform projection, so early return\n */\n if (!this.layout || !(layout || layoutId)) return\n\n this.resolvedRelativeTargetAt = frameData.timestamp\n\n const relativeParent = this.getClosestProjectingParent()\n\n if (\n relativeParent &&\n this.linkedParentVersion !== relativeParent.layoutVersion &&\n !relativeParent.options.layoutRoot\n ) {\n this.removeRelativeTarget()\n }\n\n /**\n * If we don't have a targetDelta but do have a layout, we can attempt to resolve\n * a relativeParent. This will allow a component to perform scale correction\n * even if no animation has started.\n */\n if (!this.targetDelta && !this.relativeTarget) {\n if (relativeParent && relativeParent.layout) {\n this.createRelativeTarget(\n relativeParent,\n this.layout.layoutBox,\n relativeParent.layout.layoutBox\n )\n } else {\n this.removeRelativeTarget()\n }\n }\n\n /**\n * If we have no relative target or no target delta our target isn't valid\n * for this frame.\n */\n if (!this.relativeTarget && !this.targetDelta) return\n\n /**\n * Lazy-init target data structure\n */\n if (!this.target) {\n this.target = createBox()\n this.targetWithTransforms = createBox()\n }\n\n /**\n * If we've got a relative box for this component, resolve it into a target relative to the parent.\n */\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.relativeParent &&\n this.relativeParent.target\n ) {\n this.forceRelativeParentToResolveTarget()\n\n calcRelativeBox(\n this.target,\n this.relativeTarget,\n this.relativeParent.target\n )\n\n /**\n * If we've only got a targetDelta, resolve it into a target\n */\n } else if (this.targetDelta) {\n if (Boolean(this.resumingFrom)) {\n // TODO: This is creating a new object every frame\n this.target = this.applyTransform(this.layout.layoutBox)\n } else {\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n applyBoxDelta(this.target, this.targetDelta)\n } else {\n /**\n * If no target, use own layout as target\n */\n copyBoxInto(this.target, this.layout.layoutBox)\n }\n\n /**\n * If we've been told to attempt to resolve a relative target, do so.\n */\n if (this.attemptToResolveRelativeTarget) {\n this.attemptToResolveRelativeTarget = false\n\n if (\n relativeParent &&\n Boolean(relativeParent.resumingFrom) ===\n Boolean(this.resumingFrom) &&\n !relativeParent.options.layoutScroll &&\n relativeParent.target &&\n this.animationProgress !== 1\n ) {\n this.createRelativeTarget(\n relativeParent,\n this.target,\n relativeParent.target\n )\n } else {\n this.relativeParent = this.relativeTarget = undefined\n }\n }\n\n /**\n * Increase debug counter for resolved target deltas\n */\n if (statsBuffer.value) {\n metrics.calculatedTargetDeltas++\n }\n }\n\n getClosestProjectingParent() {\n if (\n !this.parent ||\n hasScale(this.parent.latestValues) ||\n has2DTranslate(this.parent.latestValues)\n ) {\n return undefined\n }\n\n if (this.parent.isProjecting()) {\n return this.parent\n } else {\n return this.parent.getClosestProjectingParent()\n }\n }\n\n isProjecting() {\n return Boolean(\n (this.relativeTarget ||\n this.targetDelta ||\n this.options.layoutRoot) &&\n this.layout\n )\n }\n\n linkedParentVersion: number = 0\n createRelativeTarget(\n relativeParent: IProjectionNode,\n layout: Box,\n parentLayout: Box\n ) {\n this.relativeParent = relativeParent\n this.linkedParentVersion = relativeParent.layoutVersion\n this.forceRelativeParentToResolveTarget()\n this.relativeTarget = createBox()\n this.relativeTargetOrigin = createBox()\n calcRelativePosition(\n this.relativeTargetOrigin,\n layout,\n parentLayout\n )\n\n copyBoxInto(this.relativeTarget, this.relativeTargetOrigin)\n }\n\n removeRelativeTarget() {\n this.relativeParent = this.relativeTarget = undefined\n }\n\n hasProjected: boolean = false\n\n calcProjection() {\n const lead = this.getLead()\n const isShared = Boolean(this.resumingFrom) || this !== lead\n\n let canSkip = true\n\n /**\n * If this is a normal layout animation and neither this node nor its nearest projecting\n * is dirty then we can't skip.\n */\n if (this.isProjectionDirty || this.parent?.isProjectionDirty) {\n canSkip = false\n }\n\n /**\n * If this is a shared layout animation and this node's shared projection is dirty then\n * we can't skip.\n */\n if (\n isShared &&\n (this.isSharedProjectionDirty || this.isTransformDirty)\n ) {\n canSkip = false\n }\n\n /**\n * If we have resolved the target this frame we must recalculate the\n * projection to ensure it visually represents the internal calculations.\n */\n if (this.resolvedRelativeTargetAt === frameData.timestamp) {\n canSkip = false\n }\n\n if (canSkip) return\n\n const { layout, layoutId } = this.options\n\n /**\n * If this section of the tree isn't animating we can\n * delete our target sources for the following frame.\n */\n this.isTreeAnimating = Boolean(\n (this.parent && this.parent.isTreeAnimating) ||\n this.currentAnimation ||\n this.pendingAnimation\n )\n if (!this.isTreeAnimating) {\n this.targetDelta = this.relativeTarget = undefined\n }\n\n if (!this.layout || !(layout || layoutId)) return\n\n /**\n * Reset the corrected box with the latest values from box, as we're then going\n * to perform mutative operations on it.\n */\n copyBoxInto(this.layoutCorrected, this.layout.layoutBox)\n\n /**\n * Record previous tree scales before updating.\n */\n const prevTreeScaleX = this.treeScale.x\n const prevTreeScaleY = this.treeScale.y\n /**\n * Apply all the parent deltas to this box to produce the corrected box. This\n * is the layout box, as it will appear on screen as a result of the transforms of its parents.\n */\n applyTreeDeltas(\n this.layoutCorrected,\n this.treeScale,\n this.path,\n isShared\n )\n\n /**\n * If this layer needs to perform scale correction but doesn't have a target,\n * use the layout as the target.\n */\n if (\n lead.layout &&\n !lead.target &&\n (this.treeScale.x !== 1 || this.treeScale.y !== 1)\n ) {\n lead.target = lead.layout.layoutBox\n lead.targetWithTransforms = createBox()\n }\n\n const { target } = lead\n\n if (!target) {\n /**\n * If we don't have a target to project into, but we were previously\n * projecting, we want to remove the stored transform and schedule\n * a render to ensure the elements reflect the removed transform.\n */\n if (this.prevProjectionDelta) {\n this.createProjectionDeltas()\n this.scheduleRender()\n }\n\n return\n }\n\n if (!this.projectionDelta || !this.prevProjectionDelta) {\n this.createProjectionDeltas()\n } else {\n copyAxisDeltaInto(\n this.prevProjectionDelta.x,\n this.projectionDelta.x\n )\n copyAxisDeltaInto(\n this.prevProjectionDelta.y,\n this.projectionDelta.y\n )\n }\n\n /**\n * Update the delta between the corrected box and the target box before user-set transforms were applied.\n * This will allow us to calculate the corrected borderRadius and boxShadow to compensate\n * for our layout reprojection, but still allow them to be scaled correctly by the user.\n * It might be that to simplify this we may want to accept that user-set scale is also corrected\n * and we wouldn't have to keep and calc both deltas, OR we could support a user setting\n * to allow people to choose whether these styles are corrected based on just the\n * layout reprojection or the final bounding box.\n */\n calcBoxDelta(\n this.projectionDelta!,\n this.layoutCorrected,\n target,\n this.latestValues\n )\n\n if (\n this.treeScale.x !== prevTreeScaleX ||\n this.treeScale.y !== prevTreeScaleY ||\n !axisDeltaEquals(\n this.projectionDelta!.x,\n this.prevProjectionDelta!.x\n ) ||\n !axisDeltaEquals(\n this.projectionDelta!.y,\n this.prevProjectionDelta!.y\n )\n ) {\n this.hasProjected = true\n this.scheduleRender()\n this.notifyListeners(\"projectionUpdate\", target)\n }\n\n /**\n * Increase debug counter for recalculated projections\n */\n if (statsBuffer.value) {\n metrics.calculatedProjections++\n }\n }\n\n isVisible = true\n hide() {\n this.isVisible = false\n // TODO: Schedule render\n }\n show() {\n this.isVisible = true\n // TODO: Schedule render\n }\n\n scheduleRender(notifyAll = true) {\n this.options.visualElement?.scheduleRender()\n if (notifyAll) {\n const stack = this.getStack()\n stack && stack.scheduleRender()\n }\n if (this.resumingFrom && !this.resumingFrom.instance) {\n this.resumingFrom = undefined\n }\n }\n\n createProjectionDeltas() {\n this.prevProjectionDelta = createDelta()\n this.projectionDelta = createDelta()\n this.projectionDeltaWithTransform = createDelta()\n }\n\n /**\n * Animation\n */\n animationValues?: ResolvedValues\n pendingAnimation?: Process\n currentAnimation?: JSAnimation<number>\n mixTargetDelta: (progress: number) => void\n animationProgress = 0\n\n setAnimationOrigin(\n delta: Delta,\n hasOnlyRelativeTargetChanged: boolean = false\n ) {\n const snapshot = this.snapshot\n const snapshotLatestValues = snapshot ? snapshot.latestValues : {}\n const mixedValues = { ...this.latestValues }\n\n const targetDelta = createDelta()\n if (\n !this.relativeParent ||\n !this.relativeParent.options.layoutRoot\n ) {\n this.relativeTarget = this.relativeTargetOrigin = undefined\n }\n this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged\n\n const relativeLayout = createBox()\n\n const snapshotSource = snapshot ? snapshot.source : undefined\n const layoutSource = this.layout ? this.layout.source : undefined\n const isSharedLayoutAnimation = snapshotSource !== layoutSource\n const stack = this.getStack()\n const isOnlyMember = !stack || stack.members.length <= 1\n const shouldCrossfadeOpacity = Boolean(\n isSharedLayoutAnimation &&\n !isOnlyMember &&\n this.options.crossfade === true &&\n !this.path.some(hasOpacityCrossfade)\n )\n\n this.animationProgress = 0\n\n let prevRelativeTarget: Box\n\n this.mixTargetDelta = (latest: number) => {\n const progress = latest / 1000\n\n mixAxisDelta(targetDelta.x, delta.x, progress)\n mixAxisDelta(targetDelta.y, delta.y, progress)\n this.setTargetDelta(targetDelta)\n\n if (\n this.relativeTarget &&\n this.relativeTargetOrigin &&\n this.layout &&\n this.relativeParent &&\n this.relativeParent.layout\n ) {\n calcRelativePosition(\n relativeLayout,\n this.layout.layoutBox,\n this.relativeParent.layout.layoutBox\n )\n mixBox(\n this.relativeTarget,\n this.relativeTargetOrigin,\n relativeLayout,\n progress\n )\n\n /**\n * If this is an unchanged relative target we can consider the\n * projection not dirty.\n */\n if (\n prevRelativeTarget &&\n boxEquals(this.relativeTarget, prevRelativeTarget)\n ) {\n this.isProjectionDirty = false\n }\n\n if (!prevRelativeTarget) prevRelativeTarget = createBox()\n copyBoxInto(prevRelativeTarget, this.relativeTarget)\n }\n\n if (isSharedLayoutAnimation) {\n this.animationValues = mixedValues\n\n mixValues(\n mixedValues,\n snapshotLatestValues,\n this.latestValues,\n progress,\n shouldCrossfadeOpacity,\n isOnlyMember\n )\n }\n\n this.root.scheduleUpdateProjection()\n this.scheduleRender()\n\n this.animationProgress = progress\n }\n\n this.mixTargetDelta(this.options.layoutRoot ? 1000 : 0)\n }\n\n motionValue?: MotionValue<number>\n startAnimation(options: ValueAnimationOptions<number>) {\n this.notifyListeners(\"animationStart\")\n\n this.currentAnimation?.stop()\n this.resumingFrom?.currentAnimation?.stop()\n\n if (this.pendingAnimation) {\n cancelFrame(this.pendingAnimation)\n this.pendingAnimation = undefined\n }\n\n /**\n * Start the animation in the next frame to have a frame with progress 0,\n * where the target is the same as when the animation started, so we can\n * calculate the relative positions correctly for instant transitions.\n */\n this.pendingAnimation = frame.update(() => {\n globalProjectionState.hasAnimatedSinceResize = true\n\n activeAnimations.layout++\n this.motionValue ||= motionValue(0)\n\n this.currentAnimation = animateSingleValue(\n this.motionValue,\n [0, 1000],\n {\n ...(options as any),\n velocity: 0,\n isSync: true,\n onUpdate: (latest: number) => {\n this.mixTargetDelta(latest)\n options.onUpdate && options.onUpdate(latest)\n },\n onStop: () => {\n activeAnimations.layout--\n },\n onComplete: () => {\n activeAnimations.layout--\n options.onComplete && options.onComplete()\n this.completeAnimation()\n },\n }\n ) as JSAnimation<number>\n\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = this.currentAnimation\n }\n\n this.pendingAnimation = undefined\n })\n }\n\n completeAnimation() {\n if (this.resumingFrom) {\n this.resumingFrom.currentAnimation = undefined\n this.resumingFrom.preserveOpacity = undefined\n }\n\n const stack = this.getStack()\n stack && stack.exitAnimationComplete()\n this.resumingFrom =\n this.currentAnimation =\n this.animationValues =\n undefined\n\n this.notifyListeners(\"animationComplete\")\n }\n\n finishAnimation() {\n if (this.currentAnimation) {\n this.mixTargetDelta && this.mixTargetDelta(animationTarget)\n this.currentAnimation.stop()\n }\n\n this.completeAnimation()\n }\n\n applyTransformsToTarget() {\n const lead = this.getLead()\n let { targetWithTransforms, target, layout, latestValues } = lead\n\n if (!targetWithTransforms || !target || !layout) return\n\n /**\n * If we're only animating position, and this element isn't the lead element,\n * then instead of projecting into the lead box we instead want to calculate\n * a new target that aligns the two boxes but maintains the layout shape.\n */\n if (\n this !== lead &&\n this.layout &&\n layout &&\n shouldAnimatePositionOnly(\n this.options.animationType,\n this.layout.layoutBox,\n layout.layoutBox\n )\n ) {\n target = this.target || createBox()\n\n const xLength = calcLength(this.layout!.layoutBox.x)\n target!.x.min = lead.target!.x.min\n target!.x.max = target.x.min + xLength\n\n const yLength = calcLength(this.layout!.layoutBox.y)\n target!.y.min = lead.target!.y.min\n target!.y.max = target.y.min + yLength\n }\n\n copyBoxInto(targetWithTransforms, target)\n\n /**\n * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.\n * This is the final box that we will then project into by calculating a transform delta and\n * applying it to the corrected box.\n */\n transformBox(targetWithTransforms, latestValues)\n\n /**\n * Update the delta between the corrected box and the final target box, after\n * user-set transforms are applied to it. This will be used by the renderer to\n * create a transform style that will reproject the element from its layout layout\n * into the desired bounding box.\n */\n calcBoxDelta(\n this.projectionDeltaWithTransform!,\n this.layoutCorrected,\n targetWithTransforms!,\n latestValues\n )\n }\n\n /**\n * Shared layout\n */\n // TODO Only running on root node\n sharedNodes: Map<string, NodeStack> = new Map()\n registerSharedNode(layoutId: string, node: IProjectionNode) {\n if (!this.sharedNodes.has(layoutId)) {\n this.sharedNodes.set(layoutId, new NodeStack())\n }\n\n const stack = this.sharedNodes.get(layoutId)!\n stack.add(node)\n\n const config = node.options.initialPromotionConfig\n node.promote({\n transition: config ? config.transition : undefined,\n preserveFollowOpacity:\n config && config.shouldPreserveFollowOpacity\n ? config.shouldPreserveFollowOpacity(node)\n : undefined,\n })\n }\n\n isLead(): boolean {\n const stack = this.getStack()\n return stack ? stack.lead === this : true\n }\n\n getLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.lead || this : this\n }\n\n getPrevLead() {\n const { layoutId } = this.options\n return layoutId ? this.getStack()?.prevLead : undefined\n }\n\n getStack() {\n const { layoutId } = this.options\n if (layoutId) return this.root.sharedNodes.get(layoutId)\n }\n\n promote({\n needsReset,\n transition,\n preserveFollowOpacity,\n }: {\n needsReset?: boolean\n transition?: Transition\n preserveFollowOpacity?: boolean\n } = {}) {\n const stack = this.getStack()\n if (stack) stack.promote(this, preserveFollowOpacity)\n\n if (needsReset) {\n this.projectionDelta = undefined\n this.needsReset = true\n }\n if (transition) this.setOptions({ transition })\n }\n\n relegate(): boolean {\n const stack = this.getStack()\n if (stack) {\n return stack.relegate(this)\n } else {\n return false\n }\n }\n\n resetSkewAndRotation() {\n const { visualElement } = this.options\n\n if (!visualElement) return\n\n // If there's no detected skew or rotation values, we can early return without a forced render.\n let hasDistortingTransform = false\n\n /**\n * An unrolled check for rotation values. Most elements don't have any rotation and\n * skipping the nested loop and new object creation is 50% faster.\n */\n const { latestValues } = visualElement\n if (\n latestValues.z ||\n latestValues.rotate ||\n latestValues.rotateX ||\n latestValues.rotateY ||\n latestValues.rotateZ ||\n latestValues.skewX ||\n latestValues.skewY\n ) {\n hasDistortingTransform = true\n }\n\n // If there's no distorting values, we don't need to do any more.\n if (!hasDistortingTransform) return\n\n const resetValues: ResolvedValues = {}\n\n if (latestValues.z) {\n resetDistortingTransform(\n \"z\",\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Check the skew and rotate value of all axes and reset to 0\n for (let i = 0; i < transformAxes.length; i++) {\n resetDistortingTransform(\n `rotate${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n resetDistortingTransform(\n `skew${transformAxes[i]}`,\n visualElement,\n resetValues,\n this.animationValues\n )\n }\n\n // Force a render of this element to apply the transform with all skews and rotations\n // set to 0.\n visualElement.render()\n\n // Put back all the values we reset\n for (const key in resetValues) {\n visualElement.setStaticValue(key, resetValues[key])\n if (this.animationValues) {\n this.animationValues[key] = resetValues[key]\n }\n }\n\n // Schedule a render for the next frame. This ensures we won't visually\n // see the element with the reset rotate value applied.\n visualElement.scheduleRender()\n }\n\n applyProjectionStyles(\n targetStyle: any, // CSSStyleDeclaration - doesn't allow numbers to be assigned to properties\n styleProp?: MotionStyle\n ) {\n if (!this.instance || this.isSVG) return\n\n if (!this.isVisible) {\n targetStyle.visibility = \"hidden\"\n return\n }\n\n const transformTemplate = this.getTransformTemplate()\n\n if (this.needsReset) {\n this.needsReset = false\n\n targetStyle.visibility = \"\"\n targetStyle.opacity = \"\"\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n targetStyle.transform = transformTemplate\n ? transformTemplate(this.latestValues, \"\")\n : \"none\"\n return\n }\n\n const lead = this.getLead()\n if (!this.projectionDelta || !this.layout || !lead.target) {\n if (this.options.layoutId) {\n targetStyle.opacity =\n this.latestValues.opacity !== undefined\n ? this.latestValues.opacity\n : 1\n targetStyle.pointerEvents =\n resolveMotionValue(styleProp?.pointerEvents) || \"\"\n }\n if (this.hasProjected && !hasTransform(this.latestValues)) {\n targetStyle.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n this.hasProjected = false\n }\n\n return\n }\n\n targetStyle.visibility = \"\"\n\n const valuesToRender = lead.animationValues || lead.latestValues\n this.applyTransformsToTarget()\n\n let transform = buildProjectionTransform(\n this.projectionDeltaWithTransform!,\n this.treeScale,\n valuesToRender\n )\n\n if (transformTemplate) {\n transform = transformTemplate(valuesToRender, transform)\n }\n\n targetStyle.transform = transform\n\n const { x, y } = this.projectionDelta\n targetStyle.transformOrigin = `${x.origin * 100}% ${\n y.origin * 100\n }% 0`\n\n if (lead.animationValues) {\n /**\n * If the lead component is animating, assign this either the entering/leaving\n * opacity\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity ??\n this.latestValues.opacity ??\n 1\n : this.preserveOpacity\n ? this.latestValues.opacity\n : valuesToRender.opacityExit\n } else {\n /**\n * Or we're not animating at all, set the lead component to its layout\n * opacity and other components to hidden.\n */\n targetStyle.opacity =\n lead === this\n ? valuesToRender.opacity !== undefined\n ? valuesToRender.opacity\n : \"\"\n : valuesToRender.opacityExit !== undefined\n ? valuesToRender.opacityExit\n : 0\n }\n\n /**\n * Apply scale correction\n */\n for (const key in scaleCorrectors) {\n if (valuesToRender[key] === undefined) continue\n\n const { correct, applyTo, isCSSVariable } = scaleCorrectors[key]\n\n /**\n * Only apply scale correction to the value if we have an\n * active projection transform. Otherwise these values become\n * vulnerable to distortion if the element changes size without\n * a corresponding layout animation.\n */\n const corrected =\n transform === \"none\"\n ? valuesToRender[key]\n : correct(valuesToRender[key], lead)\n\n if (applyTo) {\n const num = applyTo.length\n for (let i = 0; i < num; i++) {\n targetStyle[applyTo[i] as any] = corrected\n }\n } else {\n // If this is a CSS variable, set it directly on the instance.\n // Replacing this function from creating styles to setting them\n // would be a good place to remove per frame object creation\n if (isCSSVariable) {\n ;(\n this.options.visualElement as HTMLVisualElement\n ).renderState.vars[key] = corrected\n } else {\n targetStyle[key as any] = corrected\n }\n }\n }\n\n /**\n * Disable pointer events on follow components. This is to ensure\n * that if a follow component covers a lead component it doesn't block\n * pointer events on the lead.\n */\n if (this.options.layoutId) {\n targetStyle.pointerEvents =\n lead === this\n ? resolveMotionValue(styleProp?.pointerEvents) || \"\"\n : \"none\"\n }\n }\n\n clearSnapshot() {\n this.resumeFrom = this.snapshot = undefined\n }\n\n // Only run on root\n resetTree() {\n this.root.nodes!.forEach((node: IProjectionNode) =>\n node.currentAnimation?.stop()\n )\n this.root.nodes!.forEach(clearMeasurements)\n this.root.sharedNodes.clear()\n }\n }\n}\n\nfunction updateLayout(node: IProjectionNode) {\n node.updateLayout()\n}\n\nfunction notifyLayoutUpdate(node: IProjectionNode) {\n const snapshot = node.resumeFrom?.snapshot || node.snapshot\n\n if (\n node.isLead() &&\n node.layout &&\n snapshot &&\n node.hasListeners(\"didUpdate\")\n ) {\n const { layoutBox: layout, measuredBox: measuredLayout } = node.layout\n const { animationType } = node.options\n\n const isShared = snapshot.source !== node.layout.source\n\n // TODO Maybe we want to also resize the layout snapshot so we don't trigger\n // animations for instance if layout=\"size\" and an element has only changed position\n if (animationType === \"size\") {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(axisSnapshot)\n axisSnapshot.min = layout[axis].min\n axisSnapshot.max = axisSnapshot.min + length\n })\n } else if (\n shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)\n ) {\n eachAxis((axis) => {\n const axisSnapshot = isShared\n ? snapshot.measuredBox[axis]\n : snapshot.layoutBox[axis]\n const length = calcLength(layout[axis])\n axisSnapshot.max = axisSnapshot.min + length\n\n /**\n * Ensure relative target gets resized and rerendererd\n */\n if (node.relativeTarget && !node.currentAnimation) {\n node.isProjectionDirty = true\n node.relativeTarget[axis].max =\n node.relativeTarget[axis].min + length\n }\n })\n }\n\n const layoutDelta = createDelta()\n\n calcBoxDelta(layoutDelta, layout, snapshot.layoutBox)\n const visualDelta = createDelta()\n if (isShared) {\n calcBoxDelta(\n visualDelta,\n node.applyTransform(measuredLayout, true),\n snapshot.measuredBox\n )\n } else {\n calcBoxDelta(visualDelta, layout, snapshot.layoutBox)\n }\n\n const hasLayoutChanged = !isDeltaZero(layoutDelta)\n let hasRelativeLayoutChanged = false\n\n if (!node.resumeFrom) {\n const relativeParent = node.getClosestProjectingParent()\n\n /**\n * If the relativeParent is itself resuming from a different element then\n * the relative snapshot is not relavent\n */\n if (relativeParent && !relativeParent.resumeFrom) {\n const { snapshot: parentSnapshot, layout: parentLayout } =\n relativeParent\n\n if (parentSnapshot && parentLayout) {\n const relativeSnapshot = createBox()\n calcRelativePosition(\n relativeSnapshot,\n snapshot.layoutBox,\n parentSnapshot.layoutBox\n )\n\n const relativeLayout = createBox()\n calcRelativePosition(\n relativeLayout,\n layout,\n parentLayout.layoutBox\n )\n\n if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {\n hasRelativeLayoutChanged = true\n }\n\n if (relativeParent.options.layoutRoot) {\n node.relativeTarget = relativeLayout\n node.relativeTargetOrigin = relativeSnapshot\n node.relativeParent = relativeParent\n }\n }\n }\n }\n\n node.notifyListeners(\"didUpdate\", {\n layout,\n snapshot,\n delta: visualDelta,\n layoutDelta,\n hasLayoutChanged,\n hasRelativeLayoutChanged,\n })\n } else if (node.isLead()) {\n const { onExitComplete } = node.options\n onExitComplete && onExitComplete()\n }\n\n /**\n * Clearing transition\n * TODO: Investigate why this transition is being passed in as {type: false } from Framer\n * and why we need it at all\n */\n node.options.transition = undefined\n}\n\nexport function propagateDirtyNodes(node: IProjectionNode) {\n /**\n * Increase debug counter for nodes encountered this frame\n */\n if (statsBuffer.value) {\n metrics.nodes++\n }\n\n if (!node.parent) return\n\n /**\n * If this node isn't projecting, propagate isProjectionDirty. It will have\n * no performance impact but it will allow the next child that *is* projecting\n * but *isn't* dirty to just check its parent to see if *any* ancestor needs\n * correcting.\n */\n if (!node.isProjecting()) {\n node.isProjectionDirty = node.parent.isProjectionDirty\n }\n\n /**\n * Propagate isSharedProjectionDirty and isTransformDirty\n * throughout the whole tree. A future revision can take another look at\n * this but for safety we still recalcualte shared nodes.\n */\n node.isSharedProjectionDirty ||= Boolean(\n node.isProjectionDirty ||\n node.parent.isProjectionDirty ||\n node.parent.isSharedProjectionDirty\n )\n\n node.isTransformDirty ||= node.parent.isTransformDirty\n}\n\nexport function cleanDirtyNodes(node: IProjectionNode) {\n node.isProjectionDirty =\n node.isSharedProjectionDirty =\n node.isTransformDirty =\n false\n}\n\nfunction clearSnapshot(node: IProjectionNode) {\n node.clearSnapshot()\n}\n\nfunction clearMeasurements(node: IProjectionNode) {\n node.clearMeasurements()\n}\n\nfunction clearIsLayoutDirty(node: IProjectionNode) {\n node.isLayoutDirty = false\n}\n\nfunction resetTransformStyle(node: IProjectionNode) {\n const { visualElement } = node.options\n if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {\n visualElement.notify(\"BeforeLayoutMeasure\")\n }\n\n node.resetTransform()\n}\n\nfunction finishAnimation(node: IProjectionNode) {\n node.finishAnimation()\n node.targetDelta = node.relativeTarget = node.target = undefined\n node.isProjectionDirty = true\n}\n\nfunction resolveTargetDelta(node: IProjectionNode) {\n node.resolveTargetDelta()\n}\n\nfunction calcProjection(node: IProjectionNode) {\n node.calcProjection()\n}\n\nfunction resetSkewAndRotation(node: IProjectionNode) {\n node.resetSkewAndRotation()\n}\n\nfunction removeLeadSnapshots(stack: NodeStack) {\n stack.removeLeadSnapshot()\n}\n\nexport function mixAxisDelta(output: AxisDelta, delta: AxisDelta, p: number) {\n output.translate = mixNumber(delta.translate, 0, p)\n output.scale = mixNumber(delta.scale, 1, p)\n output.origin = delta.origin\n output.originPoint = delta.originPoint\n}\n\nexport function mixAxis(output: Axis, from: Axis, to: Axis, p: number) {\n output.min = mixNumber(from.min, to.min, p)\n output.max = mixNumber(from.max, to.max, p)\n}\n\nexport function mixBox(output: Box, from: Box, to: Box, p: number) {\n mixAxis(output.x, from.x, to.x, p)\n mixAxis(output.y, from.y, to.y, p)\n}\n\nfunction hasOpacityCrossfade(node: IProjectionNode) {\n return (\n node.animationValues && node.animationValues.opacityExit !== undefined\n )\n}\n\nconst defaultLayoutTransition = {\n duration: 0.45,\n ease: [0.4, 0, 0.1, 1],\n}\n\nconst userAgentContains = (string: string) =>\n typeof navigator !== \"undefined\" &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n ? Math.round\n : noop\n\nfunction roundAxis(axis: Axis): void {\n // Round to the nearest .5 pixels to support subpixel layouts\n axis.min = roundPoint(axis.min)\n axis.max = roundPoint(axis.max)\n}\n\nfunction roundBox(box: Box): void {\n roundAxis(box.x)\n roundAxis(box.y)\n}\n\nfunction shouldAnimatePositionOnly(\n animationType: string | undefined,\n snapshot: Box,\n layout: Box\n) {\n return (\n animationType === \"position\" ||\n (animationType === \"preserve-aspect\" &&\n !isNear(aspectRatio(snapshot), aspectRatio(layout), 0.2))\n )\n}\n\nfunction checkNodeWasScrollRoot(node: IProjectionNode) {\n return node !== node.root && node.scroll?.wasRoot\n}\n","import { clamp } from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { JSAnimation } from \"./JSAnimation\"\nimport { NativeAnimation, NativeAnimationOptions } from \"./NativeAnimation\"\nimport { AnyResolvedKeyframe, ValueAnimationOptions } from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { replaceStringEasing } from \"./waapi/utils/unsupported-easing\"\n\nexport type NativeAnimationOptionsExtended<T extends AnyResolvedKeyframe> =\n NativeAnimationOptions & ValueAnimationOptions<T> & NativeAnimationOptions\n\n/**\n * 10ms is chosen here as it strikes a balance between smooth\n * results (more than one keyframe per frame at 60fps) and\n * keyframe quantity.\n */\nconst sampleDelta = 10 //ms\n\nexport class NativeAnimationExtended<\n T extends AnyResolvedKeyframe\n> extends NativeAnimation<T> {\n options: NativeAnimationOptionsExtended<T>\n\n constructor(options: NativeAnimationOptionsExtended<T>) {\n /**\n * The base NativeAnimation function only supports a subset\n * of Motion easings, and WAAPI also only supports some\n * easing functions via string/cubic-bezier definitions.\n *\n * This function replaces those unsupported easing functions\n * with a JS easing function. This will later get compiled\n * to a linear() easing function.\n */\n replaceStringEasing(options)\n\n /**\n * Ensure we replace the transition type with a generator function\n * before passing to WAAPI.\n *\n * TODO: Does this have a better home? It could be shared with\n * JSAnimation.\n */\n replaceTransitionType(options)\n\n super(options)\n\n if (options.startTime !== undefined) {\n this.startTime = options.startTime\n }\n\n this.options = options\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * Rather than read committed styles back out of the DOM, we can\n * create a renderless JS animation and sample it twice to calculate\n * its current value, \"previous\" value, and therefore allow\n * Motion to calculate velocity for any subsequent animation.\n */\n updateMotionValue(value?: T) {\n const { motionValue, onUpdate, onComplete, element, ...options } =\n this.options\n\n if (!motionValue) return\n\n if (value !== undefined) {\n motionValue.set(value)\n return\n }\n\n const sampleAnimation = new JSAnimation({\n ...options,\n autoplay: false,\n })\n\n /**\n * Use wall-clock elapsed time for sampling.\n * Under CPU load, WAAPI's currentTime may not reflect actual\n * elapsed time, causing incorrect sampling and visual jumps.\n */\n const sampleTime = Math.max(sampleDelta, time.now() - this.startTime)\n const delta = clamp(0, sampleDelta, sampleTime - sampleDelta)\n\n motionValue.setWithVelocity(\n sampleAnimation.sample(Math.max(0, sampleTime - delta)).value,\n sampleAnimation.sample(sampleTime).value,\n delta\n )\n\n sampleAnimation.stop()\n }\n}\n","import {\n addValueToWillChange,\n animateMotionValue,\n calcLength,\n convertBoundingBoxToBox,\n convertBoxToBoundingBox,\n createBox,\n eachAxis,\n frame,\n isElementKeyboardAccessible,\n measurePageBox,\n mixNumber,\n PanInfo,\n percent,\n ResolvedConstraints,\n setDragLock,\n Transition,\n type VisualElement,\n} from \"motion-dom\"\nimport { Axis, Point, invariant } from \"motion-utils\"\nimport { addDomEvent, type LayoutUpdateData } from \"motion-dom\"\nimport { addPointerEvent } from \"../../events/add-pointer-event\"\nimport { extractEventInfo } from \"../../events/event-info\"\nimport { MotionProps } from \"../../motion/types\"\nimport { getContextWindow } from \"../../utils/get-context-window\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { PanSession } from \"../pan/PanSession\"\nimport {\n applyConstraints,\n calcOrigin,\n calcRelativeConstraints,\n calcViewportConstraints,\n defaultElastic,\n rebaseAxisConstraints,\n resolveDragElastic,\n} from \"./utils/constraints\"\n\nexport const elementDragControls = new WeakMap<\n VisualElement,\n VisualElementDragControls\n>()\n\nexport interface DragControlOptions {\n /**\n * This distance after which dragging starts and a direction is locked in.\n *\n * @public\n */\n distanceThreshold?: number\n\n /**\n * Whether to immediately snap to the cursor when dragging starts.\n *\n * @public\n */\n snapToCursor?: boolean\n}\n\ntype DragDirection = \"x\" | \"y\"\n\nexport class VisualElementDragControls {\n private visualElement: VisualElement<HTMLElement>\n\n private panSession?: PanSession\n\n private openDragLock: VoidFunction | null = null\n\n isDragging = false\n private currentDirection: DragDirection | null = null\n\n private originPoint: Point = { x: 0, y: 0 }\n\n /**\n * The permitted boundaries of travel, in pixels.\n */\n private constraints: ResolvedConstraints | false = false\n\n private hasMutatedConstraints = false\n\n /**\n * The per-axis resolved elastic values.\n */\n private elastic = createBox()\n\n /**\n * The latest pointer event. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPointerEvent: PointerEvent | null = null\n\n /**\n * The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.\n */\n private latestPanInfo: PanInfo | null = null\n\n constructor(visualElement: VisualElement<HTMLElement>) {\n this.visualElement = visualElement\n }\n\n start(\n originEvent: PointerEvent,\n { snapToCursor = false, distanceThreshold }: DragControlOptions = {}\n ) {\n /**\n * Don't start dragging if this component is exiting\n */\n const { presenceContext } = this.visualElement\n if (presenceContext && presenceContext.isPresent === false) return\n\n const onSessionStart = (event: PointerEvent) => {\n // Stop or pause animations based on context:\n // - snapToCursor: stop because we'll set new position values\n // - otherwise: pause to allow resume if no drag starts (for constraint animations)\n if (snapToCursor) {\n this.stopAnimation()\n this.snapToCursor(extractEventInfo(event).point)\n } else {\n this.pauseAnimation()\n }\n }\n\n const onStart = (event: PointerEvent, info: PanInfo) => {\n // Stop any paused animation so motion values reflect true current position\n // (pauseAnimation was called in onSessionStart to allow resume if no drag started)\n this.stopAnimation()\n\n // Attempt to grab the global drag gesture lock - maybe make this part of PanSession\n const { drag, dragPropagation, onDragStart } = this.getProps()\n\n if (drag && !dragPropagation) {\n if (this.openDragLock) this.openDragLock()\n\n this.openDragLock = setDragLock(drag)\n\n // If we don 't have the lock, don't start dragging\n if (!this.openDragLock) return\n }\n\n this.latestPointerEvent = event\n this.latestPanInfo = info\n this.isDragging = true\n\n this.currentDirection = null\n\n this.resolveConstraints()\n\n if (this.visualElement.projection) {\n this.visualElement.projection.isAnimationBlocked = true\n this.visualElement.projection.target = undefined\n }\n\n /**\n * Record gesture origin and pointer offset\n */\n eachAxis((axis) => {\n let current = this.getAxisMotionValue(axis).get() || 0\n\n /**\n * If the MotionValue is a percentage value convert to px\n */\n if (percent.test(current)) {\n const { projection } = this.visualElement\n\n if (projection && projection.layout) {\n const measuredAxis = projection.layout.layoutBox[axis]\n\n if (measuredAxis) {\n const length = calcLength(measuredAxis)\n current = length * (parseFloat(current) / 100)\n }\n }\n }\n\n this.originPoint[axis] = current\n })\n\n // Fire onDragStart event\n if (onDragStart) {\n frame.postRender(() => onDragStart(event, info))\n }\n\n addValueToWillChange(this.visualElement, \"transform\")\n\n const { animationState } = this.visualElement\n animationState && animationState.setActive(\"whileDrag\", true)\n }\n\n const onMove = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n const {\n dragPropagation,\n dragDirectionLock,\n onDirectionLock,\n onDrag,\n } = this.getProps()\n\n // If we didn't successfully receive the gesture lock, early return.\n if (!dragPropagation && !this.openDragLock) return\n\n const { offset } = info\n // Attempt to detect drag direction if directionLock is true\n if (dragDirectionLock && this.currentDirection === null) {\n this.currentDirection = getCurrentDirection(offset)\n\n // If we've successfully set a direction, notify listener\n if (this.currentDirection !== null) {\n onDirectionLock && onDirectionLock(this.currentDirection)\n }\n\n return\n }\n\n // Update each point with the latest position\n this.updateAxis(\"x\", info.point, offset)\n this.updateAxis(\"y\", info.point, offset)\n\n /**\n * Ideally we would leave the renderer to fire naturally at the end of\n * this frame but if the element is about to change layout as the result\n * of a re-render we want to ensure the browser can read the latest\n * bounding box to ensure the pointer and element don't fall out of sync.\n */\n this.visualElement.render()\n\n /**\n * This must fire after the render call as it might trigger a state\n * change which itself might trigger a layout update.\n */\n onDrag && onDrag(event, info)\n }\n\n const onSessionEnd = (event: PointerEvent, info: PanInfo) => {\n this.latestPointerEvent = event\n this.latestPanInfo = info\n\n this.stop(event, info)\n\n this.latestPointerEvent = null\n this.latestPanInfo = null\n }\n\n const resumeAnimation = () =>\n eachAxis(\n (axis) =>\n this.getAnimationState(axis) === \"paused\" &&\n this.getAxisMotionValue(axis).animation?.play()\n )\n\n const { dragSnapToOrigin } = this.getProps()\n this.panSession = new PanSession(\n originEvent,\n {\n onSessionStart,\n onStart,\n onMove,\n onSessionEnd,\n resumeAnimation,\n },\n {\n transformPagePoint: this.visualElement.getTransformPagePoint(),\n dragSnapToOrigin,\n distanceThreshold,\n contextWindow: getContextWindow(this.visualElement),\n element: this.visualElement.current,\n }\n )\n }\n\n /**\n * @internal\n */\n stop(event?: PointerEvent, panInfo?: PanInfo) {\n const finalEvent = event || this.latestPointerEvent\n const finalPanInfo = panInfo || this.latestPanInfo\n\n const isDragging = this.isDragging\n this.cancel()\n if (!isDragging || !finalPanInfo || !finalEvent) return\n\n const { velocity } = finalPanInfo\n this.startAnimation(velocity)\n\n const { onDragEnd } = this.getProps()\n if (onDragEnd) {\n frame.postRender(() => onDragEnd(finalEvent, finalPanInfo))\n }\n }\n\n /**\n * @internal\n */\n cancel() {\n this.isDragging = false\n\n const { projection, animationState } = this.visualElement\n\n if (projection) {\n projection.isAnimationBlocked = false\n }\n\n this.endPanSession()\n\n const { dragPropagation } = this.getProps()\n\n if (!dragPropagation && this.openDragLock) {\n this.openDragLock()\n this.openDragLock = null\n }\n\n animationState && animationState.setActive(\"whileDrag\", false)\n }\n\n /**\n * Clean up the pan session without modifying other drag state.\n * This is used during unmount to ensure event listeners are removed\n * without affecting projection animations or drag locks.\n * @internal\n */\n endPanSession() {\n this.panSession && this.panSession.end()\n this.panSession = undefined\n }\n\n private updateAxis(axis: DragDirection, _point: Point, offset?: Point) {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return\n\n const axisValue = this.getAxisMotionValue(axis)\n let next = this.originPoint[axis] + offset[axis]\n\n // Apply constraints\n if (this.constraints && this.constraints[axis]) {\n next = applyConstraints(\n next,\n this.constraints[axis],\n this.elastic[axis]\n )\n }\n\n axisValue.set(next)\n }\n\n private resolveConstraints() {\n const { dragConstraints, dragElastic } = this.getProps()\n\n const layout =\n this.visualElement.projection &&\n !this.visualElement.projection.layout\n ? this.visualElement.projection.measure(false)\n : this.visualElement.projection?.layout\n\n const prevConstraints = this.constraints\n\n if (dragConstraints && isRefObject(dragConstraints)) {\n if (!this.constraints) {\n this.constraints = this.resolveRefConstraints()\n }\n } else {\n if (dragConstraints && layout) {\n this.constraints = calcRelativeConstraints(\n layout.layoutBox,\n dragConstraints\n )\n } else {\n this.constraints = false\n }\n }\n\n this.elastic = resolveDragElastic(dragElastic)\n\n /**\n * If we're outputting to external MotionValues, we want to rebase the measured constraints\n * from viewport-relative to component-relative.\n */\n if (\n prevConstraints !== this.constraints &&\n layout &&\n this.constraints &&\n !this.hasMutatedConstraints\n ) {\n eachAxis((axis) => {\n if (\n this.constraints !== false &&\n this.getAxisMotionValue(axis)\n ) {\n this.constraints[axis] = rebaseAxisConstraints(\n layout.layoutBox[axis],\n this.constraints[axis]\n )\n }\n })\n }\n }\n\n private resolveRefConstraints() {\n const { dragConstraints: constraints, onMeasureDragConstraints } =\n this.getProps()\n if (!constraints || !isRefObject(constraints)) return false\n\n const constraintsElement = constraints.current as HTMLElement\n\n invariant(\n constraintsElement !== null,\n \"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.\",\n \"drag-constraints-ref\"\n )\n\n const { projection } = this.visualElement\n\n // TODO\n if (!projection || !projection.layout) return false\n\n const constraintsBox = measurePageBox(\n constraintsElement,\n projection.root!,\n this.visualElement.getTransformPagePoint()\n )\n\n let measuredConstraints = calcViewportConstraints(\n projection.layout.layoutBox,\n constraintsBox\n )\n\n /**\n * If there's an onMeasureDragConstraints listener we call it and\n * if different constraints are returned, set constraints to that\n */\n if (onMeasureDragConstraints) {\n const userConstraints = onMeasureDragConstraints(\n convertBoxToBoundingBox(measuredConstraints)\n )\n\n this.hasMutatedConstraints = !!userConstraints\n\n if (userConstraints) {\n measuredConstraints = convertBoundingBoxToBox(userConstraints)\n }\n }\n\n return measuredConstraints\n }\n\n private startAnimation(velocity: Point) {\n const {\n drag,\n dragMomentum,\n dragElastic,\n dragTransition,\n dragSnapToOrigin,\n onDragTransitionEnd,\n } = this.getProps()\n\n const constraints: Partial<ResolvedConstraints> = this.constraints || {}\n\n const momentumAnimations = eachAxis((axis) => {\n if (!shouldDrag(axis, drag, this.currentDirection)) {\n return\n }\n\n let transition = (constraints && constraints[axis]) || {}\n\n if (dragSnapToOrigin) transition = { min: 0, max: 0 }\n\n /**\n * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame\n * of spring animations so we should look into adding a disable spring option to `inertia`.\n * We could do something here where we affect the `bounceStiffness` and `bounceDamping`\n * using the value of `dragElastic`.\n */\n const bounceStiffness = dragElastic ? 200 : 1000000\n const bounceDamping = dragElastic ? 40 : 10000000\n\n const inertia: Transition = {\n type: \"inertia\",\n velocity: dragMomentum ? velocity[axis] : 0,\n bounceStiffness,\n bounceDamping,\n timeConstant: 750,\n restDelta: 1,\n restSpeed: 10,\n ...dragTransition,\n ...transition,\n }\n\n // If we're not animating on an externally-provided `MotionValue` we can use the\n // component's animation controls which will handle interactions with whileHover (etc),\n // otherwise we just have to animate the `MotionValue` itself.\n return this.startAxisValueAnimation(axis, inertia)\n })\n\n // Run all animations and then resolve the new drag constraints.\n return Promise.all(momentumAnimations).then(onDragTransitionEnd)\n }\n\n private startAxisValueAnimation(\n axis: DragDirection,\n transition: Transition\n ) {\n const axisValue = this.getAxisMotionValue(axis)\n\n addValueToWillChange(this.visualElement, axis)\n\n return axisValue.start(\n animateMotionValue(\n axis,\n axisValue,\n 0,\n transition,\n this.visualElement,\n false\n )\n )\n }\n\n private stopAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).stop())\n }\n\n private pauseAnimation() {\n eachAxis((axis) => this.getAxisMotionValue(axis).animation?.pause())\n }\n\n private getAnimationState(axis: DragDirection) {\n return this.getAxisMotionValue(axis).animation?.state\n }\n\n /**\n * Drag works differently depending on which props are provided.\n *\n * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.\n * - Otherwise, we apply the delta to the x/y motion values.\n */\n private getAxisMotionValue(axis: DragDirection) {\n const dragKey =\n `_drag${axis.toUpperCase()}` as `_drag${Uppercase<DragDirection>}`\n const props = this.visualElement.getProps()\n const externalMotionValue = props[dragKey]\n\n return externalMotionValue\n ? externalMotionValue\n : this.visualElement.getValue(\n axis,\n (props.initial\n ? props.initial[axis as keyof typeof props.initial]\n : undefined) || 0\n )\n }\n\n private snapToCursor(point: Point) {\n eachAxis((axis) => {\n const { drag } = this.getProps()\n\n // If we're not dragging this axis, do an early return.\n if (!shouldDrag(axis, drag, this.currentDirection)) return\n\n const { projection } = this.visualElement\n const axisValue = this.getAxisMotionValue(axis)\n\n if (projection && projection.layout) {\n const { min, max } = projection.layout.layoutBox[axis]\n\n /**\n * The layout measurement includes the current transform value,\n * so we need to add it back to get the correct snap position.\n * This fixes an issue where elements with initial coordinates\n * would snap to the wrong position on the first drag.\n */\n const current = axisValue.get() || 0\n\n axisValue.set(point[axis] - mixNumber(min, max, 0.5) + current)\n }\n })\n }\n\n /**\n * When the viewport resizes we want to check if the measured constraints\n * have changed and, if so, reposition the element within those new constraints\n * relative to where it was before the resize.\n */\n scalePositionWithinConstraints() {\n if (!this.visualElement.current) return\n\n const { drag, dragConstraints } = this.getProps()\n const { projection } = this.visualElement\n if (!isRefObject(dragConstraints) || !projection || !this.constraints)\n return\n\n /**\n * Stop current animations as there can be visual glitching if we try to do\n * this mid-animation\n */\n this.stopAnimation()\n\n /**\n * Record the relative position of the dragged element relative to the\n * constraints box and save as a progress value.\n */\n const boxProgress = { x: 0, y: 0 }\n eachAxis((axis) => {\n const axisValue = this.getAxisMotionValue(axis)\n if (axisValue && this.constraints !== false) {\n const latest = axisValue.get()\n boxProgress[axis] = calcOrigin(\n { min: latest, max: latest },\n this.constraints[axis] as Axis\n )\n }\n })\n\n /**\n * Update the layout of this element and resolve the latest drag constraints\n */\n const { transformTemplate } = this.visualElement.getProps()\n this.visualElement.current.style.transform = transformTemplate\n ? transformTemplate({}, \"\")\n : \"none\"\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n this.resolveConstraints()\n\n /**\n * For each axis, calculate the current progress of the layout axis\n * within the new constraints.\n */\n eachAxis((axis) => {\n if (!shouldDrag(axis, drag, null)) return\n\n /**\n * Calculate a new transform based on the previous box progress\n */\n const axisValue = this.getAxisMotionValue(axis)\n const { min, max } = (this.constraints as ResolvedConstraints)[\n axis\n ] as Axis\n axisValue.set(mixNumber(min, max, boxProgress[axis]))\n })\n }\n\n addListeners() {\n if (!this.visualElement.current) return\n elementDragControls.set(this.visualElement, this)\n const element = this.visualElement.current\n\n /**\n * Attach a pointerdown event listener on this DOM element to initiate drag tracking.\n */\n const stopPointerListener = addPointerEvent(\n element,\n \"pointerdown\",\n (event) => {\n const { drag, dragListener = true } = this.getProps()\n const target = event.target as Element\n\n /**\n * Only block drag if clicking on a keyboard-accessible child element.\n * If the draggable element itself is keyboard-accessible (e.g., motion.button),\n * dragging should still work when clicking directly on it.\n */\n const isClickingKeyboardAccessibleChild =\n target !== element &&\n isElementKeyboardAccessible(target)\n\n if (drag && dragListener && !isClickingKeyboardAccessibleChild) {\n this.start(event)\n }\n }\n )\n\n const measureDragConstraints = () => {\n const { dragConstraints } = this.getProps()\n if (isRefObject(dragConstraints) && dragConstraints.current) {\n this.constraints = this.resolveRefConstraints()\n }\n }\n\n const { projection } = this.visualElement\n\n const stopMeasureLayoutListener = projection!.addEventListener(\n \"measure\",\n measureDragConstraints\n )\n\n if (projection && !projection!.layout) {\n projection.root && projection.root.updateScroll()\n projection.updateLayout()\n }\n\n frame.read(measureDragConstraints)\n\n /**\n * Attach a window resize listener to scale the draggable target within its defined\n * constraints as the window resizes.\n */\n const stopResizeListener = addDomEvent(window, \"resize\", () =>\n this.scalePositionWithinConstraints()\n )\n\n /**\n * If the element's layout changes, calculate the delta and apply that to\n * the drag gesture's origin point.\n */\n const stopLayoutUpdateListener = projection!.addEventListener(\n \"didUpdate\",\n (({ delta, hasLayoutChanged }: LayoutUpdateData) => {\n if (this.isDragging && hasLayoutChanged) {\n eachAxis((axis) => {\n const motionValue = this.getAxisMotionValue(axis)\n if (!motionValue) return\n\n this.originPoint[axis] += delta[axis].translate\n motionValue.set(\n motionValue.get() + delta[axis].translate\n )\n })\n\n this.visualElement.render()\n }\n }) as any\n )\n\n return () => {\n stopResizeListener()\n stopPointerListener()\n stopMeasureLayoutListener()\n stopLayoutUpdateListener && stopLayoutUpdateListener()\n }\n }\n\n getProps(): MotionProps {\n const props = this.visualElement.getProps()\n const {\n drag = false,\n dragDirectionLock = false,\n dragPropagation = false,\n dragConstraints = false,\n dragElastic = defaultElastic,\n dragMomentum = true,\n } = props\n return {\n ...props,\n drag,\n dragDirectionLock,\n dragPropagation,\n dragConstraints,\n dragElastic,\n dragMomentum,\n }\n }\n}\n\nfunction shouldDrag(\n direction: DragDirection,\n drag: boolean | DragDirection | undefined,\n currentDirection: null | DragDirection\n) {\n return (\n (drag === true || drag === direction) &&\n (currentDirection === null || currentDirection === direction)\n )\n}\n\n/**\n * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower\n * than the provided threshold, return `null`.\n *\n * @param offset - The x/y offset from origin.\n * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.\n */\nfunction getCurrentDirection(\n offset: Point,\n lockThreshold = 10\n): DragDirection | null {\n let direction: DragDirection | null = null\n\n if (Math.abs(offset.y) > lockThreshold) {\n direction = \"y\"\n } else if (Math.abs(offset.x) > lockThreshold) {\n direction = \"x\"\n }\n\n return direction\n}\n\nexport function expectsResolvedDragConstraints({\n dragConstraints,\n onMeasureDragConstraints,\n}: MotionProps) {\n return isRefObject(dragConstraints) && !!onMeasureDragConstraints\n}\n","import {\n clamp,\n invariant,\n millisecondsToSeconds,\n pipe,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { time } from \"../frameloop/sync-time\"\nimport { activeAnimations } from \"../stats/animation-count\"\nimport { mix } from \"../utils/mix\"\nimport { Mixer } from \"../utils/mix/types\"\nimport { frameloopDriver } from \"./drivers/frame\"\nimport { DriverControls } from \"./drivers/types\"\nimport { inertia } from \"./generators/inertia\"\nimport { keyframes as keyframesGenerator } from \"./generators/keyframes\"\nimport { calcGeneratorDuration } from \"./generators/utils/calc-duration\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnimationState,\n GeneratorFactory,\n KeyframeGenerator,\n TimelineWithFallback,\n ValueAnimationOptions,\n} from \"./types\"\nimport { replaceTransitionType } from \"./utils/replace-transition-type\"\nimport { WithPromise } from \"./utils/WithPromise\"\n\nconst percentToProgress = (percent: number) => percent / 100\n\nexport class JSAnimation<T extends number | string>\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n state: AnimationPlayState = \"idle\"\n\n startTime: number | null = null\n\n /**\n * The driver that's controlling the animation loop. Normally this is a requestAnimationFrame loop\n * but in tests we can pass in a synchronous loop.\n */\n private driver?: DriverControls\n\n private isStopped = false\n\n private generator: KeyframeGenerator<T>\n\n private calculatedDuration: number\n\n private resolvedDuration: number\n\n private totalDuration: number\n\n private options: ValueAnimationOptions<T>\n\n /**\n * The current time of the animation.\n */\n private currentTime: number = 0\n\n /**\n * The time at which the animation was paused.\n */\n private holdTime: number | null = null\n\n /**\n * Playback speed as a factor. 0 would be stopped, -1 reverse and 2 double speed.\n */\n private playbackSpeed = 1\n\n /*\n * If our generator doesn't support mixing numbers, we need to replace keyframes with\n * [0, 100] and then make a function that maps that to the actual keyframes.\n *\n * 100 is chosen instead of 1 as it works nicer with spring animations.\n */\n private mixKeyframes: Mixer<T> | undefined\n\n private mirroredGenerator: KeyframeGenerator<T> | undefined\n\n constructor(options: ValueAnimationOptions<T>) {\n super()\n activeAnimations.mainThread++\n\n this.options = options\n this.initAnimation()\n this.play()\n\n if (options.autoplay === false) this.pause()\n }\n\n initAnimation() {\n const { options } = this\n\n replaceTransitionType(options)\n\n const {\n type = keyframesGenerator,\n repeat = 0,\n repeatDelay = 0,\n repeatType,\n velocity = 0,\n } = options\n let { keyframes } = options\n\n const generatorFactory =\n (type as GeneratorFactory) || keyframesGenerator\n\n if (\n process.env.NODE_ENV !== \"production\" &&\n generatorFactory !== keyframesGenerator\n ) {\n invariant(\n keyframes.length <= 2,\n `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes}`,\n \"spring-two-frames\"\n )\n }\n\n if (\n generatorFactory !== keyframesGenerator &&\n typeof keyframes[0] !== \"number\"\n ) {\n this.mixKeyframes = pipe(\n percentToProgress,\n mix(keyframes[0], keyframes[1])\n ) as (t: number) => T\n\n keyframes = [0 as T, 100 as T]\n }\n\n const generator = generatorFactory({ ...options, keyframes })\n\n /**\n * If we have a mirror repeat type we need to create a second generator that outputs the\n * mirrored (not reversed) animation and later ping pong between the two generators.\n */\n if (repeatType === \"mirror\") {\n this.mirroredGenerator = generatorFactory({\n ...options,\n keyframes: [...keyframes].reverse(),\n velocity: -velocity,\n })\n }\n\n /**\n * If duration is undefined and we have repeat options,\n * we need to calculate a duration from the generator.\n *\n * We set it to the generator itself to cache the duration.\n * Any timeline resolver will need to have already precalculated\n * the duration by this step.\n */\n if (generator.calculatedDuration === null) {\n generator.calculatedDuration = calcGeneratorDuration(generator)\n }\n\n const { calculatedDuration } = generator\n this.calculatedDuration = calculatedDuration\n this.resolvedDuration = calculatedDuration + repeatDelay\n this.totalDuration = this.resolvedDuration * (repeat + 1) - repeatDelay\n this.generator = generator\n }\n\n updateTime(timestamp: number) {\n const animationTime =\n Math.round(timestamp - this.startTime!) * this.playbackSpeed\n\n // Update currentTime\n if (this.holdTime !== null) {\n this.currentTime = this.holdTime\n } else {\n // Rounding the time because floating point arithmetic is not always accurate, e.g. 3000.367 - 1000.367 =\n // 2000.0000000000002. This is a problem when we are comparing the currentTime with the duration, for\n // example.\n this.currentTime = animationTime\n }\n }\n\n tick(timestamp: number, sample = false) {\n const {\n generator,\n totalDuration,\n mixKeyframes,\n mirroredGenerator,\n resolvedDuration,\n calculatedDuration,\n } = this\n\n if (this.startTime === null) return generator.next(0)\n\n const {\n delay = 0,\n keyframes,\n repeat,\n repeatType,\n repeatDelay,\n type,\n onUpdate,\n finalKeyframe,\n } = this.options\n\n /**\n * requestAnimationFrame timestamps can come through as lower than\n * the startTime as set by performance.now(). Here we prevent this,\n * though in the future it could be possible to make setting startTime\n * a pending operation that gets resolved here.\n */\n if (this.speed > 0) {\n this.startTime = Math.min(this.startTime, timestamp)\n } else if (this.speed < 0) {\n this.startTime = Math.min(\n timestamp - totalDuration / this.speed,\n this.startTime\n )\n }\n\n if (sample) {\n this.currentTime = timestamp\n } else {\n this.updateTime(timestamp)\n }\n\n // Rebase on delay\n const timeWithoutDelay =\n this.currentTime - delay * (this.playbackSpeed >= 0 ? 1 : -1)\n const isInDelayPhase =\n this.playbackSpeed >= 0\n ? timeWithoutDelay < 0\n : timeWithoutDelay > totalDuration\n this.currentTime = Math.max(timeWithoutDelay, 0)\n\n // If this animation has finished, set the current time to the total duration.\n if (this.state === \"finished\" && this.holdTime === null) {\n this.currentTime = totalDuration\n }\n\n let elapsed = this.currentTime\n let frameGenerator = generator\n\n if (repeat) {\n /**\n * Get the current progress (0-1) of the animation. If t is >\n * than duration we'll get values like 2.5 (midway through the\n * third iteration)\n */\n const progress =\n Math.min(this.currentTime, totalDuration) / resolvedDuration\n\n /**\n * Get the current iteration (0 indexed). For instance the floor of\n * 2.5 is 2.\n */\n let currentIteration = Math.floor(progress)\n\n /**\n * Get the current progress of the iteration by taking the remainder\n * so 2.5 is 0.5 through iteration 2\n */\n let iterationProgress = progress % 1.0\n\n /**\n * If iteration progress is 1 we count that as the end\n * of the previous iteration.\n */\n if (!iterationProgress && progress >= 1) {\n iterationProgress = 1\n }\n\n iterationProgress === 1 && currentIteration--\n\n currentIteration = Math.min(currentIteration, repeat + 1)\n\n /**\n * Reverse progress if we're not running in \"normal\" direction\n */\n\n const isOddIteration = Boolean(currentIteration % 2)\n if (isOddIteration) {\n if (repeatType === \"reverse\") {\n iterationProgress = 1 - iterationProgress\n if (repeatDelay) {\n iterationProgress -= repeatDelay / resolvedDuration\n }\n } else if (repeatType === \"mirror\") {\n frameGenerator = mirroredGenerator!\n }\n }\n\n elapsed = clamp(0, 1, iterationProgress) * resolvedDuration\n }\n\n /**\n * If we're in negative time, set state as the initial keyframe.\n * This prevents delay: x, duration: 0 animations from finishing\n * instantly.\n */\n const state = isInDelayPhase\n ? { done: false, value: keyframes[0] }\n : frameGenerator.next(elapsed)\n\n if (mixKeyframes) {\n state.value = mixKeyframes(state.value as number)\n }\n\n let { done } = state\n\n if (!isInDelayPhase && calculatedDuration !== null) {\n done =\n this.playbackSpeed >= 0\n ? this.currentTime >= totalDuration\n : this.currentTime <= 0\n }\n\n const isAnimationFinished =\n this.holdTime === null &&\n (this.state === \"finished\" || (this.state === \"running\" && done))\n\n // TODO: The exception for inertia could be cleaner here\n if (isAnimationFinished && type !== inertia) {\n state.value = getFinalKeyframe(\n keyframes,\n this.options,\n finalKeyframe,\n this.speed\n )\n }\n\n if (onUpdate) {\n onUpdate(state.value)\n }\n\n if (isAnimationFinished) {\n this.finish()\n }\n\n return state\n }\n\n /**\n * Allows the returned animation to be awaited or promise-chained. Currently\n * resolves when the animation finishes at all but in a future update could/should\n * reject if its cancels.\n */\n then(resolve: VoidFunction, reject?: VoidFunction) {\n return this.finished.then(resolve, reject)\n }\n\n get duration() {\n return millisecondsToSeconds(this.calculatedDuration)\n }\n\n get iterationDuration() {\n const { delay = 0 } = this.options || {}\n return this.duration + millisecondsToSeconds(delay)\n }\n\n get time() {\n return millisecondsToSeconds(this.currentTime)\n }\n\n set time(newTime: number) {\n newTime = secondsToMilliseconds(newTime)\n this.currentTime = newTime\n\n if (\n this.startTime === null ||\n this.holdTime !== null ||\n this.playbackSpeed === 0\n ) {\n this.holdTime = newTime\n } else if (this.driver) {\n this.startTime = this.driver.now() - newTime / this.playbackSpeed\n }\n\n this.driver?.start(false)\n }\n\n get speed() {\n return this.playbackSpeed\n }\n\n set speed(newSpeed: number) {\n this.updateTime(time.now())\n const hasChanged = this.playbackSpeed !== newSpeed\n this.playbackSpeed = newSpeed\n\n if (hasChanged) {\n this.time = millisecondsToSeconds(this.currentTime)\n }\n }\n\n play() {\n if (this.isStopped) return\n\n const { driver = frameloopDriver, startTime } = this.options\n\n if (!this.driver) {\n this.driver = driver((timestamp) => this.tick(timestamp))\n }\n\n this.options.onPlay?.()\n\n const now = this.driver.now()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n this.startTime = now\n } else if (this.holdTime !== null) {\n this.startTime = now - this.holdTime\n } else if (!this.startTime) {\n this.startTime = startTime ?? now\n }\n\n if (this.state === \"finished\" && this.speed < 0) {\n this.startTime += this.calculatedDuration\n }\n\n this.holdTime = null\n\n /**\n * Set playState to running only after we've used it in\n * the previous logic.\n */\n this.state = \"running\"\n\n this.driver.start()\n }\n\n pause() {\n this.state = \"paused\"\n this.updateTime(time.now())\n this.holdTime = this.currentTime\n }\n\n /**\n * This method is bound to the instance to fix a pattern where\n * animation.stop is returned as a reference from a useEffect.\n */\n stop = () => {\n const { motionValue } = this.options\n if (motionValue && motionValue.updatedAt !== time.now()) {\n this.tick(time.now())\n }\n\n this.isStopped = true\n if (this.state === \"idle\") return\n this.teardown()\n this.options.onStop?.()\n }\n\n complete() {\n if (this.state !== \"running\") {\n this.play()\n }\n\n this.state = \"finished\"\n this.holdTime = null\n }\n\n finish() {\n this.notifyFinished()\n this.teardown()\n this.state = \"finished\"\n\n this.options.onComplete?.()\n }\n\n cancel() {\n this.holdTime = null\n this.startTime = 0\n this.tick(0)\n this.teardown()\n this.options.onCancel?.()\n }\n\n private teardown() {\n this.state = \"idle\"\n this.stopDriver()\n this.startTime = this.holdTime = null\n activeAnimations.mainThread--\n }\n\n private stopDriver() {\n if (!this.driver) return\n this.driver.stop()\n this.driver = undefined\n }\n\n sample(sampleTime: number): AnimationState<T> {\n this.startTime = 0\n return this.tick(sampleTime, true)\n }\n\n attachTimeline(timeline: TimelineWithFallback): VoidFunction {\n if (this.options.allowFlatten) {\n this.options.type = \"keyframes\"\n this.options.ease = \"linear\"\n this.initAnimation()\n }\n\n this.driver?.stop()\n return timeline.observe(this)\n }\n}\n\n// Legacy function support\nexport function animateValue<T extends number | string>(\n options: ValueAnimationOptions<T>\n) {\n return new JSAnimation(options)\n}\n","import { MotionProps } from \"../types\"\n\n/**\n * A list of all valid MotionProps.\n *\n * @privateRemarks\n * This doesn't throw if a `MotionProp` name is missing - it should.\n */\nconst validMotionProps = new Set<keyof MotionProps>([\n \"animate\",\n \"exit\",\n \"variants\",\n \"initial\",\n \"style\",\n \"values\",\n \"variants\",\n \"transition\",\n \"transformTemplate\",\n \"custom\",\n \"inherit\",\n \"onBeforeLayoutMeasure\",\n \"onAnimationStart\",\n \"onAnimationComplete\",\n \"onUpdate\",\n \"onDragStart\",\n \"onDrag\",\n \"onDragEnd\",\n \"onMeasureDragConstraints\",\n \"onDirectionLock\",\n \"onDragTransitionEnd\",\n \"_dragX\",\n \"_dragY\",\n \"onHoverStart\",\n \"onHoverEnd\",\n \"onViewportEnter\",\n \"onViewportLeave\",\n \"globalTapTarget\",\n \"ignoreStrict\",\n \"viewport\",\n])\n\n/**\n * Check whether a prop name is a valid `MotionProp` key.\n *\n * @param key - Name of the property to check\n * @returns `true` is key is a valid `MotionProp`.\n *\n * @public\n */\nexport function isValidMotionProp(key: string) {\n return (\n key.startsWith(\"while\") ||\n (key.startsWith(\"drag\") && key !== \"draggable\") ||\n key.startsWith(\"layout\") ||\n key.startsWith(\"onTap\") ||\n key.startsWith(\"onPan\") ||\n key.startsWith(\"onLayout\") ||\n validMotionProps.has(key as keyof MotionProps)\n )\n}\n","import { Box } from \"motion-utils\"\nimport {\n isNumericalString,\n isZeroValueString,\n SubscriptionManager,\n warnOnce,\n} from \"motion-utils\"\nimport { cancelFrame, frame } from \"../frameloop\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { time } from \"../frameloop/sync-time\"\nimport { motionValue, MotionValue } from \"../value\"\nimport { isMotionValue } from \"../value/utils/is-motion-value\"\nimport { KeyframeResolver } from \"../animation/keyframes/KeyframesResolver\"\nimport type { AnyResolvedKeyframe } from \"../animation/types\"\nimport { transformProps } from \"./utils/keys-transform\"\nimport { complex } from \"../value/types/complex\"\nimport { findValueType } from \"../value/types/utils/find\"\nimport { getAnimatableNone } from \"../value/types/utils/animatable-none\"\nimport type { MotionNodeOptions } from \"../node/types\"\nimport { createBox } from \"../projection/geometry/models\"\nimport {\n initPrefersReducedMotion,\n hasReducedMotionListener,\n prefersReducedMotion,\n} from \"./utils/reduced-motion\"\nimport { visualElementStore } from \"./store\"\nimport {\n ResolvedValues,\n VisualElementEventCallbacks,\n VisualElementOptions,\n PresenceContextProps,\n ReducedMotionConfig,\n FeatureDefinitions,\n MotionConfigContextProps,\n} from \"./types\"\nimport { AnimationState } from \"./utils/animation-state\"\nimport {\n isControllingVariants as checkIsControllingVariants,\n isVariantNode as checkIsVariantNode,\n} from \"./utils/is-controlling-variants\"\nimport { updateMotionValuesFromProps } from \"./utils/motion-values\"\nimport { resolveVariantFromProps } from \"./utils/resolve-variants\"\nimport { Feature } from \"./Feature\"\n\nconst propEventHandlers = [\n \"AnimationStart\",\n \"AnimationComplete\",\n \"Update\",\n \"BeforeLayoutMeasure\",\n \"LayoutMeasure\",\n \"LayoutAnimationStart\",\n \"LayoutAnimationComplete\",\n] as const\n\n/**\n * Static feature definitions - can be injected by framework layer\n */\nlet featureDefinitions: Partial<FeatureDefinitions> = {}\n\n/**\n * Set feature definitions for all VisualElements.\n * This should be called by the framework layer (e.g., framer-motion) during initialization.\n */\nexport function setFeatureDefinitions(definitions: Partial<FeatureDefinitions>) {\n featureDefinitions = definitions\n}\n\n/**\n * Get the current feature definitions\n */\nexport function getFeatureDefinitions(): Partial<FeatureDefinitions> {\n return featureDefinitions\n}\n\n/**\n * Motion style type - a subset of CSS properties that can contain motion values\n */\nexport type MotionStyle = {\n [K: string]: AnyResolvedKeyframe | MotionValue | undefined\n}\n\n/**\n * A VisualElement is an imperative abstraction around UI elements such as\n * HTMLElement, SVGElement, Three.Object3D etc.\n */\nexport abstract class VisualElement<\n Instance = unknown,\n RenderState = unknown,\n Options extends {} = {}\n> {\n /**\n * VisualElements are arranged in trees mirroring that of the React tree.\n * Each type of VisualElement has a unique name, to detect when we're crossing\n * type boundaries within that tree.\n */\n abstract type: string\n\n /**\n * An `Array.sort` compatible function that will compare two Instances and\n * compare their respective positions within the tree.\n */\n abstract sortInstanceNodePosition(a: Instance, b: Instance): number\n\n /**\n * Measure the viewport-relative bounding box of the Instance.\n */\n abstract measureInstanceViewportBox(\n instance: Instance,\n props: MotionNodeOptions & Partial<MotionConfigContextProps>\n ): Box\n\n /**\n * When a value has been removed from all animation props we need to\n * pick a target to animate back to. For instance, for HTMLElements\n * we can look in the style prop.\n */\n abstract getBaseTargetFromProps(\n props: MotionNodeOptions,\n key: string\n ): AnyResolvedKeyframe | undefined | MotionValue\n\n /**\n * When we first animate to a value we need to animate it *from* a value.\n * Often this have been specified via the initial prop but it might be\n * that the value needs to be read from the Instance.\n */\n abstract readValueFromInstance(\n instance: Instance,\n key: string,\n options: Options\n ): AnyResolvedKeyframe | null | undefined\n\n /**\n * When a value has been removed from the VisualElement we use this to remove\n * it from the inherting class' unique render state.\n */\n abstract removeValueFromRenderState(\n key: string,\n renderState: RenderState\n ): void\n\n /**\n * Run before a React or VisualElement render, builds the latest motion\n * values into an Instance-specific format. For example, HTMLVisualElement\n * will use this step to build `style` and `var` values.\n */\n abstract build(\n renderState: RenderState,\n latestValues: ResolvedValues,\n props: MotionNodeOptions\n ): void\n\n /**\n * Apply the built values to the Instance. For example, HTMLElements will have\n * styles applied via `setProperty` and the style attribute, whereas SVGElements\n * will have values applied to attributes.\n */\n abstract renderInstance(\n instance: Instance,\n renderState: RenderState,\n styleProp?: MotionStyle,\n projection?: any\n ): void\n\n /**\n * This method is called when a transform property is bound to a motion value.\n * It's currently used to measure SVG elements when a new transform property is bound.\n */\n onBindTransform?(): void\n\n /**\n * If the component child is provided as a motion value, handle subscriptions\n * with the renderer-specific VisualElement.\n */\n handleChildMotionValue?(): void\n\n /**\n * This method takes React props and returns found MotionValues. For example, HTML\n * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.\n *\n * This isn't an abstract method as it needs calling in the constructor, but it is\n * intended to be one.\n */\n scrapeMotionValuesFromProps(\n _props: MotionNodeOptions,\n _prevProps: MotionNodeOptions,\n _visualElement: VisualElement\n ): {\n [key: string]: MotionValue | AnyResolvedKeyframe\n } {\n return {}\n }\n\n /**\n * A reference to the current underlying Instance, e.g. a HTMLElement\n * or Three.Mesh etc.\n */\n current: Instance | null = null\n\n /**\n * A reference to the parent VisualElement (if exists).\n */\n parent: VisualElement | undefined\n\n /**\n * A set containing references to this VisualElement's children.\n */\n children = new Set<VisualElement>()\n\n /**\n * A set containing the latest children of this VisualElement. This is flushed\n * at the start of every commit. We use it to calculate the stagger delay\n * for newly-added children.\n */\n enteringChildren?: Set<VisualElement>\n\n /**\n * The depth of this VisualElement within the overall VisualElement tree.\n */\n depth: number\n\n /**\n * The current render state of this VisualElement. Defined by inherting VisualElements.\n */\n renderState: RenderState\n\n /**\n * An object containing the latest static values for each of this VisualElement's\n * MotionValues.\n */\n latestValues: ResolvedValues\n\n /**\n * Determine what role this visual element should take in the variant tree.\n */\n isVariantNode: boolean = false\n isControllingVariants: boolean = false\n\n /**\n * If this component is part of the variant tree, it should track\n * any children that are also part of the tree. This is essentially\n * a shadow tree to simplify logic around how to stagger over children.\n */\n variantChildren?: Set<VisualElement>\n\n /**\n * Decides whether this VisualElement should animate in reduced motion\n * mode.\n *\n * TODO: This is currently set on every individual VisualElement but feels\n * like it could be set globally.\n */\n shouldReduceMotion: boolean | null = null\n\n /**\n * Normally, if a component is controlled by a parent's variants, it can\n * rely on that ancestor to trigger animations further down the tree.\n * However, if a component is created after its parent is mounted, the parent\n * won't trigger that mount animation so the child needs to.\n *\n * TODO: This might be better replaced with a method isParentMounted\n */\n manuallyAnimateOnMount: boolean\n\n /**\n * This can be set by AnimatePresence to force components that mount\n * at the same time as it to mount as if they have initial={false} set.\n */\n blockInitialAnimation: boolean\n\n /**\n * A reference to this VisualElement's projection node, used in layout animations.\n */\n projection?: any\n\n /**\n * A map of all motion values attached to this visual element. Motion\n * values are source of truth for any given animated value. A motion\n * value might be provided externally by the component via props.\n */\n values = new Map<string, MotionValue>()\n\n /**\n * The AnimationState, this is hydrated by the animation Feature.\n */\n animationState?: AnimationState\n\n KeyframeResolver = KeyframeResolver\n\n /**\n * The options used to create this VisualElement. The Options type is defined\n * by the inheriting VisualElement and is passed straight through to the render functions.\n */\n readonly options: Options\n\n /**\n * A reference to the latest props provided to the VisualElement's host React component.\n */\n props: MotionNodeOptions\n prevProps?: MotionNodeOptions\n\n presenceContext: PresenceContextProps | null\n prevPresenceContext?: PresenceContextProps | null\n\n /**\n * Cleanup functions for active features (hover/tap/exit etc)\n */\n private features: {\n [K in keyof FeatureDefinitions]?: Feature<Instance>\n } = {}\n\n /**\n * A map of every subscription that binds the provided or generated\n * motion values onChange listeners to this visual element.\n */\n private valueSubscriptions = new Map<string, VoidFunction>()\n\n /**\n * A reference to the ReducedMotionConfig passed to the VisualElement's host React component.\n */\n private reducedMotionConfig: ReducedMotionConfig | undefined\n\n /**\n * On mount, this will be hydrated with a callback to disconnect\n * this visual element from its parent on unmount.\n */\n private removeFromVariantTree: undefined | VoidFunction\n\n /**\n * A reference to the previously-provided motion values as returned\n * from scrapeMotionValuesFromProps. We use the keys in here to determine\n * if any motion values need to be removed after props are updated.\n */\n private prevMotionValues: MotionStyle = {}\n\n /**\n * When values are removed from all animation props we need to search\n * for a fallback value to animate to. These values are tracked in baseTarget.\n */\n private baseTarget: ResolvedValues\n\n /**\n * Create an object of the values we initially animated from (if initial prop present).\n */\n private initialValues: ResolvedValues\n\n /**\n * An object containing a SubscriptionManager for each active event.\n */\n private events: {\n [key: string]: SubscriptionManager<any>\n } = {}\n\n /**\n * An object containing an unsubscribe function for each prop event subscription.\n * For example, every \"Update\" event can have multiple subscribers via\n * VisualElement.on(), but only one of those can be defined via the onUpdate prop.\n */\n private propEventSubscriptions: {\n [key: string]: VoidFunction\n } = {}\n\n constructor(\n {\n parent,\n props,\n presenceContext,\n reducedMotionConfig,\n blockInitialAnimation,\n visualState,\n }: VisualElementOptions<Instance, RenderState>,\n options: Options = {} as any\n ) {\n const { latestValues, renderState } = visualState\n this.latestValues = latestValues\n this.baseTarget = { ...latestValues }\n this.initialValues = props.initial ? { ...latestValues } : {}\n this.renderState = renderState\n this.parent = parent\n this.props = props\n this.presenceContext = presenceContext\n this.depth = parent ? parent.depth + 1 : 0\n this.reducedMotionConfig = reducedMotionConfig\n this.options = options\n this.blockInitialAnimation = Boolean(blockInitialAnimation)\n\n this.isControllingVariants = checkIsControllingVariants(props)\n this.isVariantNode = checkIsVariantNode(props)\n if (this.isVariantNode) {\n this.variantChildren = new Set()\n }\n\n this.manuallyAnimateOnMount = Boolean(parent && parent.current)\n\n /**\n * Any motion values that are provided to the element when created\n * aren't yet bound to the element, as this would technically be impure.\n * However, we iterate through the motion values and set them to the\n * initial values for this component.\n *\n * TODO: This is impure and we should look at changing this to run on mount.\n * Doing so will break some tests but this isn't necessarily a breaking change,\n * more a reflection of the test.\n */\n const { willChange, ...initialMotionValues } =\n this.scrapeMotionValuesFromProps(props, {}, this)\n\n for (const key in initialMotionValues) {\n const value = initialMotionValues[key]\n\n if (latestValues[key] !== undefined && isMotionValue(value)) {\n value.set(latestValues[key])\n }\n }\n }\n\n mount(instance: Instance) {\n this.current = instance\n\n visualElementStore.set(instance, this)\n\n if (this.projection && !this.projection.instance) {\n this.projection.mount(instance)\n }\n\n if (this.parent && this.isVariantNode && !this.isControllingVariants) {\n this.removeFromVariantTree = this.parent.addVariantChild(this)\n }\n\n this.values.forEach((value, key) => this.bindToMotionValue(key, value))\n\n /**\n * Determine reduced motion preference. Only initialize the matchMedia\n * listener if we actually need the dynamic value (i.e., when config\n * is neither \"never\" nor \"always\").\n */\n if (this.reducedMotionConfig === \"never\") {\n this.shouldReduceMotion = false\n } else if (this.reducedMotionConfig === \"always\") {\n this.shouldReduceMotion = true\n } else {\n if (!hasReducedMotionListener.current) {\n initPrefersReducedMotion()\n }\n this.shouldReduceMotion = prefersReducedMotion.current\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n warnOnce(\n this.shouldReduceMotion !== true,\n \"You have Reduced Motion enabled on your device. Animations may not appear as expected.\",\n \"reduced-motion-disabled\"\n )\n }\n\n this.parent?.addChild(this)\n\n this.update(this.props, this.presenceContext)\n }\n\n unmount() {\n this.projection && this.projection.unmount()\n cancelFrame(this.notifyUpdate)\n cancelFrame(this.render)\n this.valueSubscriptions.forEach((remove) => remove())\n this.valueSubscriptions.clear()\n this.removeFromVariantTree && this.removeFromVariantTree()\n this.parent?.removeChild(this)\n\n for (const key in this.events) {\n this.events[key].clear()\n }\n\n for (const key in this.features) {\n const feature = this.features[key as keyof typeof this.features]\n if (feature) {\n feature.unmount()\n feature.isMounted = false\n }\n }\n this.current = null\n }\n\n addChild(child: VisualElement) {\n this.children.add(child)\n this.enteringChildren ??= new Set()\n this.enteringChildren.add(child)\n }\n\n removeChild(child: VisualElement) {\n this.children.delete(child)\n this.enteringChildren && this.enteringChildren.delete(child)\n }\n\n private bindToMotionValue(key: string, value: MotionValue) {\n if (this.valueSubscriptions.has(key)) {\n this.valueSubscriptions.get(key)!()\n }\n\n const valueIsTransform = transformProps.has(key)\n\n if (valueIsTransform && this.onBindTransform) {\n this.onBindTransform()\n }\n\n const removeOnChange = value.on(\n \"change\",\n (latestValue: AnyResolvedKeyframe) => {\n this.latestValues[key] = latestValue\n\n this.props.onUpdate && frame.preRender(this.notifyUpdate)\n\n if (valueIsTransform && this.projection) {\n this.projection.isTransformDirty = true\n }\n\n this.scheduleRender()\n }\n )\n\n let removeSyncCheck: VoidFunction | void\n if (typeof window !== \"undefined\" && (window as any).MotionCheckAppearSync) {\n removeSyncCheck = (window as any).MotionCheckAppearSync(this, key, value)\n }\n\n this.valueSubscriptions.set(key, () => {\n removeOnChange()\n if (removeSyncCheck) removeSyncCheck()\n if (value.owner) value.stop()\n })\n }\n\n sortNodePosition(other: VisualElement<Instance>) {\n /**\n * If these nodes aren't even of the same type we can't compare their depth.\n */\n if (\n !this.current ||\n !this.sortInstanceNodePosition ||\n this.type !== other.type\n ) {\n return 0\n }\n\n return this.sortInstanceNodePosition(\n this.current as Instance,\n other.current as Instance\n )\n }\n\n updateFeatures() {\n let key: keyof typeof featureDefinitions = \"animation\"\n\n for (key in featureDefinitions) {\n const featureDefinition = featureDefinitions[key]\n\n if (!featureDefinition) continue\n\n const { isEnabled, Feature: FeatureConstructor } = featureDefinition\n\n /**\n * If this feature is enabled but not active, make a new instance.\n */\n if (\n !this.features[key] &&\n FeatureConstructor &&\n isEnabled(this.props)\n ) {\n this.features[key] = new FeatureConstructor(this) as any\n }\n\n /**\n * If we have a feature, mount or update it.\n */\n if (this.features[key]) {\n const feature = this.features[key]!\n if (feature.isMounted) {\n feature.update()\n } else {\n feature.mount()\n feature.isMounted = true\n }\n }\n }\n }\n\n notifyUpdate = () => this.notify(\"Update\", this.latestValues)\n\n triggerBuild() {\n this.build(this.renderState, this.latestValues, this.props)\n }\n\n render = () => {\n if (!this.current) return\n this.triggerBuild()\n this.renderInstance(\n this.current,\n this.renderState,\n (this.props as any).style,\n this.projection\n )\n }\n\n private renderScheduledAt = 0.0\n scheduleRender = () => {\n const now = time.now()\n if (this.renderScheduledAt < now) {\n this.renderScheduledAt = now\n frame.render(this.render, false, true)\n }\n }\n\n /**\n * Measure the current viewport box with or without transforms.\n * Only measures axis-aligned boxes, rotate and skew must be manually\n * removed with a re-render to work.\n */\n measureViewportBox() {\n return this.current\n ? this.measureInstanceViewportBox(this.current, this.props)\n : createBox()\n }\n\n getStaticValue(key: string) {\n return this.latestValues[key]\n }\n\n setStaticValue(key: string, value: AnyResolvedKeyframe) {\n this.latestValues[key] = value\n }\n\n /**\n * Update the provided props. Ensure any newly-added motion values are\n * added to our map, old ones removed, and listeners updated.\n */\n update(props: MotionNodeOptions, presenceContext: PresenceContextProps | null) {\n if (props.transformTemplate || this.props.transformTemplate) {\n this.scheduleRender()\n }\n\n this.prevProps = this.props\n this.props = props\n\n this.prevPresenceContext = this.presenceContext\n this.presenceContext = presenceContext\n\n /**\n * Update prop event handlers ie onAnimationStart, onAnimationComplete\n */\n for (let i = 0; i < propEventHandlers.length; i++) {\n const key = propEventHandlers[i]\n if (this.propEventSubscriptions[key]) {\n this.propEventSubscriptions[key]()\n delete this.propEventSubscriptions[key]\n }\n\n const listenerName = (\"on\" + key) as keyof typeof props\n const listener = props[listenerName]\n if (listener) {\n this.propEventSubscriptions[key] = this.on(key as any, listener)\n }\n }\n\n this.prevMotionValues = updateMotionValuesFromProps(\n this,\n this.scrapeMotionValuesFromProps(props, this.prevProps || {}, this),\n this.prevMotionValues\n )\n\n if (this.handleChildMotionValue) {\n this.handleChildMotionValue()\n }\n }\n\n getProps() {\n return this.props\n }\n\n /**\n * Returns the variant definition with a given name.\n */\n getVariant(name: string) {\n return this.props.variants ? this.props.variants[name] : undefined\n }\n\n /**\n * Returns the defined default transition on this component.\n */\n getDefaultTransition() {\n return this.props.transition\n }\n\n getTransformPagePoint() {\n return (this.props as any).transformPagePoint\n }\n\n getClosestVariantNode(): VisualElement | undefined {\n return this.isVariantNode\n ? this\n : this.parent\n ? this.parent.getClosestVariantNode()\n : undefined\n }\n\n /**\n * Add a child visual element to our set of children.\n */\n addVariantChild(child: VisualElement) {\n const closestVariantNode = this.getClosestVariantNode()\n if (closestVariantNode) {\n closestVariantNode.variantChildren &&\n closestVariantNode.variantChildren.add(child)\n return () => closestVariantNode.variantChildren!.delete(child)\n }\n }\n\n /**\n * Add a motion value and bind it to this visual element.\n */\n addValue(key: string, value: MotionValue) {\n // Remove existing value if it exists\n const existingValue = this.values.get(key)\n\n if (value !== existingValue) {\n if (existingValue) this.removeValue(key)\n this.bindToMotionValue(key, value)\n this.values.set(key, value)\n this.latestValues[key] = value.get()\n }\n }\n\n /**\n * Remove a motion value and unbind any active subscriptions.\n */\n removeValue(key: string) {\n this.values.delete(key)\n const unsubscribe = this.valueSubscriptions.get(key)\n if (unsubscribe) {\n unsubscribe()\n this.valueSubscriptions.delete(key)\n }\n delete this.latestValues[key]\n this.removeValueFromRenderState(key, this.renderState)\n }\n\n /**\n * Check whether we have a motion value for this key\n */\n hasValue(key: string) {\n return this.values.has(key)\n }\n\n /**\n * Get a motion value for this key. If called with a default\n * value, we'll create one if none exists.\n */\n getValue(key: string): MotionValue | undefined\n getValue(key: string, defaultValue: AnyResolvedKeyframe | null): MotionValue\n getValue(\n key: string,\n defaultValue?: AnyResolvedKeyframe | null\n ): MotionValue | undefined {\n if (this.props.values && this.props.values[key]) {\n return this.props.values[key]\n }\n\n let value = this.values.get(key)\n\n if (value === undefined && defaultValue !== undefined) {\n value = motionValue(\n defaultValue === null ? undefined : defaultValue,\n { owner: this }\n )\n this.addValue(key, value)\n }\n\n return value\n }\n\n /**\n * If we're trying to animate to a previously unencountered value,\n * we need to check for it in our state and as a last resort read it\n * directly from the instance (which might have performance implications).\n */\n readValue(key: string, target?: AnyResolvedKeyframe | null) {\n let value =\n this.latestValues[key] !== undefined || !this.current\n ? this.latestValues[key]\n : this.getBaseTargetFromProps(this.props, key) ??\n this.readValueFromInstance(this.current, key, this.options)\n\n if (value !== undefined && value !== null) {\n if (\n typeof value === \"string\" &&\n (isNumericalString(value) || isZeroValueString(value))\n ) {\n // If this is a number read as a string, ie \"0\" or \"200\", convert it to a number\n value = parseFloat(value)\n } else if (!findValueType(value) && complex.test(target)) {\n value = getAnimatableNone(key, target as string)\n }\n\n this.setBaseTarget(key, isMotionValue(value) ? value.get() : value)\n }\n\n return isMotionValue(value) ? value.get() : value\n }\n\n /**\n * Set the base target to later animate back to. This is currently\n * only hydrated on creation and when we first read a value.\n */\n setBaseTarget(key: string, value: AnyResolvedKeyframe) {\n this.baseTarget[key] = value\n }\n\n /**\n * Find the base target for a value thats been removed from all animation\n * props.\n */\n getBaseTarget(key: string): ResolvedValues[string] | undefined | null {\n const { initial } = this.props\n\n let valueFromInitial: ResolvedValues[string] | undefined | null\n\n if (typeof initial === \"string\" || typeof initial === \"object\") {\n const variant = resolveVariantFromProps(\n this.props,\n initial as any,\n this.presenceContext?.custom\n )\n if (variant) {\n valueFromInitial = variant[\n key as keyof typeof variant\n ] as string\n }\n }\n\n /**\n * If this value still exists in the current initial variant, read that.\n */\n if (initial && valueFromInitial !== undefined) {\n return valueFromInitial\n }\n\n /**\n * Alternatively, if this VisualElement config has defined a getBaseTarget\n * so we can read the value from an alternative source, try that.\n */\n const target = this.getBaseTargetFromProps(this.props, key)\n if (target !== undefined && !isMotionValue(target)) return target\n\n /**\n * If the value was initially defined on initial, but it doesn't any more,\n * return undefined. Otherwise return the value as initially read from the DOM.\n */\n return this.initialValues[key] !== undefined &&\n valueFromInitial === undefined\n ? undefined\n : this.baseTarget[key]\n }\n\n on<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n callback: VisualElementEventCallbacks[EventName]\n ) {\n if (!this.events[eventName]) {\n this.events[eventName] = new SubscriptionManager()\n }\n\n return this.events[eventName].add(callback)\n }\n\n notify<EventName extends keyof VisualElementEventCallbacks>(\n eventName: EventName,\n ...args: any\n ) {\n if (this.events[eventName]) {\n this.events[eventName].notify(...args)\n }\n }\n\n scheduleRenderMicrotask() {\n microtask.render(this.render)\n }\n}\n","\"use client\"\n\nimport { invariant, warning } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, useContext } from \"react\"\nimport { LayoutGroupContext } from \"../context/LayoutGroupContext\"\nimport { LazyContext } from \"../context/LazyContext\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { MotionContext } from \"../context/MotionContext\"\nimport { useCreateMotionContext } from \"../context/MotionContext/create\"\nimport { DOMMotionComponents } from \"../render/dom/types\"\nimport { useRender } from \"../render/dom/use-render\"\nimport { isSVGComponent } from \"../render/dom/utils/is-svg-component\"\nimport { HTMLRenderState } from \"../render/html/types\"\nimport { useHTMLVisualState } from \"../render/html/use-html-visual-state\"\nimport { SVGRenderState } from \"../render/svg/types\"\nimport { useSVGVisualState } from \"../render/svg/use-svg-visual-state\"\nimport { CreateVisualElement } from \"../render/types\"\nimport { isBrowser } from \"../utils/is-browser\"\nimport { getInitializedFeatureDefinitions } from \"./features/definitions\"\nimport { loadFeatures } from \"./features/load-features\"\nimport { FeatureBundle, FeaturePackages } from \"./features/types\"\nimport { MotionProps } from \"./types\"\nimport { motionComponentSymbol } from \"./utils/symbol\"\nimport { useMotionRef } from \"./utils/use-motion-ref\"\nimport { useVisualElement } from \"./utils/use-visual-element\"\n\nexport interface MotionComponentConfig<\n TagName extends keyof DOMMotionComponents | string = \"div\"\n> {\n preloadedFeatures?: FeatureBundle\n createVisualElement?: CreateVisualElement\n Component: TagName | React.ComponentType<React.PropsWithChildren<unknown>>\n forwardMotionProps?: boolean\n}\n\nexport type MotionComponentProps<Props> = {\n [K in Exclude<keyof Props, keyof MotionProps>]?: Props[K]\n} & MotionProps\n\nexport type MotionComponent<T, P> = T extends keyof DOMMotionComponents\n ? DOMMotionComponents[T]\n : React.ComponentType<\n Omit<MotionComponentProps<P>, \"children\"> & {\n children?: \"children\" extends keyof P\n ? P[\"children\"] | MotionComponentProps<P>[\"children\"]\n : MotionComponentProps<P>[\"children\"]\n }\n >\n\nexport interface MotionComponentOptions {\n forwardMotionProps?: boolean\n /**\n * Specify whether the component renders an HTML or SVG element.\n * This is useful when wrapping custom SVG components that need\n * SVG-specific attribute handling (like viewBox animation).\n * By default, Motion auto-detects based on the component name,\n * but custom React components are always treated as HTML.\n */\n type?: \"html\" | \"svg\"\n}\n\n/**\n * Create a `motion` component.\n *\n * This function accepts a Component argument, which can be either a string (ie \"div\"\n * for `motion.div`), or an actual React component.\n *\n * Alongside this is a config option which provides a way of rendering the provided\n * component \"offline\", or outside the React render cycle.\n */\nexport function createMotionComponent<\n Props,\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n { forwardMotionProps = false, type }: MotionComponentOptions = {},\n preloadedFeatures?: FeaturePackages,\n createVisualElement?: CreateVisualElement<Props, TagName>\n) {\n preloadedFeatures && loadFeatures(preloadedFeatures)\n\n /**\n * Determine whether to use SVG or HTML rendering based on:\n * 1. Explicit `type` option (highest priority)\n * 2. Auto-detection via `isSVGComponent`\n */\n const isSVG = type ? type === \"svg\" : isSVGComponent(Component)\n const useVisualState = isSVG ? useSVGVisualState : useHTMLVisualState\n\n function MotionDOMComponent(\n props: MotionComponentProps<Props>,\n externalRef?: React.Ref<HTMLElement | SVGElement>\n ) {\n /**\n * If we need to measure the element we load this functionality in a\n * separate class component in order to gain access to getSnapshotBeforeUpdate.\n */\n let MeasureLayout: undefined | React.ComponentType<MotionProps>\n\n const configAndProps = {\n ...useContext(MotionConfigContext),\n ...props,\n layoutId: useLayoutId(props),\n }\n\n const { isStatic } = configAndProps\n\n const context = useCreateMotionContext<HTMLElement | SVGElement>(props)\n\n const visualState = useVisualState(props, isStatic)\n\n if (!isStatic && isBrowser) {\n useStrictMode(configAndProps, preloadedFeatures)\n\n const layoutProjection = getProjectionFunctionality(configAndProps)\n MeasureLayout = layoutProjection.MeasureLayout\n\n /**\n * Create a VisualElement for this component. A VisualElement provides a common\n * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as\n * providing a way of rendering to these APIs outside of the React render loop\n * for more performant animations and interactions\n */\n context.visualElement = useVisualElement(\n Component,\n visualState,\n configAndProps,\n createVisualElement,\n layoutProjection.ProjectionNode,\n isSVG\n )\n }\n\n /**\n * The mount order and hierarchy is specific to ensure our element ref\n * is hydrated by the time features fire their effects.\n */\n return (\n <MotionContext.Provider value={context}>\n {MeasureLayout && context.visualElement ? (\n <MeasureLayout\n visualElement={context.visualElement}\n {...configAndProps}\n />\n ) : null}\n {useRender<Props, TagName>(\n Component,\n props,\n useMotionRef<\n HTMLElement | SVGElement,\n HTMLRenderState | SVGRenderState\n >(visualState, context.visualElement, externalRef),\n visualState,\n isStatic,\n forwardMotionProps,\n isSVG\n )}\n </MotionContext.Provider>\n )\n }\n\n MotionDOMComponent.displayName = `motion.${\n typeof Component === \"string\"\n ? Component\n : `create(${Component.displayName ?? Component.name ?? \"\"})`\n }`\n\n const ForwardRefMotionComponent = forwardRef(MotionDOMComponent as any)\n ;(ForwardRefMotionComponent as any)[motionComponentSymbol] = Component\n\n return ForwardRefMotionComponent as MotionComponent<TagName, Props>\n}\n\nfunction useLayoutId({ layoutId }: MotionProps) {\n const layoutGroupId = useContext(LayoutGroupContext).id\n return layoutGroupId && layoutId !== undefined\n ? layoutGroupId + \"-\" + layoutId\n : layoutId\n}\n\nfunction useStrictMode(\n configAndProps: MotionProps,\n preloadedFeatures?: FeaturePackages\n) {\n const isStrict = useContext(LazyContext).strict\n\n /**\n * If we're in development mode, check to make sure we're not rendering a motion component\n * as a child of LazyMotion, as this will break the file-size benefits of using it.\n */\n if (\n process.env.NODE_ENV !== \"production\" &&\n preloadedFeatures &&\n isStrict\n ) {\n const strictMessage =\n \"You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.\"\n configAndProps.ignoreStrict\n ? warning(false, strictMessage, \"lazy-strict-mode\")\n : invariant(false, strictMessage, \"lazy-strict-mode\")\n }\n}\n\nfunction getProjectionFunctionality(props: MotionProps) {\n const featureDefinitions = getInitializedFeatureDefinitions()\n const { drag, layout } = featureDefinitions\n\n if (!drag && !layout) return {}\n\n const combined = { ...drag, ...layout }\n\n return {\n MeasureLayout:\n drag?.isEnabled(props) || layout?.isEnabled(props)\n ? combined.MeasureLayout\n : undefined,\n ProjectionNode: combined.ProjectionNode,\n }\n}\n","\"use client\";\n\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\nimport { cjk } from \"@streamdown/cjk\";\nimport { code } from \"@streamdown/code\";\nimport { math } from \"@streamdown/math\";\nimport { mermaid } from \"@streamdown/mermaid\";\nimport { BrainIcon, ChevronDownIcon } from \"lucide-react\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { createContext, memo, useContext, useEffect, useState } from \"react\";\nimport { Streamdown } from \"streamdown\";\nimport { LinkSafetyModal } from \"./message\";\nimport { Shimmer } from \"./shimmer\";\n\ninterface ReasoningContextValue {\n isStreaming: boolean;\n isOpen: boolean;\n setIsOpen: (open: boolean) => void;\n duration: number | undefined;\n}\n\nconst ReasoningContext = createContext<ReasoningContextValue | null>(null);\n\nexport const useReasoning = () => {\n const context = useContext(ReasoningContext);\n if (!context) {\n throw new Error(\"Reasoning components must be used within Reasoning\");\n }\n return context;\n};\n\nexport type ReasoningProps = ComponentProps<typeof Collapsible> & {\n isStreaming?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n duration?: number;\n};\n\nconst AUTO_CLOSE_DELAY = 1000;\nconst MS_IN_S = 1000;\n\nexport const Reasoning = memo(\n ({\n className,\n isStreaming = false,\n open,\n defaultOpen = true,\n onOpenChange,\n duration: durationProp,\n children,\n ...props\n }: ReasoningProps) => {\n const [isOpen, setIsOpen] = useControllableState({\n prop: open,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n const [duration, setDuration] = useControllableState({\n prop: durationProp,\n defaultProp: undefined,\n });\n\n const [hasAutoClosed, setHasAutoClosed] = useState(false);\n const [startTime, setStartTime] = useState<number | null>(null);\n\n // Track duration when streaming starts and ends\n useEffect(() => {\n if (isStreaming) {\n if (startTime === null) {\n setStartTime(Date.now());\n }\n } else if (startTime !== null) {\n setDuration(Math.ceil((Date.now() - startTime) / MS_IN_S));\n setStartTime(null);\n }\n }, [isStreaming, startTime, setDuration]);\n\n // Auto-open when streaming starts, auto-close when streaming ends (once only)\n useEffect(() => {\n if (defaultOpen && !isStreaming && isOpen && !hasAutoClosed) {\n // Add a small delay before closing to allow user to see the content\n const timer = setTimeout(() => {\n setIsOpen(false);\n setHasAutoClosed(true);\n }, AUTO_CLOSE_DELAY);\n\n return () => clearTimeout(timer);\n }\n }, [isStreaming, isOpen, defaultOpen, setIsOpen, hasAutoClosed]);\n\n const handleOpenChange = (newOpen: boolean) => {\n setIsOpen(newOpen);\n };\n\n return (\n <ReasoningContext.Provider\n value={{ isStreaming, isOpen, setIsOpen, duration }}\n >\n <Collapsible\n className={cn(\"not-prose mb-4\", className)}\n onOpenChange={handleOpenChange}\n open={isOpen}\n {...props}\n >\n {children}\n </Collapsible>\n </ReasoningContext.Provider>\n );\n }\n);\n\nexport type ReasoningTriggerProps = ComponentProps<\n typeof CollapsibleTrigger\n> & {\n getThinkingMessage?: (isStreaming: boolean, duration?: number) => ReactNode;\n};\n\nconst defaultGetThinkingMessage = (isStreaming: boolean, duration?: number) => {\n if (isStreaming || duration === 0) {\n return <Shimmer duration={1}>Thinking...</Shimmer>;\n }\n if (duration === undefined) {\n return <p>Thought for a few seconds</p>;\n }\n return <p>Thought for {duration} seconds</p>;\n};\n\nexport const ReasoningTrigger = memo(\n ({\n className,\n children,\n getThinkingMessage = defaultGetThinkingMessage,\n ...props\n }: ReasoningTriggerProps) => {\n const { isStreaming, isOpen, duration } = useReasoning();\n\n return (\n <CollapsibleTrigger\n className={cn(\n \"flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n <BrainIcon className=\"size-4\" />\n {getThinkingMessage(isStreaming, duration)}\n <ChevronDownIcon\n className={cn(\n \"size-4 transition-transform\",\n isOpen ? \"rotate-180\" : \"rotate-0\"\n )}\n />\n </>\n )}\n </CollapsibleTrigger>\n );\n }\n);\n\nexport type ReasoningContentProps = ComponentProps<\n typeof CollapsibleContent\n> & {\n children: string;\n};\n\nexport const ReasoningContent = memo(\n ({ className, children, ...props }: ReasoningContentProps) => (\n <CollapsibleContent\n className={cn(\n \"mt-4 text-sm\",\n \"data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in\",\n className\n )}\n {...props}\n >\n <Streamdown\n plugins={{ code, mermaid, math, cjk }}\n linkSafety={{ enabled: true, renderModal: LinkSafetyModal }}\n {...props}\n >\n {children}\n </Streamdown>\n </CollapsibleContent>\n )\n);\n\nReasoning.displayName = \"Reasoning\";\nReasoningTrigger.displayName = \"ReasoningTrigger\";\nReasoningContent.displayName = \"ReasoningContent\";\n","\"use client\";\n\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from \"@/components/ui/command\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@/components/ui/hover-card\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupTextarea,\n} from \"@/components/ui/input-group\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { cn } from \"@/lib/utils\";\nimport type { ChatStatus, FileUIPart, SourceDocumentUIPart } from \"ai\";\nimport {\n CornerDownLeftIcon,\n ImageIcon,\n Loader2Icon,\n PlusIcon,\n SquareIcon,\n XIcon,\n} from \"lucide-react\";\nimport { nanoid } from \"nanoid\";\nimport {\n type ChangeEvent,\n type ChangeEventHandler,\n Children,\n type ClipboardEventHandler,\n type ComponentProps,\n createContext,\n type FormEvent,\n type FormEventHandler,\n type HTMLAttributes,\n type KeyboardEventHandler,\n type PropsWithChildren,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\n// ============================================================================\n// Provider Context & Types\n// ============================================================================\n\nexport interface AttachmentsContext {\n files: (FileUIPart & { id: string })[];\n add: (files: File[] | FileList) => void;\n remove: (id: string) => void;\n clear: () => void;\n openFileDialog: () => void;\n fileInputRef: RefObject<HTMLInputElement | null>;\n}\n\nexport interface TextInputContext {\n value: string;\n setInput: (v: string) => void;\n clear: () => void;\n}\n\nexport interface PromptInputControllerProps {\n textInput: TextInputContext;\n attachments: AttachmentsContext;\n /** INTERNAL: Allows PromptInput to register its file textInput + \"open\" callback */\n __registerFileInput: (\n ref: RefObject<HTMLInputElement | null>,\n open: () => void\n ) => void;\n}\n\nconst PromptInputController = createContext<PromptInputControllerProps | null>(\n null\n);\nconst ProviderAttachmentsContext = createContext<AttachmentsContext | null>(\n null\n);\n\nexport const usePromptInputController = () => {\n const ctx = useContext(PromptInputController);\n if (!ctx) {\n throw new Error(\n \"Wrap your component inside <PromptInputProvider> to use usePromptInputController().\"\n );\n }\n return ctx;\n};\n\n// Optional variants (do NOT throw). Useful for dual-mode components.\nconst useOptionalPromptInputController = () =>\n useContext(PromptInputController);\n\nexport const useProviderAttachments = () => {\n const ctx = useContext(ProviderAttachmentsContext);\n if (!ctx) {\n throw new Error(\n \"Wrap your component inside <PromptInputProvider> to use useProviderAttachments().\"\n );\n }\n return ctx;\n};\n\nconst useOptionalProviderAttachments = () =>\n useContext(ProviderAttachmentsContext);\n\nexport type PromptInputProviderProps = PropsWithChildren<{\n initialInput?: string;\n}>;\n\n/**\n * Optional global provider that lifts PromptInput state outside of PromptInput.\n * If you don't use it, PromptInput stays fully self-managed.\n */\nexport function PromptInputProvider({\n initialInput: initialTextInput = \"\",\n children,\n}: PromptInputProviderProps) {\n // ----- textInput state\n const [textInput, setTextInput] = useState(initialTextInput);\n const clearInput = useCallback(() => setTextInput(\"\"), []);\n\n // ----- attachments state (global when wrapped)\n const [attachmentFiles, setAttachmentFiles] = useState<\n (FileUIPart & { id: string })[]\n >([]);\n const fileInputRef = useRef<HTMLInputElement | null>(null);\n const openRef = useRef<() => void>(() => undefined);\n\n const add = useCallback((files: File[] | FileList) => {\n const incoming = Array.from(files);\n if (incoming.length === 0) {\n return;\n }\n\n setAttachmentFiles((prev) =>\n prev.concat(\n incoming.map((file) => ({\n id: nanoid(),\n type: \"file\" as const,\n url: URL.createObjectURL(file),\n mediaType: file.type,\n filename: file.name,\n }))\n )\n );\n }, []);\n\n const remove = useCallback((id: string) => {\n setAttachmentFiles((prev) => {\n const found = prev.find((f) => f.id === id);\n if (found?.url) {\n URL.revokeObjectURL(found.url);\n }\n return prev.filter((f) => f.id !== id);\n });\n }, []);\n\n const clear = useCallback(() => {\n setAttachmentFiles((prev) => {\n for (const f of prev) {\n if (f.url) {\n URL.revokeObjectURL(f.url);\n }\n }\n return [];\n });\n }, []);\n\n // Keep a ref to attachments for cleanup on unmount (avoids stale closure)\n const attachmentsRef = useRef(attachmentFiles);\n attachmentsRef.current = attachmentFiles;\n\n // Cleanup blob URLs on unmount to prevent memory leaks\n useEffect(\n () => () => {\n for (const f of attachmentsRef.current) {\n if (f.url) {\n URL.revokeObjectURL(f.url);\n }\n }\n },\n []\n );\n\n const openFileDialog = useCallback(() => {\n openRef.current?.();\n }, []);\n\n const attachments = useMemo<AttachmentsContext>(\n () => ({\n files: attachmentFiles,\n add,\n remove,\n clear,\n openFileDialog,\n fileInputRef,\n }),\n [attachmentFiles, add, remove, clear, openFileDialog]\n );\n\n const __registerFileInput = useCallback(\n (ref: RefObject<HTMLInputElement | null>, open: () => void) => {\n fileInputRef.current = ref.current;\n openRef.current = open;\n },\n []\n );\n\n const controller = useMemo<PromptInputControllerProps>(\n () => ({\n textInput: {\n value: textInput,\n setInput: setTextInput,\n clear: clearInput,\n },\n attachments,\n __registerFileInput,\n }),\n [textInput, clearInput, attachments, __registerFileInput]\n );\n\n return (\n <PromptInputController.Provider value={controller}>\n <ProviderAttachmentsContext.Provider value={attachments}>\n {children}\n </ProviderAttachmentsContext.Provider>\n </PromptInputController.Provider>\n );\n}\n\n// ============================================================================\n// Component Context & Hooks\n// ============================================================================\n\nconst LocalAttachmentsContext = createContext<AttachmentsContext | null>(null);\n\nexport const usePromptInputAttachments = () => {\n // Prefer local context (inside PromptInput) as it has validation, fall back to provider\n const provider = useOptionalProviderAttachments();\n const local = useContext(LocalAttachmentsContext);\n const context = local ?? provider;\n if (!context) {\n throw new Error(\n \"usePromptInputAttachments must be used within a PromptInput or PromptInputProvider\"\n );\n }\n return context;\n};\n\n// ============================================================================\n// Referenced Sources (Local to PromptInput)\n// ============================================================================\n\nexport interface ReferencedSourcesContext {\n sources: (SourceDocumentUIPart & { id: string })[];\n add: (sources: SourceDocumentUIPart[] | SourceDocumentUIPart) => void;\n remove: (id: string) => void;\n clear: () => void;\n}\n\nexport const LocalReferencedSourcesContext =\n createContext<ReferencedSourcesContext | null>(null);\n\nexport const usePromptInputReferencedSources = () => {\n const ctx = useContext(LocalReferencedSourcesContext);\n if (!ctx) {\n throw new Error(\n \"usePromptInputReferencedSources must be used within a LocalReferencedSourcesContext.Provider\"\n );\n }\n return ctx;\n};\n\nexport type PromptInputActionAddAttachmentsProps = ComponentProps<\n typeof DropdownMenuItem\n> & {\n label?: string;\n};\n\nexport const PromptInputActionAddAttachments = ({\n label = \"Add photos or files\",\n ...props\n}: PromptInputActionAddAttachmentsProps) => {\n const attachments = usePromptInputAttachments();\n\n return (\n <DropdownMenuItem\n {...props}\n onSelect={(e) => {\n e.preventDefault();\n attachments.openFileDialog();\n }}\n >\n <ImageIcon className=\"mr-2 size-4\" /> {label}\n </DropdownMenuItem>\n );\n};\n\nexport interface PromptInputMessage {\n text: string;\n files: FileUIPart[];\n}\n\nexport type PromptInputProps = Omit<\n HTMLAttributes<HTMLFormElement>,\n \"onSubmit\" | \"onError\"\n> & {\n accept?: string; // e.g., \"image/*\" or leave undefined for any\n multiple?: boolean;\n // When true, accepts drops anywhere on document. Default false (opt-in).\n globalDrop?: boolean;\n // Render a hidden input with given name and keep it in sync for native form posts. Default false.\n syncHiddenInput?: boolean;\n // Minimal constraints\n maxFiles?: number;\n maxFileSize?: number; // bytes\n onError?: (err: {\n code: \"max_files\" | \"max_file_size\" | \"accept\";\n message: string;\n }) => void;\n onSubmit: (\n message: PromptInputMessage,\n event: FormEvent<HTMLFormElement>\n ) => void | Promise<void>;\n};\n\nexport const PromptInput = ({\n className,\n accept,\n multiple,\n globalDrop,\n syncHiddenInput,\n maxFiles,\n maxFileSize,\n onError,\n onSubmit,\n children,\n ...props\n}: PromptInputProps) => {\n // Try to use a provider controller if present\n const controller = useOptionalPromptInputController();\n const usingProvider = !!controller;\n\n // Refs\n const inputRef = useRef<HTMLInputElement | null>(null);\n const formRef = useRef<HTMLFormElement | null>(null);\n\n // ----- Local attachments (only used when no provider)\n const [items, setItems] = useState<(FileUIPart & { id: string })[]>([]);\n const files = usingProvider ? controller.attachments.files : items;\n\n // ----- Local referenced sources (always local to PromptInput)\n const [referencedSources, setReferencedSources] = useState<\n (SourceDocumentUIPart & { id: string })[]\n >([]);\n\n // Keep a ref to files for cleanup on unmount (avoids stale closure)\n const filesRef = useRef(files);\n filesRef.current = files;\n\n const openFileDialogLocal = useCallback(() => {\n inputRef.current?.click();\n }, []);\n\n const matchesAccept = useCallback(\n (f: File) => {\n if (!accept || accept.trim() === \"\") {\n return true;\n }\n\n const patterns = accept\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n return patterns.some((pattern) => {\n if (pattern.endsWith(\"/*\")) {\n const prefix = pattern.slice(0, -1); // e.g: image/* -> image/\n return f.type.startsWith(prefix);\n }\n return f.type === pattern;\n });\n },\n [accept]\n );\n\n const addLocal = useCallback(\n (fileList: File[] | FileList) => {\n const incoming = Array.from(fileList);\n const accepted = incoming.filter((f) => matchesAccept(f));\n if (incoming.length && accepted.length === 0) {\n onError?.({\n code: \"accept\",\n message: \"No files match the accepted types.\",\n });\n return;\n }\n const withinSize = (f: File) =>\n maxFileSize ? f.size <= maxFileSize : true;\n const sized = accepted.filter(withinSize);\n if (accepted.length > 0 && sized.length === 0) {\n onError?.({\n code: \"max_file_size\",\n message: \"All files exceed the maximum size.\",\n });\n return;\n }\n\n setItems((prev) => {\n const capacity =\n typeof maxFiles === \"number\"\n ? Math.max(0, maxFiles - prev.length)\n : undefined;\n const capped =\n typeof capacity === \"number\" ? sized.slice(0, capacity) : sized;\n if (typeof capacity === \"number\" && sized.length > capacity) {\n onError?.({\n code: \"max_files\",\n message: \"Too many files. Some were not added.\",\n });\n }\n const next: (FileUIPart & { id: string })[] = [];\n for (const file of capped) {\n next.push({\n id: nanoid(),\n type: \"file\",\n url: URL.createObjectURL(file),\n mediaType: file.type,\n filename: file.name,\n });\n }\n return prev.concat(next);\n });\n },\n [matchesAccept, maxFiles, maxFileSize, onError]\n );\n\n const removeLocal = useCallback(\n (id: string) =>\n setItems((prev) => {\n const found = prev.find((file) => file.id === id);\n if (found?.url) {\n URL.revokeObjectURL(found.url);\n }\n return prev.filter((file) => file.id !== id);\n }),\n []\n );\n\n // Wrapper that validates files before calling provider's add\n const addWithProviderValidation = useCallback(\n (fileList: File[] | FileList) => {\n const incoming = Array.from(fileList);\n const accepted = incoming.filter((f) => matchesAccept(f));\n if (incoming.length && accepted.length === 0) {\n onError?.({\n code: \"accept\",\n message: \"No files match the accepted types.\",\n });\n return;\n }\n const withinSize = (f: File) =>\n maxFileSize ? f.size <= maxFileSize : true;\n const sized = accepted.filter(withinSize);\n if (accepted.length > 0 && sized.length === 0) {\n onError?.({\n code: \"max_file_size\",\n message: \"All files exceed the maximum size.\",\n });\n return;\n }\n\n const currentCount = files.length;\n const capacity =\n typeof maxFiles === \"number\"\n ? Math.max(0, maxFiles - currentCount)\n : undefined;\n const capped =\n typeof capacity === \"number\" ? sized.slice(0, capacity) : sized;\n if (typeof capacity === \"number\" && sized.length > capacity) {\n onError?.({\n code: \"max_files\",\n message: \"Too many files. Some were not added.\",\n });\n }\n\n if (capped.length > 0) {\n controller?.attachments.add(capped);\n }\n },\n [matchesAccept, maxFileSize, maxFiles, onError, files.length, controller]\n );\n\n const clearAttachments = useCallback(\n () =>\n usingProvider\n ? controller?.attachments.clear()\n : setItems((prev) => {\n for (const file of prev) {\n if (file.url) {\n URL.revokeObjectURL(file.url);\n }\n }\n return [];\n }),\n [usingProvider, controller]\n );\n\n const clearReferencedSources = useCallback(\n () => setReferencedSources([]),\n []\n );\n\n const add = usingProvider ? addWithProviderValidation : addLocal;\n const remove = usingProvider ? controller.attachments.remove : removeLocal;\n const openFileDialog = usingProvider\n ? controller.attachments.openFileDialog\n : openFileDialogLocal;\n\n const clear = useCallback(() => {\n clearAttachments();\n clearReferencedSources();\n }, [clearAttachments, clearReferencedSources]);\n\n // Let provider know about our hidden file input so external menus can call openFileDialog()\n useEffect(() => {\n if (!usingProvider) {\n return;\n }\n controller.__registerFileInput(inputRef, () => inputRef.current?.click());\n }, [usingProvider, controller]);\n\n // Note: File input cannot be programmatically set for security reasons\n // The syncHiddenInput prop is no longer functional\n useEffect(() => {\n if (syncHiddenInput && inputRef.current && files.length === 0) {\n inputRef.current.value = \"\";\n }\n }, [files, syncHiddenInput]);\n\n // Attach drop handlers on nearest form and document (opt-in)\n useEffect(() => {\n const form = formRef.current;\n if (!form) {\n return;\n }\n if (globalDrop) {\n return; // when global drop is on, let the document-level handler own drops\n }\n\n const onDragOver = (e: DragEvent) => {\n if (e.dataTransfer?.types?.includes(\"Files\")) {\n e.preventDefault();\n }\n };\n const onDrop = (e: DragEvent) => {\n if (e.dataTransfer?.types?.includes(\"Files\")) {\n e.preventDefault();\n }\n if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {\n add(e.dataTransfer.files);\n }\n };\n form.addEventListener(\"dragover\", onDragOver);\n form.addEventListener(\"drop\", onDrop);\n return () => {\n form.removeEventListener(\"dragover\", onDragOver);\n form.removeEventListener(\"drop\", onDrop);\n };\n }, [add, globalDrop]);\n\n useEffect(() => {\n if (!globalDrop) {\n return;\n }\n\n const onDragOver = (e: DragEvent) => {\n if (e.dataTransfer?.types?.includes(\"Files\")) {\n e.preventDefault();\n }\n };\n const onDrop = (e: DragEvent) => {\n if (e.dataTransfer?.types?.includes(\"Files\")) {\n e.preventDefault();\n }\n if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {\n add(e.dataTransfer.files);\n }\n };\n document.addEventListener(\"dragover\", onDragOver);\n document.addEventListener(\"drop\", onDrop);\n return () => {\n document.removeEventListener(\"dragover\", onDragOver);\n document.removeEventListener(\"drop\", onDrop);\n };\n }, [add, globalDrop]);\n\n useEffect(\n () => () => {\n if (!usingProvider) {\n for (const f of filesRef.current) {\n if (f.url) {\n URL.revokeObjectURL(f.url);\n }\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- cleanup only on unmount; filesRef always current\n [usingProvider]\n );\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (event.currentTarget.files) {\n add(event.currentTarget.files);\n }\n // Reset input value to allow selecting files that were previously removed\n event.currentTarget.value = \"\";\n };\n\n const convertBlobUrlToDataUrl = async (\n url: string\n ): Promise<string | null> => {\n try {\n const response = await fetch(url);\n const blob = await response.blob();\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result as string);\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(blob);\n });\n } catch {\n return null;\n }\n };\n\n const attachmentsCtx = useMemo<AttachmentsContext>(\n () => ({\n files: files.map((item) => ({ ...item, id: item.id })),\n add,\n remove,\n clear: clearAttachments,\n openFileDialog,\n fileInputRef: inputRef,\n }),\n [files, add, remove, clearAttachments, openFileDialog]\n );\n\n const refsCtx = useMemo<ReferencedSourcesContext>(\n () => ({\n sources: referencedSources,\n add: (incoming: SourceDocumentUIPart[] | SourceDocumentUIPart) => {\n const array = Array.isArray(incoming) ? incoming : [incoming];\n setReferencedSources((prev) =>\n prev.concat(array.map((s) => ({ ...s, id: nanoid() })))\n );\n },\n remove: (id: string) => {\n setReferencedSources((prev) => prev.filter((s) => s.id !== id));\n },\n clear: clearReferencedSources,\n }),\n [referencedSources, clearReferencedSources]\n );\n\n const handleSubmit: FormEventHandler<HTMLFormElement> = (event) => {\n event.preventDefault();\n\n const form = event.currentTarget;\n const text = usingProvider\n ? controller.textInput.value\n : (() => {\n const formData = new FormData(form);\n return (formData.get(\"message\") as string) || \"\";\n })();\n\n // Reset form immediately after capturing text to avoid race condition\n // where user input during async blob conversion would be lost\n if (!usingProvider) {\n form.reset();\n }\n\n // Convert blob URLs to data URLs asynchronously\n Promise.all(\n files.map(async ({ id, ...item }) => {\n if (item.url?.startsWith(\"blob:\")) {\n const dataUrl = await convertBlobUrlToDataUrl(item.url);\n // If conversion failed, keep the original blob URL\n return {\n ...item,\n url: dataUrl ?? item.url,\n };\n }\n return item;\n })\n )\n .then((convertedFiles: FileUIPart[]) => {\n try {\n const result = onSubmit({ text, files: convertedFiles }, event);\n\n // Handle both sync and async onSubmit\n if (result instanceof Promise) {\n result\n .then(() => {\n clear();\n if (usingProvider) {\n controller.textInput.clear();\n }\n })\n .catch(() => {\n // Don't clear on error - user may want to retry\n });\n } else {\n // Sync function completed without throwing, clear inputs\n clear();\n if (usingProvider) {\n controller.textInput.clear();\n }\n }\n } catch {\n // Don't clear on error - user may want to retry\n }\n })\n .catch(() => {\n // Don't clear on error - user may want to retry\n });\n };\n\n // Render with or without local provider\n const inner = (\n <>\n <input\n accept={accept}\n aria-label=\"Upload files\"\n className=\"hidden\"\n multiple={multiple}\n onChange={handleChange}\n ref={inputRef}\n title=\"Upload files\"\n type=\"file\"\n />\n <form\n className={cn(\"w-full\", className)}\n onSubmit={handleSubmit}\n ref={formRef}\n {...props}\n >\n <InputGroup className=\"overflow-hidden\">{children}</InputGroup>\n </form>\n </>\n );\n\n const withReferencedSources = (\n <LocalReferencedSourcesContext.Provider value={refsCtx}>\n {inner}\n </LocalReferencedSourcesContext.Provider>\n );\n\n // Always provide LocalAttachmentsContext so children get validated add function\n return (\n <LocalAttachmentsContext.Provider value={attachmentsCtx}>\n {withReferencedSources}\n </LocalAttachmentsContext.Provider>\n );\n};\n\nexport type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputBody = ({\n className,\n ...props\n}: PromptInputBodyProps) => (\n <div className={cn(\"contents\", className)} {...props} />\n);\n\nexport type PromptInputTextareaProps = ComponentProps<\n typeof InputGroupTextarea\n>;\n\nexport const PromptInputTextarea = ({\n onChange,\n onKeyDown,\n className,\n placeholder = \"What would you like to know?\",\n ...props\n}: PromptInputTextareaProps) => {\n const controller = useOptionalPromptInputController();\n const attachments = usePromptInputAttachments();\n const [isComposing, setIsComposing] = useState(false);\n\n const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = (e) => {\n // Call the external onKeyDown handler first\n onKeyDown?.(e);\n\n // If the external handler prevented default, don't run internal logic\n if (e.defaultPrevented) {\n return;\n }\n\n if (e.key === \"Enter\") {\n if (isComposing || e.nativeEvent.isComposing) {\n return;\n }\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n\n // Check if the submit button is disabled before submitting\n const form = e.currentTarget.form;\n const submitButton = form?.querySelector(\n 'button[type=\"submit\"]'\n ) as HTMLButtonElement | null;\n if (submitButton?.disabled) {\n return;\n }\n\n form?.requestSubmit();\n }\n\n // Remove last attachment when Backspace is pressed and textarea is empty\n if (\n e.key === \"Backspace\" &&\n e.currentTarget.value === \"\" &&\n attachments.files.length > 0\n ) {\n e.preventDefault();\n const lastAttachment = attachments.files.at(-1);\n if (lastAttachment) {\n attachments.remove(lastAttachment.id);\n }\n }\n };\n\n const handlePaste: ClipboardEventHandler<HTMLTextAreaElement> = (event) => {\n const items = event.clipboardData?.items;\n\n if (!items) {\n return;\n }\n\n const files: File[] = [];\n\n for (const item of items) {\n if (item.kind === \"file\") {\n const file = item.getAsFile();\n if (file) {\n files.push(file);\n }\n }\n }\n\n if (files.length > 0) {\n event.preventDefault();\n attachments.add(files);\n }\n };\n\n const controlledProps = controller\n ? {\n value: controller.textInput.value,\n onChange: (e: ChangeEvent<HTMLTextAreaElement>) => {\n controller.textInput.setInput(e.currentTarget.value);\n onChange?.(e);\n },\n }\n : {\n onChange,\n };\n\n return (\n <InputGroupTextarea\n className={cn(\"field-sizing-content max-h-48 min-h-16\", className)}\n name=\"message\"\n onCompositionEnd={() => setIsComposing(false)}\n onCompositionStart={() => setIsComposing(true)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n placeholder={placeholder}\n {...props}\n {...controlledProps}\n />\n );\n};\n\nexport type PromptInputHeaderProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n \"align\"\n>;\n\nexport const PromptInputHeader = ({\n className,\n ...props\n}: PromptInputHeaderProps) => (\n <InputGroupAddon\n align=\"block-end\"\n className={cn(\"order-first flex-wrap gap-1\", className)}\n {...props}\n />\n);\n\nexport type PromptInputFooterProps = Omit<\n ComponentProps<typeof InputGroupAddon>,\n \"align\"\n>;\n\nexport const PromptInputFooter = ({\n className,\n ...props\n}: PromptInputFooterProps) => (\n <InputGroupAddon\n align=\"block-end\"\n className={cn(\"justify-between gap-1\", className)}\n {...props}\n />\n);\n\nexport type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputTools = ({\n className,\n ...props\n}: PromptInputToolsProps) => (\n <div className={cn(\"flex items-center gap-1\", className)} {...props} />\n);\n\nexport type PromptInputButtonProps = ComponentProps<typeof InputGroupButton>;\n\nexport const PromptInputButton = ({\n variant = \"ghost\",\n className,\n size,\n ...props\n}: PromptInputButtonProps) => {\n const newSize =\n size ?? (Children.count(props.children) > 1 ? \"sm\" : \"icon-sm\");\n\n return (\n <InputGroupButton\n className={cn(className)}\n size={newSize}\n type=\"button\"\n variant={variant}\n {...props}\n />\n );\n};\n\nexport type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;\nexport const PromptInputActionMenu = (props: PromptInputActionMenuProps) => (\n <DropdownMenu {...props} />\n);\n\nexport type PromptInputActionMenuTriggerProps = PromptInputButtonProps;\n\nexport const PromptInputActionMenuTrigger = ({\n className,\n children,\n ...props\n}: PromptInputActionMenuTriggerProps) => (\n <DropdownMenuTrigger asChild>\n <PromptInputButton className={className} {...props}>\n {children ?? <PlusIcon className=\"size-4\" />}\n </PromptInputButton>\n </DropdownMenuTrigger>\n);\n\nexport type PromptInputActionMenuContentProps = ComponentProps<\n typeof DropdownMenuContent\n>;\nexport const PromptInputActionMenuContent = ({\n className,\n ...props\n}: PromptInputActionMenuContentProps) => (\n <DropdownMenuContent align=\"start\" className={cn(className)} {...props} />\n);\n\nexport type PromptInputActionMenuItemProps = ComponentProps<\n typeof DropdownMenuItem\n>;\nexport const PromptInputActionMenuItem = ({\n className,\n ...props\n}: PromptInputActionMenuItemProps) => (\n <DropdownMenuItem className={cn(className)} {...props} />\n);\n\n// Note: Actions that perform side-effects (like opening a file dialog)\n// are provided in opt-in modules (e.g., prompt-input-attachments).\n\nexport type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {\n status?: ChatStatus;\n onStop?: () => void;\n};\n\nexport const PromptInputSubmit = ({\n className,\n variant = \"default\",\n size = \"icon-sm\",\n status,\n onStop,\n onClick,\n children,\n ...props\n}: PromptInputSubmitProps) => {\n const isGenerating = status === \"submitted\" || status === \"streaming\";\n\n let Icon = <CornerDownLeftIcon className=\"size-4\" />;\n\n if (status === \"submitted\") {\n Icon = <Loader2Icon className=\"size-4 animate-spin\" />;\n } else if (status === \"streaming\") {\n Icon = <SquareIcon className=\"size-4\" />;\n } else if (status === \"error\") {\n Icon = <XIcon className=\"size-4\" />;\n }\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n if (isGenerating && onStop) {\n e.preventDefault();\n onStop();\n return;\n }\n onClick?.(e);\n };\n\n return (\n <InputGroupButton\n aria-label={isGenerating ? \"Stop\" : \"Submit\"}\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={isGenerating && onStop ? \"button\" : \"submit\"}\n variant={variant}\n {...props}\n >\n {children ?? Icon}\n </InputGroupButton>\n );\n};\n\nexport type PromptInputSelectProps = ComponentProps<typeof Select>;\n\nexport const PromptInputSelect = (props: PromptInputSelectProps) => (\n <Select {...props} />\n);\n\nexport type PromptInputSelectTriggerProps = ComponentProps<\n typeof SelectTrigger\n>;\n\nexport const PromptInputSelectTrigger = ({\n className,\n ...props\n}: PromptInputSelectTriggerProps) => (\n <SelectTrigger\n className={cn(\n \"border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors\",\n \"hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground\",\n className\n )}\n {...props}\n />\n);\n\nexport type PromptInputSelectContentProps = ComponentProps<\n typeof SelectContent\n>;\n\nexport const PromptInputSelectContent = ({\n className,\n ...props\n}: PromptInputSelectContentProps) => (\n <SelectContent className={cn(className)} {...props} />\n);\n\nexport type PromptInputSelectItemProps = ComponentProps<typeof SelectItem>;\n\nexport const PromptInputSelectItem = ({\n className,\n ...props\n}: PromptInputSelectItemProps) => (\n <SelectItem className={cn(className)} {...props} />\n);\n\nexport type PromptInputSelectValueProps = ComponentProps<typeof SelectValue>;\n\nexport const PromptInputSelectValue = ({\n className,\n ...props\n}: PromptInputSelectValueProps) => (\n <SelectValue className={cn(className)} {...props} />\n);\n\nexport type PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;\n\nexport const PromptInputHoverCard = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}: PromptInputHoverCardProps) => (\n <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />\n);\n\nexport type PromptInputHoverCardTriggerProps = ComponentProps<\n typeof HoverCardTrigger\n>;\n\nexport const PromptInputHoverCardTrigger = (\n props: PromptInputHoverCardTriggerProps\n) => <HoverCardTrigger {...props} />;\n\nexport type PromptInputHoverCardContentProps = ComponentProps<\n typeof HoverCardContent\n>;\n\nexport const PromptInputHoverCardContent = ({\n align = \"start\",\n ...props\n}: PromptInputHoverCardContentProps) => (\n <HoverCardContent align={align} {...props} />\n);\n\nexport type PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputTabsList = ({\n className,\n ...props\n}: PromptInputTabsListProps) => <div className={cn(className)} {...props} />;\n\nexport type PromptInputTabProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputTab = ({\n className,\n ...props\n}: PromptInputTabProps) => <div className={cn(className)} {...props} />;\n\nexport type PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;\n\nexport const PromptInputTabLabel = ({\n className,\n ...props\n}: PromptInputTabLabelProps) => (\n <h3\n className={cn(\n \"mb-2 px-3 font-medium text-muted-foreground text-xs\",\n className\n )}\n {...props}\n />\n);\n\nexport type PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputTabBody = ({\n className,\n ...props\n}: PromptInputTabBodyProps) => (\n <div className={cn(\"space-y-1\", className)} {...props} />\n);\n\nexport type PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;\n\nexport const PromptInputTabItem = ({\n className,\n ...props\n}: PromptInputTabItemProps) => (\n <div\n className={cn(\n \"flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent\",\n className\n )}\n {...props}\n />\n);\n\nexport type PromptInputCommandProps = ComponentProps<typeof Command>;\n\nexport const PromptInputCommand = ({\n className,\n ...props\n}: PromptInputCommandProps) => <Command className={cn(className)} {...props} />;\n\nexport type PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;\n\nexport const PromptInputCommandInput = ({\n className,\n ...props\n}: PromptInputCommandInputProps) => (\n <CommandInput className={cn(className)} {...props} />\n);\n\nexport type PromptInputCommandListProps = ComponentProps<typeof CommandList>;\n\nexport const PromptInputCommandList = ({\n className,\n ...props\n}: PromptInputCommandListProps) => (\n <CommandList className={cn(className)} {...props} />\n);\n\nexport type PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;\n\nexport const PromptInputCommandEmpty = ({\n className,\n ...props\n}: PromptInputCommandEmptyProps) => (\n <CommandEmpty className={cn(className)} {...props} />\n);\n\nexport type PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;\n\nexport const PromptInputCommandGroup = ({\n className,\n ...props\n}: PromptInputCommandGroupProps) => (\n <CommandGroup className={cn(className)} {...props} />\n);\n\nexport type PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;\n\nexport const PromptInputCommandItem = ({\n className,\n ...props\n}: PromptInputCommandItemProps) => (\n <CommandItem className={cn(className)} {...props} />\n);\n\nexport type PromptInputCommandSeparatorProps = ComponentProps<\n typeof CommandSeparator\n>;\n\nexport const PromptInputCommandSeparator = ({\n className,\n ...props\n}: PromptInputCommandSeparatorProps) => (\n <CommandSeparator className={cn(className)} {...props} />\n);\n","\"use client\";import{a as ae}from\"./chunk-NZJY6EH4.mjs\";import*as w from\"@radix-ui/react-dialog\";import*as t from\"react\";import{Primitive as D}from\"@radix-ui/react-primitive\";import{useId as H}from\"@radix-ui/react-id\";import{composeRefs as G}from\"@radix-ui/react-compose-refs\";var N='[cmdk-group=\"\"]',Y='[cmdk-group-items=\"\"]',be='[cmdk-group-heading=\"\"]',le='[cmdk-item=\"\"]',ce=`${le}:not([aria-disabled=\"true\"])`,Z=\"cmdk-item-select\",T=\"data-value\",Re=(r,o,n)=>ae(r,o,n),ue=t.createContext(void 0),K=()=>t.useContext(ue),de=t.createContext(void 0),ee=()=>t.useContext(de),fe=t.createContext(void 0),me=t.forwardRef((r,o)=>{let n=L(()=>{var e,a;return{search:\"\",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:\"\",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L(()=>new Set),c=L(()=>new Map),d=L(()=>new Map),f=L(()=>new Set),p=pe(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=!1,vimBindings:j=!0,...O}=r,$=H(),q=H(),_=H(),I=t.useRef(null),v=ke();k(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit()}},[R]),k(()=>{v(6,ne)},[]);let E=t.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e===\"search\")J(),z(),v(1,W);else if(e===\"value\"){if(document.activeElement.hasAttribute(\"cmdk-input\")||document.activeElement.hasAttribute(\"cmdk-root\")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus()}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit()}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:\"\";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit()}},emit:()=>{f.current.forEach(e=>e())}}),[]),U=t.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit()}))},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit()}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute(\"id\"))===e&&W(),E.emit()})}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e)}),filter:()=>p.current.shouldFilter,label:b||r[\"aria-label\"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===!1)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g)}),a.push([i,g])});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute(\"id\"),y=l.getAttribute(\"id\");return((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y} > *`))}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N}[${T}=\"${encodeURIComponent(i[0])}\"]`);l==null||l.parentElement.appendChild(l)})}function W(){let e=V().find(s=>s.getAttribute(\"aria-disabled\")!==\"true\"),a=e==null?void 0:e.getAttribute(T);E.setState(\"value\",a||void 0)}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===!1){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:\"\",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N))==null?void 0:s.querySelector(be))==null||i.scrollIntoView({block:\"nearest\"})),e.scrollIntoView({block:\"nearest\"}))}function M(){var e;return(e=I.current)==null?void 0:e.querySelector(`${le}[aria-selected=\"true\"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce))||[])}function X(e){let s=V()[e];s&&E.setState(\"value\",s.getAttribute(T))}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState(\"value\",l.getAttribute(T))}function re(e){let a=M(),s=a==null?void 0:a.closest(N),i;for(;s&&!i;)s=e>0?we(s,N):De(s,N),i=s==null?void 0:s.querySelector(ce);i?E.setState(\"value\",i.getAttribute(T)):Q(e)}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1)},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1)};return t.createElement(D.div,{ref:o,tabIndex:-1,...O,\"cmdk-root\":\"\",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case\"n\":case\"j\":{j&&e.ctrlKey&&ie(e);break}case\"ArrowDown\":{ie(e);break}case\"p\":case\"k\":{j&&e.ctrlKey&&se(e);break}case\"ArrowUp\":{se(e);break}case\"Home\":{e.preventDefault(),X(0);break}case\"End\":{e.preventDefault(),oe();break}case\"Enter\":{e.preventDefault();let i=M();if(i){let l=new Event(Z);i.dispatchEvent(l)}}}}},t.createElement(\"label\",{\"cmdk-label\":\"\",htmlFor:U.inputId,id:U.labelId,style:Te},b),B(r,e=>t.createElement(de.Provider,{value:E},t.createElement(ue.Provider,{value:U},e))))}),he=t.forwardRef((r,o)=>{var _,I;let n=H(),u=t.useRef(null),c=t.useContext(fe),d=K(),f=pe(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve(n,u,[r.value,r.children,u],r.keywords),m=ee(),R=P(v=>v.value&&v.value===b.current),x=P(v=>p||d.filter()===!1?!0:v.search?v.filtered.items.get(n)>0:!0);t.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z,C),()=>v.removeEventListener(Z,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current)}function S(){m.setState(\"value\",b.current,!0)}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return t.createElement(D.div,{ref:G(u,o),...q,id:n,\"cmdk-item\":\"\",role:\"option\",\"aria-disabled\":!!A,\"aria-selected\":!!R,\"data-disabled\":!!A,\"data-selected\":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=t.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=H(),p=t.useRef(null),b=t.useRef(null),m=H(),R=K(),x=P(S=>c||R.filter()===!1?!0:S.search?S.filtered.groups.has(f):!0);k(()=>R.group(f),[]),ve(f,p,[r.value,r.heading,b]);let C=t.useMemo(()=>({id:f,forceMount:c}),[c]);return t.createElement(D.div,{ref:G(p,o),...d,\"cmdk-group\":\"\",role:\"presentation\",hidden:x?void 0:!0},n&&t.createElement(\"div\",{ref:b,\"cmdk-group-heading\":\"\",\"aria-hidden\":!0,id:m},n),B(r,S=>t.createElement(\"div\",{\"cmdk-group-items\":\"\",role:\"group\",\"aria-labelledby\":n?m:void 0},t.createElement(fe.Provider,{value:C},S))))}),ye=t.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=t.useRef(null),d=P(f=>!f.search);return!n&&!d?null:t.createElement(D.div,{ref:G(c,o),...u,\"cmdk-separator\":\"\",role:\"separator\"})}),Se=t.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee(),f=P(m=>m.search),p=P(m=>m.selectedItemId),b=K();return t.useEffect(()=>{r.value!=null&&d.setState(\"search\",r.value)},[r.value]),t.createElement(D.input,{ref:o,...u,\"cmdk-input\":\"\",autoComplete:\"off\",autoCorrect:\"off\",spellCheck:!1,\"aria-autocomplete\":\"list\",role:\"combobox\",\"aria-expanded\":!0,\"aria-controls\":b.listId,\"aria-labelledby\":b.labelId,\"aria-activedescendant\":p,id:b.inputId,type:\"text\",value:c?r.value:f,onChange:m=>{c||d.setState(\"search\",m.target.value),n==null||n(m.target.value)}})}),Ce=t.forwardRef((r,o)=>{let{children:n,label:u=\"Suggestions\",...c}=r,d=t.useRef(null),f=t.useRef(null),p=P(m=>m.selectedItemId),b=K();return t.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty(\"--cmdk-list-height\",S.toFixed(1)+\"px\")})});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m)}}},[]),t.createElement(D.div,{ref:G(d,o),...c,\"cmdk-list\":\"\",role:\"listbox\",tabIndex:-1,\"aria-activedescendant\":p,\"aria-label\":u,id:b.listId},B(r,m=>t.createElement(\"div\",{ref:G(f,b.listInnerRef),\"cmdk-list-sizer\":\"\"},m)))}),xe=t.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return t.createElement(w.Root,{open:n,onOpenChange:u},t.createElement(w.Portal,{container:f},t.createElement(w.Overlay,{\"cmdk-overlay\":\"\",className:c}),t.createElement(w.Content,{\"aria-label\":r.label,\"cmdk-dialog\":\"\",className:d},t.createElement(me,{ref:o,...p}))))}),Ie=t.forwardRef((r,o)=>P(u=>u.filtered.count===0)?t.createElement(D.div,{ref:o,...r,\"cmdk-empty\":\"\",role:\"presentation\"}):null),Pe=t.forwardRef((r,o)=>{let{progress:n,children:u,label:c=\"Loading...\",...d}=r;return t.createElement(D.div,{ref:o,...d,\"cmdk-loading\":\"\",role:\"progressbar\",\"aria-valuenow\":n,\"aria-valuemin\":0,\"aria-valuemax\":100,\"aria-label\":c},B(r,f=>t.createElement(\"div\",{\"aria-hidden\":!0},f)))}),_e=Object.assign(me,{List:Ce,Item:he,Input:Se,Group:Ee,Separator:ye,Dialog:xe,Empty:Ie,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling}}function pe(r){let o=t.useRef(r);return k(()=>{o.current=r}),o}var k=typeof window==\"undefined\"?t.useEffect:t.useLayoutEffect;function L(r){let o=t.useRef();return o.current===void 0&&(o.current=r()),o}function P(r){let o=ee(),n=()=>r(o.snapshot());return t.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=t.useRef(),d=K();return k(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R==\"string\")return R.trim();if(typeof R==\"object\"&&\"current\"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T,f),c.current=f}),c}var ke=()=>{let[r,o]=t.useState(),n=L(()=>new Map);return k(()=>{n.current.forEach(u=>u()),n.current=new Map},[r]),(u,c)=>{n.current.set(u,c),o({})}};function Me(r){let o=r.type;return typeof o==\"function\"?o(r.props):\"render\"in o?o.render(r.props):r}function B({asChild:r,children:o},n){return r&&t.isValidElement(o)?t.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:\"absolute\",width:\"1px\",height:\"1px\",padding:\"0\",margin:\"-1px\",overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",whiteSpace:\"nowrap\",borderWidth:\"0\"};export{_e as Command,xe as CommandDialog,Ie as CommandEmpty,Ee as CommandGroup,Se as CommandInput,he as CommandItem,Ce as CommandList,Pe as CommandLoading,me as CommandRoot,ye as CommandSeparator,Re as defaultFilter,P as useCommandState};\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\"\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n )\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"bg-border -mx-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n","\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar Slot = createSlot(\"MenuContent.ScrollLock\");\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i];\n const jj = polygon[j];\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","var U=1,Y=.9,H=.8,J=.17,p=.1,u=.999,$=.9999;var k=.99,m=/[\\\\\\/_+.#\"@\\[\\(\\{&]/,B=/[\\\\\\/_+.#\"@\\[\\(\\{&]/g,K=/[\\s-]/,X=/[\\s-]/g;function G(_,C,h,P,A,f,O){if(f===C.length)return A===_.length?U:k;var T=`${A},${f}`;if(O[T]!==void 0)return O[T];for(var L=P.charAt(f),c=h.indexOf(L,A),S=0,E,N,R,M;c>=0;)E=G(_,C,h,P,c+1,f+1,O),E>S&&(c===A?E*=U:m.test(_.charAt(c-1))?(E*=H,R=_.slice(A,c-1).match(B),R&&A>0&&(E*=Math.pow(u,R.length))):K.test(_.charAt(c-1))?(E*=Y,M=_.slice(A,c-1).match(X),M&&A>0&&(E*=Math.pow(u,M.length))):(E*=J,A>0&&(E*=Math.pow(u,c-A))),_.charAt(c)!==C.charAt(f)&&(E*=$)),(E<p&&h.charAt(c-1)===P.charAt(f+1)||P.charAt(f+1)===P.charAt(f)&&h.charAt(c-1)!==P.charAt(f))&&(N=G(_,C,h,P,c+1,f+2,O),N*p>E&&(E=N*p)),E>S&&(S=E),c=h.indexOf(L,c+1);return O[T]=S,S}function D(_){return _.toLowerCase().replace(X,\" \")}function W(_,C,h){return _=h&&h.length>0?`${_+\" \"+h.join(\" \")}`:_,G(_,C,D(_),D(C),0,0,{})}export{W as a};\n","\"use client\";\n\n// src/dropdown-menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { createMenuScope } from \"@radix-ui/react-menu\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DROPDOWN_MENU_NAME = \"DropdownMenu\";\nvar [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nvar useMenuScope = createMenuScope();\nvar [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);\nvar DropdownMenu = (props) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME\n });\n return /* @__PURE__ */ jsx(\n DropdownMenuProvider,\n {\n scope: __scopeDropdownMenu,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })\n }\n );\n};\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\nvar TRIGGER_NAME = \"DropdownMenuTrigger\";\nvar DropdownMenuTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n id: context.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n if (!context.open) event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if ([\"Enter\", \" \"].includes(event.key)) context.onOpenToggle();\n if (event.key === \"ArrowDown\") context.onOpenChange(true);\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault();\n })\n }\n ) });\n }\n);\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DropdownMenuPortal\";\nvar DropdownMenuPortal = (props) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });\n};\nDropdownMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"DropdownMenuContent\";\nvar DropdownMenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.Content,\n {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n ...menuScope,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n event.preventDefault();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n }),\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n }\n);\nDropdownMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"DropdownMenuGroup\";\nvar DropdownMenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });\n }\n);\nDropdownMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"DropdownMenuLabel\";\nvar DropdownMenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });\n }\n);\nDropdownMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"DropdownMenuItem\";\nvar DropdownMenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });\n }\n);\nDropdownMenuItem.displayName = ITEM_NAME;\nvar CHECKBOX_ITEM_NAME = \"DropdownMenuCheckboxItem\";\nvar DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });\n});\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"DropdownMenuRadioGroup\";\nvar DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });\n});\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"DropdownMenuRadioItem\";\nvar DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });\n});\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar INDICATOR_NAME = \"DropdownMenuItemIndicator\";\nvar DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });\n});\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\nvar SEPARATOR_NAME = \"DropdownMenuSeparator\";\nvar DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });\n});\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"DropdownMenuArrow\";\nvar DropdownMenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });\n }\n);\nDropdownMenuArrow.displayName = ARROW_NAME;\nvar DropdownMenuSub = (props) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: \"DropdownMenuSub\"\n });\n return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });\n};\nvar SUB_TRIGGER_NAME = \"DropdownMenuSubTrigger\";\nvar DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });\n});\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"DropdownMenuSubContent\";\nvar DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.SubContent,\n {\n ...menuScope,\n ...subContentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\nvar Root2 = DropdownMenu;\nvar Trigger = DropdownMenuTrigger;\nvar Portal2 = DropdownMenuPortal;\nvar Content2 = DropdownMenuContent;\nvar Group2 = DropdownMenuGroup;\nvar Label2 = DropdownMenuLabel;\nvar Item2 = DropdownMenuItem;\nvar CheckboxItem2 = DropdownMenuCheckboxItem;\nvar RadioGroup2 = DropdownMenuRadioGroup;\nvar RadioItem2 = DropdownMenuRadioItem;\nvar ItemIndicator2 = DropdownMenuItemIndicator;\nvar Separator2 = DropdownMenuSeparator;\nvar Arrow2 = DropdownMenuArrow;\nvar Sub2 = DropdownMenuSub;\nvar SubTrigger2 = DropdownMenuSubTrigger;\nvar SubContent2 = DropdownMenuSubContent;\nexport {\n Arrow2 as Arrow,\n CheckboxItem2 as CheckboxItem,\n Content2 as Content,\n DropdownMenu,\n DropdownMenuArrow,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuItemIndicator,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Group2 as Group,\n Item2 as Item,\n ItemIndicator2 as ItemIndicator,\n Label2 as Label,\n Portal2 as Portal,\n RadioGroup2 as RadioGroup,\n RadioItem2 as RadioItem,\n Root2 as Root,\n Separator2 as Separator,\n Sub2 as Sub,\n SubContent2 as SubContent,\n SubTrigger2 as SubTrigger,\n Trigger,\n createDropdownMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n )\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","\"use client\";\n\n// src/hover-card.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { jsx } from \"react/jsx-runtime\";\nvar originalBodyUserSelect;\nvar HOVERCARD_NAME = \"HoverCard\";\nvar [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [HoverCardProvider, useHoverCardContext] = createHoverCardContext(HOVERCARD_NAME);\nvar HoverCard = (props) => {\n const {\n __scopeHoverCard,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n openDelay = 700,\n closeDelay = 300\n } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const hasSelectionRef = React.useRef(false);\n const isPointerDownOnContentRef = React.useRef(false);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: HOVERCARD_NAME\n });\n const handleOpen = React.useCallback(() => {\n clearTimeout(closeTimerRef.current);\n openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay);\n }, [openDelay, setOpen]);\n const handleClose = React.useCallback(() => {\n clearTimeout(openTimerRef.current);\n if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) {\n closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay);\n }\n }, [closeDelay, setOpen]);\n const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]);\n React.useEffect(() => {\n return () => {\n clearTimeout(openTimerRef.current);\n clearTimeout(closeTimerRef.current);\n };\n }, []);\n return /* @__PURE__ */ jsx(\n HoverCardProvider,\n {\n scope: __scopeHoverCard,\n open,\n onOpenChange: setOpen,\n onOpen: handleOpen,\n onClose: handleClose,\n onDismiss: handleDismiss,\n hasSelectionRef,\n isPointerDownOnContentRef,\n children: /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children })\n }\n );\n};\nHoverCard.displayName = HOVERCARD_NAME;\nvar TRIGGER_NAME = \"HoverCardTrigger\";\nvar HoverCardTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeHoverCard, ...triggerProps } = props;\n const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.a,\n {\n \"data-state\": context.open ? \"open\" : \"closed\",\n ...triggerProps,\n ref: forwardedRef,\n onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),\n onFocus: composeEventHandlers(props.onFocus, context.onOpen),\n onBlur: composeEventHandlers(props.onBlur, context.onClose),\n onTouchStart: composeEventHandlers(props.onTouchStart, (event) => event.preventDefault())\n }\n ) });\n }\n);\nHoverCardTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"HoverCardPortal\";\nvar [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar HoverCardPortal = (props) => {\n const { __scopeHoverCard, forceMount, children, container } = props;\n const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeHoverCard, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nHoverCardPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"HoverCardContent\";\nvar HoverCardContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(\n HoverCardContentImpl,\n {\n \"data-state\": context.open ? \"open\" : \"closed\",\n ...contentProps,\n onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),\n ref: forwardedRef\n }\n ) });\n }\n);\nHoverCardContent.displayName = CONTENT_NAME;\nvar HoverCardContentImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeHoverCard,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [containSelection, setContainSelection] = React.useState(false);\n React.useEffect(() => {\n if (containSelection) {\n const body = document.body;\n originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;\n body.style.userSelect = \"none\";\n body.style.webkitUserSelect = \"none\";\n return () => {\n body.style.userSelect = originalBodyUserSelect;\n body.style.webkitUserSelect = originalBodyUserSelect;\n };\n }\n }, [containSelection]);\n React.useEffect(() => {\n if (ref.current) {\n const handlePointerUp = () => {\n setContainSelection(false);\n context.isPointerDownOnContentRef.current = false;\n setTimeout(() => {\n const hasSelection = document.getSelection()?.toString() !== \"\";\n if (hasSelection) context.hasSelectionRef.current = true;\n });\n };\n document.addEventListener(\"pointerup\", handlePointerUp);\n return () => {\n document.removeEventListener(\"pointerup\", handlePointerUp);\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = false;\n };\n }\n }, [context.isPointerDownOnContentRef, context.hasSelectionRef]);\n React.useEffect(() => {\n if (ref.current) {\n const tabbables = getTabbableNodes(ref.current);\n tabbables.forEach((tabbable) => tabbable.setAttribute(\"tabindex\", \"-1\"));\n }\n });\n return /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: false,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: composeEventHandlers(onFocusOutside, (event) => {\n event.preventDefault();\n }),\n onDismiss: context.onDismiss,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n ...popperScope,\n ...contentProps,\n onPointerDown: composeEventHandlers(contentProps.onPointerDown, (event) => {\n if (event.currentTarget.contains(event.target)) {\n setContainSelection(true);\n }\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = true;\n }),\n ref: composedRefs,\n style: {\n ...contentProps.style,\n userSelect: containSelection ? \"text\" : void 0,\n // Safari requires prefix\n WebkitUserSelect: containSelection ? \"text\" : void 0,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-hover-card-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-hover-card-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-hover-card-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-hover-card-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-hover-card-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n );\n});\nvar ARROW_NAME = \"HoverCardArrow\";\nvar HoverCardArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeHoverCard, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nHoverCardArrow.displayName = ARROW_NAME;\nfunction excludeTouch(eventHandler) {\n return (event) => event.pointerType === \"touch\" ? void 0 : eventHandler();\n}\nfunction getTabbableNodes(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nvar Root2 = HoverCard;\nvar Trigger = HoverCardTrigger;\nvar Portal = HoverCardPortal;\nvar Content2 = HoverCardContent;\nvar Arrow2 = HoverCardArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n HoverCard,\n HoverCardArrow,\n HoverCardContent,\n HoverCardPortal,\n HoverCardTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createHoverCardScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction HoverCard({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return (\n <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n )\n}\n\nfunction HoverCardContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport { Input } from \"@/components/ui/input\"\nimport { Textarea } from \"@/components/ui/textarea\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","import { webcrypto as crypto } from 'node:crypto'\nimport { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\nfunction fillPool(bytes) {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.getRandomValues(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.getRandomValues(pool)\n poolOffset = 0\n }\n poolOffset += bytes\n}\nexport function random(bytes) {\n fillPool((bytes |= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\nexport function customRandom(alphabet, defaultSize, getRandom) {\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n if (!size) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let i = step\n while (i--) {\n id += alphabet[bytes[i] & mask] || ''\n if (id.length >= size) return id\n }\n }\n }\n}\nexport function customAlphabet(alphabet, size = 21) {\n return customRandom(alphabet, size, random)\n}\nexport function nanoid(size = 21) {\n fillPool((size |= 0))\n let id = ''\n for (let i = poolOffset - size; i < poolOffset; i++) {\n id += scopedUrlAlphabet[pool[i] & 63]\n }\n return id\n}\n","export const urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n];\n\n/**\n * @component @name Square\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Square = createLucideIcon('square', __iconNode);\n\nexport default Square;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['circle', { cx: '9', cy: '9', r: '2', key: 'af1f0g' }],\n ['path', { d: 'm21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21', key: '1xmnt7' }],\n];\n\n/**\n * @component @name Image\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8Y2lyY2xlIGN4PSI5IiBjeT0iOSIgcj0iMiIgLz4KICA8cGF0aCBkPSJtMjEgMTUtMy4wODYtMy4wODZhMiAyIDAgMCAwLTIuODI4IDBMNiAyMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/image\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Image = createLucideIcon('image', __iconNode);\n\nexport default Image;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'm21 21-4.34-4.34', key: '14j7rj' }],\n ['circle', { cx: '11', cy: '11', r: '8', key: '4ej97u' }],\n];\n\n/**\n * @component @name Search\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEgMjEtNC4zNC00LjM0IiAvPgogIDxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/search\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Search = createLucideIcon('search', __iconNode);\n\nexport default Search;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M20 4v7a4 4 0 0 1-4 4H4', key: '6o5b7l' }],\n ['path', { d: 'm9 10-5 5 5 5', key: '1kshq7' }],\n];\n\n/**\n * @component @name CornerDownLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgNHY3YTQgNCAwIDAgMS00IDRINCIgLz4KICA8cGF0aCBkPSJtOSAxMC01IDUgNSA1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/corner-down-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CornerDownLeft = createLucideIcon('corner-down-left', __iconNode);\n\nexport default CornerDownLeft;\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport * as MenuPrimitive from '@radix-ui/react-menu';\nimport { createMenuScope } from '@radix-ui/react-menu';\nimport { useId } from '@radix-ui/react-id';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenu\n * -----------------------------------------------------------------------------------------------*/\n\nconst DROPDOWN_MENU_NAME = 'DropdownMenu';\n\ntype ScopedProps<P> = P & { __scopeDropdownMenu?: Scope };\nconst [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nconst useMenuScope = createMenuScope();\n\ntype DropdownMenuContextValue = {\n triggerId: string;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n contentId: string;\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpenToggle(): void;\n modal: boolean;\n};\n\nconst [DropdownMenuProvider, useDropdownMenuContext] =\n createDropdownMenuContext<DropdownMenuContextValue>(DROPDOWN_MENU_NAME);\n\ninterface DropdownMenuProps {\n children?: React.ReactNode;\n dir?: Direction;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n modal?: boolean;\n}\n\nconst DropdownMenu: React.FC<DropdownMenuProps> = (props: ScopedProps<DropdownMenuProps>) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true,\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME,\n });\n\n return (\n <DropdownMenuProvider\n scope={__scopeDropdownMenu}\n triggerId={useId()}\n triggerRef={triggerRef}\n contentId={useId()}\n open={open}\n onOpenChange={setOpen}\n onOpenToggle={React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen])}\n modal={modal}\n >\n <MenuPrimitive.Root {...menuScope} open={open} onOpenChange={setOpen} dir={dir} modal={modal}>\n {children}\n </MenuPrimitive.Root>\n </DropdownMenuProvider>\n );\n};\n\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'DropdownMenuTrigger';\n\ntype DropdownMenuTriggerElement = React.ComponentRef<typeof Primitive.button>;\ntype PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;\ninterface DropdownMenuTriggerProps extends PrimitiveButtonProps {}\n\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n (props: ScopedProps<DropdownMenuTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return (\n <MenuPrimitive.Anchor asChild {...menuScope}>\n <Primitive.button\n type=\"button\"\n id={context.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open}\n aria-controls={context.open ? context.contentId : undefined}\n data-state={context.open ? 'open' : 'closed'}\n data-disabled={disabled ? '' : undefined}\n disabled={disabled}\n {...triggerProps}\n ref={composeRefs(forwardedRef, context.triggerRef)}\n onPointerDown={composeEventHandlers(props.onPointerDown, (event) => {\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n // prevent trigger focusing when opening\n // this allows the content to be given focus without competition\n if (!context.open) event.preventDefault();\n }\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if (['Enter', ' '].includes(event.key)) context.onOpenToggle();\n if (event.key === 'ArrowDown') context.onOpenChange(true);\n // prevent keydown from scrolling window / first focused item to execute\n // that keydown (inadvertently closing the menu)\n if (['Enter', ' ', 'ArrowDown'].includes(event.key)) event.preventDefault();\n })}\n />\n </MenuPrimitive.Anchor>\n );\n }\n);\n\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'DropdownMenuPortal';\n\ntype MenuPortalProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;\ninterface DropdownMenuPortalProps extends MenuPortalProps {}\n\nconst DropdownMenuPortal: React.FC<DropdownMenuPortalProps> = (\n props: ScopedProps<DropdownMenuPortalProps>\n) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Portal {...menuScope} {...portalProps} />;\n};\n\nDropdownMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'DropdownMenuContent';\n\ntype DropdownMenuContentElement = React.ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;\ninterface DropdownMenuContentProps extends Omit<MenuContentProps, 'onEntryFocus'> {}\n\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props: ScopedProps<DropdownMenuContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n\n return (\n <MenuPrimitive.Content\n id={context.contentId}\n aria-labelledby={context.triggerId}\n {...menuScope}\n {...contentProps}\n ref={forwardedRef}\n onCloseAutoFocus={composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n // Always prevent auto focus because we either focus manually or want user agent focus\n event.preventDefault();\n })}\n onInteractOutside={composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent as PointerEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n })}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin':\n 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height':\n 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n }\n);\n\nDropdownMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'DropdownMenuGroup';\n\ntype DropdownMenuGroupElement = React.ComponentRef<typeof MenuPrimitive.Group>;\ntype MenuGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>;\ninterface DropdownMenuGroupProps extends MenuGroupProps {}\n\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n (props: ScopedProps<DropdownMenuGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Group {...menuScope} {...groupProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'DropdownMenuLabel';\n\ntype DropdownMenuLabelElement = React.ComponentRef<typeof MenuPrimitive.Label>;\ntype MenuLabelProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Label>;\ninterface DropdownMenuLabelProps extends MenuLabelProps {}\n\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n (props: ScopedProps<DropdownMenuLabelProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Label {...menuScope} {...labelProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'DropdownMenuItem';\n\ntype DropdownMenuItemElement = React.ComponentRef<typeof MenuPrimitive.Item>;\ntype MenuItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;\ninterface DropdownMenuItemProps extends MenuItemProps {}\n\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props: ScopedProps<DropdownMenuItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Item {...menuScope} {...itemProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuItem.displayName = ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem';\n\ntype DropdownMenuCheckboxItemElement = React.ComponentRef<typeof MenuPrimitive.CheckboxItem>;\ntype MenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>;\ninterface DropdownMenuCheckboxItemProps extends MenuCheckboxItemProps {}\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props: ScopedProps<DropdownMenuCheckboxItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.CheckboxItem {...menuScope} {...checkboxItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'DropdownMenuRadioGroup';\n\ntype DropdownMenuRadioGroupElement = React.ComponentRef<typeof MenuPrimitive.RadioGroup>;\ntype MenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps extends MenuRadioGroupProps {}\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>((props: ScopedProps<DropdownMenuRadioGroupProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioGroup {...menuScope} {...radioGroupProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'DropdownMenuRadioItem';\n\ntype DropdownMenuRadioItemElement = React.ComponentRef<typeof MenuPrimitive.RadioItem>;\ntype MenuRadioItemProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>;\ninterface DropdownMenuRadioItemProps extends MenuRadioItemProps {}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props: ScopedProps<DropdownMenuRadioItemProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.RadioItem {...menuScope} {...radioItemProps} ref={forwardedRef} />;\n});\n\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst INDICATOR_NAME = 'DropdownMenuItemIndicator';\n\ntype DropdownMenuItemIndicatorElement = React.ComponentRef<typeof MenuPrimitive.ItemIndicator>;\ntype MenuItemIndicatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.ItemIndicator>;\ninterface DropdownMenuItemIndicatorProps extends MenuItemIndicatorProps {}\n\nconst DropdownMenuItemIndicator = React.forwardRef<\n DropdownMenuItemIndicatorElement,\n DropdownMenuItemIndicatorProps\n>((props: ScopedProps<DropdownMenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.ItemIndicator {...menuScope} {...itemIndicatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'DropdownMenuSeparator';\n\ntype DropdownMenuSeparatorElement = React.ComponentRef<typeof MenuPrimitive.Separator>;\ntype MenuSeparatorProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps extends MenuSeparatorProps {}\n\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>((props: ScopedProps<DropdownMenuSeparatorProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Separator {...menuScope} {...separatorProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'DropdownMenuArrow';\n\ntype DropdownMenuArrowElement = React.ComponentRef<typeof MenuPrimitive.Arrow>;\ntype MenuArrowProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.Arrow>;\ninterface DropdownMenuArrowProps extends MenuArrowProps {}\n\nconst DropdownMenuArrow = React.forwardRef<DropdownMenuArrowElement, DropdownMenuArrowProps>(\n (props: ScopedProps<DropdownMenuArrowProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.Arrow {...menuScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nDropdownMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSub\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DropdownMenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = (\n props: ScopedProps<DropdownMenuSubProps>\n) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: 'DropdownMenuSub',\n });\n\n return (\n <MenuPrimitive.Sub {...menuScope} open={open} onOpenChange={setOpen}>\n {children}\n </MenuPrimitive.Sub>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger';\n\ntype DropdownMenuSubTriggerElement = React.ComponentRef<typeof MenuPrimitive.SubTrigger>;\ntype MenuSubTriggerProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps extends MenuSubTriggerProps {}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props: ScopedProps<DropdownMenuSubTriggerProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return <MenuPrimitive.SubTrigger {...menuScope} {...subTriggerProps} ref={forwardedRef} />;\n});\n\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * DropdownMenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'DropdownMenuSubContent';\n\ntype DropdownMenuSubContentElement = React.ComponentRef<typeof MenuPrimitive.Content>;\ntype MenuSubContentProps = React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps extends MenuSubContentProps {}\n\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props: ScopedProps<DropdownMenuSubContentProps>, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n\n return (\n <MenuPrimitive.SubContent\n {...menuScope}\n {...subContentProps}\n ref={forwardedRef}\n style={{\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n );\n});\n\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = DropdownMenu;\nconst Trigger = DropdownMenuTrigger;\nconst Portal = DropdownMenuPortal;\nconst Content = DropdownMenuContent;\nconst Group = DropdownMenuGroup;\nconst Label = DropdownMenuLabel;\nconst Item = DropdownMenuItem;\nconst CheckboxItem = DropdownMenuCheckboxItem;\nconst RadioGroup = DropdownMenuRadioGroup;\nconst RadioItem = DropdownMenuRadioItem;\nconst ItemIndicator = DropdownMenuItemIndicator;\nconst Separator = DropdownMenuSeparator;\nconst Arrow = DropdownMenuArrow;\nconst Sub = DropdownMenuSub;\nconst SubTrigger = DropdownMenuSubTrigger;\nconst SubContent = DropdownMenuSubContent;\n\nexport {\n createDropdownMenuScope,\n //\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuPortal,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuItemIndicator,\n DropdownMenuSeparator,\n DropdownMenuArrow,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuPortalProps,\n DropdownMenuContentProps,\n DropdownMenuGroupProps,\n DropdownMenuLabelProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuItemIndicatorProps,\n DropdownMenuSeparatorProps,\n DropdownMenuArrowProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\n\nimport type { Scope } from '@radix-ui/react-context';\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCard\n * -----------------------------------------------------------------------------------------------*/\n\nlet originalBodyUserSelect: string;\n\nconst HOVERCARD_NAME = 'HoverCard';\n\ntype ScopedProps<P> = P & { __scopeHoverCard?: Scope };\nconst [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [\n createPopperScope,\n]);\nconst usePopperScope = createPopperScope();\n\ntype HoverCardContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n onOpen(): void;\n onClose(): void;\n onDismiss(): void;\n hasSelectionRef: React.MutableRefObject<boolean>;\n isPointerDownOnContentRef: React.MutableRefObject<boolean>;\n};\n\nconst [HoverCardProvider, useHoverCardContext] =\n createHoverCardContext<HoverCardContextValue>(HOVERCARD_NAME);\n\ninterface HoverCardProps {\n children?: React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openDelay?: number;\n closeDelay?: number;\n}\n\nconst HoverCard: React.FC<HoverCardProps> = (props: ScopedProps<HoverCardProps>) => {\n const {\n __scopeHoverCard,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n openDelay = 700,\n closeDelay = 300,\n } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n const openTimerRef = React.useRef(0);\n const closeTimerRef = React.useRef(0);\n const hasSelectionRef = React.useRef(false);\n const isPointerDownOnContentRef = React.useRef(false);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: HOVERCARD_NAME,\n });\n\n const handleOpen = React.useCallback(() => {\n clearTimeout(closeTimerRef.current);\n openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay);\n }, [openDelay, setOpen]);\n\n const handleClose = React.useCallback(() => {\n clearTimeout(openTimerRef.current);\n if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) {\n closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay);\n }\n }, [closeDelay, setOpen]);\n\n const handleDismiss = React.useCallback(() => setOpen(false), [setOpen]);\n\n // cleanup any queued state updates on unmount\n React.useEffect(() => {\n return () => {\n clearTimeout(openTimerRef.current);\n clearTimeout(closeTimerRef.current);\n };\n }, []);\n\n return (\n <HoverCardProvider\n scope={__scopeHoverCard}\n open={open}\n onOpenChange={setOpen}\n onOpen={handleOpen}\n onClose={handleClose}\n onDismiss={handleDismiss}\n hasSelectionRef={hasSelectionRef}\n isPointerDownOnContentRef={isPointerDownOnContentRef}\n >\n <PopperPrimitive.Root {...popperScope}>{children}</PopperPrimitive.Root>\n </HoverCardProvider>\n );\n};\n\nHoverCard.displayName = HOVERCARD_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst TRIGGER_NAME = 'HoverCardTrigger';\n\ntype HoverCardTriggerElement = React.ComponentRef<typeof Primitive.a>;\ntype PrimitiveLinkProps = React.ComponentPropsWithoutRef<typeof Primitive.a>;\ninterface HoverCardTriggerProps extends PrimitiveLinkProps {}\n\nconst HoverCardTrigger = React.forwardRef<HoverCardTriggerElement, HoverCardTriggerProps>(\n (props: ScopedProps<HoverCardTriggerProps>, forwardedRef) => {\n const { __scopeHoverCard, ...triggerProps } = props;\n const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n return (\n <PopperPrimitive.Anchor asChild {...popperScope}>\n <Primitive.a\n data-state={context.open ? 'open' : 'closed'}\n {...triggerProps}\n ref={forwardedRef}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen))}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose))}\n onFocus={composeEventHandlers(props.onFocus, context.onOpen)}\n onBlur={composeEventHandlers(props.onBlur, context.onClose)}\n // prevent focus event on touch devices\n onTouchStart={composeEventHandlers(props.onTouchStart, (event) => event.preventDefault())}\n />\n </PopperPrimitive.Anchor>\n );\n }\n);\n\nHoverCardTrigger.displayName = TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'HoverCardPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createHoverCardContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface HoverCardPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardPortal: React.FC<HoverCardPortalProps> = (\n props: ScopedProps<HoverCardPortalProps>\n) => {\n const { __scopeHoverCard, forceMount, children, container } = props;\n const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard);\n return (\n <PortalProvider scope={__scopeHoverCard} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nHoverCardPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'HoverCardContent';\n\ntype HoverCardContentElement = HoverCardContentImplElement;\ninterface HoverCardContentProps extends HoverCardContentImplProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst HoverCardContent = React.forwardRef<HoverCardContentElement, HoverCardContentProps>(\n (props: ScopedProps<HoverCardContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard);\n return (\n <Presence present={forceMount || context.open}>\n <HoverCardContentImpl\n data-state={context.open ? 'open' : 'closed'}\n {...contentProps}\n onPointerEnter={composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen))}\n onPointerLeave={composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose))}\n ref={forwardedRef}\n />\n </Presence>\n );\n }\n);\n\nHoverCardContent.displayName = CONTENT_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype HoverCardContentImplElement = React.ComponentRef<typeof PopperPrimitive.Content>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ninterface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {\n /**\n * Event handler called when the escape key is down.\n * Can be prevented.\n */\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n /**\n * Event handler called when the a `pointerdown` event happens outside of the `HoverCard`.\n * Can be prevented.\n */\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n /**\n * Event handler called when the focus moves outside of the `HoverCard`.\n * Can be prevented.\n */\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n /**\n * Event handler called when an interaction happens outside the `HoverCard`.\n * Specifically, when a `pointerdown` event happens outside or focus moves outside of it.\n * Can be prevented.\n */\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst HoverCardContentImpl = React.forwardRef<\n HoverCardContentImplElement,\n HoverCardContentImplProps\n>((props: ScopedProps<HoverCardContentImplProps>, forwardedRef) => {\n const {\n __scopeHoverCard,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard);\n const popperScope = usePopperScope(__scopeHoverCard);\n const ref = React.useRef<HoverCardContentImplElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [containSelection, setContainSelection] = React.useState(false);\n\n React.useEffect(() => {\n if (containSelection) {\n const body = document.body;\n\n // Safari requires prefix\n originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;\n\n body.style.userSelect = 'none';\n body.style.webkitUserSelect = 'none';\n return () => {\n body.style.userSelect = originalBodyUserSelect;\n body.style.webkitUserSelect = originalBodyUserSelect;\n };\n }\n }, [containSelection]);\n\n React.useEffect(() => {\n if (ref.current) {\n const handlePointerUp = () => {\n setContainSelection(false);\n context.isPointerDownOnContentRef.current = false;\n\n // Delay a frame to ensure we always access the latest selection\n setTimeout(() => {\n const hasSelection = document.getSelection()?.toString() !== '';\n if (hasSelection) context.hasSelectionRef.current = true;\n });\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = false;\n };\n }\n }, [context.isPointerDownOnContentRef, context.hasSelectionRef]);\n\n React.useEffect(() => {\n if (ref.current) {\n const tabbables = getTabbableNodes(ref.current);\n tabbables.forEach((tabbable) => tabbable.setAttribute('tabindex', '-1'));\n }\n });\n\n return (\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={false}\n onInteractOutside={onInteractOutside}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={composeEventHandlers(onFocusOutside, (event) => {\n event.preventDefault();\n })}\n onDismiss={context.onDismiss}\n >\n <PopperPrimitive.Content\n {...popperScope}\n {...contentProps}\n onPointerDown={composeEventHandlers(contentProps.onPointerDown, (event) => {\n // Contain selection to current layer\n if (event.currentTarget.contains(event.target as HTMLElement)) {\n setContainSelection(true);\n }\n context.hasSelectionRef.current = false;\n context.isPointerDownOnContentRef.current = true;\n })}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n userSelect: containSelection ? 'text' : undefined,\n // Safari requires prefix\n WebkitUserSelect: containSelection ? 'text' : undefined,\n // re-namespace exposed content custom properties\n ...{\n '--radix-hover-card-content-transform-origin': 'var(--radix-popper-transform-origin)',\n '--radix-hover-card-content-available-width': 'var(--radix-popper-available-width)',\n '--radix-hover-card-content-available-height': 'var(--radix-popper-available-height)',\n '--radix-hover-card-trigger-width': 'var(--radix-popper-anchor-width)',\n '--radix-hover-card-trigger-height': 'var(--radix-popper-anchor-height)',\n },\n }}\n />\n </DismissableLayer>\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * HoverCardArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'HoverCardArrow';\n\ntype HoverCardArrowElement = React.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface HoverCardArrowProps extends PopperArrowProps {}\n\nconst HoverCardArrow = React.forwardRef<HoverCardArrowElement, HoverCardArrowProps>(\n (props: ScopedProps<HoverCardArrowProps>, forwardedRef) => {\n const { __scopeHoverCard, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeHoverCard);\n return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nHoverCardArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction excludeTouch<E>(eventHandler: () => void) {\n return (event: React.PointerEvent<E>) =>\n event.pointerType === 'touch' ? undefined : eventHandler();\n}\n\n/**\n * Returns a list of nodes that can be in the tab sequence.\n * @see: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker\n */\nfunction getTabbableNodes(container: HTMLElement) {\n const nodes: HTMLElement[] = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: any) => {\n // `.tabIndex` is not the same as the `tabindex` attribute. It works on the\n // runtime's understanding of tabbability, so this automatically accounts\n // for any kind of element that could be tabbed to.\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n },\n });\n while (walker.nextNode()) nodes.push(walker.currentNode as HTMLElement);\n return nodes;\n}\n\nconst Root = HoverCard;\nconst Trigger = HoverCardTrigger;\nconst Portal = HoverCardPortal;\nconst Content = HoverCardContent;\nconst Arrow = HoverCardArrow;\n\nexport {\n createHoverCardScope,\n //\n HoverCard,\n HoverCardTrigger,\n HoverCardPortal,\n HoverCardContent,\n HoverCardArrow,\n //\n Root,\n Trigger,\n Portal,\n Content,\n Arrow,\n};\nexport type {\n HoverCardProps,\n HoverCardTriggerProps,\n HoverCardPortalProps,\n HoverCardContentProps,\n HoverCardArrowProps,\n};\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs, composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { createSlot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst SELECTION_KEYS = ['Enter', ' '];\nconst FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS: Record<Direction, string[]> = {\n ltr: [...SELECTION_KEYS, 'ArrowRight'],\n rtl: [...SELECTION_KEYS, 'ArrowLeft'],\n};\nconst SUB_CLOSE_KEYS: Record<Direction, string[]> = {\n ltr: ['ArrowLeft'],\n rtl: ['ArrowRight'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'Menu';\n\ntype ItemData = { disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n MenuItemElement,\n ItemData\n>(MENU_NAME);\n\ntype ScopedProps<P> = P & { __scopeMenu?: Scope };\nconst [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope,\n]);\nconst usePopperScope = createPopperScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenuContextValue = {\n open: boolean;\n onOpenChange(open: boolean): void;\n content: MenuContentElement | null;\n onContentChange(content: MenuContentElement | null): void;\n};\n\nconst [MenuProvider, useMenuContext] = createMenuContext<MenuContextValue>(MENU_NAME);\n\ntype MenuRootContextValue = {\n onClose(): void;\n isUsingKeyboardRef: React.RefObject<boolean>;\n dir: Direction;\n modal: boolean;\n};\n\nconst [MenuRootProvider, useMenuRootContext] = createMenuContext<MenuRootContextValue>(MENU_NAME);\n\ninterface MenuProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n dir?: Direction;\n modal?: boolean;\n}\n\nconst Menu: React.FC<MenuProps> = (props: ScopedProps<MenuProps>) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState<MenuContentElement | null>(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n\n React.useEffect(() => {\n // Capture phase ensures we set the boolean before any side effects execute\n // in response to the key or pointer event as they might depend on this value.\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener('pointerdown', handlePointer, { capture: true, once: true });\n document.addEventListener('pointermove', handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => (isUsingKeyboardRef.current = false);\n document.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener('keydown', handleKeyDown, { capture: true });\n document.removeEventListener('pointerdown', handlePointer, { capture: true });\n document.removeEventListener('pointermove', handlePointer, { capture: true });\n };\n }, []);\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <MenuProvider\n scope={__scopeMenu}\n open={open}\n onOpenChange={handleOpenChange}\n content={content}\n onContentChange={setContent}\n >\n <MenuRootProvider\n scope={__scopeMenu}\n onClose={React.useCallback(() => handleOpenChange(false), [handleOpenChange])}\n isUsingKeyboardRef={isUsingKeyboardRef}\n dir={direction}\n modal={modal}\n >\n {children}\n </MenuRootProvider>\n </MenuProvider>\n </PopperPrimitive.Root>\n );\n};\n\nMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'MenuAnchor';\n\ntype MenuAnchorElement = React.ComponentRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface MenuAnchorProps extends PopperAnchorProps {}\n\nconst MenuAnchor = React.forwardRef<MenuAnchorElement, MenuAnchorProps>(\n (props: ScopedProps<MenuAnchorProps>, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n }\n);\n\nMenuAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenuPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createMenuContext<PortalContextValue>(PORTAL_NAME, {\n forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface MenuPortalProps {\n children?: React.ReactNode;\n /**\n * Specify a container element to portal the content into.\n */\n container?: PortalProps['container'];\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuPortal: React.FC<MenuPortalProps> = (props: ScopedProps<MenuPortalProps>) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return (\n <PortalProvider scope={__scopeMenu} forceMount={forceMount}>\n <Presence present={forceMount || context.open}>\n <PortalPrimitive asChild container={container}>\n {children}\n </PortalPrimitive>\n </Presence>\n </PortalProvider>\n );\n};\n\nMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenuContent';\n\ntype MenuContentContextValue = {\n onItemEnter(event: React.PointerEvent): void;\n onItemLeave(event: React.PointerEvent): void;\n onTriggerLeave(event: React.PointerEvent): void;\n searchRef: React.RefObject<string>;\n pointerGraceTimerRef: React.MutableRefObject<number>;\n onPointerGraceIntentChange(intent: GraceIntent | null): void;\n};\nconst [MenuContentProvider, useMenuContentContext] =\n createMenuContext<MenuContentContextValue>(CONTENT_NAME);\n\ntype MenuContentElement = MenuRootContentTypeElement;\n/**\n * We purposefully don't union MenuRootContent and MenuSubContent props here because\n * they have conflicting prop types. We agreed that we would allow MenuSubContent to\n * accept props that it would just ignore.\n */\ninterface MenuContentProps extends MenuRootContentTypeProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuContent = React.forwardRef<MenuContentElement, MenuContentProps>(\n (props: ScopedProps<MenuContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n\n return (\n <Collection.Provider scope={props.__scopeMenu}>\n <Presence present={forceMount || context.open}>\n <Collection.Slot scope={props.__scopeMenu}>\n {rootContext.modal ? (\n <MenuRootContentModal {...contentProps} ref={forwardedRef} />\n ) : (\n <MenuRootContentNonModal {...contentProps} ref={forwardedRef} />\n )}\n </Collection.Slot>\n </Presence>\n </Collection.Provider>\n );\n }\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuRootContentTypeElement = MenuContentImplElement;\ninterface MenuRootContentTypeProps\n extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {}\n\nconst MenuRootContentModal = React.forwardRef<MenuRootContentTypeElement, MenuRootContentTypeProps>(\n (props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef<MenuRootContentTypeElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n // Hide everything from ARIA except the `MenuContent`\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n\n return (\n <MenuContentImpl\n {...props}\n ref={composedRefs}\n // we make sure we're not trapping once it's been closed\n // (closed !== unmounted when animating out)\n trapFocus={context.open}\n // make sure to only disable pointer events when open\n // this avoids blocking interactions while animating out\n disableOutsidePointerEvents={context.open}\n disableOutsideScroll\n // When focus is trapped, a `focusout` event may still happen.\n // We make sure we don't trigger our `onDismiss` in such case.\n onFocusOutside={composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )}\n onDismiss={() => context.onOpenChange(false)}\n />\n );\n }\n);\n\nconst MenuRootContentNonModal = React.forwardRef<\n MenuRootContentTypeElement,\n MenuRootContentTypeProps\n>((props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return (\n <MenuContentImpl\n {...props}\n ref={forwardedRef}\n trapFocus={false}\n disableOutsidePointerEvents={false}\n disableOutsideScroll={false}\n onDismiss={() => context.onOpenChange(false)}\n />\n );\n});\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuContentImplElement = React.ComponentRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype RovingFocusGroupProps = React.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ntype MenuContentImplPrivateProps = {\n onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n onDismiss?: DismissableLayerProps['onDismiss'];\n disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];\n\n /**\n * Whether scrolling outside the `MenuContent` should be prevented\n * (default: `false`)\n */\n disableOutsideScroll?: boolean;\n\n /**\n * Whether focus should be trapped within the `MenuContent`\n * (default: false)\n */\n trapFocus?: FocusScopeProps['trapped'];\n};\ninterface MenuContentImplProps\n extends MenuContentImplPrivateProps,\n Omit<PopperContentProps, 'dir' | 'onPlaced'> {\n /**\n * Event handler called when auto-focusing on close.\n * Can be prevented.\n */\n onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: RovingFocusGroupProps['loop'];\n\n onEntryFocus?: RovingFocusGroupProps['onEntryFocus'];\n onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst Slot = createSlot('MenuContent.ScrollLock');\n\nconst MenuContentImpl = React.forwardRef<MenuContentImplElement, MenuContentImplProps>(\n (props: ScopedProps<MenuContentImplProps>, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState<string | null>(null);\n const contentRef = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef('');\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef<GraceIntent | null>(null);\n const pointerDirRef = React.useRef<Side>('right');\n const lastPointerXRef = React.useRef(0);\n\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll\n ? { as: Slot, allowPinchZoom: true }\n : undefined;\n\n const handleTypeaheadSearch = (key: string) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n\n // Reset `searchRef` 1 second after it was last updated\n (function updateSearch(value: string) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n })(search);\n\n if (newItem) {\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => (newItem as HTMLElement).focus());\n }\n };\n\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n\n // Make sure the whole tree has focus guards as our `MenuContent` may be\n // the last element in the DOM (because of the `Portal`)\n useFocusGuards();\n\n const isPointerMovingToSubmenu = React.useCallback((event: React.PointerEvent) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n\n return (\n <MenuContentProvider\n scope={__scopeMenu}\n searchRef={searchRef}\n onItemEnter={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n )}\n onItemLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n )}\n onTriggerLeave={React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n )}\n pointerGraceTimerRef={pointerGraceTimerRef}\n onPointerGraceIntentChange={React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, [])}\n >\n <ScrollLockWrapper {...scrollLockWrapperProps}>\n <FocusScope\n asChild\n trapped={trapFocus}\n onMountAutoFocus={composeEventHandlers(onOpenAutoFocus, (event) => {\n // when opening, explicitly focus the content area only and leave\n // `onEntryFocus` in control of focusing first item\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n })}\n onUnmountAutoFocus={onCloseAutoFocus}\n >\n <DismissableLayer\n asChild\n disableOutsidePointerEvents={disableOutsidePointerEvents}\n onEscapeKeyDown={onEscapeKeyDown}\n onPointerDownOutside={onPointerDownOutside}\n onFocusOutside={onFocusOutside}\n onInteractOutside={onInteractOutside}\n onDismiss={onDismiss}\n >\n <RovingFocusGroup.Root\n asChild\n {...rovingFocusGroupScope}\n dir={rootContext.dir}\n orientation=\"vertical\"\n loop={loop}\n currentTabStopId={currentItemId}\n onCurrentTabStopIdChange={setCurrentItemId}\n onEntryFocus={composeEventHandlers(onEntryFocus, (event) => {\n // only focus first item when using keyboard\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n })}\n preventScrollOnEntryFocus\n >\n <PopperPrimitive.Content\n role=\"menu\"\n aria-orientation=\"vertical\"\n data-state={getOpenState(context.open)}\n data-radix-menu-content=\"\"\n dir={rootContext.dir}\n {...popperScope}\n {...contentProps}\n ref={composedRefs}\n style={{ outline: 'none', ...contentProps.style }}\n onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n // submenu key events bubble through portals. We only care about keys in this menu.\n const target = event.target as HTMLElement;\n const isKeyDownInside =\n target.closest('[data-radix-menu-content]') === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n // menus should not be navigated using tab key so we prevent it\n if (event.key === 'Tab') event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n // focus first/last item based on key pressed\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current!);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n })}\n onBlur={composeEventHandlers(props.onBlur, (event) => {\n // clear search buffer when leaving the menu\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = '';\n }\n })}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target as HTMLElement;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n\n // We don't use `event.movementX` for this check because Safari will\n // always return `0` on a pointer event.\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )}\n />\n </RovingFocusGroup.Root>\n </DismissableLayer>\n </FocusScope>\n </ScrollLockWrapper>\n </MenuContentProvider>\n );\n }\n);\n\nMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenuGroup';\n\ntype MenuGroupElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface MenuGroupProps extends PrimitiveDivProps {}\n\nconst MenuGroup = React.forwardRef<MenuGroupElement, MenuGroupProps>(\n (props: ScopedProps<MenuGroupProps>, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return <Primitive.div role=\"group\" {...groupProps} ref={forwardedRef} />;\n }\n);\n\nMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenuLabel';\n\ntype MenuLabelElement = React.ComponentRef<typeof Primitive.div>;\ninterface MenuLabelProps extends PrimitiveDivProps {}\n\nconst MenuLabel = React.forwardRef<MenuLabelElement, MenuLabelProps>(\n (props: ScopedProps<MenuLabelProps>, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return <Primitive.div {...labelProps} ref={forwardedRef} />;\n }\n);\n\nMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenuItem';\nconst ITEM_SELECT = 'menu.itemSelect';\n\ntype MenuItemElement = MenuItemImplElement;\ninterface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {\n onSelect?: (event: Event) => void;\n}\n\nconst MenuItem = React.forwardRef<MenuItemElement, MenuItemProps>(\n (props: ScopedProps<MenuItemProps>, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef<HTMLDivElement>(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n\n return (\n <MenuItemImpl\n {...itemProps}\n ref={composedRefs}\n disabled={disabled}\n onClick={composeEventHandlers(props.onClick, handleSelect)}\n onPointerDown={(event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n }}\n onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n // Pointer down can move to a different menu item which should activate it on pointer up.\n // We dispatch a click for selection to allow composition with click based triggers and to\n // prevent Firefox from getting stuck in text selection mode when the menu closes.\n if (!isPointerDownRef.current) event.currentTarget?.click();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (disabled || (isTypingAhead && event.key === ' ')) return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n /**\n * We prevent default browser behaviour for selection keys as they should trigger\n * a selection only:\n * - prevents space from scrolling the page.\n * - if keydown causes focus to move, prevents keydown from firing on the new target.\n */\n event.preventDefault();\n }\n })}\n />\n );\n }\n);\n\nMenuItem.displayName = ITEM_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuItemImplElement = React.ComponentRef<typeof Primitive.div>;\ninterface MenuItemImplProps extends PrimitiveDivProps {\n disabled?: boolean;\n textValue?: string;\n}\n\nconst MenuItemImpl = React.forwardRef<MenuItemImplElement, MenuItemImplProps>(\n (props: ScopedProps<MenuItemImplProps>, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef<HTMLDivElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n\n // get the item's `.textContent` as default strategy for typeahead `textValue`\n const [textContent, setTextContent] = React.useState('');\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? '').trim());\n }\n }, [itemProps.children]);\n\n return (\n <Collection.ItemSlot\n scope={__scopeMenu}\n disabled={disabled}\n textValue={textValue ?? textContent}\n >\n <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} focusable={!disabled}>\n <Primitive.div\n role=\"menuitem\"\n data-highlighted={isFocused ? '' : undefined}\n aria-disabled={disabled || undefined}\n data-disabled={disabled ? '' : undefined}\n {...itemProps}\n ref={composedRefs}\n /**\n * We focus items on `pointerMove` to achieve the following:\n *\n * - Mouse over an item (it focuses)\n * - Leave mouse where it is and use keyboard to focus a different item\n * - Wiggle mouse without it leaving previously focused item\n * - Previously focused item should re-focus\n *\n * If we used `mouseOver`/`mouseEnter` it would not re-focus when the mouse\n * wiggles. This is to match native menu implementation.\n */\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n )}\n onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n />\n </RovingFocusGroup.Item>\n </Collection.ItemSlot>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\n\ntype MenuCheckboxItemElement = MenuItemElement;\n\ntype CheckedState = boolean | 'indeterminate';\n\ninterface MenuCheckboxItemProps extends MenuItemProps {\n checked?: CheckedState;\n // `onCheckedChange` can never be called with `\"indeterminate\"` from the inside\n onCheckedChange?: (checked: boolean) => void;\n}\n\nconst MenuCheckboxItem = React.forwardRef<MenuCheckboxItemElement, MenuCheckboxItemProps>(\n (props: ScopedProps<MenuCheckboxItemProps>, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return (\n <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n <MenuItem\n role=\"menuitemcheckbox\"\n aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n {...checkboxItemProps}\n ref={forwardedRef}\n data-state={getCheckedState(checked)}\n onSelect={composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )}\n />\n </ItemIndicatorProvider>\n );\n }\n);\n\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenuRadioGroup';\n\nconst [RadioGroupProvider, useRadioGroupContext] = createMenuContext<MenuRadioGroupProps>(\n RADIO_GROUP_NAME,\n { value: undefined, onValueChange: () => {} }\n);\n\ntype MenuRadioGroupElement = React.ComponentRef<typeof MenuGroup>;\ninterface MenuRadioGroupProps extends MenuGroupProps {\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioGroup = React.forwardRef<MenuRadioGroupElement, MenuRadioGroupProps>(\n (props: ScopedProps<MenuRadioGroupProps>, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return (\n <RadioGroupProvider scope={props.__scopeMenu} value={value} onValueChange={handleValueChange}>\n <MenuGroup {...groupProps} ref={forwardedRef} />\n </RadioGroupProvider>\n );\n }\n);\n\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenuRadioItem';\n\ntype MenuRadioItemElement = React.ComponentRef<typeof MenuItem>;\ninterface MenuRadioItemProps extends MenuItemProps {\n value: string;\n}\n\nconst MenuRadioItem = React.forwardRef<MenuRadioItemElement, MenuRadioItemProps>(\n (props: ScopedProps<MenuRadioItemProps>, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return (\n <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n <MenuItem\n role=\"menuitemradio\"\n aria-checked={checked}\n {...radioItemProps}\n ref={forwardedRef}\n data-state={getCheckedState(checked)}\n onSelect={composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )}\n />\n </ItemIndicatorProvider>\n );\n }\n);\n\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'MenuItemIndicator';\n\ntype CheckboxContextValue = { checked: CheckedState };\n\nconst [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext<CheckboxContextValue>(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\n\ntype MenuItemIndicatorElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface MenuItemIndicatorProps extends PrimitiveSpanProps {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuItemIndicator = React.forwardRef<MenuItemIndicatorElement, MenuItemIndicatorProps>(\n (props: ScopedProps<MenuItemIndicatorProps>, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return (\n <Presence\n present={\n forceMount ||\n isIndeterminate(indicatorContext.checked) ||\n indicatorContext.checked === true\n }\n >\n <Primitive.span\n {...itemIndicatorProps}\n ref={forwardedRef}\n data-state={getCheckedState(indicatorContext.checked)}\n />\n </Presence>\n );\n }\n);\n\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenuSeparator';\n\ntype MenuSeparatorElement = React.ComponentRef<typeof Primitive.div>;\ninterface MenuSeparatorProps extends PrimitiveDivProps {}\n\nconst MenuSeparator = React.forwardRef<MenuSeparatorElement, MenuSeparatorProps>(\n (props: ScopedProps<MenuSeparatorProps>, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return (\n <Primitive.div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...separatorProps}\n ref={forwardedRef}\n />\n );\n }\n);\n\nMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenuArrow';\n\ntype MenuArrowElement = React.ComponentRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface MenuArrowProps extends PopperArrowProps {}\n\nconst MenuArrow = React.forwardRef<MenuArrowElement, MenuArrowProps>(\n (props: ScopedProps<MenuArrowProps>, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n }\n);\n\nMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenuSub';\n\ntype MenuSubContextValue = {\n contentId: string;\n triggerId: string;\n trigger: MenuSubTriggerElement | null;\n onTriggerChange(trigger: MenuSubTriggerElement | null): void;\n};\n\nconst [MenuSubProvider, useMenuSubContext] = createMenuContext<MenuSubContextValue>(SUB_NAME);\n\ninterface MenuSubProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?(open: boolean): void;\n}\n\nconst MenuSub: React.FC<MenuSubProps> = (props: ScopedProps<MenuSubProps>) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState<MenuSubTriggerElement | null>(null);\n const [content, setContent] = React.useState<MenuContentElement | null>(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n\n // Prevent the parent menu from reopening with open submenus.\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n\n return (\n <PopperPrimitive.Root {...popperScope}>\n <MenuProvider\n scope={__scopeMenu}\n open={open}\n onOpenChange={handleOpenChange}\n content={content}\n onContentChange={setContent}\n >\n <MenuSubProvider\n scope={__scopeMenu}\n contentId={useId()}\n triggerId={useId()}\n trigger={trigger}\n onTriggerChange={setTrigger}\n >\n {children}\n </MenuSubProvider>\n </MenuProvider>\n </PopperPrimitive.Root>\n );\n};\n\nMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenuSubTrigger';\n\ntype MenuSubTriggerElement = MenuItemImplElement;\ninterface MenuSubTriggerProps extends MenuItemImplProps {}\n\nconst MenuSubTrigger = React.forwardRef<MenuSubTriggerElement, MenuSubTriggerProps>(\n (props: ScopedProps<MenuSubTriggerProps>, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef<number | null>(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n\n return (\n <MenuAnchor asChild {...scope}>\n <MenuItemImpl\n id={subContext.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={context.open}\n aria-controls={subContext.contentId}\n data-state={getOpenState(context.open)}\n {...props}\n ref={composeRefs(forwardedRef, subContext.onTriggerChange)}\n // This is redundant for mouse users but we cannot determine pointer type from\n // click event and we cannot use pointerup event (see git history for reasons why)\n onClick={(event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n /**\n * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n * and we rely heavily on `onFocusOutside` for submenus to close when switching\n * between separate submenus.\n */\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n }}\n onPointerMove={composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n )}\n onPointerLeave={composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n // TODO: make sure to update this when we change positioning logic\n const side = context.content?.dataset.side as Side;\n const rightSide = side === 'right';\n const bleed = rightSide ? -5 : +5;\n const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom },\n ],\n side,\n });\n\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n\n // There's 100ms where the user may leave an item before the submenu was opened.\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n )}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== '';\n if (props.disabled || (isTypingAhead && event.key === ' ')) return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n // The trigger may hold focus if opened via pointer interaction\n // so we ensure content is given focus again when switching to keyboard.\n context.content?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n </MenuAnchor>\n );\n }\n);\n\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenuSubContent';\n\ntype MenuSubContentElement = MenuContentImplElement;\ninterface MenuSubContentProps\n extends Omit<\n MenuContentImplProps,\n keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'\n > {\n /**\n * Used to force mounting when more control is needed. Useful when\n * controlling animation with React animation libraries.\n */\n forceMount?: true;\n}\n\nconst MenuSubContent = React.forwardRef<MenuSubContentElement, MenuSubContentProps>(\n (props: ScopedProps<MenuSubContentProps>, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef<MenuSubContentElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return (\n <Collection.Provider scope={props.__scopeMenu}>\n <Presence present={forceMount || context.open}>\n <Collection.Slot scope={props.__scopeMenu}>\n <MenuContentImpl\n id={subContext.contentId}\n aria-labelledby={subContext.triggerId}\n {...subContentProps}\n ref={composedRefs}\n align=\"start\"\n side={rootContext.dir === 'rtl' ? 'left' : 'right'}\n disableOutsidePointerEvents={false}\n disableOutsideScroll={false}\n trapFocus={false}\n onOpenAutoFocus={(event) => {\n // when opening a submenu, focus content for keyboard users only\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n }}\n // The menu might close because of focusing another menu item in the parent menu. We\n // don't want it to refocus the trigger in that case so we handle trigger focus ourselves.\n onCloseAutoFocus={(event) => event.preventDefault()}\n onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n // on pointer interaction.\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n })}\n onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n // ensure pressing escape in submenu doesn't escape full screen mode\n event.preventDefault();\n })}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n // Submenu key events bubble through portals. We only care about keys in this menu.\n const isKeyDownInside = event.currentTarget.contains(event.target as HTMLElement);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n // We focus manually because we prevented it in `onCloseAutoFocus`\n subContext.trigger?.focus();\n // prevent window from scrolling\n event.preventDefault();\n }\n })}\n />\n </Collection.Slot>\n </Presence>\n </Collection.Provider>\n );\n }\n);\n\nMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getOpenState(open: boolean) {\n return open ? 'open' : 'closed';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n return checked === 'indeterminate';\n}\n\nfunction getCheckedState(checked: CheckedState) {\n return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map<T>((_, index) => array[(startIndex + index) % array.length]!);\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction getNextMatch(values: string[], search: string, currentMatch?: string) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0]! : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find((value) =>\n value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\ntype Side = 'left' | 'right';\ntype GraceIntent = { area: Polygon; side: Side };\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i]!;\n const jj = polygon[j]!;\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n\n // prettier-ignore\n const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n\n return inside;\n}\n\nfunction isPointerInGraceArea(event: React.PointerEvent, area?: Polygon) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\n\nfunction whenMouse<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = Menu;\nconst Anchor = MenuAnchor;\nconst Portal = MenuPortal;\nconst Content = MenuContent;\nconst Group = MenuGroup;\nconst Label = MenuLabel;\nconst Item = MenuItem;\nconst CheckboxItem = MenuCheckboxItem;\nconst RadioGroup = MenuRadioGroup;\nconst RadioItem = MenuRadioItem;\nconst ItemIndicator = MenuItemIndicator;\nconst Separator = MenuSeparator;\nconst Arrow = MenuArrow;\nconst Sub = MenuSub;\nconst SubTrigger = MenuSubTrigger;\nconst SubContent = MenuSubContent;\n\nexport {\n createMenuScope,\n //\n Menu,\n MenuAnchor,\n MenuPortal,\n MenuContent,\n MenuGroup,\n MenuLabel,\n MenuItem,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuItemIndicator,\n MenuSeparator,\n MenuArrow,\n MenuSub,\n MenuSubTrigger,\n MenuSubContent,\n //\n Root,\n Anchor,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n SubTrigger,\n SubContent,\n};\nexport type {\n MenuProps,\n MenuAnchorProps,\n MenuPortalProps,\n MenuContentProps,\n MenuGroupProps,\n MenuLabelProps,\n MenuItemProps,\n MenuCheckboxItemProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuItemIndicatorProps,\n MenuSeparatorProps,\n MenuArrowProps,\n MenuSubProps,\n MenuSubTriggerProps,\n MenuSubContentProps,\n};\n","\"use client\";\n\n// src/scroll-area.tsx\nimport * as React2 from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\n\n// src/use-state-machine.ts\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/scroll-area.tsx\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar SCROLL_AREA_NAME = \"ScrollArea\";\nvar [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);\nvar [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);\nvar ScrollArea = React2.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeScrollArea,\n type = \"hover\",\n dir,\n scrollHideDelay = 600,\n ...scrollAreaProps\n } = props;\n const [scrollArea, setScrollArea] = React2.useState(null);\n const [viewport, setViewport] = React2.useState(null);\n const [content, setContent] = React2.useState(null);\n const [scrollbarX, setScrollbarX] = React2.useState(null);\n const [scrollbarY, setScrollbarY] = React2.useState(null);\n const [cornerWidth, setCornerWidth] = React2.useState(0);\n const [cornerHeight, setCornerHeight] = React2.useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = React2.useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = React2.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));\n const direction = useDirection(dir);\n return /* @__PURE__ */ jsx(\n ScrollAreaProvider,\n {\n scope: __scopeScrollArea,\n type,\n dir: direction,\n scrollHideDelay,\n scrollArea,\n viewport,\n onViewportChange: setViewport,\n content,\n onContentChange: setContent,\n scrollbarX,\n onScrollbarXChange: setScrollbarX,\n scrollbarXEnabled,\n onScrollbarXEnabledChange: setScrollbarXEnabled,\n scrollbarY,\n onScrollbarYChange: setScrollbarY,\n scrollbarYEnabled,\n onScrollbarYEnabledChange: setScrollbarYEnabled,\n onCornerWidthChange: setCornerWidth,\n onCornerHeightChange: setCornerHeight,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n dir: direction,\n ...scrollAreaProps,\n ref: composedRefs,\n style: {\n position: \"relative\",\n // Pass corner sizes as CSS vars to reduce re-renders of context consumers\n [\"--radix-scroll-area-corner-width\"]: cornerWidth + \"px\",\n [\"--radix-scroll-area-corner-height\"]: cornerHeight + \"px\",\n ...props.style\n }\n }\n )\n }\n );\n }\n);\nScrollArea.displayName = SCROLL_AREA_NAME;\nvar VIEWPORT_NAME = \"ScrollAreaViewport\";\nvar ScrollAreaViewport = React2.forwardRef(\n (props, forwardedRef) => {\n const { __scopeScrollArea, children, nonce, ...viewportProps } = props;\n const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);\n const ref = React2.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`\n },\n nonce\n }\n ),\n /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-scroll-area-viewport\": \"\",\n ...viewportProps,\n ref: composedRefs,\n style: {\n /**\n * We don't support `visible` because the intention is to have at least one scrollbar\n * if this component is used and `visible` will behave like `auto` in that case\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description\n *\n * We don't handle `auto` because the intention is for the native implementation\n * to be hidden if using this component. We just want to ensure the node is scrollable\n * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent\n * the browser from having to work out whether to render native scrollbars or not,\n * we tell it to with the intention of hiding them in CSS.\n */\n overflowX: context.scrollbarXEnabled ? \"scroll\" : \"hidden\",\n overflowY: context.scrollbarYEnabled ? \"scroll\" : \"hidden\",\n ...props.style\n },\n children: /* @__PURE__ */ jsx(\"div\", { ref: context.onContentChange, style: { minWidth: \"100%\", display: \"table\" }, children })\n }\n )\n ] });\n }\n);\nScrollAreaViewport.displayName = VIEWPORT_NAME;\nvar SCROLLBAR_NAME = \"ScrollAreaScrollbar\";\nvar ScrollAreaScrollbar = React2.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;\n const isHorizontal = props.orientation === \"horizontal\";\n React2.useEffect(() => {\n isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);\n return () => {\n isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);\n };\n }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);\n return context.type === \"hover\" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === \"scroll\" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === \"auto\" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === \"always\" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;\n }\n);\nScrollAreaScrollbar.displayName = SCROLLBAR_NAME;\nvar ScrollAreaScrollbarHover = React2.forwardRef((props, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [visible, setVisible] = React2.useState(false);\n React2.useEffect(() => {\n const scrollArea = context.scrollArea;\n let hideTimer = 0;\n if (scrollArea) {\n const handlePointerEnter = () => {\n window.clearTimeout(hideTimer);\n setVisible(true);\n };\n const handlePointerLeave = () => {\n hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);\n };\n scrollArea.addEventListener(\"pointerenter\", handlePointerEnter);\n scrollArea.addEventListener(\"pointerleave\", handlePointerLeave);\n return () => {\n window.clearTimeout(hideTimer);\n scrollArea.removeEventListener(\"pointerenter\", handlePointerEnter);\n scrollArea.removeEventListener(\"pointerleave\", handlePointerLeave);\n };\n }\n }, [context.scrollArea, context.scrollHideDelay]);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx(\n ScrollAreaScrollbarAuto,\n {\n \"data-state\": visible ? \"visible\" : \"hidden\",\n ...scrollbarProps,\n ref: forwardedRef\n }\n ) });\n});\nvar ScrollAreaScrollbarScroll = React2.forwardRef((props, forwardedRef) => {\n const { forceMount, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const isHorizontal = props.orientation === \"horizontal\";\n const debounceScrollEnd = useDebounceCallback(() => send(\"SCROLL_END\"), 100);\n const [state, send] = useStateMachine(\"hidden\", {\n hidden: {\n SCROLL: \"scrolling\"\n },\n scrolling: {\n SCROLL_END: \"idle\",\n POINTER_ENTER: \"interacting\"\n },\n interacting: {\n SCROLL: \"interacting\",\n POINTER_LEAVE: \"idle\"\n },\n idle: {\n HIDE: \"hidden\",\n SCROLL: \"scrolling\",\n POINTER_ENTER: \"interacting\"\n }\n });\n React2.useEffect(() => {\n if (state === \"idle\") {\n const hideTimer = window.setTimeout(() => send(\"HIDE\"), context.scrollHideDelay);\n return () => window.clearTimeout(hideTimer);\n }\n }, [state, context.scrollHideDelay, send]);\n React2.useEffect(() => {\n const viewport = context.viewport;\n const scrollDirection = isHorizontal ? \"scrollLeft\" : \"scrollTop\";\n if (viewport) {\n let prevScrollPos = viewport[scrollDirection];\n const handleScroll = () => {\n const scrollPos = viewport[scrollDirection];\n const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;\n if (hasScrollInDirectionChanged) {\n send(\"SCROLL\");\n debounceScrollEnd();\n }\n prevScrollPos = scrollPos;\n };\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [context.viewport, isHorizontal, send, debounceScrollEnd]);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || state !== \"hidden\", children: /* @__PURE__ */ jsx(\n ScrollAreaScrollbarVisible,\n {\n \"data-state\": state === \"hidden\" ? \"hidden\" : \"visible\",\n ...scrollbarProps,\n ref: forwardedRef,\n onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send(\"POINTER_ENTER\")),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send(\"POINTER_LEAVE\"))\n }\n ) });\n});\nvar ScrollAreaScrollbarAuto = React2.forwardRef((props, forwardedRef) => {\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const { forceMount, ...scrollbarProps } = props;\n const [visible, setVisible] = React2.useState(false);\n const isHorizontal = props.orientation === \"horizontal\";\n const handleResize = useDebounceCallback(() => {\n if (context.viewport) {\n const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;\n const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;\n setVisible(isHorizontal ? isOverflowX : isOverflowY);\n }\n }, 10);\n useResizeObserver(context.viewport, handleResize);\n useResizeObserver(context.content, handleResize);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx(\n ScrollAreaScrollbarVisible,\n {\n \"data-state\": visible ? \"visible\" : \"hidden\",\n ...scrollbarProps,\n ref: forwardedRef\n }\n ) });\n});\nvar ScrollAreaScrollbarVisible = React2.forwardRef((props, forwardedRef) => {\n const { orientation = \"vertical\", ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const thumbRef = React2.useRef(null);\n const pointerOffsetRef = React2.useRef(0);\n const [sizes, setSizes] = React2.useState({\n content: 0,\n viewport: 0,\n scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }\n });\n const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);\n const commonProps = {\n ...scrollbarProps,\n sizes,\n onSizesChange: setSizes,\n hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),\n onThumbChange: (thumb) => thumbRef.current = thumb,\n onThumbPointerUp: () => pointerOffsetRef.current = 0,\n onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos\n };\n function getScrollPosition(pointerPos, dir) {\n return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);\n }\n if (orientation === \"horizontal\") {\n return /* @__PURE__ */ jsx(\n ScrollAreaScrollbarX,\n {\n ...commonProps,\n ref: forwardedRef,\n onThumbPositionChange: () => {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollLeft;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);\n thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;\n }\n },\n onWheelScroll: (scrollPos) => {\n if (context.viewport) context.viewport.scrollLeft = scrollPos;\n },\n onDragScroll: (pointerPos) => {\n if (context.viewport) {\n context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);\n }\n }\n }\n );\n }\n if (orientation === \"vertical\") {\n return /* @__PURE__ */ jsx(\n ScrollAreaScrollbarY,\n {\n ...commonProps,\n ref: forwardedRef,\n onThumbPositionChange: () => {\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollTop;\n const offset = getThumbOffsetFromScroll(scrollPos, sizes);\n thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n },\n onWheelScroll: (scrollPos) => {\n if (context.viewport) context.viewport.scrollTop = scrollPos;\n },\n onDragScroll: (pointerPos) => {\n if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);\n }\n }\n );\n }\n return null;\n});\nvar ScrollAreaScrollbarX = React2.forwardRef((props, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React2.useState();\n const ref = React2.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);\n React2.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n return /* @__PURE__ */ jsx(\n ScrollAreaScrollbarImpl,\n {\n \"data-orientation\": \"horizontal\",\n ...scrollbarProps,\n ref: composeRefs,\n sizes,\n style: {\n bottom: 0,\n left: context.dir === \"rtl\" ? \"var(--radix-scroll-area-corner-width)\" : 0,\n right: context.dir === \"ltr\" ? \"var(--radix-scroll-area-corner-width)\" : 0,\n [\"--radix-scroll-area-thumb-width\"]: getThumbSize(sizes) + \"px\",\n ...props.style\n },\n onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),\n onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),\n onWheelScroll: (event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollLeft + event.deltaX;\n props.onWheelScroll(scrollPos);\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n },\n onResize: () => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollWidth,\n viewport: context.viewport.offsetWidth,\n scrollbar: {\n size: ref.current.clientWidth,\n paddingStart: toInt(computedStyle.paddingLeft),\n paddingEnd: toInt(computedStyle.paddingRight)\n }\n });\n }\n }\n }\n );\n});\nvar ScrollAreaScrollbarY = React2.forwardRef((props, forwardedRef) => {\n const { sizes, onSizesChange, ...scrollbarProps } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = React2.useState();\n const ref = React2.useRef(null);\n const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);\n React2.useEffect(() => {\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [ref]);\n return /* @__PURE__ */ jsx(\n ScrollAreaScrollbarImpl,\n {\n \"data-orientation\": \"vertical\",\n ...scrollbarProps,\n ref: composeRefs,\n sizes,\n style: {\n top: 0,\n right: context.dir === \"ltr\" ? 0 : void 0,\n left: context.dir === \"rtl\" ? 0 : void 0,\n bottom: \"var(--radix-scroll-area-corner-height)\",\n [\"--radix-scroll-area-thumb-height\"]: getThumbSize(sizes) + \"px\",\n ...props.style\n },\n onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),\n onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),\n onWheelScroll: (event, maxScrollPos) => {\n if (context.viewport) {\n const scrollPos = context.viewport.scrollTop + event.deltaY;\n props.onWheelScroll(scrollPos);\n if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {\n event.preventDefault();\n }\n }\n },\n onResize: () => {\n if (ref.current && context.viewport && computedStyle) {\n onSizesChange({\n content: context.viewport.scrollHeight,\n viewport: context.viewport.offsetHeight,\n scrollbar: {\n size: ref.current.clientHeight,\n paddingStart: toInt(computedStyle.paddingTop),\n paddingEnd: toInt(computedStyle.paddingBottom)\n }\n });\n }\n }\n }\n );\n});\nvar [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);\nvar ScrollAreaScrollbarImpl = React2.forwardRef((props, forwardedRef) => {\n const {\n __scopeScrollArea,\n sizes,\n hasThumb,\n onThumbChange,\n onThumbPointerUp,\n onThumbPointerDown,\n onThumbPositionChange,\n onDragScroll,\n onWheelScroll,\n onResize,\n ...scrollbarProps\n } = props;\n const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);\n const [scrollbar, setScrollbar] = React2.useState(null);\n const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));\n const rectRef = React2.useRef(null);\n const prevWebkitUserSelectRef = React2.useRef(\"\");\n const viewport = context.viewport;\n const maxScrollPos = sizes.content - sizes.viewport;\n const handleWheelScroll = useCallbackRef(onWheelScroll);\n const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);\n const handleResize = useDebounceCallback(onResize, 10);\n function handleDragScroll(event) {\n if (rectRef.current) {\n const x = event.clientX - rectRef.current.left;\n const y = event.clientY - rectRef.current.top;\n onDragScroll({ x, y });\n }\n }\n React2.useEffect(() => {\n const handleWheel = (event) => {\n const element = event.target;\n const isScrollbarWheel = scrollbar?.contains(element);\n if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);\n };\n document.addEventListener(\"wheel\", handleWheel, { passive: false });\n return () => document.removeEventListener(\"wheel\", handleWheel, { passive: false });\n }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);\n React2.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);\n useResizeObserver(scrollbar, handleResize);\n useResizeObserver(context.content, handleResize);\n return /* @__PURE__ */ jsx(\n ScrollbarProvider,\n {\n scope: __scopeScrollArea,\n scrollbar,\n hasThumb,\n onThumbChange: useCallbackRef(onThumbChange),\n onThumbPointerUp: useCallbackRef(onThumbPointerUp),\n onThumbPositionChange: handleThumbPositionChange,\n onThumbPointerDown: useCallbackRef(onThumbPointerDown),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...scrollbarProps,\n ref: composeRefs,\n style: { position: \"absolute\", ...scrollbarProps.style },\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n const mainPointer = 0;\n if (event.button === mainPointer) {\n const element = event.target;\n element.setPointerCapture(event.pointerId);\n rectRef.current = scrollbar.getBoundingClientRect();\n prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;\n document.body.style.webkitUserSelect = \"none\";\n if (context.viewport) context.viewport.style.scrollBehavior = \"auto\";\n handleDragScroll(event);\n }\n }),\n onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n const element = event.target;\n if (element.hasPointerCapture(event.pointerId)) {\n element.releasePointerCapture(event.pointerId);\n }\n document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;\n if (context.viewport) context.viewport.style.scrollBehavior = \"\";\n rectRef.current = null;\n })\n }\n )\n }\n );\n});\nvar THUMB_NAME = \"ScrollAreaThumb\";\nvar ScrollAreaThumb = React2.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, ...thumbProps } = props;\n const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });\n }\n);\nvar ScrollAreaThumbImpl = React2.forwardRef(\n (props, forwardedRef) => {\n const { __scopeScrollArea, style, ...thumbProps } = props;\n const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);\n const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);\n const { onThumbPositionChange } = scrollbarContext;\n const composedRef = useComposedRefs(\n forwardedRef,\n (node) => scrollbarContext.onThumbChange(node)\n );\n const removeUnlinkedScrollListenerRef = React2.useRef(void 0);\n const debounceScrollEnd = useDebounceCallback(() => {\n if (removeUnlinkedScrollListenerRef.current) {\n removeUnlinkedScrollListenerRef.current();\n removeUnlinkedScrollListenerRef.current = void 0;\n }\n }, 100);\n React2.useEffect(() => {\n const viewport = scrollAreaContext.viewport;\n if (viewport) {\n const handleScroll = () => {\n debounceScrollEnd();\n if (!removeUnlinkedScrollListenerRef.current) {\n const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);\n removeUnlinkedScrollListenerRef.current = listener;\n onThumbPositionChange();\n }\n };\n onThumbPositionChange();\n viewport.addEventListener(\"scroll\", handleScroll);\n return () => viewport.removeEventListener(\"scroll\", handleScroll);\n }\n }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": scrollbarContext.hasThumb ? \"visible\" : \"hidden\",\n ...thumbProps,\n ref: composedRef,\n style: {\n width: \"var(--radix-scroll-area-thumb-width)\",\n height: \"var(--radix-scroll-area-thumb-height)\",\n ...style\n },\n onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {\n const thumb = event.target;\n const thumbRect = thumb.getBoundingClientRect();\n const x = event.clientX - thumbRect.left;\n const y = event.clientY - thumbRect.top;\n scrollbarContext.onThumbPointerDown({ x, y });\n }),\n onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)\n }\n );\n }\n);\nScrollAreaThumb.displayName = THUMB_NAME;\nvar CORNER_NAME = \"ScrollAreaCorner\";\nvar ScrollAreaCorner = React2.forwardRef(\n (props, forwardedRef) => {\n const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);\n const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);\n const hasCorner = context.type !== \"scroll\" && hasBothScrollbarsVisible;\n return hasCorner ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;\n }\n);\nScrollAreaCorner.displayName = CORNER_NAME;\nvar ScrollAreaCornerImpl = React2.forwardRef((props, forwardedRef) => {\n const { __scopeScrollArea, ...cornerProps } = props;\n const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);\n const [width, setWidth] = React2.useState(0);\n const [height, setHeight] = React2.useState(0);\n const hasSize = Boolean(width && height);\n useResizeObserver(context.scrollbarX, () => {\n const height2 = context.scrollbarX?.offsetHeight || 0;\n context.onCornerHeightChange(height2);\n setHeight(height2);\n });\n useResizeObserver(context.scrollbarY, () => {\n const width2 = context.scrollbarY?.offsetWidth || 0;\n context.onCornerWidthChange(width2);\n setWidth(width2);\n });\n return hasSize ? /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...cornerProps,\n ref: forwardedRef,\n style: {\n width,\n height,\n position: \"absolute\",\n right: context.dir === \"ltr\" ? 0 : void 0,\n left: context.dir === \"rtl\" ? 0 : void 0,\n bottom: 0,\n ...props.style\n }\n }\n ) : null;\n});\nfunction toInt(value) {\n return value ? parseInt(value, 10) : 0;\n}\nfunction getThumbRatio(viewportSize, contentSize) {\n const ratio = viewportSize / contentSize;\n return isNaN(ratio) ? 0 : ratio;\n}\nfunction getThumbSize(sizes) {\n const ratio = getThumbRatio(sizes.viewport, sizes.content);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;\n return Math.max(thumbSize, 18);\n}\nfunction getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = \"ltr\") {\n const thumbSizePx = getThumbSize(sizes);\n const thumbCenter = thumbSizePx / 2;\n const offset = pointerOffset || thumbCenter;\n const thumbOffsetFromEnd = thumbSizePx - offset;\n const minPointerPos = sizes.scrollbar.paddingStart + offset;\n const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;\n const maxScrollPos = sizes.content - sizes.viewport;\n const scrollRange = dir === \"ltr\" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);\n return interpolate(pointerPos);\n}\nfunction getThumbOffsetFromScroll(scrollPos, sizes, dir = \"ltr\") {\n const thumbSizePx = getThumbSize(sizes);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const scrollbar = sizes.scrollbar.size - scrollbarPadding;\n const maxScrollPos = sizes.content - sizes.viewport;\n const maxThumbPos = scrollbar - thumbSizePx;\n const scrollClampRange = dir === \"ltr\" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];\n const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange);\n const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);\n return interpolate(scrollWithoutMomentum);\n}\nfunction linearScale(input, output) {\n return (value) => {\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\nfunction isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {\n return scrollPos > 0 && scrollPos < maxScrollPos;\n}\nvar addUnlinkedScrollListener = (node, handler = () => {\n}) => {\n let prevPosition = { left: node.scrollLeft, top: node.scrollTop };\n let rAF = 0;\n (function loop() {\n const position = { left: node.scrollLeft, top: node.scrollTop };\n const isHorizontalScroll = prevPosition.left !== position.left;\n const isVerticalScroll = prevPosition.top !== position.top;\n if (isHorizontalScroll || isVerticalScroll) handler();\n prevPosition = position;\n rAF = window.requestAnimationFrame(loop);\n })();\n return () => window.cancelAnimationFrame(rAF);\n};\nfunction useDebounceCallback(callback, delay) {\n const handleCallback = useCallbackRef(callback);\n const debounceTimerRef = React2.useRef(0);\n React2.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);\n return React2.useCallback(() => {\n window.clearTimeout(debounceTimerRef.current);\n debounceTimerRef.current = window.setTimeout(handleCallback, delay);\n }, [handleCallback, delay]);\n}\nfunction useResizeObserver(element, onResize) {\n const handleResize = useCallbackRef(onResize);\n useLayoutEffect(() => {\n let rAF = 0;\n if (element) {\n const resizeObserver = new ResizeObserver(() => {\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return () => {\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [element, handleResize]);\n}\nvar Root = ScrollArea;\nvar Viewport = ScrollAreaViewport;\nvar Scrollbar = ScrollAreaScrollbar;\nvar Thumb = ScrollAreaThumb;\nvar Corner = ScrollAreaCorner;\nexport {\n Corner,\n Root,\n ScrollArea,\n ScrollAreaCorner,\n ScrollAreaScrollbar,\n ScrollAreaThumb,\n ScrollAreaViewport,\n Scrollbar,\n Thumb,\n Viewport,\n createScrollAreaScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction ScrollArea({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn(\"relative\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n )\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n \"flex touch-none p-px transition-colors select-none\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-full\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n )\n}\n\nexport { ScrollArea, ScrollBar }\n","\"use client\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n ScrollArea,\n ScrollBar,\n} from \"@/components/ui/scroll-area\";\nimport { cn } from \"@/lib/utils\";\nimport type { ComponentProps } from \"react\";\n\nexport type SuggestionsProps = ComponentProps<typeof ScrollArea>;\n\nexport const Suggestions = ({\n className,\n children,\n ...props\n}: SuggestionsProps) => (\n <ScrollArea className=\"w-full overflow-x-auto whitespace-nowrap\" {...props}>\n <div className={cn(\"flex w-max flex-nowrap items-center gap-2\", className)}>\n {children}\n </div>\n <ScrollBar className=\"hidden\" orientation=\"horizontal\" />\n </ScrollArea>\n);\n\nexport type SuggestionProps = Omit<ComponentProps<typeof Button>, \"onClick\"> & {\n suggestion: string;\n onClick?: (suggestion: string) => void;\n};\n\nexport const Suggestion = ({\n suggestion,\n onClick,\n className,\n variant = \"outline\",\n size = \"sm\",\n children,\n ...props\n}: SuggestionProps) => {\n const handleClick = () => {\n onClick?.(suggestion);\n };\n\n return (\n <Button\n className={cn(\n \"cursor-pointer rounded-full px-4 transition-all duration-200\",\n \"hover:scale-[1.02] hover:shadow-md hover:border-primary/50\",\n className\n )}\n onClick={handleClick}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children || suggestion}\n </Button>\n );\n};\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M13 5h8', key: 'a7qcls' }],\n ['path', { d: 'M13 12h8', key: 'h98zly' }],\n ['path', { d: 'M13 19h8', key: 'c3s6r1' }],\n ['path', { d: 'm3 17 2 2 4-4', key: '1jhpwq' }],\n ['rect', { x: '3', y: '4', width: '6', height: '6', rx: '1', key: 'cif1o7' }],\n];\n\n/**\n * @component @name ListTodo\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgNWg4IiAvPgogIDxwYXRoIGQ9Ik0xMyAxMmg4IiAvPgogIDxwYXRoIGQ9Ik0xMyAxOWg4IiAvPgogIDxwYXRoIGQ9Im0zIDE3IDIgMiA0LTQiIC8+CiAgPHJlY3QgeD0iMyIgeT0iNCIgd2lkdGg9IjYiIGhlaWdodD0iNiIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/list-todo\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ListTodo = createLucideIcon('list-todo', __iconNode);\n\nexport default ListTodo;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n];\n\n/**\n * @component @name CircleDot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-dot\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleDot = createLucideIcon('circle-dot', __iconNode);\n\nexport default CircleDot;\n","\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { type TodoItem, type TodosResponse } from \"@/lib/api\";\nimport {\n CheckCircle2Icon,\n CircleIcon,\n CircleDotIcon,\n XCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n ListTodoIcon,\n} from \"lucide-react\";\nimport { useState } from \"react\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nexport interface TodoPanelProps {\n todosData: TodosResponse | null;\n isLoading?: boolean;\n className?: string;\n}\n\nconst statusIcons: Record<string, typeof CircleIcon> = {\n pending: CircleIcon,\n in_progress: CircleDotIcon,\n completed: CheckCircle2Icon,\n cancelled: XCircleIcon,\n};\n\nconst statusColors: Record<string, string> = {\n pending: \"text-muted-foreground\",\n in_progress: \"text-primary\",\n completed: \"text-green-500\",\n cancelled: \"text-muted-foreground/50\",\n};\n\nexport function TodoPanel({ todosData, isLoading, className }: TodoPanelProps) {\n const [isExpanded, setIsExpanded] = useState(false);\n \n if (!todosData || todosData.todos.length === 0) {\n return null;\n }\n\n const { todos, stats, nextTodo } = todosData;\n \n // Sort: in_progress first, then pending, then completed/cancelled\n const sortedTodos = [...todos].sort((a, b) => {\n const order: Record<string, number> = { in_progress: 0, pending: 1, completed: 2, cancelled: 3 };\n return (order[a.status] ?? 4) - (order[b.status] ?? 4);\n });\n\n const progressPercent = stats.total > 0 \n ? Math.round((stats.completed / stats.total) * 100) \n : 0;\n\n return (\n <div className={cn(\n \"rounded-lg border bg-card/50 backdrop-blur-sm overflow-hidden\",\n className\n )}>\n {/* Header - always shows current task and stats */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2 hover:bg-muted/50 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">\n <ListTodoIcon className=\"size-4 text-primary shrink-0\" />\n {/* Show current task inline when collapsed */}\n {!isExpanded && nextTodo ? (\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">\n <CircleDotIcon className=\"size-3.5 text-primary shrink-0\" />\n <span className=\"text-sm truncate\">{nextTodo.content}</span>\n </div>\n ) : (\n <span className=\"font-medium text-sm\">Tasks</span>\n )}\n <span className=\"text-xs text-muted-foreground shrink-0\">\n {stats.completed}/{stats.total}\n </span>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {/* Progress bar */}\n <div className=\"w-16 h-1.5 bg-muted rounded-full overflow-hidden\">\n <div \n className=\"h-full bg-primary transition-all duration-300\"\n style={{ width: `${progressPercent}%` }}\n />\n </div>\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {isExpanded && (\n <div className=\"border-t\">\n {/* Next todo highlight */}\n {nextTodo && (\n <div className=\"px-3 py-2 bg-primary/5 border-b flex items-center gap-2\">\n <CircleDotIcon className=\"size-4 text-primary shrink-0\" />\n <div className=\"min-w-0 flex-1\">\n <span className=\"text-xs text-primary font-medium uppercase tracking-wide\">\n Current\n </span>\n <p className=\"text-sm font-medium truncate\">{nextTodo.content}</p>\n </div>\n </div>\n )}\n\n {/* Todo list */}\n <div className=\"max-h-[200px] overflow-auto\">\n {sortedTodos.map((todo) => {\n const Icon = statusIcons[todo.status] || CircleIcon;\n const color = statusColors[todo.status] || \"text-muted-foreground\";\n const isNext = todo.id === nextTodo?.id;\n \n return (\n <Tooltip key={todo.id}>\n <TooltipTrigger asChild>\n <div \n className={cn(\n \"flex items-start gap-2 px-3 py-1.5 hover:bg-muted/30 transition-colors cursor-default\",\n isNext && \"bg-primary/5\"\n )}\n >\n <Icon className={cn(\"size-4 mt-0.5 shrink-0\", color)} />\n <span className={cn(\n \"text-sm flex-1 min-w-0 truncate\",\n todo.status === \"cancelled\" && \"line-through text-muted-foreground/50\",\n todo.status === \"completed\" && \"text-muted-foreground\"\n )}>\n {todo.content}\n </span>\n </div>\n </TooltipTrigger>\n <TooltipContent side=\"left\" className=\"max-w-xs\">\n <p className=\"text-sm\">{todo.content}</p>\n <p className=\"text-xs text-muted-foreground capitalize mt-1\">\n {todo.status.replace('_', ' ')}\n </p>\n </TooltipContent>\n </Tooltip>\n );\n })}\n </div>\n\n {/* Stats footer */}\n <div className=\"px-3 py-1.5 border-t bg-muted/30 flex items-center gap-3 text-xs text-muted-foreground\">\n {stats.inProgress > 0 && (\n <span className=\"flex items-center gap-1\">\n <CircleDotIcon className=\"size-3 text-primary\" />\n {stats.inProgress} active\n </span>\n )}\n {stats.pending > 0 && (\n <span className=\"flex items-center gap-1\">\n <CircleIcon className=\"size-3\" />\n {stats.pending} pending\n </span>\n )}\n {stats.completed > 0 && (\n <span className=\"flex items-center gap-1\">\n <CheckCircle2Icon className=\"size-3 text-green-500\" />\n {stats.completed} done\n </span>\n )}\n </div>\n </div>\n )}\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm9 12 2 2 4-4', key: 'dzmm74' }],\n];\n\n/**\n * @component @name CircleCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJtOSAxMiAyIDIgNC00IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleCheck = createLucideIcon('circle-check', __iconNode);\n\nexport default CircleCheck;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'm21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3',\n key: 'wmoenq',\n },\n ],\n ['path', { d: 'M12 9v4', key: 'juzpu7' }],\n ['path', { d: 'M12 17h.01', key: 'p32p05' }],\n];\n\n/**\n * @component @name TriangleAlert\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMjEuNzMgMTgtOC0xNGEyIDIgMCAwIDAtMy40OCAwbC04IDE0QTIgMiAwIDAgMCA0IDIxaDE2YTIgMiAwIDAgMCAxLjczLTMiIC8+CiAgPHBhdGggZD0iTTEyIDl2NCIgLz4KICA8cGF0aCBkPSJNMTIgMTdoLjAxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/triangle-alert\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst TriangleAlert = createLucideIcon('triangle-alert', __iconNode);\n\nexport default TriangleAlert;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n ['path', { d: 'M10 12.5 8 15l2 2.5', key: '1tg20x' }],\n ['path', { d: 'm14 12.5 2 2.5-2 2.5', key: 'yinavb' }],\n];\n\n/**\n * @component @name FileCode\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KICA8cGF0aCBkPSJNMTAgMTIuNSA4IDE1bDIgMi41IiAvPgogIDxwYXRoIGQ9Im0xNCAxMi41IDIgMi41LTIgMi41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-code\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileCode = createLucideIcon('file-code', __iconNode);\n\nexport default FileCode;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z',\n key: '1a8usu',\n },\n ],\n ['path', { d: 'm15 5 4 4', key: '1mk7zo' }],\n];\n\n/**\n * @component @name Pencil\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEuMTc0IDYuODEyYTEgMSAwIDAgMC0zLjk4Ni0zLjk4N0wzLjg0MiAxNi4xNzRhMiAyIDAgMCAwLS41LjgzbC0xLjMyMSA0LjM1MmEuNS41IDAgMCAwIC42MjMuNjIybDQuMzUzLTEuMzJhMiAyIDAgMCAwIC44My0uNDk3eiIgLz4KICA8cGF0aCBkPSJtMTUgNSA0IDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/pencil\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Pencil = createLucideIcon('pencil', __iconNode);\n\nexport default Pencil;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8', key: '1357e3' }],\n ['path', { d: 'M3 3v5h5', key: '1xhq8a' }],\n];\n\n/**\n * @component @name RotateCcw\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAxIDAgOS05IDkuNzUgOS43NSAwIDAgMC02Ljc0IDIuNzRMMyA4IiAvPgogIDxwYXRoIGQ9Ik0zIDN2NWg1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/rotate-ccw\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RotateCcw = createLucideIcon('rotate-ccw', __iconNode);\n\nexport default RotateCcw;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n];\n\n/**\n * @component @name File\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst File = createLucideIcon('file', __iconNode);\n\nexport default File;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n ['path', { d: 'M9 15h6', key: 'cctwl0' }],\n ['path', { d: 'M12 18v-6', key: '17g6i2' }],\n];\n\n/**\n * @component @name FilePlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KICA8cGF0aCBkPSJNOSAxNWg2IiAvPgogIDxwYXRoIGQ9Ik0xMiAxOHYtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-plus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FilePlus = createLucideIcon('file-plus', __iconNode);\n\nexport default FilePlus;\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport {\n CheckCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CopyIcon,\n FileCodeIcon,\n FileIcon,\n FilePlusIcon,\n PencilIcon,\n XCircleIcon,\n} from \"lucide-react\";\nimport { useState, useMemo, memo } from \"react\";\nimport { CodeBlock } from \"./code-block\";\n\n// Language detection from file extension\nconst getLanguageFromPath = (path: string): string => {\n const ext = path.split(\".\").pop()?.toLowerCase() || \"\";\n const langMap: Record<string, string> = {\n ts: \"typescript\",\n tsx: \"tsx\",\n js: \"javascript\",\n jsx: \"jsx\",\n py: \"python\",\n rb: \"ruby\",\n go: \"go\",\n rs: \"rust\",\n java: \"java\",\n c: \"c\",\n cpp: \"cpp\",\n h: \"c\",\n hpp: \"cpp\",\n cs: \"csharp\",\n php: \"php\",\n swift: \"swift\",\n kt: \"kotlin\",\n scala: \"scala\",\n sh: \"bash\",\n bash: \"bash\",\n zsh: \"bash\",\n fish: \"bash\",\n ps1: \"powershell\",\n sql: \"sql\",\n html: \"html\",\n htm: \"html\",\n css: \"css\",\n scss: \"scss\",\n sass: \"sass\",\n less: \"less\",\n json: \"json\",\n yaml: \"yaml\",\n yml: \"yaml\",\n xml: \"xml\",\n md: \"markdown\",\n markdown: \"markdown\",\n txt: \"plaintext\",\n toml: \"toml\",\n ini: \"ini\",\n cfg: \"ini\",\n conf: \"ini\",\n dockerfile: \"dockerfile\",\n makefile: \"makefile\",\n };\n return langMap[ext] || \"plaintext\";\n};\n\nexport interface WriteFileInput {\n path?: string;\n mode?: \"full\" | \"str_replace\";\n content?: string;\n old_string?: string;\n new_string?: string;\n}\n\nexport interface WriteFileOutput {\n success?: boolean;\n error?: string;\n mode?: \"full\" | \"str_replace\";\n action?: \"created\" | \"replaced\";\n linesRemoved?: number;\n linesAdded?: number;\n lineDelta?: number;\n bytesWritten?: number;\n lineCount?: number;\n}\n\nexport interface WriteFileToolProps {\n input: WriteFileInput;\n output?: WriteFileOutput;\n status: \"pending\" | \"streaming\" | \"running\" | \"completed\" | \"rejected\" | \"error\";\n /** Raw streaming args text (before JSON parsing) */\n streamingArgsText?: string;\n className?: string;\n}\n\n// Simple diff line component\nconst DiffLine = memo(({ line, type }: { line: string; type: \"add\" | \"remove\" | \"context\" }) => {\n const prefix = type === \"add\" ? \"+\" : type === \"remove\" ? \"-\" : \" \";\n const bgClass = type === \"add\" \n ? \"bg-green-500/10\" \n : type === \"remove\" \n ? \"bg-red-500/10\" \n : \"\";\n const textClass = type === \"add\"\n ? \"text-green-600 dark:text-green-400\"\n : type === \"remove\"\n ? \"text-red-600 dark:text-red-400\"\n : \"text-muted-foreground\";\n\n return (\n <div className={cn(\"font-mono text-xs leading-5 px-2\", bgClass, textClass)}>\n <span className=\"select-none w-4 inline-block\">{prefix}</span>\n <span className=\"whitespace-pre-wrap break-all\">{line || \" \"}</span>\n </div>\n );\n});\nDiffLine.displayName = \"DiffLine\";\n\n// Generate diff lines from old and new strings\nfunction generateDiffLines(oldStr: string, newStr: string): { line: string; type: \"add\" | \"remove\" | \"context\" }[] {\n const oldLines = oldStr.split(\"\\n\");\n const newLines = newStr.split(\"\\n\");\n const result: { line: string; type: \"add\" | \"remove\" | \"context\" }[] = [];\n\n // Simple diff: show removed lines first, then added lines\n // For a more sophisticated diff, could use a proper diff algorithm\n for (const line of oldLines) {\n result.push({ line, type: \"remove\" });\n }\n for (const line of newLines) {\n result.push({ line, type: \"add\" });\n }\n\n return result;\n}\n\nexport function WriteFileTool({\n input,\n output,\n status,\n streamingArgsText,\n className,\n}: WriteFileToolProps) {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const filePath = input?.path || \"\";\n const fileName = filePath.split(\"/\").pop() || \"file\";\n // Check both input and output for mode (output has it after execution)\n const mode = input?.mode || output?.mode || \"full\";\n const language = getLanguageFromPath(filePath);\n\n // Parse streaming args to extract partial content\n const streamingContent = useMemo(() => {\n if (!streamingArgsText) return null;\n \n try {\n // Try to parse what we have so far\n // The streaming args come as partial JSON, so we may need to be lenient\n const parsed = JSON.parse(streamingArgsText);\n return parsed;\n } catch {\n // Try to extract content from partial JSON\n // Look for \"content\": \"...\" pattern (use [\\s\\S] for cross-line matching)\n const contentMatch = streamingArgsText.match(/\"content\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\[\\s\\S])*)(?:\"|$)/);\n if (contentMatch) {\n try {\n // Unescape the string\n return { content: JSON.parse(`\"${contentMatch[1]}\"`) };\n } catch {\n return { content: contentMatch[1] };\n }\n }\n \n // Look for old_string/new_string patterns\n const oldMatch = streamingArgsText.match(/\"old_string\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\[\\s\\S])*)(?:\"|$)/);\n const newMatch = streamingArgsText.match(/\"new_string\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\[\\s\\S])*)(?:\"|$)/);\n \n if (oldMatch || newMatch) {\n return {\n old_string: oldMatch ? oldMatch[1] : undefined,\n new_string: newMatch ? newMatch[1] : undefined,\n };\n }\n \n return null;\n }\n }, [streamingArgsText]);\n\n // Determine what content to show\n const displayContent = input?.content || streamingContent?.content || \"\";\n const displayOldString = input?.old_string || streamingContent?.old_string || \"\";\n const displayNewString = input?.new_string || streamingContent?.new_string || \"\";\n\n const isStreaming = status === \"streaming\" || status === \"pending\";\n const isCompleted = status === \"completed\";\n // Only show error if success is explicitly false, not just undefined\n const isError = status === \"error\" || output?.success === false;\n\n // Status icon and color\n const StatusIcon = isCompleted && output?.success\n ? CheckCircleIcon\n : isError\n ? XCircleIcon\n : isStreaming\n ? FileCodeIcon\n : FileIcon;\n\n const statusColor = isCompleted && output?.success\n ? \"text-green-600 dark:text-green-500\"\n : isError\n ? \"text-red-600 dark:text-red-500\"\n : isStreaming\n ? \"text-blue-600 dark:text-blue-500\"\n : \"text-muted-foreground\";\n\n // Mode icon\n const ModeIcon = mode === \"str_replace\" ? PencilIcon : output?.action === \"created\" ? FilePlusIcon : FileCodeIcon;\n\n return (\n <div className={cn(\"rounded-lg border overflow-hidden bg-background\", className)}>\n {/* Header */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2.5 bg-muted/50 hover:bg-muted/70 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <StatusIcon className={cn(\"size-4 shrink-0\", statusColor)} />\n <ModeIcon className=\"size-3.5 text-muted-foreground shrink-0\" />\n <span className=\"font-medium text-sm truncate\">{fileName}</span>\n {mode === \"str_replace\" && (\n <Badge variant=\"secondary\" className=\"text-xs shrink-0\">\n edit\n </Badge>\n )}\n {output?.action === \"created\" && (\n <Badge variant=\"secondary\" className=\"text-xs shrink-0\">\n new\n </Badge>\n )}\n {isStreaming && (\n <span className=\"text-xs text-muted-foreground animate-pulse\">streaming...</span>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {output?.success && output.lineDelta !== undefined && (\n <span className={cn(\n \"text-xs font-mono\",\n output.lineDelta >= 0 ? \"text-green-600 dark:text-green-400\" : \"text-red-600 dark:text-red-400\"\n )}>\n {output.lineDelta >= 0 ? \"+\" : \"\"}{output.lineDelta}\n </span>\n )}\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {/* Content */}\n {isExpanded && (\n <div className=\"border-t\">\n {/* File path */}\n <div className=\"px-3 py-1.5 bg-muted/30 border-b flex items-center justify-between\">\n <span className=\"text-xs text-muted-foreground font-mono truncate\">{filePath}</span>\n {displayContent && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6\"\n onClick={() => navigator.clipboard.writeText(displayContent)}\n >\n <CopyIcon className=\"size-3\" />\n </Button>\n )}\n </div>\n\n {/* str_replace mode: show diff view */}\n {mode === \"str_replace\" ? (\n <div className=\"max-h-[200px] overflow-auto\">\n {/* Removed section */}\n {displayOldString && (\n <div className=\"border-b\">\n <div className=\"px-3 py-1 bg-red-500/5 border-b text-xs text-red-600 dark:text-red-400 font-medium\">\n Removed\n </div>\n <div className=\"py-1\">\n {displayOldString.split(\"\\n\").map((line: string, i: number) => (\n <DiffLine key={`old-${i}`} line={line} type=\"remove\" />\n ))}\n </div>\n </div>\n )}\n\n {/* Added section */}\n {displayNewString && (\n <div>\n <div className=\"px-3 py-1 bg-green-500/5 border-b text-xs text-green-600 dark:text-green-400 font-medium\">\n Added\n </div>\n <div className=\"py-1\">\n {displayNewString.split(\"\\n\").map((line: string, i: number) => (\n <DiffLine key={`new-${i}`} line={line} type=\"add\" />\n ))}\n </div>\n </div>\n )}\n\n {/* Streaming indicator when no content yet */}\n {!displayOldString && !displayNewString && isStreaming && (\n <div className=\"px-3 py-4 text-center text-muted-foreground text-sm\">\n <span className=\"animate-pulse\">Receiving changes...</span>\n </div>\n )}\n </div>\n ) : (\n /* full mode: show code block */\n <div className=\"max-h-[200px] overflow-auto\">\n {displayContent ? (\n <CodeBlock\n code={displayContent}\n language={language as \"typescript\"}\n showLineNumbers\n />\n ) : isStreaming ? (\n <div className=\"px-3 py-4 text-center text-muted-foreground text-sm\">\n <span className=\"animate-pulse\">Writing file...</span>\n </div>\n ) : null}\n </div>\n )}\n\n {/* Status/Result footer - only show when we have a definitive success or error */}\n {(output?.success === true || output?.success === false || isError) && (\n <div className={cn(\n \"px-3 py-2 border-t text-xs flex items-center gap-2\",\n output?.success === true\n ? \"bg-green-500/5 text-green-600 dark:text-green-400\"\n : \"bg-red-500/5 text-red-600 dark:text-red-400\"\n )}>\n {output?.success === true ? (\n <>\n <CheckCircleIcon className=\"size-3.5\" />\n <span>\n {mode === \"str_replace\"\n ? `Replaced ${output.linesRemoved || 0} → ${output.linesAdded || 0} lines`\n : `${output.action === \"created\" ? \"Created\" : \"Updated\"} (${output.lineCount || 0} lines)`\n }\n </span>\n </>\n ) : (\n <>\n <XCircleIcon className=\"size-3.5\" />\n <span>{output?.error || \"Failed to write file\"}</span>\n </>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n ['path', { d: 'M10 9H8', key: 'b1mrlr' }],\n ['path', { d: 'M16 13H8', key: 't4e002' }],\n ['path', { d: 'M16 17H8', key: 'z1uh3a' }],\n];\n\n/**\n * @component @name FileText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNiAyMmEyIDIgMCAwIDEtMi0yVjRhMiAyIDAgMCAxIDItMmg4YTIuNCAyLjQgMCAwIDEgMS43MDQuNzA2bDMuNTg4IDMuNTg4QTIuNCAyLjQgMCAwIDEgMjAgOHYxMmEyIDIgMCAwIDEtMiAyeiIgLz4KICA8cGF0aCBkPSJNMTQgMnY1YTEgMSAwIDAgMCAxIDFoNSIgLz4KICA8cGF0aCBkPSJNMTAgOUg4IiAvPgogIDxwYXRoIGQ9Ik0xNiAxM0g4IiAvPgogIDxwYXRoIGQ9Ik0xNiAxN0g4IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-text\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileText = createLucideIcon('file-text', __iconNode);\n\nexport default FileText;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '6', cy: '6', r: '3', key: '1lh9wr' }],\n ['path', { d: 'M8.12 8.12 12 12', key: '1alkpv' }],\n ['path', { d: 'M20 4 8.12 15.88', key: 'xgtan2' }],\n ['circle', { cx: '6', cy: '18', r: '3', key: 'fqmcym' }],\n ['path', { d: 'M14.8 14.8 20 20', key: 'ptml3r' }],\n];\n\n/**\n * @component @name Scissors\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI2IiBjeT0iNiIgcj0iMyIgLz4KICA8cGF0aCBkPSJNOC4xMiA4LjEyIDEyIDEyIiAvPgogIDxwYXRoIGQ9Ik0yMCA0IDguMTIgMTUuODgiIC8+CiAgPGNpcmNsZSBjeD0iNiIgY3k9IjE4IiByPSIzIiAvPgogIDxwYXRoIGQ9Ik0xNC44IDE0LjggMjAgMjAiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/scissors\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Scissors = createLucideIcon('scissors', __iconNode);\n\nexport default Scissors;\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport {\n CheckCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CopyIcon,\n FileIcon,\n FileTextIcon,\n AlertCircleIcon,\n ScissorsIcon,\n} from \"lucide-react\";\nimport { useState, useMemo } from \"react\";\nimport { CodeBlock } from \"./code-block\";\n\n// Language detection from file extension\nconst getLanguageFromPath = (path: string): string => {\n const ext = path.split(\".\").pop()?.toLowerCase() || \"\";\n const langMap: Record<string, string> = {\n ts: \"typescript\",\n tsx: \"tsx\",\n js: \"javascript\",\n jsx: \"jsx\",\n py: \"python\",\n rb: \"ruby\",\n go: \"go\",\n rs: \"rust\",\n java: \"java\",\n c: \"c\",\n cpp: \"cpp\",\n h: \"c\",\n hpp: \"cpp\",\n cs: \"csharp\",\n php: \"php\",\n swift: \"swift\",\n kt: \"kotlin\",\n scala: \"scala\",\n sh: \"bash\",\n bash: \"bash\",\n zsh: \"bash\",\n fish: \"bash\",\n ps1: \"powershell\",\n sql: \"sql\",\n html: \"html\",\n htm: \"html\",\n css: \"css\",\n scss: \"scss\",\n sass: \"sass\",\n less: \"less\",\n json: \"json\",\n yaml: \"yaml\",\n yml: \"yaml\",\n xml: \"xml\",\n md: \"markdown\",\n markdown: \"markdown\",\n txt: \"plaintext\",\n toml: \"toml\",\n ini: \"ini\",\n cfg: \"ini\",\n conf: \"ini\",\n dockerfile: \"dockerfile\",\n makefile: \"makefile\",\n };\n return langMap[ext] || \"plaintext\";\n};\n\n// Format file size\nconst formatFileSize = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / 1024 / 1024).toFixed(2)} MB`;\n};\n\nexport interface ReadFileInput {\n path?: string;\n startLine?: number;\n endLine?: number;\n}\n\nexport interface ReadFileOutput {\n success?: boolean;\n error?: string;\n path?: string;\n relativePath?: string;\n content?: string;\n lineCount?: number;\n wasTruncated?: boolean;\n sizeBytes?: number;\n}\n\nexport interface ReadFileToolProps {\n input: ReadFileInput;\n output?: ReadFileOutput;\n status: \"pending\" | \"streaming\" | \"running\" | \"completed\" | \"rejected\" | \"error\";\n className?: string;\n}\n\nexport function ReadFileTool({\n input,\n output,\n status,\n className,\n}: ReadFileToolProps) {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const filePath = input?.path || output?.relativePath || output?.path || \"\";\n const fileName = filePath.split(\"/\").pop() || \"file\";\n const language = getLanguageFromPath(filePath);\n\n const content = output?.content || \"\";\n const isLoading = status === \"pending\" || status === \"streaming\" || status === \"running\";\n const isCompleted = status === \"completed\" && output?.success === true;\n // Only show error if success is explicitly false, not just undefined\n const isError = status === \"error\" || output?.success === false;\n\n // Format line range if specified\n const lineRangeText = useMemo(() => {\n if (input?.startLine && input?.endLine) {\n return `lines ${input.startLine}-${input.endLine}`;\n }\n if (input?.startLine) {\n return `from line ${input.startLine}`;\n }\n if (input?.endLine) {\n return `to line ${input.endLine}`;\n }\n return null;\n }, [input?.startLine, input?.endLine]);\n\n // Status icon and color\n const StatusIcon = isCompleted\n ? CheckCircleIcon\n : isError\n ? AlertCircleIcon\n : FileIcon;\n\n const statusColor = isCompleted\n ? \"text-green-600 dark:text-green-500\"\n : isError\n ? \"text-red-600 dark:text-red-500\"\n : \"text-muted-foreground\";\n\n return (\n <div className={cn(\"rounded-lg border overflow-hidden bg-background\", className)}>\n {/* Header */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2.5 bg-muted/50 hover:bg-muted/70 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <StatusIcon className={cn(\"size-4 shrink-0\", statusColor)} />\n <FileTextIcon className=\"size-3.5 text-muted-foreground shrink-0\" />\n <span className=\"font-medium text-sm truncate\">{fileName}</span>\n {lineRangeText && (\n <Badge variant=\"outline\" className=\"text-xs shrink-0\">\n {lineRangeText}\n </Badge>\n )}\n {output?.wasTruncated && (\n <Badge variant=\"secondary\" className=\"text-xs shrink-0 gap-1\">\n <ScissorsIcon className=\"size-3\" />\n truncated\n </Badge>\n )}\n {isLoading && (\n <span className=\"text-xs text-muted-foreground animate-pulse\">reading...</span>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {output?.lineCount !== undefined && (\n <span className=\"text-xs text-muted-foreground\">\n {output.lineCount} lines\n </span>\n )}\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {/* Content */}\n {isExpanded && (\n <div className=\"border-t\">\n {/* File path bar */}\n <div className=\"px-3 py-1.5 bg-muted/30 border-b flex items-center justify-between\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <span className=\"text-xs text-muted-foreground font-mono truncate\">{filePath}</span>\n {output?.sizeBytes !== undefined && (\n <span className=\"text-xs text-muted-foreground/60 shrink-0\">\n ({formatFileSize(output.sizeBytes)})\n </span>\n )}\n </div>\n {content && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6\"\n onClick={(e) => {\n e.stopPropagation();\n navigator.clipboard.writeText(content);\n }}\n >\n <CopyIcon className=\"size-3\" />\n </Button>\n )}\n </div>\n\n {/* File content */}\n <div className=\"max-h-[200px] overflow-auto\">\n {isLoading ? (\n <div className=\"px-3 py-8 text-center text-muted-foreground text-sm\">\n <span className=\"animate-pulse\">Reading file...</span>\n </div>\n ) : isError ? (\n <div className=\"px-3 py-4 text-red-600 dark:text-red-400 text-sm flex items-start gap-2\">\n <AlertCircleIcon className=\"size-4 mt-0.5 shrink-0\" />\n <span>{output?.error || \"Failed to read file\"}</span>\n </div>\n ) : content ? (\n <CodeBlock\n code={content}\n language={language as \"typescript\"}\n showLineNumbers\n />\n ) : (\n <div className=\"px-3 py-4 text-muted-foreground text-sm italic\">\n File is empty\n </div>\n )}\n </div>\n\n {/* Status footer for truncated files */}\n {output?.wasTruncated && (\n <div className=\"px-3 py-2 border-t bg-amber-500/5 text-xs text-amber-600 dark:text-amber-400 flex items-center gap-2\">\n <ScissorsIcon className=\"size-3.5\" />\n <span>\n Content was truncated. Use startLine/endLine to read specific sections.\n </span>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport {\n CheckCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CopyIcon,\n TerminalIcon,\n XCircleIcon,\n RadioIcon,\n ClockIcon,\n StopCircleIcon,\n} from \"lucide-react\";\nimport { useState, useRef, useEffect } from \"react\";\n\nexport interface BashInput {\n command?: string;\n background?: boolean;\n id?: string;\n kill?: boolean;\n tail?: number;\n input?: string;\n key?: 'Enter' | 'Escape' | 'Up' | 'Down' | 'Left' | 'Right' | 'Tab' | 'C-c' | 'C-d' | 'y' | 'n';\n}\n\nexport interface BashOutput {\n success?: boolean;\n error?: string;\n id?: string;\n output?: string;\n exitCode?: number;\n status?: string;\n message?: string;\n // Support legacy field names\n stdout?: string;\n stderr?: string;\n}\n\nexport interface BashToolProps {\n input: BashInput;\n output?: BashOutput;\n status: \"pending\" | \"streaming\" | \"running\" | \"completed\" | \"rejected\" | \"error\";\n /** Terminal ID for live streaming */\n terminalId?: string;\n /** Live streaming output */\n liveOutput?: string;\n className?: string;\n}\n\nexport function BashTool({\n input,\n output,\n status,\n terminalId,\n liveOutput,\n className,\n}: BashToolProps) {\n const [isExpanded, setIsExpanded] = useState(true);\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n\n // Auto-scroll to bottom when output updates (during streaming)\n useEffect(() => {\n if (scrollContainerRef.current) {\n scrollContainerRef.current.scrollTop = scrollContainerRef.current.scrollHeight;\n }\n }, [liveOutput, output?.output]);\n\n const command = input?.command || \"\";\n const isBackground = input?.background || false;\n const isKillOperation = input?.kill === true;\n const isInputOperation = input?.id && (input?.input !== undefined || input?.key !== undefined);\n const isLogCheck = input?.id && !input?.command && !input?.kill && !isInputOperation;\n \n const isLoading = status === \"pending\" || status === \"streaming\" || status === \"running\";\n const isLive = isLoading && terminalId && liveOutput !== undefined;\n const isCompleted = status === \"completed\";\n const isError = status === \"error\" || output?.success === false;\n const exitCode = output?.exitCode;\n\n // Get the output to display\n const displayOutput = (() => {\n // During live streaming, show live output\n if (isLive) {\n return liveOutput || \"\";\n }\n // After completion, show the final output\n if (output) {\n // Handle different output formats\n const finalOutput = output.output || output.stdout || \"\";\n const stderr = output.stderr || \"\";\n if (stderr) {\n return finalOutput + (finalOutput ? \"\\n\" : \"\") + stderr;\n }\n return finalOutput;\n }\n return \"\";\n })();\n\n // Truncate command for display\n const displayCommand = command.length > 50 ? command.slice(0, 50) + \"...\" : command;\n\n // Status icon and styling\n const getStatusDisplay = () => {\n if (isKillOperation) {\n return {\n Icon: StopCircleIcon,\n color: \"text-amber-600 dark:text-amber-500\",\n label: output?.status === \"stopped\" ? \"Stopped\" : \"Stopping...\",\n };\n }\n if (isInputOperation) {\n const inputLabel = input?.key ? `key: ${input.key}` : `input: \"${input?.input?.slice(0, 20)}...\"`;\n return {\n Icon: TerminalIcon,\n color: \"text-purple-600 dark:text-purple-500\",\n label: isLoading ? \"Sending...\" : inputLabel,\n };\n }\n if (isLogCheck) {\n return {\n Icon: TerminalIcon,\n color: \"text-blue-600 dark:text-blue-500\",\n label: \"Logs\",\n };\n }\n if (isLive) {\n return {\n Icon: RadioIcon,\n color: \"text-green-600 dark:text-green-500 animate-pulse\",\n label: \"Live\",\n };\n }\n if (isLoading) {\n return {\n Icon: ClockIcon,\n color: \"text-muted-foreground animate-pulse\",\n label: \"Executing...\",\n };\n }\n if (isCompleted && exitCode === 0) {\n return {\n Icon: CheckCircleIcon,\n color: \"text-green-600 dark:text-green-500\",\n label: \"Completed\",\n };\n }\n if (isCompleted && exitCode !== 0) {\n return {\n Icon: XCircleIcon,\n color: \"text-red-600 dark:text-red-500\",\n label: `Exit ${exitCode}`,\n };\n }\n if (isError) {\n return {\n Icon: XCircleIcon,\n color: \"text-red-600 dark:text-red-500\",\n label: \"Error\",\n };\n }\n return {\n Icon: TerminalIcon,\n color: \"text-muted-foreground\",\n label: \"\",\n };\n };\n\n const { Icon, color, label } = getStatusDisplay();\n\n return (\n <div className={cn(\"rounded-lg border overflow-hidden bg-background\", className)}>\n {/* Header */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2.5 bg-muted/50 hover:bg-muted/70 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <Icon className={cn(\"size-4 shrink-0\", color)} />\n <TerminalIcon className=\"size-3.5 text-muted-foreground shrink-0\" />\n <code className=\"font-mono text-sm truncate\" title={command}>\n {displayCommand || (isKillOperation ? `kill ${input?.id}` : isLogCheck ? `logs ${input?.id}` : \"bash\")}\n </code>\n {isBackground && (\n <Badge variant=\"secondary\" className=\"text-xs shrink-0\">\n background\n </Badge>\n )}\n {isLive && (\n <Badge variant=\"secondary\" className=\"text-xs shrink-0 bg-green-500/10 text-green-600 dark:text-green-400 gap-1\">\n <RadioIcon className=\"size-2 animate-pulse\" />\n live\n </Badge>\n )}\n {label && !isLive && (\n <span className={cn(\"text-xs shrink-0\", color)}>\n {label}\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {exitCode !== undefined && isCompleted && (\n <Badge \n variant={exitCode === 0 ? \"secondary\" : \"destructive\"} \n className={cn(\n \"text-xs\",\n exitCode === 0 ? \"bg-green-500/10 text-green-600 dark:text-green-400\" : \"\"\n )}\n >\n exit {exitCode}\n </Badge>\n )}\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {/* Content */}\n {isExpanded && (\n <div className=\"border-t\">\n {/* Command bar */}\n {command && (\n <div className=\"px-3 py-1.5 bg-muted/30 border-b flex items-center justify-between\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <span className=\"text-muted-foreground text-xs\">$</span>\n <code className=\"text-xs font-mono truncate\">{command}</code>\n </div>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6\"\n onClick={(e) => {\n e.stopPropagation();\n navigator.clipboard.writeText(command);\n }}\n >\n <CopyIcon className=\"size-3\" />\n </Button>\n </div>\n )}\n\n {/* Output area */}\n <div \n ref={scrollContainerRef}\n className=\"bg-zinc-950 dark:bg-zinc-950 relative max-h-[300px] overflow-auto\"\n >\n <pre\n className=\"px-3 py-2 text-xs font-mono text-zinc-300 whitespace-pre-wrap break-all min-h-[40px]\"\n >\n {displayOutput || (\n <span className=\"text-muted-foreground italic\">\n {isLoading ? \"Waiting for output...\" : \"(no output)\"}\n </span>\n )}\n {isLive && (\n <span className=\"inline-block w-2 h-4 bg-green-500 animate-pulse ml-0.5\" />\n )}\n </pre>\n\n {/* Copy button for output */}\n {displayOutput && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"absolute top-1 right-1 size-6 text-zinc-500 hover:text-zinc-300 bg-zinc-900/80\"\n onClick={(e) => {\n e.stopPropagation();\n navigator.clipboard.writeText(displayOutput);\n }}\n >\n <CopyIcon className=\"size-3\" />\n </Button>\n )}\n </div>\n\n {/* Error message */}\n {output?.error && (\n <div className=\"px-3 py-2 border-t bg-red-500/5 text-red-600 dark:text-red-400 text-xs flex items-start gap-2\">\n <XCircleIcon className=\"size-3.5 mt-0.5 shrink-0\" />\n <span>{output.error}</span>\n </div>\n )}\n\n {/* Status message for background processes */}\n {output?.message && !output?.error && (\n <div className=\"px-3 py-2 border-t bg-muted/30 text-muted-foreground text-xs\">\n {output.message}\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['rect', { x: '9', y: '9', width: '6', height: '6', rx: '1', key: '1ssd4o' }],\n];\n\n/**\n * @component @name CircleStop\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cmVjdCB4PSI5IiB5PSI5IiB3aWR0aD0iNiIgaGVpZ2h0PSI2IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle-stop\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleStop = createLucideIcon('circle-stop', __iconNode);\n\nexport default CircleStop;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M16.247 7.761a6 6 0 0 1 0 8.478', key: '1fwjs5' }],\n ['path', { d: 'M19.075 4.933a10 10 0 0 1 0 14.134', key: 'ehdyv1' }],\n ['path', { d: 'M4.925 19.067a10 10 0 0 1 0-14.134', key: '1q22gi' }],\n ['path', { d: 'M7.753 16.239a6 6 0 0 1 0-8.478', key: 'r2q7qm' }],\n ['circle', { cx: '12', cy: '12', r: '2', key: '1c9p78' }],\n];\n\n/**\n * @component @name Radio\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYuMjQ3IDcuNzYxYTYgNiAwIDAgMSAwIDguNDc4IiAvPgogIDxwYXRoIGQ9Ik0xOS4wNzUgNC45MzNhMTAgMTAgMCAwIDEgMCAxNC4xMzQiIC8+CiAgPHBhdGggZD0iTTQuOTI1IDE5LjA2N2ExMCAxMCAwIDAgMSAwLTE0LjEzNCIgLz4KICA8cGF0aCBkPSJNNy43NTMgMTYuMjM5YTYgNiAwIDAgMSAwLTguNDc4IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/radio\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Radio = createLucideIcon('radio', __iconNode);\n\nexport default Radio;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 19h8', key: 'baeox8' }],\n ['path', { d: 'm4 17 6-6-6-6', key: '1yngyt' }],\n];\n\n/**\n * @component @name Terminal\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTloOCIgLz4KICA8cGF0aCBkPSJtNCAxNyA2LTYtNi02IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/terminal\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Terminal = createLucideIcon('terminal', __iconNode);\n\nexport default Terminal;\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\nimport {\n CheckCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n CircleIcon,\n CircleDotIcon,\n ListTodoIcon,\n PlusIcon,\n TrashIcon,\n XCircleIcon,\n ClockIcon,\n} from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface TodoItem {\n id: string;\n content: string;\n status: \"pending\" | \"in_progress\" | \"completed\" | \"cancelled\";\n order?: number;\n createdAt?: string;\n}\n\nexport interface TodoInput {\n action: \"add\" | \"list\" | \"mark\" | \"clear\";\n items?: { content: string; order?: number }[];\n todoId?: string;\n status?: \"pending\" | \"in_progress\" | \"completed\" | \"cancelled\";\n}\n\nexport interface TodoOutput {\n success?: boolean;\n error?: string;\n action?: string;\n itemsAdded?: number;\n itemsRemoved?: number;\n items?: TodoItem[];\n item?: TodoItem;\n stats?: {\n total: number;\n pending: number;\n inProgress: number;\n completed: number;\n cancelled: number;\n };\n}\n\nexport interface TodoToolProps {\n input: TodoInput;\n output?: TodoOutput;\n status: \"pending\" | \"streaming\" | \"running\" | \"completed\" | \"rejected\" | \"error\";\n className?: string;\n}\n\nconst statusIcons: Record<string, typeof CircleIcon> = {\n pending: CircleIcon,\n in_progress: CircleDotIcon,\n completed: CheckCircleIcon,\n cancelled: XCircleIcon,\n};\n\nconst statusColors: Record<string, string> = {\n pending: \"text-muted-foreground\",\n in_progress: \"text-blue-600 dark:text-blue-400\",\n completed: \"text-green-600 dark:text-green-400\",\n cancelled: \"text-muted-foreground/50\",\n};\n\nconst actionLabels: Record<string, string> = {\n add: \"Add Tasks\",\n list: \"List Tasks\",\n mark: \"Update Task\",\n clear: \"Clear Tasks\",\n};\n\nconst ActionIcon = ({ action }: { action: string }) => {\n switch (action) {\n case \"add\":\n return <PlusIcon className=\"size-3.5\" />;\n case \"list\":\n return <ListTodoIcon className=\"size-3.5\" />;\n case \"mark\":\n return <CheckCircleIcon className=\"size-3.5\" />;\n case \"clear\":\n return <TrashIcon className=\"size-3.5\" />;\n default:\n return <ListTodoIcon className=\"size-3.5\" />;\n }\n};\n\nexport function TodoTool({\n input,\n output,\n status,\n className,\n}: TodoToolProps) {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const action = input?.action || \"list\";\n const isLoading = status === \"pending\" || status === \"streaming\" || status === \"running\";\n const isCompleted = status === \"completed\";\n const isError = status === \"error\" || output?.success === false;\n\n // Status icon and color\n const StatusIcon = isCompleted && output?.success\n ? CheckCircleIcon\n : isError\n ? XCircleIcon\n : isLoading\n ? ClockIcon\n : ListTodoIcon;\n\n const statusColor = isCompleted && output?.success\n ? \"text-green-600 dark:text-green-500\"\n : isError\n ? \"text-red-600 dark:text-red-500\"\n : isLoading\n ? \"text-muted-foreground animate-pulse\"\n : \"text-muted-foreground\";\n\n const renderTodoItem = (item: TodoItem) => {\n const Icon = statusIcons[item.status] || CircleIcon;\n const color = statusColors[item.status] || \"text-muted-foreground\";\n \n return (\n <div key={item.id} className=\"flex items-start gap-2 py-1\">\n <Icon className={cn(\"size-4 mt-0.5 shrink-0\", color)} />\n <span className={cn(\n \"text-sm\",\n item.status === \"cancelled\" && \"line-through text-muted-foreground/50\",\n item.status === \"completed\" && \"text-muted-foreground\"\n )}>\n {item.content}\n </span>\n </div>\n );\n };\n\n return (\n <div className={cn(\"rounded-lg border overflow-hidden bg-background\", className)}>\n {/* Header */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2.5 bg-muted/50 hover:bg-muted/70 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <StatusIcon className={cn(\"size-4 shrink-0\", statusColor)} />\n <ActionIcon action={action} />\n <span className=\"font-medium text-sm\">{actionLabels[action] || action}</span>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground animate-pulse\">running...</span>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {output?.stats && (\n <div className=\"flex items-center gap-1.5 text-xs\">\n <span className=\"text-muted-foreground\">{output.stats.completed}/{output.stats.total}</span>\n </div>\n )}\n {output?.itemsAdded !== undefined && (\n <Badge variant=\"secondary\" className=\"text-xs bg-green-500/10 text-green-600 dark:text-green-400\">\n +{output.itemsAdded}\n </Badge>\n )}\n {output?.itemsRemoved !== undefined && (\n <Badge variant=\"secondary\" className=\"text-xs\">\n cleared {output.itemsRemoved}\n </Badge>\n )}\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {/* Content */}\n {isExpanded && (\n <div className=\"border-t\">\n {/* Stats bar for list action */}\n {output?.stats && (\n <div className=\"px-3 py-2 bg-muted/30 border-b flex items-center gap-4 text-xs\">\n <div className=\"flex items-center gap-1\">\n <CircleIcon className=\"size-3 text-muted-foreground\" />\n <span>{output.stats.pending} pending</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <CircleDotIcon className=\"size-3 text-blue-500\" />\n <span>{output.stats.inProgress} active</span>\n </div>\n <div className=\"flex items-center gap-1\">\n <CheckCircleIcon className=\"size-3 text-green-500\" />\n <span>{output.stats.completed} done</span>\n </div>\n </div>\n )}\n\n {/* Items list */}\n {output?.items && output.items.length > 0 && (\n <div className=\"px-3 py-2 max-h-[200px] overflow-auto\">\n {output.items.map(renderTodoItem)}\n </div>\n )}\n\n {/* Single item (for mark action) */}\n {output?.item && !output.items && (\n <div className=\"px-3 py-2\">\n {renderTodoItem(output.item)}\n </div>\n )}\n\n {/* Input preview (for add action while pending) */}\n {action === \"add\" && input?.items && !output?.items && (\n <div className=\"px-3 py-2 max-h-[200px] overflow-auto\">\n {input.items.map((item, i) => (\n <div key={i} className=\"flex items-start gap-2 py-1 text-muted-foreground\">\n <CircleIcon className=\"size-4 mt-0.5 shrink-0\" />\n <span className=\"text-sm\">{item.content}</span>\n </div>\n ))}\n </div>\n )}\n\n {/* Empty state */}\n {action === \"list\" && output?.items?.length === 0 && (\n <div className=\"px-3 py-4 text-center text-muted-foreground text-sm\">\n No tasks yet\n </div>\n )}\n\n {/* Error message */}\n {output?.error && (\n <div className=\"px-3 py-2 border-t bg-red-500/5 text-red-600 dark:text-red-400 text-xs flex items-start gap-2\">\n <XCircleIcon className=\"size-3.5 mt-0.5 shrink-0\" />\n <span>{output.error}</span>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6', key: 'miytrc' }],\n ['path', { d: 'M3 6h18', key: 'd0wm0j' }],\n ['path', { d: 'M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2', key: 'e791ji' }],\n];\n\n/**\n * @component @name Trash\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgNnYxNGEyIDIgMCAwIDEtMiAySDdhMiAyIDAgMCAxLTItMlY2IiAvPgogIDxwYXRoIGQ9Ik0zIDZoMTgiIC8+CiAgPHBhdGggZD0iTTggNlY0YTIgMiAwIDAgMSAyLTJoNGEyIDIgMCAwIDEgMiAydjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/trash\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Trash = createLucideIcon('trash', __iconNode);\n\nexport default Trash;\n","\"use client\";\n\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\nimport {\n BookOpenIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n ClockIcon,\n CopyIcon,\n ListIcon,\n SparklesIcon,\n XCircleIcon,\n} from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface SkillInfo {\n name: string;\n description?: string;\n}\n\nexport interface LoadSkillInput {\n action: \"list\" | \"load\";\n skillName?: string;\n}\n\nexport interface LoadSkillOutput {\n success?: boolean;\n error?: string;\n action?: string;\n skillCount?: number;\n skills?: SkillInfo[];\n skillName?: string;\n description?: string;\n content?: string;\n contentLength?: number;\n availableSkills?: string[];\n}\n\nexport interface LoadSkillToolProps {\n input: LoadSkillInput;\n output?: LoadSkillOutput;\n status: \"pending\" | \"streaming\" | \"running\" | \"completed\" | \"rejected\" | \"error\";\n className?: string;\n}\n\nexport function LoadSkillTool({\n input,\n output,\n status,\n className,\n}: LoadSkillToolProps) {\n const [isExpanded, setIsExpanded] = useState(true);\n\n const action = input?.action || \"list\";\n const skillName = input?.skillName || output?.skillName;\n const isLoading = status === \"pending\" || status === \"streaming\" || status === \"running\";\n const isCompleted = status === \"completed\";\n const isError = status === \"error\" || output?.success === false;\n\n // Status icon and color\n const StatusIcon = isCompleted && output?.success\n ? CheckCircleIcon\n : isError\n ? XCircleIcon\n : isLoading\n ? ClockIcon\n : BookOpenIcon;\n\n const statusColor = isCompleted && output?.success\n ? \"text-green-600 dark:text-green-500\"\n : isError\n ? \"text-red-600 dark:text-red-500\"\n : isLoading\n ? \"text-muted-foreground animate-pulse\"\n : \"text-muted-foreground\";\n\n const headerTitle = action === \"load\" \n ? skillName ? `Load: ${skillName}` : \"Load Skill\"\n : \"List Skills\";\n\n return (\n <div className={cn(\"rounded-lg border overflow-hidden bg-background\", className)}>\n {/* Header */}\n <button\n onClick={() => setIsExpanded(!isExpanded)}\n className=\"flex items-center justify-between w-full px-3 py-2.5 bg-muted/50 hover:bg-muted/70 transition-colors\"\n >\n <div className=\"flex items-center gap-2 min-w-0\">\n <StatusIcon className={cn(\"size-4 shrink-0\", statusColor)} />\n {action === \"list\" ? (\n <ListIcon className=\"size-3.5 text-muted-foreground\" />\n ) : (\n <SparklesIcon className=\"size-3.5 text-muted-foreground\" />\n )}\n <span className=\"font-medium text-sm truncate\">{headerTitle}</span>\n {isLoading && (\n <span className=\"text-xs text-muted-foreground animate-pulse\">loading...</span>\n )}\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {output?.skillCount !== undefined && (\n <Badge variant=\"secondary\" className=\"text-xs\">\n {output.skillCount} skills\n </Badge>\n )}\n {output?.contentLength !== undefined && (\n <Badge variant=\"secondary\" className=\"text-xs\">\n {Math.round(output.contentLength / 1000)}k chars\n </Badge>\n )}\n {isExpanded ? (\n <ChevronDownIcon className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRightIcon className=\"size-4 text-muted-foreground\" />\n )}\n </div>\n </button>\n\n {/* Content */}\n {isExpanded && (\n <div className=\"border-t\">\n {/* List of skills */}\n {output?.skills && output.skills.length > 0 && (\n <div className=\"max-h-[200px] overflow-auto\">\n {output.skills.map((skill, i) => (\n <div \n key={skill.name} \n className={cn(\n \"px-3 py-2 flex items-start gap-2\",\n i < output.skills!.length - 1 && \"border-b\"\n )}\n >\n <BookOpenIcon className=\"size-4 mt-0.5 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0\">\n <div className=\"font-medium text-sm\">{skill.name}</div>\n {skill.description && (\n <div className=\"text-xs text-muted-foreground truncate\">\n {skill.description}\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Loaded skill info */}\n {action === \"load\" && output?.success && output.skillName && (\n <div className=\"px-3 py-2 bg-muted/30\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2\">\n <SparklesIcon className=\"size-4 text-green-600 dark:text-green-400\" />\n <span className=\"font-medium text-sm\">{output.skillName}</span>\n </div>\n {output.content && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-6\"\n onClick={(e) => {\n e.stopPropagation();\n navigator.clipboard.writeText(output.content!);\n }}\n >\n <CopyIcon className=\"size-3\" />\n </Button>\n )}\n </div>\n {output.description && (\n <p className=\"text-xs text-muted-foreground mt-1\">{output.description}</p>\n )}\n </div>\n )}\n\n {/* Skill content preview */}\n {output?.content && (\n <div className=\"max-h-[150px] overflow-auto border-t\">\n <pre className=\"px-3 py-2 text-xs font-mono text-muted-foreground whitespace-pre-wrap\">\n {output.content.slice(0, 500)}\n {output.content.length > 500 && \"...\"}\n </pre>\n </div>\n )}\n\n {/* Available skills hint on error */}\n {output?.availableSkills && output.availableSkills.length > 0 && (\n <div className=\"px-3 py-2 bg-muted/30 border-t\">\n <div className=\"text-xs text-muted-foreground\">\n Available: {output.availableSkills.join(\", \")}\n </div>\n </div>\n )}\n\n {/* Empty state */}\n {action === \"list\" && output?.skills?.length === 0 && (\n <div className=\"px-3 py-4 text-center text-muted-foreground text-sm\">\n No skills available\n </div>\n )}\n\n {/* Error message */}\n {output?.error && (\n <div className=\"px-3 py-2 border-t bg-red-500/5 text-red-600 dark:text-red-400 text-xs flex items-start gap-2\">\n <XCircleIcon className=\"size-3.5 mt-0.5 shrink-0\" />\n <span>{output.error}</span>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z',\n key: '1s2grr',\n },\n ],\n ['path', { d: 'M20 2v4', key: '1rf3ol' }],\n ['path', { d: 'M22 4h-4', key: 'gwowj6' }],\n ['circle', { cx: '4', cy: '20', r: '2', key: '6kqj1y' }],\n];\n\n/**\n * @component @name Sparkles\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTEuMDE3IDIuODE0YTEgMSAwIDAgMSAxLjk2NiAwbDEuMDUxIDUuNTU4YTIgMiAwIDAgMCAxLjU5NCAxLjU5NGw1LjU1OCAxLjA1MWExIDEgMCAwIDEgMCAxLjk2NmwtNS41NTggMS4wNTFhMiAyIDAgMCAwLTEuNTk0IDEuNTk0bC0xLjA1MSA1LjU1OGExIDEgMCAwIDEtMS45NjYgMGwtMS4wNTEtNS41NThhMiAyIDAgMCAwLTEuNTk0LTEuNTk0bC01LjU1OC0xLjA1MWExIDEgMCAwIDEgMC0xLjk2Nmw1LjU1OC0xLjA1MWEyIDIgMCAwIDAgMS41OTQtMS41OTR6IiAvPgogIDxwYXRoIGQ9Ik0yMCAydjQiIC8+CiAgPHBhdGggZD0iTTIyIDRoLTQiIC8+CiAgPGNpcmNsZSBjeD0iNCIgY3k9IjIwIiByPSIyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/sparkles\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Sparkles = createLucideIcon('sparkles', __iconNode);\n\nexport default Sparkles;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M3 5h.01', key: '18ugdj' }],\n ['path', { d: 'M3 12h.01', key: 'nlz23k' }],\n ['path', { d: 'M3 19h.01', key: 'noohij' }],\n ['path', { d: 'M8 5h13', key: '1pao27' }],\n ['path', { d: 'M8 12h13', key: '1za7za' }],\n ['path', { d: 'M8 19h13', key: 'm83p4d' }],\n];\n\n/**\n * @component @name List\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMyA1aC4wMSIgLz4KICA8cGF0aCBkPSJNMyAxMmguMDEiIC8+CiAgPHBhdGggZD0iTTMgMTloLjAxIiAvPgogIDxwYXRoIGQ9Ik04IDVoMTMiIC8+CiAgPHBhdGggZD0iTTggMTJoMTMiIC8+CiAgPHBhdGggZD0iTTggMTloMTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/list\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst List = createLucideIcon('list', __iconNode);\n\nexport default List;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 7v14', key: '1akyts' }],\n [\n 'path',\n {\n d: 'M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z',\n key: 'ruj8y',\n },\n ],\n];\n\n/**\n * @component @name BookOpen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgN3YxNCIgLz4KICA8cGF0aCBkPSJNMyAxOGExIDEgMCAwIDEtMS0xVjRhMSAxIDAgMCAxIDEtMWg1YTQgNCAwIDAgMSA0IDQgNCA0IDAgMCAxIDQtNGg1YTEgMSAwIDAgMSAxIDF2MTNhMSAxIDAgMCAxLTEgMWgtNmEzIDMgMCAwIDAtMyAzIDMgMyAwIDAgMC0zLTN6IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/book-open\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BookOpen = createLucideIcon('book-open', __iconNode);\n\nexport default BookOpen;\n","'use client';\n\nimport { useState, useRef, useEffect } from 'react';\nimport Image from 'next/image';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/ui/tooltip';\nimport {\n Conversation,\n ConversationContent,\n ConversationScrollButton,\n ConversationEmptyState,\n} from '@/components/ai-elements/conversation';\nimport {\n Message,\n MessageContent,\n MessageResponse,\n MessageActions,\n MessageAction,\n} from '@/components/ai-elements/message';\nimport {\n Tool,\n ToolHeader,\n ToolContent,\n ToolInput,\n ToolOutput,\n} from '@/components/ai-elements/tool';\nimport {\n Terminal,\n TerminalHeader,\n TerminalTitle,\n TerminalContent,\n TerminalActions,\n TerminalCopyButton,\n} from '@/components/ai-elements/terminal';\nimport {\n Artifact,\n ArtifactHeader,\n ArtifactTitle,\n ArtifactDescription,\n ArtifactContent,\n ArtifactActions,\n ArtifactAction,\n} from '@/components/ai-elements/artifact';\nimport {\n CodeBlock,\n CodeBlockHeader,\n CodeBlockTitle,\n CodeBlockFilename,\n CodeBlockActions,\n CodeBlockCopyButton,\n} from '@/components/ai-elements/code-block';\nimport {\n Confirmation,\n ConfirmationRequest,\n ConfirmationActions as ConfirmationActionsComponent,\n ConfirmationAction,\n} from '@/components/ai-elements/confirmation';\nimport { Loader } from '@/components/ai-elements/loader';\nimport {\n Reasoning,\n ReasoningTrigger,\n ReasoningContent,\n} from '@/components/ai-elements/reasoning';\nimport {\n PromptInput,\n PromptInputBody,\n PromptInputTextarea,\n PromptInputFooter,\n PromptInputSubmit,\n} from '@/components/ai-elements/prompt-input';\nimport { Suggestion, Suggestions } from '@/components/ai-elements/suggestion';\nimport {\n runAgent,\n watchStream,\n getActiveStream,\n abortStream,\n getPendingApprovals,\n approveExecution,\n rejectExecution,\n getSessionMessages,\n streamTerminal,\n updateSession,\n updateToolApproval,\n getSessionTodos,\n getSessionCheckpoints,\n revertToCheckpoint,\n type Session,\n type SSEEvent,\n type PendingApproval,\n type Message as ApiMessage,\n type ContentPart,\n type TodosResponse,\n type SessionConfig,\n type Checkpoint,\n} from '@/lib/api';\nimport { TodoPanel } from '@/components/ai-elements/todo-panel';\nimport { getConfig, type AppConfig } from '@/lib/config';\nimport { mutateSessions } from '@/hooks/use-sessions';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from '@/components/ui/select';\nimport { MessageSquare, Copy, RefreshCw, AlertTriangle, Terminal as TerminalIcon, FileCode, Radio, Pencil, Check, Settings, RotateCcw } from 'lucide-react';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/components/ui/dialog';\nimport { Switch } from '@/components/ui/switch';\nimport { Label } from '@/components/ui/label';\nimport { Input } from '@/components/ui/input';\nimport { WriteFileTool, type WriteFileInput, type WriteFileOutput } from '@/components/ai-elements/write-file-tool';\nimport { ReadFileTool, type ReadFileInput, type ReadFileOutput } from '@/components/ai-elements/read-file-tool';\nimport { BashTool, type BashInput, type BashOutput } from '@/components/ai-elements/bash-tool';\nimport { TodoTool, type TodoInput, type TodoOutput } from '@/components/ai-elements/todo-tool';\nimport { LoadSkillTool, type LoadSkillInput, type LoadSkillOutput } from '@/components/ai-elements/load-skill-tool';\n\ninterface ToolCallOutput {\n status?: string;\n rejected?: boolean;\n reason?: string;\n message?: string;\n stdout?: string;\n stderr?: string;\n exitCode?: number;\n success?: boolean;\n [key: string]: unknown;\n}\n\ninterface ToolCallInfo {\n toolCallId: string;\n toolName: string;\n input: unknown;\n output?: ToolCallOutput | unknown;\n status: 'pending' | 'streaming' | 'running' | 'completed' | 'rejected' | 'error';\n /** Raw streaming args text (before JSON parsing) - for streaming tool input */\n streamingArgsText?: string;\n /** Terminal ID for bash commands - used for live streaming */\n terminalId?: string;\n /** Live terminal output being streamed */\n liveOutput?: string;\n}\n\ninterface ChatItem {\n id: string;\n type: 'user-message' | 'assistant-text' | 'tool-call' | 'tool-result' | 'reasoning';\n content?: string;\n toolCall?: ToolCallInfo;\n /** For user messages: the message sequence number (used for revert) */\n messageSequence?: number;\n}\n\ninterface ChatInterfaceProps {\n session: Session;\n}\n\n// Map our status to AI Elements tool state\nfunction mapToolStatus(status: ToolCallInfo['status']): 'input-streaming' | 'input-available' | 'output-available' | 'output-error' | 'output-denied' {\n switch (status) {\n case 'pending':\n case 'streaming':\n return 'input-streaming';\n case 'running':\n return 'input-available';\n case 'completed':\n return 'output-available';\n case 'rejected':\n return 'output-denied';\n case 'error':\n return 'output-error';\n default:\n return 'input-streaming';\n }\n}\n\nexport function ChatInterface({ session }: ChatInterfaceProps) {\n const [chatItems, setChatItems] = useState<ChatItem[]>([]);\n const [input, setInput] = useState('');\n const [isRunning, setIsRunning] = useState(false);\n const [isWatching, setIsWatching] = useState(false); // True when watching another client's stream\n const [currentStreamId, setCurrentStreamId] = useState<string | null>(null);\n const [currentText, setCurrentText] = useState('');\n const [currentReasoning, setCurrentReasoning] = useState('');\n const [isReasoningStreaming, setIsReasoningStreaming] = useState(false);\n const [currentToolCalls, setCurrentToolCalls] = useState<ToolCallInfo[]>([]);\n const [pendingApprovals, setPendingApprovals] = useState<PendingApproval[]>([]);\n const [todosData, setTodosData] = useState<TodosResponse | null>(null);\n const [checkpoints, setCheckpoints] = useState<Checkpoint[]>([]);\n const [isReverting, setIsReverting] = useState(false);\n const currentTextRef = useRef('');\n const currentReasoningRef = useRef('');\n const toolCallsRef = useRef<ToolCallInfo[]>([]);\n const [isLoadingHistory, setIsLoadingHistory] = useState(false);\n const cancelRef = useRef<(() => void) | null>(null);\n const lastKnownStreamIdRef = useRef<string | null>(null);\n const isConnectingRef = useRef(false); // Prevent multiple simultaneous connections\n // Track if this client initiated the current stream (vs watching someone else's)\n const isStreamInitiatorRef = useRef(false);\n // Track active terminal streams - map of terminalId to cancel function\n const terminalStreamsRef = useRef<Map<string, () => void>>(new Map());\n \n // Session editing\n const [currentModel, setCurrentModel] = useState(session.model);\n const [currentName, setCurrentName] = useState(session.name || '');\n const [isEditingName, setIsEditingName] = useState(false);\n const [config, setConfig] = useState<AppConfig | null>(null);\n const [sessionConfig, setSessionConfig] = useState<SessionConfig>(session.config || {});\n const [sessionSettingsOpen, setSessionSettingsOpen] = useState(false);\n const nameInputRef = useRef<HTMLInputElement>(null);\n\n // Load config for available models\n useEffect(() => {\n getConfig().then(setConfig);\n }, []);\n\n // Sync local state when session changes (e.g., switching sessions or loading from CLI)\n useEffect(() => {\n setCurrentModel(session.model);\n setCurrentName(session.name || '');\n setSessionConfig(session.config || {});\n }, [session.id, session.model, session.name, session.config]);\n\n // Focus name input when editing starts\n useEffect(() => {\n if (isEditingName && nameInputRef.current) {\n nameInputRef.current.focus();\n nameInputRef.current.select();\n }\n }, [isEditingName]);\n\n // Handle model change\n const handleModelChange = async (newModel: string) => {\n setCurrentModel(newModel);\n try {\n await updateSession(session.id, { model: newModel });\n mutateSessions(); // Refresh sidebar\n } catch (err) {\n console.error('Failed to update model:', err);\n setCurrentModel(session.model);\n }\n };\n\n // Handle name change\n const handleNameSubmit = async () => {\n setIsEditingName(false);\n const newName = currentName.trim() || `Session`;\n if (newName !== session.name) {\n try {\n await updateSession(session.id, { name: newName });\n mutateSessions(); // Refresh sidebar\n } catch (err) {\n console.error('Failed to update name:', err);\n setCurrentName(session.name || '');\n }\n }\n };\n\n // Convert API messages to ChatItem format\n const convertApiMessages = (apiMessages: ApiMessage[]): ChatItem[] => {\n const items: ChatItem[] = [];\n const toolOutputs = new Map<string, unknown>();\n \n for (const msg of apiMessages) {\n if (msg.role === 'tool' && Array.isArray(msg.content)) {\n for (const part of msg.content) {\n if (part.type === 'tool-result') {\n toolOutputs.set(part.toolCallId, part.output ?? part.result);\n }\n }\n }\n }\n \n // Track message sequence number (each message in the array has an implicit sequence)\n let messageSequence = 0;\n for (const msg of apiMessages) {\n if (msg.role === 'user') {\n items.push({\n id: msg.id,\n type: 'user-message',\n content: typeof msg.content === 'string' ? msg.content : '',\n messageSequence, // Track sequence for revert\n });\n } else if (msg.role === 'assistant') {\n if (typeof msg.content === 'string') {\n if (msg.content.trim()) {\n items.push({\n id: msg.id,\n type: 'assistant-text',\n content: msg.content,\n });\n }\n } else if (Array.isArray(msg.content)) {\n for (let i = 0; i < msg.content.length; i++) {\n const part = msg.content[i] as ContentPart;\n if (part.type === 'reasoning' && part.text?.trim()) {\n // Add reasoning before the text/tool calls\n items.push({\n id: `${msg.id}-reasoning-${i}`,\n type: 'reasoning',\n content: part.text,\n });\n } else if (part.type === 'text' && part.text?.trim()) {\n items.push({\n id: `${msg.id}-text-${i}`,\n type: 'assistant-text',\n content: part.text,\n });\n } else if (part.type === 'tool-call') {\n const output = toolOutputs.get(part.toolCallId);\n const outputObj = output as ToolCallOutput | undefined;\n const isRejected = outputObj?.rejected === true || outputObj?.status === 'rejected';\n \n items.push({\n id: `${msg.id}-tool-${i}`,\n type: 'tool-call',\n toolCall: {\n toolCallId: part.toolCallId,\n toolName: part.toolName,\n input: part.input ?? part.args,\n output: output,\n status: isRejected ? 'rejected' : (output !== undefined ? 'completed' : 'pending'),\n },\n });\n }\n }\n }\n }\n messageSequence++; // Increment for next message\n }\n \n return items;\n };\n\n // Handle reverting to a checkpoint (before a specific user message)\n const handleRevert = async (messageSeq: number, messageContent?: string) => {\n // Find the checkpoint that was created before this message\n const checkpoint = checkpoints.find(cp => cp.messageSequence === messageSeq);\n if (!checkpoint) {\n console.error('No checkpoint found for message sequence:', messageSeq);\n return;\n }\n\n if (!window.confirm('Revert to before this message? This will undo all file changes and delete messages from this point.')) {\n return;\n }\n\n setIsReverting(true);\n try {\n await revertToCheckpoint(session.id, checkpoint.id);\n \n // Reload messages and checkpoints\n const [apiMessages, checkpointsData] = await Promise.all([\n getSessionMessages(session.id),\n getSessionCheckpoints(session.id).catch(() => ({ checkpoints: [] })),\n ]);\n const sorted = [...apiMessages].sort((a, b) => \n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n const converted = convertApiMessages(sorted);\n setChatItems(converted);\n setCheckpoints(checkpointsData.checkpoints || []);\n \n // Clear any streaming state\n setCurrentText('');\n setCurrentReasoning('');\n setCurrentToolCalls([]);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n \n // Put the reverted message content in the input box so user can re-send\n if (messageContent) {\n setInput(messageContent);\n }\n } catch (err) {\n console.error('Failed to revert:', err);\n alert('Failed to revert: ' + (err instanceof Error ? err.message : 'Unknown error'));\n } finally {\n setIsReverting(false);\n }\n };\n\n // Helper to flush any partial streaming content to chat items\n const flushPartialContent = () => {\n // Save reasoning if present\n if (currentReasoningRef.current.trim()) {\n const reasoningItem: ChatItem = {\n id: `reasoning-${Date.now()}`,\n type: 'reasoning',\n content: currentReasoningRef.current,\n };\n setChatItems((prev) => [...prev, reasoningItem]);\n currentReasoningRef.current = '';\n setCurrentReasoning('');\n }\n \n // Save text if present\n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current,\n };\n setChatItems((prev) => [...prev, textItem]);\n currentTextRef.current = '';\n setCurrentText('');\n }\n \n // Save any pending tool calls\n for (const tc of toolCallsRef.current) {\n const toolItem: ChatItem = {\n id: `tool-${tc.toolCallId}`,\n type: 'tool-call',\n toolCall: tc,\n };\n setChatItems((prev) => {\n // Check if this tool is already in chatItems to avoid duplicates\n const exists = prev.some(item => \n item.type === 'tool-call' && item.toolCall?.toolCallId === tc.toolCallId\n );\n if (exists) return prev;\n return [...prev, toolItem];\n });\n }\n toolCallsRef.current = [];\n setCurrentToolCalls([]);\n \n setIsReasoningStreaming(false);\n };\n\n // SSE event handler (shared between run and watch)\n const handleSSEEvent = (event: SSEEvent) => {\n // Handle tool-progress event separately (TypeScript union narrowing issue with switch)\n if (event.type === 'tool-progress') {\n // Terminal started - subscribe to live output stream\n if (event.toolName === 'bash' && event.data.status === 'started') {\n const terminalId = event.data.terminalId;\n \n // Find the most recent bash tool call that doesn't have a terminal ID yet\n // Note: Status might be 'streaming' or 'running' depending on event order\n toolCallsRef.current = toolCallsRef.current.map((tc) => {\n if (tc.toolName === 'bash' && !tc.terminalId && (tc.status === 'running' || tc.status === 'streaming')) {\n return { ...tc, terminalId, liveOutput: '' };\n }\n return tc;\n });\n setCurrentToolCalls([...toolCallsRef.current]);\n \n // Subscribe to terminal output stream\n if (!terminalStreamsRef.current.has(terminalId)) {\n const cancelStream = streamTerminal(\n terminalId,\n (data) => {\n // Append output to the tool call\n toolCallsRef.current = toolCallsRef.current.map((tc) => {\n if (tc.terminalId === terminalId) {\n return { ...tc, liveOutput: (tc.liveOutput || '') + data };\n }\n return tc;\n });\n setCurrentToolCalls([...toolCallsRef.current]);\n },\n () => {\n // Terminal exited - cleanup\n terminalStreamsRef.current.delete(terminalId);\n }\n );\n terminalStreamsRef.current.set(terminalId, cancelStream);\n }\n }\n return;\n }\n\n switch (event.type) {\n case 'start':\n // Message started - could use messageId for tracking\n break;\n\n case 'data-stream-id':\n setCurrentStreamId(event.streamId);\n lastKnownStreamIdRef.current = event.streamId;\n break;\n \n case 'data-user-message':\n // User message from another client - add it to chat\n // Skip if this client initiated the stream (we already added the message in handleSubmit)\n if (event.data?.content && !isStreamInitiatorRef.current) {\n setChatItems((prev) => {\n // Check if we already have a user message with this content\n // (handles ID mismatches between API-loaded messages and SSE events)\n const contentExists = prev.some(\n (item) => item.type === 'user-message' && item.content === event.data.content\n );\n if (contentExists) return prev;\n \n const messageId = event.data.id || `user-${Date.now()}`;\n return [...prev, {\n id: messageId,\n type: 'user-message',\n content: event.data.content,\n }];\n });\n }\n break;\n\n case 'data-session':\n // Session info received (from quick start) - could update session display\n break;\n\n case 'text-start':\n // Text block started - we track this implicitly\n break;\n\n case 'text-end':\n // Text block ended - we handle this in finish\n break;\n\n case 'text-delta':\n currentTextRef.current += event.delta;\n setCurrentText(currentTextRef.current);\n break;\n\n case 'reasoning-start':\n setIsReasoningStreaming(true);\n currentReasoningRef.current = '';\n setCurrentReasoning('');\n break;\n\n case 'reasoning-delta':\n currentReasoningRef.current += event.delta;\n setCurrentReasoning(currentReasoningRef.current);\n break;\n\n case 'reasoning-end':\n setIsReasoningStreaming(false);\n if (currentReasoningRef.current.trim()) {\n const reasoningItem: ChatItem = {\n id: `reasoning-${Date.now()}`,\n type: 'reasoning',\n content: currentReasoningRef.current,\n };\n setChatItems((prev) => [...prev, reasoningItem]);\n }\n currentReasoningRef.current = '';\n setCurrentReasoning('');\n break;\n\n case 'tool-input-start':\n // Tool call starting to stream - save any current text first\n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current,\n };\n setChatItems((prev) => [...prev, textItem]);\n currentTextRef.current = '';\n setCurrentText('');\n }\n \n // Create a new streaming tool call\n const streamingToolCall: ToolCallInfo = {\n toolCallId: event.toolCallId,\n toolName: event.toolName,\n input: {},\n status: 'streaming' as const,\n streamingArgsText: '',\n };\n toolCallsRef.current = [...toolCallsRef.current, streamingToolCall];\n setCurrentToolCalls([...toolCallsRef.current]);\n break;\n\n case 'tool-input-delta':\n // Append streaming args delta to the tool call\n toolCallsRef.current = toolCallsRef.current.map((tc) => {\n if (tc.toolCallId !== event.toolCallId) return tc;\n return {\n ...tc,\n streamingArgsText: (tc.streamingArgsText || '') + event.argsTextDelta,\n };\n });\n setCurrentToolCalls([...toolCallsRef.current]);\n break;\n\n case 'tool-input-available':\n // Check if this tool call already exists (was streaming via tool-input-start)\n const existingToolCall = toolCallsRef.current.find(tc => tc.toolCallId === event.toolCallId);\n \n // Flush any remaining text before showing tool\n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current,\n };\n setChatItems((prev) => [...prev, textItem]);\n currentTextRef.current = '';\n setCurrentText('');\n }\n \n // Create/update the tool call info\n const toolCallInfo: ToolCallInfo = {\n toolCallId: event.toolCallId,\n toolName: event.toolName,\n input: event.input,\n status: 'running' as const,\n streamingArgsText: existingToolCall?.streamingArgsText,\n };\n \n // Update toolCallsRef\n if (existingToolCall) {\n toolCallsRef.current = toolCallsRef.current.map((tc) => {\n if (tc.toolCallId !== event.toolCallId) return tc;\n return toolCallInfo;\n });\n } else {\n toolCallsRef.current = [...toolCallsRef.current, toolCallInfo];\n }\n setCurrentToolCalls([...toolCallsRef.current]);\n // Don't add to chatItems here - it's shown via currentToolCalls during streaming\n // It will be added/moved to chatItems when output is available\n break;\n\n case 'tool-output-available':\n // Find and cleanup any terminal stream for this tool\n const toolBeingCompleted = toolCallsRef.current.find(tc => tc.toolCallId === event.toolCallId);\n if (toolBeingCompleted?.terminalId) {\n const cancelStream = terminalStreamsRef.current.get(toolBeingCompleted.terminalId);\n if (cancelStream) {\n cancelStream();\n terminalStreamsRef.current.delete(toolBeingCompleted.terminalId);\n }\n }\n \n const outputData = event.output as ToolCallOutput | undefined;\n const isRejected = outputData?.rejected === true || outputData?.status === 'rejected';\n const finalStatus = isRejected ? ('rejected' as const) : ('completed' as const);\n \n // Get the complete tool info from toolCallsRef before we filter it out\n const completedTool = toolCallsRef.current.find(tc => tc.toolCallId === event.toolCallId);\n \n // Remove from currentToolCalls (streaming section) first\n toolCallsRef.current = toolCallsRef.current.filter(tc => tc.toolCallId !== event.toolCallId);\n setCurrentToolCalls([...toolCallsRef.current]);\n \n // Add to chatItems (or update if already there from API load)\n const completedToolItem: ChatItem = {\n id: `tool-${event.toolCallId}`,\n type: 'tool-call',\n toolCall: {\n toolCallId: event.toolCallId,\n toolName: completedTool?.toolName || 'unknown',\n input: completedTool?.input || {},\n output: event.output,\n status: finalStatus,\n },\n };\n \n setChatItems((prev) => {\n // Check if this tool already exists (from API reload)\n const existingIndex = prev.findIndex(\n item => item.type === 'tool-call' && item.toolCall?.toolCallId === event.toolCallId\n );\n if (existingIndex >= 0) {\n // Update existing\n const updated = [...prev];\n updated[existingIndex] = completedToolItem;\n return updated;\n }\n // Add new\n return [...prev, completedToolItem];\n });\n break;\n\n case 'data-approval-required':\n setPendingApprovals((prev) => {\n if (prev.some((a) => a.id === event.data.id)) {\n return prev;\n }\n return [...prev, event.data];\n });\n break;\n\n case 'finish-step':\n // Step finished - save any current text as a chat item\n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current,\n };\n setChatItems((prev) => [...prev, textItem]);\n currentTextRef.current = '';\n setCurrentText('');\n }\n break;\n\n case 'finish':\n // Reset streaming state\n setCurrentText('');\n setCurrentReasoning('');\n setIsReasoningStreaming(false);\n setCurrentToolCalls([]);\n setCurrentStreamId(null);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n cancelRef.current = null;\n isConnectingRef.current = false;\n isStreamInitiatorRef.current = false;\n // Don't reset lastKnownStreamIdRef here - it helps prevent reconnecting to same stream\n setIsRunning(false);\n setIsWatching(false);\n \n // Reload messages and checkpoints after stream finishes\n // This ensures messages have proper messageSequence for the revert button\n // and avoids duplicate key issues from streaming vs API-loaded items\n Promise.all([\n getSessionMessages(session.id),\n getSessionCheckpoints(session.id).catch(() => ({ checkpoints: [] })),\n ]).then(([apiMessages, checkpointsData]) => {\n const sorted = [...apiMessages].sort((a, b) => \n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n const converted = convertApiMessages(sorted);\n setChatItems(converted);\n setCheckpoints(checkpointsData.checkpoints || []);\n }).catch(() => {}); // Silently ignore errors\n break;\n\n case 'abort':\n if (currentReasoningRef.current.trim()) {\n const reasoningItem: ChatItem = {\n id: `reasoning-${Date.now()}`,\n type: 'reasoning',\n content: currentReasoningRef.current,\n };\n setChatItems((prev) => [...prev, reasoningItem]);\n }\n \n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current + ' [stopped]',\n };\n setChatItems((prev) => [...prev, textItem]);\n }\n \n setCurrentText('');\n setCurrentReasoning('');\n setIsReasoningStreaming(false);\n setCurrentToolCalls([]);\n setCurrentStreamId(null);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n cancelRef.current = null;\n isConnectingRef.current = false;\n isStreamInitiatorRef.current = false;\n setIsRunning(false);\n setIsWatching(false);\n break;\n\n case 'error':\n console.error('Agent error:', event.errorText);\n cancelRef.current = null;\n setIsRunning(false);\n setIsWatching(false);\n break;\n }\n };\n\n // Load messages and check for active streams when session changes\n useEffect(() => {\n const loadMessagesAndCheckStream = async () => {\n setIsLoadingHistory(true);\n setChatItems([]);\n setCurrentText('');\n setCurrentReasoning('');\n setCurrentToolCalls([]);\n setPendingApprovals([]);\n setIsRunning(false);\n setIsWatching(false);\n setCurrentStreamId(null);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n \n try {\n // Load existing messages and checkpoints in parallel\n const [apiMessages, checkpointsData] = await Promise.all([\n getSessionMessages(session.id),\n getSessionCheckpoints(session.id).catch(() => ({ checkpoints: [] })),\n ]);\n const sorted = [...apiMessages].sort((a, b) => \n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n const converted = convertApiMessages(sorted);\n setChatItems(converted);\n setCheckpoints(checkpointsData.checkpoints || []);\n\n // Check if there's an active stream to watch\n const streamInfo = await getActiveStream(session.id);\n if (streamInfo.hasActiveStream && streamInfo.stream) {\n console.log('Found active stream, connecting...', streamInfo.stream.streamId);\n isStreamInitiatorRef.current = false; // We're watching, not initiating\n setIsWatching(true);\n setIsRunning(true);\n setCurrentStreamId(streamInfo.stream.streamId);\n \n // Start watching the stream\n const cancel = watchStream(session.id, handleSSEEvent, {\n streamId: streamInfo.stream.streamId,\n onStreamId: (id) => setCurrentStreamId(id),\n });\n cancelRef.current = cancel;\n }\n } catch (err) {\n console.error('Failed to load messages:', err);\n } finally {\n setIsLoadingHistory(false);\n }\n };\n \n loadMessagesAndCheckStream();\n\n // Capture ref values for cleanup\n const terminalStreams = terminalStreamsRef.current;\n \n // Cleanup on unmount or session change\n return () => {\n if (cancelRef.current) {\n cancelRef.current();\n cancelRef.current = null;\n }\n // Cleanup all terminal streams\n terminalStreams.forEach((cancel) => cancel());\n terminalStreams.clear();\n };\n }, [session.id]);\n\n // Check for pending approvals - API is source of truth\n useEffect(() => {\n const checkApprovals = async () => {\n try {\n const approvals = await getPendingApprovals(session.id);\n // Use API response as source of truth - this correctly filters out\n // already-handled approvals that might have come from SSE replay\n setPendingApprovals(approvals);\n } catch {\n // Ignore errors\n }\n };\n // Initial check\n checkApprovals();\n const interval = setInterval(checkApprovals, 2000);\n return () => clearInterval(interval);\n }, [session.id]);\n\n // Poll for todos - more frequently when running\n useEffect(() => {\n const checkTodos = async () => {\n try {\n const data = await getSessionTodos(session.id);\n setTodosData(data);\n } catch {\n // Ignore errors\n }\n };\n // Initial fetch\n checkTodos();\n // Poll every 2 seconds when running, 5 seconds otherwise\n const pollInterval = isRunning ? 1000 : 5000;\n const interval = setInterval(checkTodos, pollInterval);\n return () => clearInterval(interval);\n }, [session.id, isRunning]);\n\n // Poll for new active streams when not currently streaming\n // This allows auto-attaching to streams started from CLI or other tabs\n useEffect(() => {\n const checkForNewStream = async () => {\n // Skip if we're already running, watching, or connecting\n if (isRunning || isConnectingRef.current) {\n return;\n }\n \n try {\n const streamInfo = await getActiveStream(session.id);\n \n if (streamInfo.hasActiveStream && streamInfo.stream) {\n const newStreamId = streamInfo.stream.streamId;\n \n // Only connect if this is a different stream than we last knew about\n if (newStreamId !== lastKnownStreamIdRef.current) {\n console.log('New active stream detected, connecting...', newStreamId);\n isConnectingRef.current = true;\n isStreamInitiatorRef.current = false; // We're watching, not initiating\n \n // Flush any partial content from previous interactions\n flushPartialContent();\n \n // Refresh messages from server to get the user message that triggered this stream\n // This ensures we see the user message even if we missed the SSE event\n try {\n const apiMessages = await getSessionMessages(session.id);\n const sorted = [...apiMessages].sort((a, b) => \n new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()\n );\n const converted = convertApiMessages(sorted);\n setChatItems(converted);\n } catch (err) {\n console.error('Failed to refresh messages:', err);\n }\n \n setIsWatching(true);\n setIsRunning(true);\n setCurrentStreamId(newStreamId);\n lastKnownStreamIdRef.current = newStreamId;\n \n // Start watching the stream\n const cancel = watchStream(session.id, handleSSEEvent, {\n streamId: newStreamId,\n onStreamId: (id) => {\n setCurrentStreamId(id);\n lastKnownStreamIdRef.current = id;\n },\n });\n cancelRef.current = cancel;\n isConnectingRef.current = false;\n }\n }\n } catch (err) {\n console.error('Failed to check for new stream:', err);\n isConnectingRef.current = false;\n }\n };\n \n // Check every 1 second for new streams\n const interval = setInterval(checkForNewStream, 1000);\n \n return () => {\n clearInterval(interval);\n };\n }, [session.id, isRunning]);\n\n const handleSubmit = () => {\n if (!input.trim() || isRunning) return;\n\n const userItem: ChatItem = {\n id: `user-${Date.now()}`,\n type: 'user-message',\n content: input,\n };\n\n setChatItems((prev) => [...prev, userItem]);\n setInput('');\n setIsRunning(true);\n setIsWatching(false);\n isStreamInitiatorRef.current = true; // Mark that we initiated this stream\n setCurrentText('');\n setCurrentReasoning('');\n setIsReasoningStreaming(false);\n setCurrentToolCalls([]);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n\n const cancel = runAgent(session.id, input, handleSSEEvent, {\n onStreamId: (id) => setCurrentStreamId(id),\n });\n \n // Store the cancel function so we can call it from the stop button\n cancelRef.current = cancel;\n };\n\n const handleStop = async () => {\n // Send abort request to server - this stops the agent properly\n // The agent will send an abort event back through the stream\n try {\n await abortStream(session.id);\n } catch (err) {\n console.error('Failed to abort stream:', err);\n }\n \n // Also cancel the local fetch connection\n // The abort event from the server will handle the state reset\n if (cancelRef.current) {\n cancelRef.current();\n cancelRef.current = null;\n }\n \n // Manually reset state as a fallback (in case we don't receive the abort event)\n // Save any partial content\n if (currentReasoningRef.current.trim()) {\n const reasoningItem: ChatItem = {\n id: `reasoning-${Date.now()}`,\n type: 'reasoning',\n content: currentReasoningRef.current,\n };\n setChatItems((prev) => [...prev, reasoningItem]);\n }\n \n if (currentTextRef.current.trim()) {\n const textItem: ChatItem = {\n id: `text-${Date.now()}`,\n type: 'assistant-text',\n content: currentTextRef.current + ' [stopped]',\n };\n setChatItems((prev) => [...prev, textItem]);\n }\n \n // Reset streaming state\n setCurrentText('');\n setCurrentReasoning('');\n setIsReasoningStreaming(false);\n setCurrentToolCalls([]);\n setCurrentStreamId(null);\n currentTextRef.current = '';\n currentReasoningRef.current = '';\n toolCallsRef.current = [];\n isConnectingRef.current = false;\n setIsRunning(false);\n setIsWatching(false);\n };\n\n const handleApprove = async (approval: PendingApproval) => {\n try {\n await approveExecution(session.id, approval.toolCallId);\n setPendingApprovals((prev) => prev.filter((a) => a.id !== approval.id));\n } catch (err) {\n console.error('Failed to approve:', err);\n }\n };\n\n const handleReject = async (approval: PendingApproval) => {\n try {\n await rejectExecution(session.id, approval.toolCallId, 'User rejected');\n setPendingApprovals((prev) => prev.filter((a) => a.id !== approval.id));\n } catch (err) {\n console.error('Failed to reject:', err);\n }\n };\n\n // Handle \"Don't show again\" - approve and disable approval for this tool\n const handleApproveAndDisable = async (approval: PendingApproval) => {\n try {\n // First approve this execution\n await approveExecution(session.id, approval.toolCallId);\n setPendingApprovals((prev) => prev.filter((a) => a.id !== approval.id));\n \n // Then disable approval for this tool in session config\n const updatedSession = await updateToolApproval(\n session.id,\n approval.toolName,\n false, // Don't require approval\n sessionConfig\n );\n \n // Update local session config state\n setSessionConfig(updatedSession.config || {});\n } catch (err) {\n console.error('Failed to approve and disable:', err);\n }\n };\n\n // Handle toggling tool approval in session settings\n const handleToggleToolApproval = async (toolId: string, currentValue: boolean) => {\n try {\n const updatedSession = await updateToolApproval(\n session.id,\n toolId,\n !currentValue,\n sessionConfig\n );\n setSessionConfig(updatedSession.config || {});\n } catch (err) {\n console.error('Failed to update tool approval:', err);\n }\n };\n\n // Get the effective approval setting for a tool (session config > global config default)\n const getToolApprovalValue = (toolId: string): boolean => {\n // Check session-level config first\n if (sessionConfig.toolApprovals?.[toolId] !== undefined) {\n return sessionConfig.toolApprovals[toolId];\n }\n // Fall back to global default (bash defaults to true, others to false)\n if (toolId === 'bash') return true;\n return false;\n };\n\n // Get language from file extension\n const getLanguageFromPath = (path: string): string => {\n const ext = path.split('.').pop()?.toLowerCase() || '';\n const langMap: Record<string, string> = {\n 'ts': 'typescript',\n 'tsx': 'tsx',\n 'js': 'javascript',\n 'jsx': 'jsx',\n 'py': 'python',\n 'rb': 'ruby',\n 'go': 'go',\n 'rs': 'rust',\n 'java': 'java',\n 'c': 'c',\n 'cpp': 'cpp',\n 'h': 'c',\n 'hpp': 'cpp',\n 'cs': 'csharp',\n 'php': 'php',\n 'swift': 'swift',\n 'kt': 'kotlin',\n 'scala': 'scala',\n 'sh': 'bash',\n 'bash': 'bash',\n 'zsh': 'bash',\n 'fish': 'bash',\n 'ps1': 'powershell',\n 'sql': 'sql',\n 'html': 'html',\n 'htm': 'html',\n 'css': 'css',\n 'scss': 'scss',\n 'sass': 'sass',\n 'less': 'less',\n 'json': 'json',\n 'yaml': 'yaml',\n 'yml': 'yaml',\n 'xml': 'xml',\n 'md': 'markdown',\n 'markdown': 'markdown',\n 'txt': 'plaintext',\n 'toml': 'toml',\n 'ini': 'ini',\n 'cfg': 'ini',\n 'conf': 'ini',\n 'dockerfile': 'dockerfile',\n 'makefile': 'makefile',\n };\n return langMap[ext] || 'plaintext';\n };\n\n const renderToolOutput = (tc: ToolCallInfo) => {\n const output = tc.output as ToolCallOutput | undefined;\n const input = tc.input as Record<string, unknown> | undefined;\n \n // Bash command - use dedicated BashTool component\n if (tc.toolName === 'bash') {\n return (\n <BashTool\n input={tc.input as BashInput}\n output={tc.output as BashOutput}\n status={tc.status}\n terminalId={tc.terminalId}\n liveOutput={tc.liveOutput}\n className=\"mt-2\"\n />\n );\n }\n\n // Todo tool - use dedicated TodoTool component\n if (tc.toolName === 'todo') {\n return (\n <TodoTool\n input={tc.input as TodoInput}\n output={tc.output as TodoOutput}\n status={tc.status}\n className=\"mt-2\"\n />\n );\n }\n\n // Load skill tool - use dedicated LoadSkillTool component\n if (tc.toolName === 'load_skill') {\n return (\n <LoadSkillTool\n input={tc.input as LoadSkillInput}\n output={tc.output as LoadSkillOutput}\n status={tc.status}\n className=\"mt-2\"\n />\n );\n }\n \n // Write file - show code editor style\n if (tc.toolName === 'write_file' && input) {\n const filePath = (input.path as string) || 'file';\n const mode = (input.mode as string) || 'full';\n const fileName = filePath.split('/').pop() || 'file';\n const language = getLanguageFromPath(filePath);\n \n // Handle str_replace mode differently\n if (mode === 'str_replace') {\n const oldString = (input.old_string as string) || '';\n const newString = (input.new_string as string) || '';\n const outputData = output as { success?: boolean; lineDelta?: number; error?: string } | undefined;\n \n return (\n <div className=\"mt-2 max-w-full overflow-hidden space-y-2\">\n <div className=\"flex items-center gap-2 text-sm\">\n <FileCode className=\"size-4 text-muted-foreground\" />\n <span className=\"font-medium\">{fileName}</span>\n <Badge variant=\"secondary\" className=\"text-xs\">str_replace</Badge>\n </div>\n <div className=\"rounded-md border overflow-hidden\">\n <div className=\"bg-red-500/10 border-b p-2\">\n <div className=\"text-xs text-red-500 mb-1\">- Remove:</div>\n <pre className=\"text-xs overflow-x-auto whitespace-pre-wrap break-words text-red-400\">\n {oldString.length > 500 ? oldString.slice(0, 500) + '...' : oldString}\n </pre>\n </div>\n <div className=\"bg-green-500/10 p-2\">\n <div className=\"text-xs text-green-500 mb-1\">+ Add:</div>\n <pre className=\"text-xs overflow-x-auto whitespace-pre-wrap break-words text-green-400\">\n {newString.length > 500 ? newString.slice(0, 500) + '...' : newString}\n </pre>\n </div>\n </div>\n {outputData && (\n <div className={`text-xs flex items-center gap-1 ${outputData.success ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'}`}>\n <span>{outputData.success ? '✓' : '✗'}</span>\n <span>\n {outputData.success \n ? `Replaced (${outputData.lineDelta !== undefined ? (outputData.lineDelta >= 0 ? '+' : '') + outputData.lineDelta + ' lines' : 'done'})` \n : outputData.error || 'Failed'}\n </span>\n </div>\n )}\n </div>\n );\n }\n \n // Full mode - show code editor\n const content = (input.content as string) || '';\n const outputData = output as { success?: boolean; action?: string; error?: string } | undefined;\n \n return (\n <div className=\"mt-2 max-w-full overflow-hidden\">\n <Artifact>\n <ArtifactHeader>\n <div className=\"flex items-center gap-2 min-w-0\">\n <FileCode className=\"size-4 text-muted-foreground shrink-0\" />\n <ArtifactTitle className=\"truncate\">{fileName}</ArtifactTitle>\n <ArtifactDescription className=\"truncate text-xs hidden sm:block\">\n {filePath}\n </ArtifactDescription>\n </div>\n <ArtifactActions>\n <ArtifactAction\n icon={Copy}\n label=\"Copy\"\n onClick={() => navigator.clipboard.writeText(content)}\n />\n </ArtifactActions>\n </ArtifactHeader>\n {content && (\n <ArtifactContent className=\"p-0 max-h-[300px] overflow-auto\">\n <CodeBlock code={content} language={language as \"typescript\"} showLineNumbers>\n <CodeBlockHeader className=\"sr-only\">\n <CodeBlockTitle>\n <CodeBlockFilename>{fileName}</CodeBlockFilename>\n </CodeBlockTitle>\n </CodeBlockHeader>\n </CodeBlock>\n </ArtifactContent>\n )}\n </Artifact>\n {outputData && (\n <div className={`mt-2 text-xs flex items-center gap-1 ${outputData.success ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'}`}>\n <span>{outputData.success ? '✓' : '✗'}</span>\n <span>\n {outputData.success \n ? `File ${outputData.action || 'written'} successfully` \n : outputData.error || 'Failed'}\n </span>\n </div>\n )}\n </div>\n );\n }\n \n // Read file - show code editor style\n if (tc.toolName === 'read_file' && output) {\n const filePath = (input?.path as string) || 'file';\n const content = (output.content as string) || JSON.stringify(output, null, 2);\n const fileName = filePath.split('/').pop() || 'file';\n const language = getLanguageFromPath(filePath);\n \n return (\n <div className=\"mt-2 max-w-full overflow-hidden\">\n <Artifact>\n <ArtifactHeader>\n <div className=\"flex items-center gap-2 min-w-0\">\n <FileCode className=\"size-4 text-muted-foreground shrink-0\" />\n <ArtifactTitle className=\"truncate\">{fileName}</ArtifactTitle>\n <ArtifactDescription className=\"truncate text-xs hidden sm:block\">\n {filePath}\n </ArtifactDescription>\n </div>\n <ArtifactActions>\n <ArtifactAction\n icon={Copy}\n label=\"Copy\"\n onClick={() => navigator.clipboard.writeText(content)}\n />\n </ArtifactActions>\n </ArtifactHeader>\n <ArtifactContent className=\"p-0 max-h-[300px] overflow-auto\">\n <CodeBlock code={content} language={language as \"typescript\"} showLineNumbers>\n <CodeBlockHeader className=\"sr-only\">\n <CodeBlockTitle>\n <CodeBlockFilename>{fileName}</CodeBlockFilename>\n </CodeBlockTitle>\n </CodeBlockHeader>\n </CodeBlock>\n </ArtifactContent>\n </Artifact>\n </div>\n );\n }\n \n // Other tools - show JSON\n if (output) {\n return (\n <ToolOutput\n output={\n <pre className=\"text-xs overflow-x-auto max-w-full whitespace-pre-wrap break-words\">\n {JSON.stringify(output, null, 2).slice(0, 500)}\n {JSON.stringify(output).length > 500 ? '...' : ''}\n </pre>\n }\n errorText={tc.status === 'error' ? 'Tool execution failed' : undefined}\n />\n );\n }\n \n return null;\n };\n\n const suggestions = [\n 'Create a hello.txt file with \"Hello, World!\"',\n 'List files in the current directory',\n 'Show the current git status',\n ];\n\n return (\n <div className=\"flex flex-col h-full bg-background\">\n {/* Header */}\n <div className=\"border-b border-border/50 px-6 py-3 flex items-center justify-between bg-card/50 backdrop-blur-sm\">\n <div className=\"min-w-0 flex items-center gap-3\">\n {/* Editable Name */}\n <div className=\"flex items-center gap-1.5\">\n {isEditingName ? (\n <form \n onSubmit={(e) => { e.preventDefault(); handleNameSubmit(); }}\n className=\"flex items-center gap-1\"\n >\n <Input\n ref={nameInputRef}\n value={currentName}\n onChange={(e) => setCurrentName(e.target.value)}\n onBlur={handleNameSubmit}\n className=\"h-7 text-sm font-semibold w-40 px-2\"\n placeholder=\"Session name\"\n />\n <Button\n type=\"submit\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-6 text-muted-foreground hover:text-foreground\"\n >\n <Check className=\"size-3.5\" />\n </Button>\n </form>\n ) : (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => setIsEditingName(true)}\n className=\"flex items-center gap-1.5 group hover:bg-muted/50 rounded px-1.5 py-0.5 -mx-1.5 transition-colors\"\n >\n <h2 className=\"font-semibold text-foreground truncate max-w-[200px]\">\n {currentName || 'Untitled Session'}\n </h2>\n <Pencil className=\"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Click to rename</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n\n {/* Model Selector */}\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <div>\n <Select value={currentModel} onValueChange={handleModelChange} disabled={isRunning}>\n <SelectTrigger className=\"h-7 text-xs border-border/50 bg-muted/30 hover:bg-muted/50 transition-colors min-w-[160px]\">\n <SelectValue placeholder=\"Select model\" />\n </SelectTrigger>\n <SelectContent>\n {config?.availableModels.map((model) => (\n <SelectItem key={model.id} value={model.id} className=\"text-xs\">\n <div className=\"flex items-center gap-2\">\n <span>{model.name}</span>\n <span className=\"text-[10px] text-muted-foreground\">{model.provider}</span>\n </div>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </TooltipTrigger>\n <TooltipContent>\n {isRunning ? 'Cannot change model while running' : 'Switch model for next message'}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </div>\n <div className=\"flex items-center gap-2 shrink-0\">\n {isWatching && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <Badge variant=\"outline\" className=\"gap-1.5 text-xs border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 cursor-help\">\n <span className=\"size-1.5 rounded-full bg-current animate-pulse\" />\n Watching\n </Badge>\n </TooltipTrigger>\n <TooltipContent>Watching stream from another client</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <Badge \n variant={isRunning ? 'default' : 'secondary'}\n className={`cursor-help ${isRunning ? 'bg-primary/90' : ''}`}\n >\n {isRunning ? (isWatching ? 'streaming' : 'running') : session.status}\n </Badge>\n </TooltipTrigger>\n <TooltipContent>\n {isRunning \n ? (isWatching ? 'Receiving streamed response' : 'Agent is processing') \n : `Session is ${session.status}`}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n \n {/* Session Settings */}\n <Dialog open={sessionSettingsOpen} onOpenChange={setSessionSettingsOpen}>\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <DialogTrigger asChild>\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"size-7 hover:bg-accent transition-colors\"\n >\n <Settings className=\"size-4\" />\n </Button>\n </DialogTrigger>\n </TooltipTrigger>\n <TooltipContent>Session Settings</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <DialogContent className=\"sm:max-w-md\">\n <DialogHeader>\n <DialogTitle className=\"flex items-center gap-2\">\n <div className=\"size-8 rounded-lg bg-muted flex items-center justify-center\">\n <Settings className=\"size-4\" />\n </div>\n Session Settings\n </DialogTitle>\n </DialogHeader>\n <div className=\"space-y-4 pt-2\">\n {/* Tool Approvals */}\n <div className=\"space-y-2\">\n <Label className=\"flex items-center gap-2 text-sm font-medium\">\n Tool Approvals\n </Label>\n <p className=\"text-xs text-muted-foreground -mt-0.5\">\n Toggle on to require approval before tool executes\n </p>\n <div className=\"space-y-1 rounded-lg border p-2.5 bg-muted/30\">\n {config?.availableTools.map((tool) => {\n const isEnabled = getToolApprovalValue(tool.id);\n return (\n <div key={tool.id} className=\"flex items-center justify-between py-1.5 hover:bg-muted/50 rounded px-2 -mx-1 transition-colors\">\n <div className=\"space-y-0\">\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium\">{tool.name}</span>\n {tool.dangerous && (\n <span className=\"text-[10px] bg-amber-500/20 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded font-medium\">\n risky\n </span>\n )}\n </div>\n <p className=\"text-[11px] text-muted-foreground\">{tool.description}</p>\n </div>\n <Switch\n checked={isEnabled}\n onCheckedChange={() => handleToggleToolApproval(tool.id, isEnabled)}\n />\n </div>\n );\n })}\n </div>\n </div>\n\n <p className=\"text-xs text-muted-foreground\">\n These settings only apply to this session. Changes take effect for future tool calls.\n </p>\n </div>\n </DialogContent>\n </Dialog>\n </div>\n </div>\n\n {/* Todo Panel - sticky at top */}\n {todosData && todosData.todos && todosData.todos.length > 0 && (\n <div className=\"px-4 py-2 border-b border-border/50 bg-muted/20\">\n <TodoPanel todosData={todosData} />\n </div>\n )}\n\n {/* Pending Approvals */}\n {pendingApprovals.length > 0 && (\n <div className=\"p-4 border-b border-border space-y-3\">\n {pendingApprovals.map((approval) => {\n const input = approval.input as Record<string, unknown>;\n return (\n <Confirmation\n key={approval.id}\n approval={{ id: approval.id, approved: false }}\n state=\"approval-requested\"\n >\n <ConfirmationRequest>\n <div className=\"flex items-start gap-3\">\n <div className=\"size-8 rounded-lg bg-amber-500/20 flex items-center justify-center shrink-0\">\n <AlertTriangle className=\"size-4 text-amber-500\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"font-medium text-sm\">Approval Required</p>\n <p className=\"text-sm text-muted-foreground mt-0.5\">\n <code className=\"bg-muted px-1.5 py-0.5 rounded font-mono text-foreground\">{approval.toolName}</code>\n </p>\n <div className=\"mt-3 rounded-lg border bg-muted/30 overflow-hidden\">\n {Object.entries(input).map(([key, value]) => (\n <div key={key} className=\"flex border-b border-border/50 last:border-b-0\">\n <div className=\"px-3 py-2 bg-muted/50 text-xs font-medium text-muted-foreground w-24 shrink-0\">\n {key}\n </div>\n <div className=\"px-3 py-2 text-xs font-mono flex-1 min-w-0 overflow-auto max-h-24\">\n {typeof value === 'string' ? (\n <span className=\"whitespace-pre-wrap break-words\">{value}</span>\n ) : (\n <span className=\"text-muted-foreground\">{JSON.stringify(value)}</span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </ConfirmationRequest>\n <ConfirmationActionsComponent>\n <ConfirmationAction variant=\"outline\" onClick={() => handleReject(approval)}>\n Reject\n </ConfirmationAction>\n <ConfirmationAction \n variant=\"ghost\" \n onClick={() => handleApproveAndDisable(approval)}\n className=\"text-muted-foreground hover:text-foreground\"\n >\n Don't ask again\n </ConfirmationAction>\n <ConfirmationAction variant=\"default\" onClick={() => handleApprove(approval)}>\n Approve\n </ConfirmationAction>\n </ConfirmationActionsComponent>\n </Confirmation>\n );\n })}\n </div>\n )}\n\n {/* Messages */}\n <Conversation className=\"flex-1 p-4\">\n <ConversationContent className=\"max-w-3xl mx-auto w-full\">\n {/* Loading history */}\n {isLoadingHistory && (\n <div className=\"flex justify-center py-12\">\n <Loader size={24} />\n </div>\n )}\n\n {/* Empty state */}\n {!isLoadingHistory && chatItems.length === 0 && !currentText && (\n <ConversationEmptyState\n icon={\n <div className=\"relative overflow-hidden rounded-2xl size-16 shadow-lg ring-1 ring-white/10\">\n <Image\n src=\"/sparke-coder.png\"\n alt=\"SparkECoder\"\n width={64}\n height={64}\n className=\"absolute inset-0 size-full object-cover\"\n priority\n />\n {isRunning && (\n <video\n src=\"/sparkecode.mp4\"\n autoPlay\n muted\n loop\n playsInline\n className=\"absolute inset-0 size-full object-cover\"\n />\n )}\n </div>\n }\n title=\"Start a conversation\"\n description=\"Ask SparkECoder to help you with coding tasks\"\n />\n )}\n\n {/* Chat items */}\n {chatItems\n // Filter out tool calls that are pending approval (shown in approval section above)\n .filter((item) => {\n if (item.type === 'tool-call' && item.toolCall) {\n const isPendingApproval = pendingApprovals.some(\n (a) => a.toolCallId === item.toolCall?.toolCallId\n );\n if (isPendingApproval) return false;\n }\n return true;\n })\n .map((item) => {\n if (item.type === 'user-message') {\n // Check if there's a checkpoint for this message (meaning we can revert to before it)\n const hasCheckpoint = item.messageSequence !== undefined && \n checkpoints.some(cp => cp.messageSequence === item.messageSequence);\n \n return (\n <Message key={item.id} from=\"user\">\n <MessageContent>\n <p className=\"whitespace-pre-wrap\">{item.content}</p>\n </MessageContent>\n {hasCheckpoint && !isRunning && (\n <MessageActions className=\"justify-end mt-1\">\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => handleRevert(item.messageSequence!, item.content)}\n disabled={isReverting}\n className=\"h-6 px-2 text-xs text-muted-foreground hover:text-destructive gap-1\"\n >\n <RotateCcw className=\"h-3 w-3\" />\n Revert\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <p>Revert to before this message (undo all changes after)</p>\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </MessageActions>\n )}\n </Message>\n );\n }\n \n if (item.type === 'reasoning') {\n return (\n <Reasoning key={item.id} isStreaming={false} defaultOpen={false}>\n <ReasoningTrigger />\n <ReasoningContent>{item.content || ''}</ReasoningContent>\n </Reasoning>\n );\n }\n \n if (item.type === 'assistant-text') {\n return (\n <Message key={item.id} from=\"assistant\">\n <div className=\"flex gap-3\">\n {/* SparkECoder avatar - static for completed messages */}\n <div className=\"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0\">\n <Image\n src=\"/sparke-coder.png\"\n alt=\"SparkECoder\"\n width={32}\n height={32}\n className=\"absolute inset-0 size-full object-cover\"\n />\n </div>\n <div className=\"flex-1 min-w-0\">\n <MessageContent>\n <MessageResponse>{item.content || ''}</MessageResponse>\n </MessageContent>\n <MessageActions>\n <MessageAction\n label=\"Copy\"\n onClick={() => navigator.clipboard.writeText(item.content || '')}\n >\n <Copy className=\"size-3\" />\n </MessageAction>\n </MessageActions>\n </div>\n </div>\n </Message>\n );\n }\n \n if (item.type === 'tool-call' && item.toolCall) {\n const tc = item.toolCall;\n const toolType = `tool-${tc.toolName}` as `tool-${string}`;\n \n // Use dedicated WriteFileTool component for write_file\n if (tc.toolName === 'write_file') {\n return (\n <WriteFileTool\n key={item.id}\n input={tc.input as WriteFileInput}\n output={tc.output as WriteFileOutput}\n status={tc.status}\n streamingArgsText={tc.streamingArgsText}\n />\n );\n }\n \n // Use dedicated ReadFileTool component for read_file\n if (tc.toolName === 'read_file') {\n return (\n <ReadFileTool\n key={item.id}\n input={tc.input as ReadFileInput}\n output={tc.output as ReadFileOutput}\n status={tc.status}\n />\n );\n }\n \n // Use dedicated BashTool component for bash\n if (tc.toolName === 'bash') {\n return (\n <BashTool\n key={item.id}\n input={tc.input as BashInput}\n output={tc.output as BashOutput}\n status={tc.status}\n terminalId={tc.terminalId}\n liveOutput={tc.liveOutput}\n />\n );\n }\n \n // Use dedicated TodoTool component for todo\n if (tc.toolName === 'todo') {\n return (\n <TodoTool\n key={item.id}\n input={tc.input as TodoInput}\n output={tc.output as TodoOutput}\n status={tc.status}\n />\n );\n }\n \n // Use dedicated LoadSkillTool component for load_skill\n if (tc.toolName === 'load_skill') {\n return (\n <LoadSkillTool\n key={item.id}\n input={tc.input as LoadSkillInput}\n output={tc.output as LoadSkillOutput}\n status={tc.status}\n />\n );\n }\n \n // Generic tool rendering for other tools\n const shouldDefaultOpen = tc.status !== 'completed';\n \n return (\n <Tool key={item.id} defaultOpen={shouldDefaultOpen}>\n <ToolHeader\n type={toolType}\n state={mapToolStatus(tc.status)}\n title={tc.toolName}\n />\n <ToolContent>\n <ToolInput input={tc.input} />\n {renderToolOutput(tc)}\n </ToolContent>\n </Tool>\n );\n }\n \n return null;\n })}\n\n {/* Thinking indicator - show when running but no content yet */}\n {isRunning && !currentText && !currentReasoning && currentToolCalls.length === 0 && (\n <div className=\"flex gap-3 items-center\">\n {/* SparkECoder avatar - animated video while thinking */}\n <div className=\"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0\">\n <video\n src=\"/sparkecode.mp4\"\n autoPlay\n muted\n loop\n playsInline\n className=\"absolute inset-0 size-full object-cover\"\n />\n </div>\n <span className=\"text-sm text-muted-foreground\">Thinking...</span>\n </div>\n )}\n\n {/* Streaming reasoning */}\n {isRunning && (isReasoningStreaming || currentReasoning) && (\n <Reasoning isStreaming={isReasoningStreaming} defaultOpen={true}>\n <ReasoningTrigger />\n <ReasoningContent>{currentReasoning}</ReasoningContent>\n </Reasoning>\n )}\n\n {/* Streaming text */}\n {isRunning && currentText && (\n <Message from=\"assistant\">\n <div className=\"flex gap-3\">\n {/* SparkECoder avatar - animated video while streaming */}\n <div className=\"relative overflow-hidden rounded-lg size-8 shadow-sm ring-1 ring-white/10 shrink-0\">\n <video\n src=\"/sparkecode.mp4\"\n autoPlay\n muted\n loop\n playsInline\n className=\"absolute inset-0 size-full object-cover\"\n />\n </div>\n <div className=\"flex-1 min-w-0\">\n <MessageContent>\n <MessageResponse>{currentText}</MessageResponse>\n <span className=\"inline-block w-2 h-4 bg-primary animate-pulse ml-1\" />\n </MessageContent>\n </div>\n </div>\n </Message>\n )}\n \n {/* Streaming tool calls */}\n {isRunning && currentToolCalls.map((tc) => {\n // Use dedicated WriteFileTool component for write_file with streaming\n if (tc.toolName === 'write_file') {\n return (\n <WriteFileTool\n key={tc.toolCallId}\n input={tc.input as WriteFileInput}\n output={tc.output as WriteFileOutput}\n status={tc.status}\n streamingArgsText={tc.streamingArgsText}\n />\n );\n }\n \n // Use dedicated ReadFileTool component for read_file\n if (tc.toolName === 'read_file') {\n return (\n <ReadFileTool\n key={tc.toolCallId}\n input={tc.input as ReadFileInput}\n output={tc.output as ReadFileOutput}\n status={tc.status}\n />\n );\n }\n \n // Use dedicated BashTool component for bash commands\n if (tc.toolName === 'bash') {\n return (\n <BashTool\n key={tc.toolCallId}\n input={tc.input as BashInput}\n output={tc.output as BashOutput}\n status={tc.status}\n terminalId={tc.terminalId}\n liveOutput={tc.liveOutput}\n />\n );\n }\n\n // Use dedicated TodoTool component for todo\n if (tc.toolName === 'todo') {\n return (\n <TodoTool\n key={tc.toolCallId}\n input={tc.input as TodoInput}\n output={tc.output as TodoOutput}\n status={tc.status}\n />\n );\n }\n\n // Use dedicated LoadSkillTool component for load_skill\n if (tc.toolName === 'load_skill') {\n return (\n <LoadSkillTool\n key={tc.toolCallId}\n input={tc.input as LoadSkillInput}\n output={tc.output as LoadSkillOutput}\n status={tc.status}\n />\n );\n }\n \n return (\n <Tool key={tc.toolCallId} defaultOpen>\n <ToolHeader\n type={`tool-${tc.toolName}` as `tool-${string}`}\n state={tc.status === 'streaming' ? 'input-streaming' : 'input-available'}\n title={tc.toolName}\n />\n <ToolContent>\n <ToolInput input={tc.input} />\n <div className=\"flex items-center gap-2 p-3 text-muted-foreground\">\n <Loader size={14} />\n <span className=\"text-sm\">\n {tc.status === 'streaming' ? 'Receiving...' : 'Executing...'}\n </span>\n </div>\n </ToolContent>\n </Tool>\n );\n })}\n\n {/* Loading indicator */}\n {isRunning && !currentText && currentToolCalls.length === 0 && (\n <div className=\"flex items-center gap-2 text-muted-foreground\">\n <Loader size={16} />\n <span className=\"text-sm\">Thinking...</span>\n </div>\n )}\n </ConversationContent>\n <ConversationScrollButton />\n </Conversation>\n\n {/* Input */}\n <div className=\"border-t border-border/50 p-4 pb-6 bg-card/30\">\n <div className=\"max-w-3xl mx-auto\">\n {/* Floating suggestions - show when empty */}\n {!isLoadingHistory && chatItems.length === 0 && !currentText && !isRunning && (\n <Suggestions className=\"mb-3\">\n {suggestions.map((suggestion) => (\n <Suggestion\n key={suggestion}\n suggestion={suggestion}\n onClick={(s) => {\n setInput(s);\n }}\n />\n ))}\n </Suggestions>\n )}\n \n <PromptInput\n onSubmit={handleSubmit}\n className=\"shadow-sm\"\n >\n <PromptInputBody>\n <PromptInputTextarea\n value={input}\n onChange={(e) => setInput(e.target.value)}\n placeholder=\"Ask SparkECoder to help...\"\n disabled={isRunning}\n autoFocus\n className=\"min-h-[80px] focus:ring-2 focus:ring-primary/20 transition-all\"\n />\n </PromptInputBody>\n <PromptInputFooter>\n <div className=\"flex-1\" />\n <PromptInputSubmit\n disabled={!isRunning && !input.trim()}\n status={isRunning ? 'streaming' : 'ready'}\n onStop={handleStop}\n className=\"bg-primary hover:bg-primary/90 transition-colors\"\n />\n </PromptInputFooter>\n </PromptInput>\n </div>\n </div>\n </div>\n );\n}\n","'use client';\n\nimport { use, useEffect, useState } from 'react';\nimport { useRouter } from 'next/navigation';\nimport { ChatInterface } from '@/components/chat-interface';\nimport { getSession, type Session } from '@/lib/api';\nimport { Loader2 } from 'lucide-react';\n\nexport default function SessionPage({\n params,\n}: {\n params: Promise<{ id: string }>;\n}) {\n const { id } = use(params);\n const router = useRouter();\n const [session, setSession] = useState<Session | null>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n async function loadSession() {\n try {\n const data = await getSession(id);\n if (!data) {\n setError('Session not found');\n return;\n }\n setSession(data);\n } catch (err) {\n console.error('Failed to load session:', err);\n setError('Failed to load session');\n } finally {\n setLoading(false);\n }\n }\n loadSession();\n }, [id]);\n\n if (loading) {\n return (\n <div className=\"flex items-center justify-center h-full\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n </div>\n );\n }\n\n if (error || !session) {\n return (\n <div className=\"flex items-center justify-center h-full\">\n <div className=\"text-center\">\n <p className=\"text-muted-foreground mb-4\">{error || 'Session not found'}</p>\n <button\n onClick={() => router.push('/')}\n className=\"text-primary hover:underline\"\n >\n Go back home\n </button>\n </div>\n </div>\n );\n }\n\n return <ChatInterface session={session} />;\n}\n"],"names":["motionValue","DefaultKeyframeResolver","calcProgress","keyframes","spring","checkIsControllingVariants","checkIsVariantNode"],"mappings":"0DACA,EAAA,EAAA,CAAA,CAAA,QACA,EAAA,EAAA,CAAA,CAAA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,EAAA,GAAA,EAAC,IAAA,CAAE,UAAU,sCAA8B,GAAS,sBACpD,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACC,QAAS,IAAM,EAAO,IAAI,CAAC,KAC3B,UAAU,wCACX,sBAQF,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CAAC,QAAS,GACjC","ignoreList":[2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,45,46,47,48,49,57,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,227,229,230,231,232,234,237,238,240,241,242,243,244,245,246,247,250,251,253,254,257,258,259,261,262,265,266,267,269,271,272,273]}